diff --git a/pages/activity_detail/activity_detail.js b/pages/activity_detail/activity_detail.js index 6e19b8a..649c716 100644 --- a/pages/activity_detail/activity_detail.js +++ b/pages/activity_detail/activity_detail.js @@ -22,6 +22,7 @@ Page({ countDownHour: 0, countDownMinute: 0, countDownSecond: 0, + countdownSec: 0, //根据状态切换样式 grounpInfo: "block", grounpInfo2: "none", @@ -79,7 +80,6 @@ Page({ * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { - //this.countActivityTime(1527609600); }, /** @@ -109,7 +109,8 @@ Page({ groupNo: that.data.groupNo, }, header: { - 'Content-Type': 'application/x-www-form-urlencoded' + 'Content-Type': 'application/x-www-form-urlencoded', + 'sessionId': wx.getStorageSync('sessionId') }, success: function (res) { var data = res.data; @@ -120,27 +121,29 @@ Page({ that.setData({ activityDetail: data.response, activityNo: data.response.activityNo, - groupNo: data.response.groupNo == undefined ? "" : data.response.groupNo, + groupNo: data.response.groupNo == undefined ? that.data.groupNo : data.response.groupNo, memberList: data.response.memberList, groupStatus: data.response.status, currentMemberType: data.response.currentMemberType == undefined ? -1 : data.response.currentMemberType, + countdownSec: data.response.countdownSec, }); let activityContent = data.response.activityContent; WxParse.wxParse('activityContent', 'html', activityContent, that); - + console.log("currentMemberType:" + that.data.groupNo + "status:" + that.data.groupStatus); //根据状态切换样式 if (that.data.groupNo !=""){ //开团后页面变化 - if (that.data.status == 10){ + if (that.data.groupStatus == 10){ //团倒计时时 - countActivityTime() + that.countActivityTime(data.response.countdownSec); //正在拼团 that.setData({ grounpInfo: "block", grounpInfo2: "none", + remark: "block", tagColor: "#F8B551", }); - if (that.data.currentMemberTyp == -1){ + if (that.data.currentMemberType == -1){ //游客 that.setData({ one_content: "none", @@ -156,9 +159,9 @@ Page({ buttomText: '邀请好友拼团', }); } - } else if (that.data.status == 20){ + } else if (that.data.groupStatus == 20){ //拼团成功 - if (that.data.currentMemberTyp == -1) { + if (that.data.currentMemberType == -1) { //游客 that.setData({ one_content: "block", @@ -182,9 +185,9 @@ Page({ remarkText: "", }); } - } else if (that.data.status == 90){ + } else if (that.data.groupStatus == 90){ //拼团失败 - if (that.data.currentMemberTyp == -1) { + if (that.data.currentMemberType == -1) { //游客 that.setData({ one_content: "block", @@ -242,7 +245,7 @@ Page({ *活动倒计时方法 */ countActivityTime: function (timeStamp) { - var totalSecond = timeStamp - Date.parse(new Date()) / 1000; + var totalSecond = timeStamp - 1; var interval = setInterval(function () { // 秒数 var second = totalSecond; @@ -308,15 +311,17 @@ Page({ //点击团按钮操作 groupTap: function (e) { + let that = this; var url = ""; + console.log("groupNo:" + that.data.groupNo + "¤tMemberType:" + that.data.currentMemberType + "&groupStatus:" + that.data.groupStatus); if (that.data.groupNo == ""){ - url = '/mall/wxa/activity/group/group'; + url = '/mall/wxa/activity/group/open'; //首次开团 this.groupOpenOrJoin(url); }else{ - if (that.data.status == 10) { + if (that.data.groupStatus == 10) { //正在拼团 - if (that.data.currentMemberTyp == -1) { + if (that.data.currentMemberType == -1) { //游客 url = '/mall/wxa/activity/group/join'; this.groupOpenOrJoin(url); @@ -324,11 +329,11 @@ Page({ //团长与参与人点击分享 this.openActionsheet(); } - } else if (that.data.status == 20) { + } else if (that.data.groupStatus == 20) { //拼团成功 if (that.data.currentMemberTyp == -1) { //游客 - url = '/mall/wxa/activity/group/group'; + url = '/mall/wxa/activity/group/open'; this.groupOpenOrJoin(url); } else { //团长与参与人立即预约 @@ -336,9 +341,9 @@ Page({ url: '../order/order', }) } - } else if (that.data.status == 90){ + } else if (that.data.groupStatus == 90){ //拼团失败 - url = '/mall/wxa/activity/group/group'; + url = '/mall/wxa/activity/group/open'; this.groupOpenOrJoin(url); } } @@ -376,6 +381,9 @@ Page({ }) return; } + that.setData({ + groupNo: data.response.orderNo == undefined ? that.data.groupNo : data.response.orderNo, + }); console.log(data.response); let dr = data.response.weixinTransParameters; console.log(dr); @@ -457,6 +465,7 @@ Page({ //打败Actionsheet,进行分享 openActionsheet: function () { + console.log("qrImageUrl:" + this.data.qrImageUrl) if (this.data.qrImageUrl.length == 0) { wx.showLoading({ title: '正在获取', diff --git a/pages/activity_detail/activity_detail.wxml b/pages/activity_detail/activity_detail.wxml index feefdcc..30cf925 100644 --- a/pages/activity_detail/activity_detail.wxml +++ b/pages/activity_detail/activity_detail.wxml @@ -3,7 +3,10 @@ - {{activityDetail.activityName}} + + {{activityDetail.activityName}} + + {{activityDetail.limitNum}}人团 {{activityDetail.limitTypeDesc}} @@ -67,7 +70,7 @@ - {{buttomText}} + {{buttomText}} ¥{{activityDetail.participantPrice / 100}} {{buttomText}} diff --git a/pages/activity_detail/activity_detail.wxss b/pages/activity_detail/activity_detail.wxss index ae674e4..f0cf023 100644 --- a/pages/activity_detail/activity_detail.wxss +++ b/pages/activity_detail/activity_detail.wxss @@ -13,7 +13,7 @@ image{ margin: -10rpx auto; } .activity_info .title{ - width: 80%; + width: 50%; padding-top: 29rpx; padding-left: 36rpx; font-weight: bold; @@ -204,6 +204,7 @@ image{ width: 86rpx; border-radius:43rpx; margin: 7rpx auto; + background-color: #999; } .grounp_info .list .view .memberList .markBlock{ diff --git a/pages/activity_list/activity_list.js b/pages/activity_list/activity_list.js index a7a7af5..60b4f0c 100644 --- a/pages/activity_list/activity_list.js +++ b/pages/activity_list/activity_list.js @@ -106,8 +106,10 @@ Page({ }, itemClick: function (event) { + var activityNo = event.currentTarget.dataset.activityno; var groupNo = event.currentTarget.dataset.groupno; + console.log("groupNo:" + groupNo); wx.navigateTo({ url: '../activity_detail/activity_detail?activityNo=' + activityNo + '&groupNo=' + groupNo })