From 711f930959afc59a0ac71fb3807b0c62d9c3ca08 Mon Sep 17 00:00:00 2001 From: taiyuan Date: Sat, 4 Dec 2021 12:53:05 +0800 Subject: [PATCH] 幸运购修改7 --- packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js | 39 ++++++++++++++++++++++++++++++++++++++- packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js | 17 ++++++++++++++--- packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxml | 3 +-- packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js | 24 ++++++++++++------------ packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js | 39 +++++++++++++++++++++++++-------------- packageC/pages/luckyGo/luckyGo_order/luckyGo_order.wxml | 4 ++-- 6 files changed, 92 insertions(+), 34 deletions(-) diff --git a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js index f2b1948..959c0c6 100644 --- a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js +++ b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js @@ -75,6 +75,8 @@ Page({ }, onLoad: function(t) { + + console.log('收到的传参', t); self = this; this.setData({ is_b_now: t.is_bnow == undefined ? 0 : t.is_bnow, @@ -85,6 +87,17 @@ Page({ this.data.postdata = appD; + + // 获取幸运购活动团team_id + this.get_teamId({ + store_id: oo.stoid, + user_id: getApp().globalData.user_id, + aid: t.group_id, + }); + + + + //如果期号有值01 // if (appD.qh) { // th.data.qh = appD.qh; @@ -102,7 +115,7 @@ Page({ //先获取物流,再获取用户信息,再展示页面 - this.get_wuliu(th.get_info(th.show_page)); + // this.get_wuliu(th.get_info(th.show_page)); }, onUnload: function() { @@ -1243,5 +1256,29 @@ Page({ }, + // 获取team_id + get_teamId(options) { + let aid = options.aid; + let store_id = options.store_id; + let user_id = options.user_id; + let url = `/api/weshop/prom/luckyOrder/getUserOrderLastInfo/${store_id}/${user_id}/${aid}`; + getApp().request.get(url, { + success: function(res) { + if(res.data.code == 0) { + console.log('获取的team_id', res.data.data.team_id); + let team_id = res.data.data.team_id; + wx.setStorage({ + key: 'team_id', + data: team_id, + }); + }; + } + }); + }, + + + + + }); diff --git a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js index 0e3f165..a975c52 100644 --- a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js +++ b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js @@ -1168,12 +1168,14 @@ Page({ if(th.data.param.from == 1) { team_id = th.data.team_id; } else { - // team_id = luckyGoInfo.team_id; + team_id = luckyGoInfo.team_id; if(luckyGoInfo.team_id == 0) { team_id = wx.getStorageSync('team_id'); - } else { - team_id = luckyGoInfo.team_id; }; + // else { + // team_id = luckyGoInfo.team_id; + // }; + // team_id = wx.getStorageSync('team_id'); }; th.setData({ @@ -1245,6 +1247,15 @@ Page({ } }); }, + + + //-----图片失败,默认图片----- + bind_bnerr: function (e) { + var _errImg = e.target.dataset.errorimg; + var _errObj = {}; + _errObj[_errImg] = '/miniapp/images/default_g_img.gif'; + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; + }, diff --git a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxml b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxml index aac5148..f0c9790 100644 --- a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxml +++ b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxml @@ -6,8 +6,7 @@ - + diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js index 0327415..9e8bc3e 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js @@ -1007,19 +1007,19 @@ Page({ // 检查是否已经参团购买 - getApp().request.get("/api/weshop/prom/luckyOrder/getUserOrderInfo/" + o.stoid + "/" + oo.user_id + "/" + this.data.prom_id, { + getApp().request.get("/api/weshop/prom/luckyOrder/getUserOrderInfo/" + o.stoid + "/" + oo.user_id + "/" + this.data.group_id, { success: function(res) { console.log('当前幸运购活动是否已经参团', res.data.code); - // if(res.data.code == 0) { - // th.setData({ - // showDetails: true, - // buyInfo: res.data.data, - // }); - // } else { - // th.setData({ - // showDetails: false, - // }); - // }; + if(res.data.code == 0) { + th.setData({ + showDetails: true, + buyInfo: res.data.data, + }); + } else { + th.setData({ + showDetails: false, + }); + }; } }); @@ -4120,7 +4120,7 @@ Page({ buyNow_pt: function (e) { s.set_b_now(e); wx.navigateTo({ - 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, + 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, }); // 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); diff --git a/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js b/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js index b883001..40db9db 100644 --- a/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js +++ b/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js @@ -1472,24 +1472,35 @@ Page({ //跳转到商品 go_gd:function (e) { + console.log(e); var gd= e.currentTarget.dataset.gd; + var prom_type = this.data.order.order_goods[0].prom_type; + // var good_url=''; + // if(prom_type == 9) { + // good_url = ''; + // } else { + // good_url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gd; + // }; + var good_url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gd; - var url="/api/weshop/activitylist/getGoodActInfo"; - var req_data={ - store_id:os.stoid,goodsidlist:gd,is_detail:1 - }; + getApp().goto(good_url); + + // var url="/api/weshop/activitylist/getGoodActInfo"; + // var req_data={ + // store_id:os.stoid,goodsidlist:gd,is_detail:1 + // }; //获取秒杀的多规格 - getApp().request.promiseGet(url, {data:req_data}).then(res=>{ - if(res.data.code==0 && res.data.data){ - if(res.data.data.length==1){ - good_url+="&prom_type="+res.data.data[0].prom_type+"&prom_id="+res.data.data[0].act_id; - } - getApp().goto(good_url); + // getApp().request.promiseGet(url, {data:req_data}).then(res=>{ + // if(res.data.code==0 && res.data.data){ + // if(res.data.data.length==1){ + // good_url+="&prom_type="+res.data.data[0].prom_type+"&prom_id="+res.data.data[0].act_id; + // } + // getApp().goto(good_url); - }else{ - getApp().goto(good_url); - } - }) + // }else{ + // getApp().goto(good_url); + // } + // }) }, diff --git a/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.wxml b/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.wxml index 2ec90cd..500d95b 100644 --- a/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.wxml +++ b/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.wxml @@ -30,11 +30,11 @@ data-errorimg="order.order_goods[{{index}}].original_img"> - + {{item.goods_name}} {{filters.show_gui_ge(item.goods_spec,item.goods_color)}} - + -- libgit2 0.21.4