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 ad15b33..f2b1948 100644 --- a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js +++ b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js @@ -102,7 +102,7 @@ Page({ //先获取物流,再获取用户信息,再展示页面 - th.get_wuliu(th.get_info(th.show_page)); + this.get_wuliu(th.get_info(th.show_page)); }, onUnload: function() { @@ -580,18 +580,24 @@ Page({ // 提交订单前弹出确认对话框 submitConfirm(e) { - wx.showModal({ - title: '温馨提示', - content: this.data.param.alert, - success(res) { - if (res.confirm) { - console.log('用户点击确定'); - self.submitForm(e); - } else if (res.cancel) { - console.log('用户点击取消'); + // is_show为0不显示温馨提示,为1显示温馨提示 + if(this.data.param.is_show == 1) { + wx.showModal({ + title: '温馨提示', + content: this.data.param.alert, + success(res) { + if (res.confirm) { + console.log('用户点击确定'); + self.submitForm(e); + } else if (res.cancel) { + console.log('用户点击取消'); + } } - } - }) + }); + } else { + this.submitForm(e); + }; + }, diff --git a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.json b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.json index 0cfb931..c78ad85 100644 --- a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.json +++ b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.json @@ -1,5 +1,5 @@ { - "navigationBarTitleText": "填写订单", + "navigationBarTitleText": "提交订单", "enablePullDownRefresh": false, "usingComponents": { "warn": "/components/long_warn/long_warn" diff --git a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js index 9a91ad8..5ab59ea 100644 --- a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js +++ b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js @@ -9,6 +9,8 @@ var t = require("../../../../utils/util.js"), o = s.globalData.setting, os = o; var regeneratorRuntime = require('../../../../utils/runtime.js'); + +let self = null; Page({ data: { @@ -48,8 +50,13 @@ Page({ showRules: false, isSuccess: false, showPoster: false, + + luckyGoMembers: [], + team_id: 0, }, + onLoad: function (t) { + self = this; if(t.team_id != null && t.team_id !=undefined) { this.setData({ team_id: t.team_id, @@ -71,7 +78,7 @@ Page({ this.init(order_sn); //-- 自定义海报 -- - getApp().request.promiseGet("/api/weshop/goods/poster/page",{ + getApp().request.promiseGet("/api/weshop/goods/poster/page", { data:{store_id:os.stoid, type:1, is_use:1 } }).then(res=>{ if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0] ){ @@ -110,6 +117,11 @@ Page({ if(this.data.luckyGoInfo.num && this.data.luckyGoInfo.num == 0) { wx.removeStorageSync('team_id'); }; + // 如果是从会员中心的幸运购列表点击进来的,退出时清除storage里的team_id + if(this.data.param.from == 1) { + let team_id = wx.getStorageSync('team_id'); + if(team_id != null && team_id != undefined) wx.removeStorageSync('team_id'); + }; }, //关闭展开列表 @@ -169,7 +181,7 @@ Page({ pt_listno = "",//团编号 pt_prom_id = 0, //活动id ee = this, - team_id = 0,//活动id + //team_id = 0,//活动id ordertx=[],//头像图片 share_img=null,//分享图片 teamlist=null,//活动表 @@ -964,14 +976,14 @@ Page({ if (pagePath.indexOf('/') != 0) { pagePath = '/' + pagePath; } - if(getApp().globalData.user_id){ + // if(getApp().globalData.user_id){ - if(pagePath.indexOf("?")>0){ - pagePath+="&first_leader="+getApp().globalData.user_id; - }else{ - pagePath+="?first_leader="+getApp().globalData.user_id; - } - } + // if(pagePath.indexOf("?")>0){ + // pagePath+="&first_leader="+getApp().globalData.user_id; + // }else{ + // pagePath+="?first_leader="+getApp().globalData.user_id; + // } + // } return { title: "邀你一起参加幸运购", path: pagePath, @@ -1146,30 +1158,49 @@ Page({ id: this.data.param.group_id, } }).then(res => { - var luckyGoInfo = res.data.data.pageData[0]; - var team_id = luckyGoInfo.team_id; - - th.setData({ - luckyGoInfo, - team_id, - }); - - //参团成功后,检查team_id - //如果team_id为0, 表示当前已开启新的一期,文字提示应改为’参团成功,本期幸运购已开团,中奖结果可点击下方查看参团列表‘ - //如果team_id为0,取出之前保存的team_id替换掉,请求上一期已成团的幸运购活动 - if(team_id != 0) { - wx.setStorage({ - key: 'team_id', - data: team_id, - }); - } else { - let team_id = wx.getStorageSync('team_id'); + if(res.data.code == 0) { + console.log('当前成团信息', res); + var luckyGoInfo = res.data.data.pageData[0]; + var team_id; + + if(th.data.param.from == 1) { + team_id = th.data.team_id; + } else { + team_id = luckyGoInfo.team_id; + }; + th.setData({ - team_id: team_id, - isSuccess: true, + luckyGoInfo, + team_id, }); + + //参团成功后,检查team_id + //如果team_id为0, 表示当前已开启新的一期,文字提示应改为’参团成功,本期幸运购已开团,中奖结果可点击下方查看参团列表‘ + //如果team_id为0,取出之前保存的team_id替换掉,请求上一期已成团的幸运购活动 + //如果从会员中心的幸运购列表邀请好友点击进来,不执行storage操作 + if(th.data.param.from == 1) return false; + if(team_id != 0) { + wx.setStorage({ + key: 'team_id', + data: team_id, + }); + console.log('存储team_id', team_id); + } else { + let team_id2 = wx.getStorageSync('team_id'); + console.log('获取team_id', team_id2); + th.setData({ + team_id: team_id2, + // isSuccess: true, + }); + }; + + // th.setData({ + // luckyGoInfo, + // team_id, + // }); + }; - + }); // 幸运购成团成员 @@ -1179,12 +1210,34 @@ Page({ team_id: this.data.team_id, } }).then(res => { - th.setData({ - luckyGoMembers: res.data.data.pageData, - }); + if(res.data.code == 0) { + console.log('当前参团成员', res, ); + let myId = getApp().globalData.userInfo.user_id; + let luckyGoMembers = res.data.data.pageData; + th.setData({ + luckyGoMembers, + }); + + self.isMe(myId, luckyGoMembers); + }; + }); }, + + // 判断自己是否中奖 + isMe(myId, list) { + list.some((item, index) => { + if(item.team_status == 2) { + if(item.user_id == myId) { + self.setData({ + iWin: true + }); + return true; + }; + } + }); + }, diff --git a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxml b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxml index 79e2e68..aac5148 100644 --- a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxml +++ b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.wxml @@ -4,7 +4,8 @@ - + + @@ -24,8 +25,9 @@ - - 待成团 + + 已成团 + 待成团 @@ -43,7 +45,7 @@ 规则 - + - + - 参团成功,还差{{filters.show_default(luckyGoInfo.group_num, '0') - filters.show_default(luckyGoInfo.num, '0')}}人即可成团,请留意成员开奖通知! - 参团成功,本期幸运购已开团! + + 参团成功,本期幸运购已开团! + {{iWin ? '恭喜您团中该商品,请等待商家发货~':'很遗憾您未团中,可获得一份帮团奖励,再接再厉噢~'}} + + 您已参团成功,还差{{filters.show_default(luckyGoInfo.group_num, '0') - filters.show_default(luckyGoInfo.num, '0')}}人参与即可成团! + 组团中,还差{{filters.show_default(luckyGoInfo.group_num, '0') - filters.show_default(luckyGoInfo.num, '0')}}人即可成团! - 未团中可获得帮团奖励 + + + @@ -85,16 +93,16 @@ - + - + @@ -166,7 +174,7 @@ 拼团成功, 规定时间内支付尾款即发货 - + 点击下方按钮分享给小伙伴,可快速成团! @@ -192,11 +200,11 @@ - 查看拼团列表 + 查看参团成员 @@ -273,7 +273,7 @@ - 已售:{{data.sales_sum}}件 + 已售:{{num_success}}件 {{categories3[0].num}}人评价 @@ -1253,9 +1253,10 @@ -