Commit 9c717ca836adaff1fe856c04164cae8cb744d46d
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
2 changed files
with
40 additions
and
6 deletions
pages/index/index/index.js
... | ... | @@ -439,7 +439,6 @@ Page({ |
439 | 439 | }); |
440 | 440 | |
441 | 441 | |
442 | - | |
443 | 442 | }, |
444 | 443 | //当隐藏的时候就关闭计时器 |
445 | 444 | onHide: function () { |
... | ... | @@ -937,10 +936,45 @@ Page({ |
937 | 936 | getApp().goto("/pages/goods/categoryList/categoryList"); |
938 | 937 | }, |
939 | 938 | |
939 | + // 幸运购跳转 | |
940 | 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 | 979 | bind_bnerr_icon: function (e) { |
946 | 980 | var def = "/miniapp/images/no_cate_def.png"; | ... | ... |
pages/index/index/index.wxml
... | ... | @@ -230,7 +230,7 @@ |
230 | 230 | |
231 | 231 | <!--幸运购--> |
232 | 232 | <view class="seckill" wx:if="{{luckGo_list && luckGo_list.length != 0}}"> |
233 | - <navigator bindtap="go_url" data-url="/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList" hover-class="none"> | |
233 | + <navigator bindtap="go_url" data-remark="1" data-url="/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList" hover-class="none"> | |
234 | 234 | <view class="seckill-time"> |
235 | 235 | <view class="classname flex ai_c"> |
236 | 236 | <i class="iconfont icon-luck"></i> |
... | ... | @@ -243,7 +243,7 @@ |
243 | 243 | </view> |
244 | 244 | </navigator> |
245 | 245 | <view class=" luck"> |
246 | - <view class="list-item" wx:for="{{luckGo_list}}" bindtap="go_url" data-url="/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id={{item.goods_id}}&group_id={{item.id}}" wx:if="{{item.status == 1}}"> | |
246 | + <view class="list-item" wx:for="{{luckGo_list}}" bindtap="go_url" data-aid="{{item.id}}" data-remark="2" data-url="/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id={{item.goods_id}}&group_id={{item.id}}" wx:if="{{item.status == 1}}"> | |
247 | 247 | <view class="flex ai-center"> |
248 | 248 | <view class="img-container"><image class="img-block" src="{{url + item.original_img}}" data-val="{{item.original_img}}" |
249 | 249 | data-errorimg="luckGo_list[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"></image></view> | ... | ... |