Commit c3a492c1a6812ea48496dded97143ebb06df6c39
1 parent
15414865
添加幸运购未支付判断
Showing
1 changed file
with
38 additions
and
4 deletions
pages/index/index/index.js
| @@ -439,7 +439,6 @@ Page({ | @@ -439,7 +439,6 @@ Page({ | ||
| 439 | }); | 439 | }); |
| 440 | 440 | ||
| 441 | 441 | ||
| 442 | - | ||
| 443 | }, | 442 | }, |
| 444 | //当隐藏的时候就关闭计时器 | 443 | //当隐藏的时候就关闭计时器 |
| 445 | onHide: function () { | 444 | onHide: function () { |
| @@ -937,10 +936,45 @@ Page({ | @@ -937,10 +936,45 @@ Page({ | ||
| 937 | getApp().goto("/pages/goods/categoryList/categoryList"); | 936 | getApp().goto("/pages/goods/categoryList/categoryList"); |
| 938 | }, | 937 | }, |
| 939 | 938 | ||
| 939 | + // 幸运购跳转 | ||
| 940 | go_url: function (e) { | 940 | go_url: function (e) { |
| 941 | - var url = e.currentTarget.dataset.url; | ||
| 942 | - getApp().goto(url); | ||
| 943 | - }, | 941 | + var remark = e.currentTarget.dataset.remark; |
| 942 | + // 不是标题 | ||
| 943 | + if (remark == 2) { | ||
| 944 | + var app = getApp(), | ||
| 945 | + os = app.globalData.setting, | ||
| 946 | + oo = app.globalData; | ||
| 947 | + // 进入幸运购活动前 判断是否有待支付订单 | ||
| 948 | + app.request.promiseGet('/api/weshop/prom/luckyOrder/page', { | ||
| 949 | + data: { | ||
| 950 | + store_id: os.stoid, | ||
| 951 | + user_id: oo.user_id, | ||
| 952 | + aid: e.currentTarget.dataset.aid, | ||
| 953 | + pay_status: 0, | ||
| 954 | + } | ||
| 955 | + }).then(res => { | ||
| 956 | + if(res.data.code == 0){ | ||
| 957 | + if (res.data.data.total > 0) { | ||
| 958 | + // 待支付订单页面 | ||
| 959 | + getApp().goto('/pages/user/order_list/order_list?type=1'); | ||
| 960 | + | ||
| 961 | + } else { | ||
| 962 | + var url = e.currentTarget.dataset.url; | ||
| 963 | + getApp().goto(url); | ||
| 964 | + | ||
| 965 | + } | ||
| 966 | + | ||
| 967 | + } | ||
| 968 | + }); | ||
| 969 | + | ||
| 970 | + } else { | ||
| 971 | + // 标题 | ||
| 972 | + var url = e.currentTarget.dataset.url; | ||
| 973 | + getApp().goto(url); | ||
| 974 | + | ||
| 975 | + } | ||
| 976 | + | ||
| 977 | + }, // | ||
| 944 | 978 | ||
| 945 | bind_bnerr_icon: function (e) { | 979 | bind_bnerr_icon: function (e) { |
| 946 | var def = "/miniapp/images/no_cate_def.png"; | 980 | var def = "/miniapp/images/no_cate_def.png"; |