From b0ca524de847e10adab0624410b72ec850b969f4 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Fri, 15 Jan 2021 17:16:01 +0800 Subject: [PATCH] 商品详情页,跳转到分享团的页 --- pages/goods/goodsInfo/goodsInfo.js | 47 ++++++++++++++++++++++++++++++++++------------- pages/team/team_success/team_success.js | 40 ++++++++++++++++++++++++++-------------- 2 files changed, 60 insertions(+), 27 deletions(-) diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 5ea8f95..0f8474c 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -860,7 +860,11 @@ Page({ url: "/pages/user/address_list/address_list?operate=selectAddress" }); }, - onUnload: function() {}, + onUnload: function() { + for(var i = 1; i < 100; i++) { + clearInterval(i); + } + }, onHide: function() { this.data.is_timer = 0; for(var i = 1; i < 100; i++) { @@ -3129,7 +3133,12 @@ Page({ } }); } else if (odr.pt_status == 1 && odr.order_status == 1) { - wx.navigateTo({ + + if(this.data.is_go_to_team_show) return false; + this.data.is_go_to_team_show=1; + wx.showLoading(); + + wx.redirectTo({ url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn, }); } else { @@ -3337,17 +3346,24 @@ Page({ //-------跳转pt商品------- go_to_nopay: function() { - var th = this; - wx.navigateTo({ - url: "/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id, - }); + var th = this; + url="/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id; + getApp().goto(url); + }, //-------跳转pt teamshow------- go_to_team_show: function() { - var th = this; - wx.navigateTo({ - url: "/pages/team/team_success/team_success?ordersn=" + th.data.buy_order.order_sn, - }); + + if(this.data.is_go_to_team_show) return false; + this.data.is_go_to_team_show=1; + wx.showLoading(); + + var th = this; + var url="/pages/team/team_success/team_success?ordersn=" + th.data.buy_order.order_sn; + wx.redirectTo({ + url:url, + }) + }, //---拼团倒计时--- @@ -3427,9 +3443,14 @@ Page({ } }); } else if (odr.pt_status == 1 && odr.order_status == 1) { - wx.navigateTo({ - url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn, - }); + + if(this.data.is_go_to_team_show) return false; + this.data.is_go_to_team_show=1; + wx.showLoading(); + + wx.redirectTo({ + url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn, + }); } else { wx.navigateTo({ url: "/pages/team/team_show/team_show?tg_id=" + id, diff --git a/pages/team/team_success/team_success.js b/pages/team/team_success/team_success.js index 6aba271..ac488dc 100644 --- a/pages/team/team_success/team_success.js +++ b/pages/team/team_success/team_success.js @@ -47,6 +47,7 @@ Page({ }, onLoad: function (t) { wx.setNavigationBarTitle({ title: "拼团订单",}) + var that=this; var th=this; //获取用户设备信息,屏幕宽度 @@ -56,7 +57,7 @@ Page({ } }) var pay_f = t.payf, order_sn = t.ordersn; - this.setData({ pay_f: pay_f, order_sn: order_sn}), + this.setData({ pay_f: pay_f, order_sn: order_sn}); this.init(order_sn); //-- 自定义海报 -- @@ -209,6 +210,19 @@ Page({ min_price=pri; } + + + //获取商品信息 + getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + goods_id, { + }).then(res => { + //商品地址 + original_img = ee.data.imageurl+ res.data.data.original_img, + goods = res.data.data + + ee.setData({goods: goods,image: original_img,}) + + }) + } }) @@ -233,13 +247,7 @@ Page({ } - //获取商品信息 - await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + goods_id, { - }).then(res => { - //商品地址 - original_img = ee.data.imageurl+ res.data.data.original_img, - goods = res.data.data - }) + //获取活动从表信息team_id:305暂时 await getApp().request.promiseGet("/api/weshop/teamgroup/page" , { @@ -266,10 +274,14 @@ Page({ } //获取大家都在团信息 - await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1?store_id="+ os.stoid +"&is_end=0&is_show=1" , { + getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1?store_id="+ os.stoid +"&is_end=0&is_show=1" , { data:{page:1,pageSize:2} }).then(res => { - pageteam = res.data.data.pageData; + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ + pageteam = res.data.data.pageData; + ee.setData({pageteam: pageteam,}) + } + }) //--当是成团的时候的操作-- @@ -277,8 +289,8 @@ Page({ //设置值 ee.setData({ - ordertx2: ordertx2, ordertx: ordertx, teamlist: teamlist, teamgroup: teamgroup, goods: goods, pageteam: pageteam, min_price: min_price, - order: order, image: original_img, share_img: share_img,max_num:max_num, + ordertx2: ordertx2, ordertx: ordertx, teamlist: teamlist, teamgroup: teamgroup, min_price: min_price, + order: order, share_img: share_img,max_num:max_num, pindGoods: teamlist,is_show:1, zk:false, hiddenName: false, ct_price:ct_price,p_status:p_status,sf_arr:sf_arr}); @@ -290,8 +302,8 @@ Page({ console.log("239什么鬼", teamlist); //设置值 ee.setData({ - ordertx2: ordertx2, ordertx: ordertx, teamlist: teamlist, teamgroup: teamgroup, goods: goods, pageteam: pageteam, - order: order, image: original_img, p_status: p_status, min_price:min_price, + ordertx2: ordertx2, ordertx: ordertx, teamlist: teamlist, teamgroup: teamgroup, + order: order, p_status: p_status, min_price:min_price, share_img: share_img, max_num: max_num, pindGoods: teamlist, is_show: 1, ct_price: ct_price, p_status: p_status,sf_arr:sf_arr}); } -- libgit2 0.21.4