Commit b0ca524de847e10adab0624410b72ec850b969f4

Authored by yvan.ni
1 parent cfb25d45

商品详情页,跳转到分享团的页

pages/goods/goodsInfo/goodsInfo.js
... ... @@ -860,7 +860,11 @@ Page({
860 860 url: "/pages/user/address_list/address_list?operate=selectAddress"
861 861 });
862 862 },
863   - onUnload: function() {},
  863 + onUnload: function() {
  864 + for(var i = 1; i < 100; i++) {
  865 + clearInterval(i);
  866 + }
  867 + },
864 868 onHide: function() {
865 869 this.data.is_timer = 0;
866 870 for(var i = 1; i < 100; i++) {
... ... @@ -3129,7 +3133,12 @@ Page({
3129 3133 }
3130 3134 });
3131 3135 } else if (odr.pt_status == 1 && odr.order_status == 1) {
3132   - wx.navigateTo({
  3136 +
  3137 + if(this.data.is_go_to_team_show) return false;
  3138 + this.data.is_go_to_team_show=1;
  3139 + wx.showLoading();
  3140 +
  3141 + wx.redirectTo({
3133 3142 url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,
3134 3143 });
3135 3144 } else {
... ... @@ -3337,17 +3346,24 @@ Page({
3337 3346  
3338 3347 //-------跳转pt商品-------
3339 3348 go_to_nopay: function() {
3340   - var th = this;
3341   - wx.navigateTo({
3342   - url: "/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id,
3343   - });
  3349 + var th = this;
  3350 + url="/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id;
  3351 + getApp().goto(url);
  3352 +
3344 3353 },
3345 3354 //-------跳转pt teamshow-------
3346 3355 go_to_team_show: function() {
3347   - var th = this;
3348   - wx.navigateTo({
3349   - url: "/pages/team/team_success/team_success?ordersn=" + th.data.buy_order.order_sn,
3350   - });
  3356 +
  3357 + if(this.data.is_go_to_team_show) return false;
  3358 + this.data.is_go_to_team_show=1;
  3359 + wx.showLoading();
  3360 +
  3361 + var th = this;
  3362 + var url="/pages/team/team_success/team_success?ordersn=" + th.data.buy_order.order_sn;
  3363 + wx.redirectTo({
  3364 + url:url,
  3365 + })
  3366 +
3351 3367 },
3352 3368  
3353 3369 //---拼团倒计时---
... ... @@ -3427,9 +3443,14 @@ Page({
3427 3443 }
3428 3444 });
3429 3445 } else if (odr.pt_status == 1 && odr.order_status == 1) {
3430   - wx.navigateTo({
3431   - url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,
3432   - });
  3446 +
  3447 + if(this.data.is_go_to_team_show) return false;
  3448 + this.data.is_go_to_team_show=1;
  3449 + wx.showLoading();
  3450 +
  3451 + wx.redirectTo({
  3452 + url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,
  3453 + });
3433 3454 } else {
3434 3455 wx.navigateTo({
3435 3456 url: "/pages/team/team_show/team_show?tg_id=" + id,
... ...
pages/team/team_success/team_success.js
... ... @@ -47,6 +47,7 @@ Page({
47 47 },
48 48 onLoad: function (t) {
49 49 wx.setNavigationBarTitle({ title: "拼团订单",})
  50 +
50 51 var that=this;
51 52 var th=this;
52 53 //获取用户设备信息,屏幕宽度
... ... @@ -56,7 +57,7 @@ Page({
56 57 }
57 58 })
58 59 var pay_f = t.payf, order_sn = t.ordersn;
59   - this.setData({ pay_f: pay_f, order_sn: order_sn}),
  60 + this.setData({ pay_f: pay_f, order_sn: order_sn});
60 61 this.init(order_sn);
61 62  
62 63 //-- 自定义海报 --
... ... @@ -209,6 +210,19 @@ Page({
209 210 min_price=pri;
210 211  
211 212 }
  213 +
  214 +
  215 + //获取商品信息
  216 + getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + goods_id, {
  217 + }).then(res => {
  218 + //商品地址
  219 + original_img = ee.data.imageurl+ res.data.data.original_img,
  220 + goods = res.data.data
  221 +
  222 + ee.setData({goods: goods,image: original_img,})
  223 +
  224 + })
  225 +
212 226 }
213 227 })
214 228  
... ... @@ -233,13 +247,7 @@ Page({
233 247 }
234 248  
235 249  
236   - //获取商品信息
237   - await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + goods_id, {
238   - }).then(res => {
239   - //商品地址
240   - original_img = ee.data.imageurl+ res.data.data.original_img,
241   - goods = res.data.data
242   - })
  250 +
243 251  
244 252 //获取活动从表信息team_id:305暂时
245 253 await getApp().request.promiseGet("/api/weshop/teamgroup/page" , {
... ... @@ -266,10 +274,14 @@ Page({
266 274 }
267 275  
268 276 //获取大家都在团信息
269   - await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1?store_id="+ os.stoid +"&is_end=0&is_show=1" , {
  277 + getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1?store_id="+ os.stoid +"&is_end=0&is_show=1" , {
270 278 data:{page:1,pageSize:2}
271 279 }).then(res => {
272   - pageteam = res.data.data.pageData;
  280 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  281 + pageteam = res.data.data.pageData;
  282 + ee.setData({pageteam: pageteam,})
  283 + }
  284 +
273 285 })
274 286  
275 287 //--当是成团的时候的操作--
... ... @@ -277,8 +289,8 @@ Page({
277 289 //设置值
278 290  
279 291 ee.setData({
280   - ordertx2: ordertx2, ordertx: ordertx, teamlist: teamlist, teamgroup: teamgroup, goods: goods, pageteam: pageteam, min_price: min_price,
281   - order: order, image: original_img, share_img: share_img,max_num:max_num,
  292 + ordertx2: ordertx2, ordertx: ordertx, teamlist: teamlist, teamgroup: teamgroup, min_price: min_price,
  293 + order: order, share_img: share_img,max_num:max_num,
282 294 pindGoods: teamlist,is_show:1, zk:false,
283 295 hiddenName: false, ct_price:ct_price,p_status:p_status,sf_arr:sf_arr});
284 296  
... ... @@ -290,8 +302,8 @@ Page({
290 302 console.log("239什么鬼", teamlist);
291 303 //设置值
292 304 ee.setData({
293   - ordertx2: ordertx2, ordertx: ordertx, teamlist: teamlist, teamgroup: teamgroup, goods: goods, pageteam: pageteam,
294   - order: order, image: original_img, p_status: p_status, min_price:min_price,
  305 + ordertx2: ordertx2, ordertx: ordertx, teamlist: teamlist, teamgroup: teamgroup,
  306 + order: order, p_status: p_status, min_price:min_price,
295 307 share_img: share_img, max_num: max_num, pindGoods: teamlist, is_show: 1,
296 308 ct_price: ct_price, p_status: p_status,sf_arr:sf_arr});
297 309 }
... ...