| @@ -247,7 +247,11 @@ var config = { | |||||
| /** | /** | ||||
| * 去拼团 | * 去拼团 | ||||
| */ | */ | ||||
| toOrderGroup: '/orderGroup/toOrderGroup' | |||||
| toOrderGroup: '/orderGroup/toOrderGroup', | |||||
| /** | |||||
| * 查询是否已参团 | |||||
| */ | |||||
| queryAttendStatus:'/orderGroup/queryAttendStatus' | |||||
| }, | }, | ||||
| weapp: { | weapp: { | ||||
| AppId: weappId | AppId: weappId | ||||
| @@ -32,9 +32,28 @@ Page({ | |||||
| orderGroupId: options.orderGroupId, | orderGroupId: options.orderGroupId, | ||||
| orderId:options.orderId | orderId:options.orderId | ||||
| }) | }) | ||||
| this.checkUser(); | |||||
| this.getDetail(options.couponChannelId); | this.getDetail(options.couponChannelId); | ||||
| this.getOneSpell(options.couponId) | 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}`, | |||||
| }) | |||||
| } | |||||
| }); | |||||
| }, | |||||
| /** | /** | ||||
| * 拨打电话 | * 拨打电话 | ||||
| */ | */ | ||||
| @@ -34,6 +34,14 @@ Page({ | |||||
| // 关闭来自于左上角的分享 | // 关闭来自于左上角的分享 | ||||
| wx.hideShareMenu() | wx.hideShareMenu() | ||||
| }, | }, | ||||
| /** | |||||
| * 去使用 | |||||
| */ | |||||
| gotoUse() { | |||||
| wx.navigateTo({ | |||||
| url: `/pages/couponorder/index/index` | |||||
| }); | |||||
| }, | |||||
| /** | /** | ||||
| * 拼团状态字段转换 | * 拼团状态字段转换 | ||||
| */ | */ | ||||
| @@ -104,7 +112,9 @@ Page({ | |||||
| console.log(res,555555555) | console.log(res,555555555) | ||||
| let data=res.data; | let data=res.data; | ||||
| data.statustext=that.changeSatus(data.status); | 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) | data.salePrice = (data.salePrice/100).toFixed(2) | ||||
| for (let i = 0; i < data.remainPeople;i++){ | for (let i = 0; i < data.remainPeople;i++){ | ||||
| let a={}; | let a={}; | ||||
| @@ -4,13 +4,13 @@ | |||||
| <view class='status'> | <view class='status'> | ||||
| <view class='status-top'> | <view class='status-top'> | ||||
| <view class='p-status'>{{data.statustext}}</view> | <view class='p-status'>{{data.statustext}}</view> | ||||
| <view class='p-text'>结束</view> | |||||
| <view class='p-time'>{{sec}}</view> | |||||
| <view class='p-mao'>:</view> | |||||
| <view class='p-time'>{{min}}</view> | |||||
| <view class='p-mao'>:</view> | |||||
| <view class='p-time'>{{hour}}</view> | |||||
| <view class='p-text'>剩余</view> | |||||
| <view class='p-text' wx:if='{{data.status!=11}}'>结束</view> | |||||
| <view class='p-time' wx:if='{{data.status!=11}}'>{{sec}}</view> | |||||
| <view class='p-mao' wx:if='{{data.status!=11}}'>:</view> | |||||
| <view class='p-time' wx:if='{{data.status!=11}}'>{{min}}</view> | |||||
| <view class='p-mao' wx:if='{{data.status!=11}}'>:</view> | |||||
| <view class='p-time' wx:if='{{data.status!=11}}'>{{hour}}</view> | |||||
| <view class='p-text' wx:if='{{data.status!=11}}'>剩余</view> | |||||
| </view> | </view> | ||||
| <view class='status-center'> | <view class='status-center'> | ||||
| <view class='status-lists'> | <view class='status-lists'> | ||||
| @@ -124,6 +124,7 @@ | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class='edit'> | <view class='edit'> | ||||
| <button class='share user-motto' id="shareBtn" open-type="share">邀请好友拼团</button> | |||||
| <button class='share user-motto' wx:if='{{data.status!=11}}' id="shareBtn" open-type="share">邀请好友拼团</button> | |||||
| <button class='share user-motto' wx:if='{{data.status==11}}' bindtap='gotoUse'>去使用</button> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| @@ -1,7 +1,7 @@ | |||||
| var config = require("../../config/config.js"); | var config = require("../../config/config.js"); | ||||
| const Http = require("../../utils/HttpBasics"); | const Http = require("../../utils/HttpBasics"); | ||||
| const imgurl = require("../../utils/imgurl"); | const imgurl = require("../../utils/imgurl"); | ||||
| const { spellStatus02 } = require("../../utils/spell"); | |||||
| const { spellStatus,spellStatus02 } = require("../../utils/spell"); | |||||
| Page({ | Page({ | ||||
| /** | /** | ||||
| * 页面的初始数据 | * 页面的初始数据 | ||||
| @@ -83,6 +83,10 @@ Page({ | |||||
| changeStatus(status){ | changeStatus(status){ | ||||
| return spellStatus02.filter(item=>status==item.value)[0].name | 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){ | gotoEdit(e){ | ||||
| console.log(e.currentTarget.dataset.status) | console.log(e.currentTarget.dataset.status) | ||||
| let status = e.currentTarget.dataset.status | let status = e.currentTarget.dataset.status | ||||
| @@ -164,15 +168,14 @@ Page({ | |||||
| console.log(res.data.list) | console.log(res.data.list) | ||||
| var tmpArr = that.data.lists; | var tmpArr = that.data.lists; | ||||
| res.data.list.map((item,index)=>{ | 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); | tmpArr.push.apply(tmpArr, res.data.list); | ||||
| console.log(tmpArr) | console.log(tmpArr) | ||||
| let lists = []; | let lists = []; | ||||
| tmpArr.map(file => { | tmpArr.map(file => { | ||||
| if (file.orderStatus != 1) { | |||||
| lists.push(file); | lists.push(file); | ||||
| } | |||||
| }) | }) | ||||
| that.setData({ | that.setData({ | ||||
| lists: lists | lists: lists | ||||
| @@ -26,30 +26,40 @@ | |||||
| <view class='right-text'>剩余{{item.remainInventory}}</view> | <view class='right-text'>剩余{{item.remainInventory}}</view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class='sepll-list' wx:if='{{flag=="myspellList"}}' wx:for="{{lists}}" wx:key="{{index}}" style='position:relative;'> | |||||
| <view class='spell-left' data-id='{{item.id}}' data-data='{{item}}' bindtap='gotoStatusDetail'> | |||||
| <image src='{{item.coverImg}}'></image> | |||||
| <view class='sepll-list' wx:if='{{flag=="myspellList"}}' wx:for="{{lists}}" wx:key="{{index}}" style='position:relative;height:auto;'> | |||||
| <view class='spell-top'> | |||||
| <view class='spell-top-left'> | |||||
| <view class='top-title' wx:if='{{item.remainPeople!=0}}'>距离成团还差</view> | |||||
| <view class='top-num' wx:if='{{item.remainPeople!=0}}'>{{item.remainPeople+'人'}}</view> | |||||
| <view class='top-title' style='color:#8C8C8C;' wx:if='{{item.remainPeople==0}}'>{{item.pressLimitNum+'人成团'}}</view> | |||||
| </view> | |||||
| <view class='spell-top-right' style='{{"color:"+(item.status==10?"#FF3232":item.status==11?"#57B257":"#8C8C8C")}}'>{{item.statusText02}}</view> | |||||
| </view> | </view> | ||||
| <view class='spell-center' data-id='{{item.id}}' data-data='{{item}}' bindtap='gotoStatusDetail'> | |||||
| <view class='tilte'>{{item.title}}</view> | |||||
| <view class='remark'>{{item.subTitle}}</view> | |||||
| <view class='price' style='margin-top:50rpx;'> | |||||
| <view class='price01'> | |||||
| <view class='price-text'style="display: inline;font-size: 24rpx;">拼团价</view> | |||||
| <view class='price-num'>{{item.salePrice/100}}</view> | |||||
| <view class='price-unit'>元</view> | |||||
| <view class='spell-bottom'> | |||||
| <view class='spell-left' data-id='{{item.id}}' data-data='{{item}}' bindtap='gotoStatusDetail'> | |||||
| <image src='{{item.coverImg}}'></image> | |||||
| </view> | |||||
| <view class='spell-center' data-id='{{item.id}}' data-data='{{item}}' bindtap='gotoStatusDetail'> | |||||
| <view class='tilte'>{{item.title}}</view> | |||||
| <view class='remark'>{{item.subTitle}}</view> | |||||
| <view class='price' style='margin-top:50rpx;'> | |||||
| <view class='price01'> | |||||
| <view class='price-text'style="display: inline;font-size: 24rpx;">拼团价</view> | |||||
| <view class='price-num'>{{item.salePrice/100}}</view> | |||||
| <view class='price-unit'>元</view> | |||||
| </view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | |||||
| <view class='spell-right' style='position:absolute;width:auto;bottom:30rpx;right:20rpx;'> | |||||
| <!-- 继续邀请好友 --> | |||||
| <button class='share user-motto right-button' open-type="share" id="shareBtn" wx:if='{{item.status==10}}' data-status='{{item.status}}' hover-class="other-button-hover" style="width:auto;display:inline-block;padding:0 8rpx;">{{item.statusText}}</button> | |||||
| <!-- 去使用 --> | |||||
| <view class='right-button' wx:if='{{item.status==11}}' data-status='{{item.status}}' bindtap='gotoEdit' style="width:auto;display:inline-block;padding:0 8rpx;">{{item.statusText}}</view> | |||||
| <!-- 重新拼团 --> | |||||
| <view class='right-button' wx:if='{{item.status==13}}' data-status='{{item.status}}' bindtap='gotoEdit' style="width:auto;display:inline-block;padding:0 8rpx;">{{item.statusText}}</view> | |||||
| <!-- 拼团失败 --> | |||||
| <view class='right-button' wx:if='{{item.status==12}}' data-status='{{item.status}}' bindtap='gotoEdit' style="width:auto;display:inline-block;padding:0 8rpx;">{{item.statusText}}</view> | |||||
| <view class='spell-right' style='position:absolute;width:auto;bottom:30rpx;right:20rpx;'> | |||||
| <!-- 继续邀请好友 --> | |||||
| <button class='share user-motto right-button' open-type="share" id="shareBtn" wx:if='{{item.status==10}}' data-status='{{item.status}}' hover-class="other-button-hover" style="width:auto;display:inline-block;padding:0 8rpx;">{{item.statusText}}</button> | |||||
| <!-- 去使用 --> | |||||
| <view class='right-button' wx:if='{{item.status==11}}' data-status='{{item.status}}' bindtap='gotoEdit' style="width:auto;display:inline-block;padding:0 8rpx;">{{item.statusText}}</view> | |||||
| <!-- 重新拼团 --> | |||||
| <view class='right-button' wx:if='{{item.status==13}}' data-status='{{item.status}}' bindtap='gotoEdit' style="width:auto;display:inline-block;padding:0 8rpx;">{{item.statusText}}</view> | |||||
| <!-- 拼团失败 --> | |||||
| <view class='right-button' wx:if='{{item.status==12}}' data-status='{{item.status}}' bindtap='gotoEdit' style="width:auto;display:inline-block;padding:0 8rpx;">{{item.statusText}}</view> | |||||
| </view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| @@ -194,4 +194,47 @@ image{ | |||||
| font-weight:500; | font-weight:500; | ||||
| color:rgba(255,253,245,1); | color:rgba(255,253,245,1); | ||||
| opacity: 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; | |||||
| } | } | ||||