diff --git a/config/config.js b/config/config.js index ccbf22a..823a6f9 100755 --- a/config/config.js +++ b/config/config.js @@ -247,7 +247,11 @@ var config = { /** * 去拼团 */ - toOrderGroup: '/orderGroup/toOrderGroup' + toOrderGroup: '/orderGroup/toOrderGroup', + /** + * 查询是否已参团 + */ + queryAttendStatus:'/orderGroup/queryAttendStatus' }, weapp: { AppId: weappId diff --git a/pages/joinFrDpell/index.js b/pages/joinFrDpell/index.js index b0ce06f..9a9628d 100644 --- a/pages/joinFrDpell/index.js +++ b/pages/joinFrDpell/index.js @@ -32,9 +32,28 @@ Page({ orderGroupId: options.orderGroupId, orderId:options.orderId }) + this.checkUser(); this.getDetail(options.couponChannelId); this.getOneSpell(options.couponId) }, + /** + * 判断用户是否已经在团中 + */ + checkUser(){ + let that = this; + Http.get({ + url: config.api.queryAttendStatus, + data: { + id: this.data.orderGroupId, + } + }).then(res => { + if (res.data==true) { + wx.redirectTo({ + url: `/pages/spellDetail/index?orderId=${this.data.orderId}&couponId=${this.data.couponId}&orderGroupId=${this.data.orderGroupId}&couponChannelId=${this.data.couponChannelId}`, + }) + } + }); + }, /** * 拨打电话 */ diff --git a/pages/spellDetail/index.js b/pages/spellDetail/index.js index 3b5ee37..d22ac1a 100644 --- a/pages/spellDetail/index.js +++ b/pages/spellDetail/index.js @@ -34,6 +34,14 @@ Page({ // 关闭来自于左上角的分享 wx.hideShareMenu() }, + /** + * 去使用 + */ + gotoUse() { + wx.navigateTo({ + url: `/pages/couponorder/index/index` + }); + }, /** * 拼团状态字段转换 */ @@ -104,7 +112,9 @@ Page({ console.log(res,555555555) let data=res.data; data.statustext=that.changeSatus(data.status); - that.countdown(data.expiredDate); + if(data.status!=11){ + that.countdown(data.expiredDate); + } data.salePrice = (data.salePrice/100).toFixed(2) for (let i = 0; i < data.remainPeople;i++){ let a={}; diff --git a/pages/spellDetail/index.wxml b/pages/spellDetail/index.wxml index c5e0829..3bc803b 100644 --- a/pages/spellDetail/index.wxml +++ b/pages/spellDetail/index.wxml @@ -4,13 +4,13 @@ {{data.statustext}} - 结束 - {{sec}} - : - {{min}} - : - {{hour}} - 剩余 + 结束 + {{sec}} + : + {{min}} + : + {{hour}} + 剩余 @@ -124,6 +124,7 @@ - + + diff --git a/pages/spellGroup/spellGroup.js b/pages/spellGroup/spellGroup.js index eccac13..0a31130 100644 --- a/pages/spellGroup/spellGroup.js +++ b/pages/spellGroup/spellGroup.js @@ -1,7 +1,7 @@ var config = require("../../config/config.js"); const Http = require("../../utils/HttpBasics"); const imgurl = require("../../utils/imgurl"); -const { spellStatus02 } = require("../../utils/spell"); +const { spellStatus,spellStatus02 } = require("../../utils/spell"); Page({ /** * 页面的初始数据 @@ -83,6 +83,10 @@ Page({ changeStatus(status){ return spellStatus02.filter(item=>status==item.value)[0].name }, + changeStatus02(status) { + console.log(status) + return spellStatus.filter(item => status == item.value)[0].name + }, gotoEdit(e){ console.log(e.currentTarget.dataset.status) let status = e.currentTarget.dataset.status @@ -164,15 +168,14 @@ Page({ console.log(res.data.list) var tmpArr = that.data.lists; res.data.list.map((item,index)=>{ - item.statusText = that.changeStatus(item.status) + item.statusText = that.changeStatus(item.status); + item.statusText02 = that.changeStatus02(item.status) }) tmpArr.push.apply(tmpArr, res.data.list); console.log(tmpArr) let lists = []; tmpArr.map(file => { - if (file.orderStatus != 1) { lists.push(file); - } }) that.setData({ lists: lists diff --git a/pages/spellGroup/spellGroup.wxml b/pages/spellGroup/spellGroup.wxml index 424ca63..ee5d1d1 100644 --- a/pages/spellGroup/spellGroup.wxml +++ b/pages/spellGroup/spellGroup.wxml @@ -26,30 +26,40 @@ 剩余{{item.remainInventory}} - - - + + + + 距离成团还差 + {{item.remainPeople+'人'}} + {{item.pressLimitNum+'人成团'}} + + {{item.statusText02}} - - {{item.title}} - {{item.subTitle}} - - - 拼团价 - {{item.salePrice/100}} - + + + + + + {{item.title}} + {{item.subTitle}} + + + 拼团价 + {{item.salePrice/100}} + + - - - - - - {{item.statusText}} - - {{item.statusText}} - - {{item.statusText}} + + + + + {{item.statusText}} + + {{item.statusText}} + + {{item.statusText}} + diff --git a/pages/spellGroup/spellGroup.wxss b/pages/spellGroup/spellGroup.wxss index 595e9da..4ab30f7 100644 --- a/pages/spellGroup/spellGroup.wxss +++ b/pages/spellGroup/spellGroup.wxss @@ -194,4 +194,47 @@ image{ font-weight:500; color:rgba(255,253,245,1); opacity: 1; +} +.spell-bottom{ + overflow: hidden; +} +.spell-top{ + height: auto; + margin: 0 30rpx; + overflow: hidden; + box-sizing: border-box; + border-bottom: 1rpx solid #EEEEEE; +} +.spell-top-left{ + float: left; + width: 60%; +} +.spell-top-right{ + float: left; + width: 40%; +} +.top-title{ + display: inline; + font-size:24rpx; + font-family:PingFang-SC-Medium; + font-weight:500; + color:rgba(51,51,51,1); + line-height:64rpx; +} +.top-num{ + display: inline; + font-size:24rpx; + font-family:PingFang-SC-Medium; + font-weight:500; + color:#FF3232; + line-height:64rpx; + padding-left: 8rpx; +} +.spell-top-right{ + text-align: right; + font-size:26rpx; + font-family:PingFang-SC-Medium; + font-weight:500; + color:rgba(255,50,50,1); + line-height:64rpx; } \ No newline at end of file