Commit 711f930959afc59a0ac71fb3807b0c62d9c3ca08
1 parent
fb1157f5
幸运购修改7
Showing
6 changed files
with
92 additions
and
34 deletions
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
... | ... | @@ -75,6 +75,8 @@ Page({ |
75 | 75 | }, |
76 | 76 | |
77 | 77 | onLoad: function(t) { |
78 | + | |
79 | + console.log('收到的传参', t); | |
78 | 80 | self = this; |
79 | 81 | this.setData({ |
80 | 82 | is_b_now: t.is_bnow == undefined ? 0 : t.is_bnow, |
... | ... | @@ -85,6 +87,17 @@ Page({ |
85 | 87 | |
86 | 88 | this.data.postdata = appD; |
87 | 89 | |
90 | + | |
91 | + // 获取幸运购活动团team_id | |
92 | + this.get_teamId({ | |
93 | + store_id: oo.stoid, | |
94 | + user_id: getApp().globalData.user_id, | |
95 | + aid: t.group_id, | |
96 | + }); | |
97 | + | |
98 | + | |
99 | + | |
100 | + | |
88 | 101 | //如果期号有值01 |
89 | 102 | // if (appD.qh) { |
90 | 103 | // th.data.qh = appD.qh; |
... | ... | @@ -102,7 +115,7 @@ Page({ |
102 | 115 | |
103 | 116 | |
104 | 117 | //先获取物流,再获取用户信息,再展示页面 |
105 | - this.get_wuliu(th.get_info(th.show_page)); | |
118 | + // this.get_wuliu(th.get_info(th.show_page)); | |
106 | 119 | }, |
107 | 120 | |
108 | 121 | onUnload: function() { |
... | ... | @@ -1243,5 +1256,29 @@ Page({ |
1243 | 1256 | }, |
1244 | 1257 | |
1245 | 1258 | |
1259 | + // 获取team_id | |
1260 | + get_teamId(options) { | |
1261 | + let aid = options.aid; | |
1262 | + let store_id = options.store_id; | |
1263 | + let user_id = options.user_id; | |
1264 | + let url = `/api/weshop/prom/luckyOrder/getUserOrderLastInfo/${store_id}/${user_id}/${aid}`; | |
1265 | + getApp().request.get(url, { | |
1266 | + success: function(res) { | |
1267 | + if(res.data.code == 0) { | |
1268 | + console.log('获取的team_id', res.data.data.team_id); | |
1269 | + let team_id = res.data.data.team_id; | |
1270 | + wx.setStorage({ | |
1271 | + key: 'team_id', | |
1272 | + data: team_id, | |
1273 | + }); | |
1274 | + }; | |
1275 | + } | |
1276 | + }); | |
1277 | + }, | |
1278 | + | |
1279 | + | |
1280 | + | |
1281 | + | |
1282 | + | |
1246 | 1283 | |
1247 | 1284 | }); | ... | ... |
packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js
... | ... | @@ -1168,12 +1168,14 @@ Page({ |
1168 | 1168 | if(th.data.param.from == 1) { |
1169 | 1169 | team_id = th.data.team_id; |
1170 | 1170 | } else { |
1171 | - // team_id = luckyGoInfo.team_id; | |
1171 | + team_id = luckyGoInfo.team_id; | |
1172 | 1172 | if(luckyGoInfo.team_id == 0) { |
1173 | 1173 | team_id = wx.getStorageSync('team_id'); |
1174 | - } else { | |
1175 | - team_id = luckyGoInfo.team_id; | |
1176 | 1174 | }; |
1175 | + // else { | |
1176 | + // team_id = luckyGoInfo.team_id; | |
1177 | + // }; | |
1178 | + // team_id = wx.getStorageSync('team_id'); | |
1177 | 1179 | }; |
1178 | 1180 | |
1179 | 1181 | th.setData({ |
... | ... | @@ -1245,6 +1247,15 @@ Page({ |
1245 | 1247 | } |
1246 | 1248 | }); |
1247 | 1249 | }, |
1250 | + | |
1251 | + | |
1252 | + //-----图片失败,默认图片----- | |
1253 | + bind_bnerr: function (e) { | |
1254 | + var _errImg = e.target.dataset.errorimg; | |
1255 | + var _errObj = {}; | |
1256 | + _errObj[_errImg] = '/miniapp/images/default_g_img.gif'; | |
1257 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
1258 | + }, | |
1248 | 1259 | |
1249 | 1260 | |
1250 | 1261 | ... | ... |
packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxml
... | ... | @@ -6,8 +6,7 @@ |
6 | 6 | <view class="flex pd20 bg-white"> |
7 | 7 | <!-- <view class="img-container shrink0" data-content="已团{{luckyGoInfo.group_joined}}件"> --> |
8 | 8 | <view class="img-container shrink0" data-content=""> |
9 | - <image class="img-block" src="{{iurl + luckyGoInfo.original_img}}" data-val="{{luckyGoInfo.original_img}}" | |
10 | - data-errorimg="luckyGoInfo.original_img" binderror="bind_bnerr" lazy-load="true"></image> | |
9 | + <image class="img-block" src="{{iurl + luckyGoInfo.original_img}}" data-errorimg="luckyGoInfo.original_img" binderror="bind_bnerr" lazy-load="true"></image> | |
11 | 10 | </view> |
12 | 11 | <view class="mgl20 flex fdc jc_sb f1 pdv10"> |
13 | 12 | <!----//图片区域----> | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
... | ... | @@ -1007,19 +1007,19 @@ Page({ |
1007 | 1007 | |
1008 | 1008 | |
1009 | 1009 | // 检查是否已经参团购买 |
1010 | - getApp().request.get("/api/weshop/prom/luckyOrder/getUserOrderInfo/" + o.stoid + "/" + oo.user_id + "/" + this.data.prom_id, { | |
1010 | + getApp().request.get("/api/weshop/prom/luckyOrder/getUserOrderInfo/" + o.stoid + "/" + oo.user_id + "/" + this.data.group_id, { | |
1011 | 1011 | success: function(res) { |
1012 | 1012 | console.log('当前幸运购活动是否已经参团', res.data.code); |
1013 | - // if(res.data.code == 0) { | |
1014 | - // th.setData({ | |
1015 | - // showDetails: true, | |
1016 | - // buyInfo: res.data.data, | |
1017 | - // }); | |
1018 | - // } else { | |
1019 | - // th.setData({ | |
1020 | - // showDetails: false, | |
1021 | - // }); | |
1022 | - // }; | |
1013 | + if(res.data.code == 0) { | |
1014 | + th.setData({ | |
1015 | + showDetails: true, | |
1016 | + buyInfo: res.data.data, | |
1017 | + }); | |
1018 | + } else { | |
1019 | + th.setData({ | |
1020 | + showDetails: false, | |
1021 | + }); | |
1022 | + }; | |
1023 | 1023 | } |
1024 | 1024 | }); |
1025 | 1025 | |
... | ... | @@ -4120,7 +4120,7 @@ Page({ |
4120 | 4120 | buyNow_pt: function (e) { |
4121 | 4121 | s.set_b_now(e); |
4122 | 4122 | wx.navigateTo({ |
4123 | - url: "/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct?is_bnow=1&group_id=" + this.data.group_id +"&goods_id=" + e.goods_id + "&alert=" + this.data.luckGoInfo.lc_alert + '&goods_price=' + this.data.luckGoInfo.group_price/100 + '&is_show=' + this.data.luckGoInfo.is_show, | |
4123 | + url: "/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct?is_bnow=1&group_id=" + this.data.group_id + "&goods_id=" + e.goods_id + "&alert=" + this.data.luckGoInfo.lc_alert + '&goods_price=' + this.data.luckGoInfo.group_price/100 + '&is_show=' + this.data.luckGoInfo.is_show, | |
4124 | 4124 | }); |
4125 | 4125 | |
4126 | 4126 | // getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&group_id=" + th.data.group_id +"&goods_id=" + e.goods_id + "&alert=" + th.data.luckGoInfo.lc_alert); | ... | ... |
packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js
... | ... | @@ -1472,24 +1472,35 @@ Page({ |
1472 | 1472 | |
1473 | 1473 | //跳转到商品 |
1474 | 1474 | go_gd:function (e) { |
1475 | + console.log(e); | |
1475 | 1476 | var gd= e.currentTarget.dataset.gd; |
1477 | + var prom_type = this.data.order.order_goods[0].prom_type; | |
1478 | + // var good_url=''; | |
1479 | + // if(prom_type == 9) { | |
1480 | + // good_url = ''; | |
1481 | + // } else { | |
1482 | + // good_url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gd; | |
1483 | + // }; | |
1484 | + | |
1476 | 1485 | var good_url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gd; |
1477 | - var url="/api/weshop/activitylist/getGoodActInfo"; | |
1478 | - var req_data={ | |
1479 | - store_id:os.stoid,goodsidlist:gd,is_detail:1 | |
1480 | - }; | |
1486 | + getApp().goto(good_url); | |
1487 | + | |
1488 | + // var url="/api/weshop/activitylist/getGoodActInfo"; | |
1489 | + // var req_data={ | |
1490 | + // store_id:os.stoid,goodsidlist:gd,is_detail:1 | |
1491 | + // }; | |
1481 | 1492 | //获取秒杀的多规格 |
1482 | - getApp().request.promiseGet(url, {data:req_data}).then(res=>{ | |
1483 | - if(res.data.code==0 && res.data.data){ | |
1484 | - if(res.data.data.length==1){ | |
1485 | - good_url+="&prom_type="+res.data.data[0].prom_type+"&prom_id="+res.data.data[0].act_id; | |
1486 | - } | |
1487 | - getApp().goto(good_url); | |
1493 | + // getApp().request.promiseGet(url, {data:req_data}).then(res=>{ | |
1494 | + // if(res.data.code==0 && res.data.data){ | |
1495 | + // if(res.data.data.length==1){ | |
1496 | + // good_url+="&prom_type="+res.data.data[0].prom_type+"&prom_id="+res.data.data[0].act_id; | |
1497 | + // } | |
1498 | + // getApp().goto(good_url); | |
1488 | 1499 | |
1489 | - }else{ | |
1490 | - getApp().goto(good_url); | |
1491 | - } | |
1492 | - }) | |
1500 | + // }else{ | |
1501 | + // getApp().goto(good_url); | |
1502 | + // } | |
1503 | + // }) | |
1493 | 1504 | }, |
1494 | 1505 | |
1495 | 1506 | ... | ... |
packageC/pages/luckyGo/luckyGo_order/luckyGo_order.wxml
... | ... | @@ -30,11 +30,11 @@ |
30 | 30 | data-errorimg="order.order_goods[{{index}}].original_img"></image> |
31 | 31 | </view> |
32 | 32 | <!-- 跳转到商品 --> |
33 | - <navigator class="order-cont pdh20" bindtap="go_gd" data-gd="{{item.goods_id}}"> | |
33 | + <view class="order-cont pdh20" bindtap="go_gd" data-gd="{{item.goods_id}}"> | |
34 | 34 | <view class="goods-name ellipsis-2">{{item.goods_name}}</view> |
35 | 35 | <!--<view class="goods-color">{{item.goods_spec}} {{item.goods_color}}</view>--> |
36 | 36 | <view class="goods-color">{{filters.show_gui_ge(item.goods_spec,item.goods_color)}}</view> |
37 | - </navigator> | |
37 | + </view> | |
38 | 38 | </view> |
39 | 39 | |
40 | 40 | ... | ... |