| @@ -1,7 +1,7 @@ | |||||
| { | { | ||||
| "pages": [ | "pages": [ | ||||
| "pages/spellDetail/index", | |||||
| "pages/index/index", | "pages/index/index", | ||||
| "pages/spellDetail/index", | |||||
| "pages/spellGroup/mySpellGroup/index", | "pages/spellGroup/mySpellGroup/index", | ||||
| "pages/spellGroup/spellGroup", | "pages/spellGroup/spellGroup", | ||||
| "pages/complete/index", | "pages/complete/index", | ||||
| @@ -2,6 +2,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 {spellStatus} = require("../../utils/spell"); | |||||
| Page({ | Page({ | ||||
| /** | /** | ||||
| @@ -11,15 +12,103 @@ Page({ | |||||
| tuanzhang: imgurl.tuanzhang.url, | tuanzhang: imgurl.tuanzhang.url, | ||||
| spellBg: imgurl.spellBg.url, | spellBg: imgurl.spellBg.url, | ||||
| position: imgurl.position.url, | position: imgurl.position.url, | ||||
| paramData:null, | |||||
| data:null, | |||||
| clock: "00", | |||||
| day: "00", | |||||
| hour: "00", | |||||
| min: "00", | |||||
| sec: "00", | |||||
| spellStatusList: spellStatus | |||||
| }, | }, | ||||
| /** | /** | ||||
| * 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
| */ | */ | ||||
| onLoad: function (options) { | onLoad: function (options) { | ||||
| console.log(this.data.spellStatusList,7777777) | |||||
| this.setData({ | |||||
| paramData:options | |||||
| }) | |||||
| this.getDetail(options) | |||||
| }, | |||||
| /** | |||||
| * 拼团状态字段转换 | |||||
| */ | |||||
| changeSatus(status){ | |||||
| console.log(spellStatus,8888888) | |||||
| return spellStatus.filter(item=>item.value==status)[0].name; | |||||
| }, | |||||
| // 时间格式化输出,如11:03 25:19 每1s都会调用一次 | |||||
| dateformat(micro_second) { | |||||
| // 总秒数 | |||||
| var second = Math.floor(micro_second / 1000); | |||||
| // 天数 | |||||
| var day = Math.floor(second / 3600 / 24) < 10 ? "0" + Math.floor(second / 3600 / 24) : Math.floor(second / 3600 / 24); | |||||
| // 小时 | |||||
| var hr = Math.floor(second / 3600 % 24) < 10 ? "0" + Math.floor(second / 3600 % 24) : Math.floor(second / 3600 % 24); | |||||
| // 分钟 | |||||
| var min = Math.floor(second / 60 % 60) < 10 ? "0" + Math.floor(second / 60 % 60) : Math.floor(second / 60 % 60); | |||||
| // 秒 | |||||
| var sec = Math.floor(second % 60) < 10 ? "0" + Math.floor(second % 60) : Math.floor(second % 60); | |||||
| // return day + "天" + hr + "小时" + min + "分钟" + sec + "秒"; | |||||
| return { | |||||
| a1: day, | |||||
| b1: hr, | |||||
| c1: min, | |||||
| d1: sec | |||||
| } | |||||
| }, | |||||
| countdown(end_time) { | |||||
| let that = this; | |||||
| var EndTime = end_time; | |||||
| var NowTime = new Date().getTime(); | |||||
| var total_micro_second = EndTime - NowTime || []; | |||||
| // 渲染倒计时时钟 | |||||
| let obj = that.dateformat(total_micro_second); | |||||
| if (total_micro_second > 0) { | |||||
| that.setData({ | |||||
| clock: obj, | |||||
| day: obj.a1, | |||||
| hour: obj.b1, | |||||
| min: obj.c1, | |||||
| sec: obj.d1, | |||||
| }) | |||||
| } else { | |||||
| that.setData({ | |||||
| clock: "00", | |||||
| day: "00", | |||||
| hour: "00", | |||||
| min: "00", | |||||
| sec: "00", | |||||
| }) | |||||
| } | |||||
| setTimeout(function () { | |||||
| total_micro_second -= 1000; | |||||
| that.countdown(end_time); | |||||
| }, 1000) | |||||
| }, | |||||
| getDetail(){ | |||||
| let that = this; | |||||
| Http.get({ | |||||
| url: config.api.queryOrderGroupStatus, | |||||
| data: { | |||||
| orderId: this.data.paramData.orderId, | |||||
| couponId: this.data.paramData.couponId, | |||||
| id: this.data.paramData.orderGroupId | |||||
| } | |||||
| }).then(res => { | |||||
| console.log(res,555555555) | |||||
| let data=res.data; | |||||
| data.status=that.changeSatus(data.status); | |||||
| that.countdown(data.expiredDate); | |||||
| data.salePrice = (data.salePrice/100).toFixed(2) | |||||
| that.setData({ | |||||
| data:res.data | |||||
| }) | |||||
| }); | |||||
| }, | }, | ||||
| /** | /** | ||||
| * 生命周期函数--监听页面初次渲染完成 | * 生命周期函数--监听页面初次渲染完成 | ||||
| */ | */ | ||||
| @@ -2,13 +2,13 @@ | |||||
| <view class='container'> | <view class='container'> | ||||
| <view class='status'> | <view class='status'> | ||||
| <view class='status-top'> | <view class='status-top'> | ||||
| <view class='p-status'>拼团中</view> | |||||
| <view class='p-status'>{{data.status}}</view> | |||||
| <view class='p-text'>结束</view> | <view class='p-text'>结束</view> | ||||
| <view class='p-time'>09</view> | |||||
| <view class='p-time'>{{sec}}</view> | |||||
| <view class='p-mao'>:</view> | <view class='p-mao'>:</view> | ||||
| <view class='p-time'>59</view> | |||||
| <view class='p-time'>{{min}}</view> | |||||
| <view class='p-mao'>:</view> | <view class='p-mao'>:</view> | ||||
| <view class='p-time'>23</view> | |||||
| <view class='p-time'>{{hour}}</view> | |||||
| <view class='p-text'>剩余</view> | <view class='p-text'>剩余</view> | ||||
| </view> | </view> | ||||
| <view class='status-center'> | <view class='status-center'> | ||||
| @@ -37,25 +37,40 @@ | |||||
| <view class='position-icon'> | <view class='position-icon'> | ||||
| <image src='{{position}}'></image> | <image src='{{position}}'></image> | ||||
| </view> | </view> | ||||
| <view class='position'>广场地址:北京市朝阳区东三环中路123号</view> | |||||
| <view class='position'>广场地址:{{data.addr}}</view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class='detail'> | <view class='detail'> | ||||
| <view class='detail-top'> | <view class='detail-top'> | ||||
| <view class='detail-top01'> | <view class='detail-top01'> | ||||
| <image src='{{spellBg}}'></image> | |||||
| <image src='{{data.coverImg}}'></image> | |||||
| </view> | </view> | ||||
| <view class='detail-top02'> | <view class='detail-top02'> | ||||
| <view class='title'>100元拼团券</view> | |||||
| <view class='des'>是打发士大夫撒旦</view> | |||||
| <view class='title'>{{data.title}}</view> | |||||
| <view class='des'>{{data.subTitle}}</view> | |||||
| </view> | </view> | ||||
| <view class='detail-top03'> | <view class='detail-top03'> | ||||
| <view class='detail-p-price'>{{data.salePrice}}元</view> | |||||
| <view class='detail-p-name'>拼团价</view> | <view class='detail-p-name'>拼团价</view> | ||||
| <view class='detail-p-price'>19.00元</view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class='detail-bottom'></view> | |||||
| <view class='detail-bottom'> | |||||
| <view class='b-unit'>元</view> | |||||
| <view class='b-price'>{{data.salePrice}}</view> | |||||
| <view class='b-name'>实付款</view> | |||||
| </view> | |||||
| </view> | |||||
| <view class='order'> | |||||
| <view class='order-list'> | |||||
| <view class='order-title'>订单编号:</view> | |||||
| <view class='order-text'>{{paramData.orderId}}</view> | |||||
| </view> | |||||
| <view class='order-list'> | |||||
| <view class='order-title'>团单编号:</view> | |||||
| <view class='order-text'>{{data.orderGroupId}}</view> | |||||
| </view> | |||||
| </view> | |||||
| <view class='edit'> | |||||
| <button class='share user-motto' id="shareBtn" open-type="share">邀请好友拼团</button> | |||||
| </view> | </view> | ||||
| <view class='order'></view> | |||||
| <view class='edit'></view> | |||||
| </view> | </view> | ||||
| @@ -116,7 +116,7 @@ page { | |||||
| } | } | ||||
| .status-bottom{ | .status-bottom{ | ||||
| width: 100%; | width: 100%; | ||||
| height: 72rpx; | |||||
| height: auto; | |||||
| overflow: hidden; | overflow: hidden; | ||||
| } | } | ||||
| .position-icon{ | .position-icon{ | ||||
| @@ -147,6 +147,7 @@ page { | |||||
| width: 100%; | width: 100%; | ||||
| height: auto; | height: auto; | ||||
| overflow: hidden; | overflow: hidden; | ||||
| padding-bottom: 12rpx; | |||||
| } | } | ||||
| .detail-top01{ | .detail-top01{ | ||||
| float: left; | float: left; | ||||
| @@ -179,4 +180,98 @@ page { | |||||
| } | } | ||||
| .detail-top03{ | .detail-top03{ | ||||
| float: left; | float: left; | ||||
| padding-top: 170rpx; | |||||
| width: 230rpx; | |||||
| } | |||||
| .detail-p-name{ | |||||
| float: right; | |||||
| font-size:26rpx; | |||||
| font-family:PingFang-SC-Medium; | |||||
| font-weight:500; | |||||
| color:rgba(134,134,134,1); | |||||
| line-height:44rpx; | |||||
| } | |||||
| .detail-p-price{ | |||||
| float: right; | |||||
| font-size:26rpx; | |||||
| font-family:PingFang-SC-Medium; | |||||
| font-weight:500; | |||||
| color:rgba(51,51,51,1); | |||||
| } | |||||
| .detail-bottom{ | |||||
| border-top: 1rpx solid #F9F9F9; | |||||
| width: 100%; | |||||
| overflow: hidden; | |||||
| height: 86rpx; | |||||
| } | |||||
| .b-unit{ | |||||
| float: right; | |||||
| font-size:24rpx; | |||||
| font-family:PingFang-SC-Medium; | |||||
| font-weight:500; | |||||
| color:rgba(237,63,46,1); | |||||
| margin-top: 36rpx; | |||||
| } | |||||
| .b-price{ | |||||
| float: right; | |||||
| font-size:40rpx; | |||||
| font-family:PingFang-SC-Medium; | |||||
| font-weight:500; | |||||
| color:rgba(237,63,46,1); | |||||
| margin-top: 18rpx; | |||||
| } | |||||
| .b-name{ | |||||
| float: right; | |||||
| font-size:26rpx; | |||||
| font-family:PingFang-SC-Medium; | |||||
| font-weight:500; | |||||
| color:rgba(51,51,51,1); | |||||
| margin-right: 6rpx; | |||||
| margin-top: 34rpx; | |||||
| } | |||||
| .order{ | |||||
| width: 690rpx; | |||||
| padding:10rpx 28rpx; | |||||
| margin: 30rpx auto 0; | |||||
| box-sizing: border-box; | |||||
| background:rgba(255,255,255,1); | |||||
| border-radius:15rpx; | |||||
| } | |||||
| .order-list{ | |||||
| height: 55rpx; | |||||
| } | |||||
| .order-title{ | |||||
| line-height: 55rpx; | |||||
| float: left; | |||||
| font-size:26rpx; | |||||
| font-family:PingFang-SC-Medium; | |||||
| font-weight:500; | |||||
| color:rgba(51,51,51,1); | |||||
| } | |||||
| .order-text{ | |||||
| float: right; | |||||
| text-align: right; | |||||
| line-height: 55rpx; | |||||
| font-size:26rpx; | |||||
| font-family:PingFang-SC-Medium; | |||||
| font-weight:500; | |||||
| color:rgba(134,134,134,1); | |||||
| } | |||||
| .user-motto { | |||||
| border: 0; | |||||
| width:650rpx; | |||||
| height:85rpx; | |||||
| background:linear-gradient(90deg,rgba(248,85,45,1) 0%,rgba(241,60,66,1) 0%,rgba(248,86,46,1) 100%); | |||||
| box-shadow:0px 8rpx 8rpx 1rpx rgba(242,61,65,0.32); | |||||
| border-radius:43rpx; | |||||
| font-size:36rpx; | |||||
| font-family:PingFang-SC-Medium; | |||||
| font-weight:500; | |||||
| color:rgba(254,254,254,1); | |||||
| line-height: 85rpx; | |||||
| margin-top: 200rpx; | |||||
| } | |||||
| .user-motto::after { | |||||
| border: none; | |||||
| } | } | ||||
| @@ -140,7 +140,7 @@ Page({ | |||||
| }) | }) | ||||
| .then(res => { | .then(res => { | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/spellDetail/index?orderId=${orderId}&couponId=${_this.data.data.couponId}` | |||||
| url: `/pages/spellDetail/index?orderId=${orderId}&couponId=${_this.data.data.couponId}&orderGroupId=${res.data.orderGroupId}` | |||||
| }); | }); | ||||
| }) | }) | ||||
| .catch(err => { | .catch(err => { | ||||
| @@ -12,6 +12,7 @@ Page({ | |||||
| mybargain: false, | mybargain: false, | ||||
| list: [], | list: [], | ||||
| lists: [], | lists: [], | ||||
| myLists:[], | |||||
| page: 1, // 设置加载的第几次,默认是第一次 | page: 1, // 设置加载的第几次,默认是第一次 | ||||
| pageSize: 10, //返回数据的个数 | pageSize: 10, //返回数据的个数 | ||||
| searchLoadingComplete: false, //“没有数据”的变量,默认false,隐藏 | searchLoadingComplete: false, //“没有数据”的变量,默认false,隐藏 | ||||
| @@ -26,6 +26,27 @@ | |||||
| <view class='right-text'>已拼27</view> | <view class='right-text'>已拼27</view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class='sepll-list' wx:for="{{lists}}" wx:key="{{index}}" data-couponId='{{item.couponId}}' data-id='{{item.id}}' bindtap='invite'> | |||||
| <view class='spell-left'> | |||||
| <image src='{{item.coverImg}}'></image> | |||||
| </view> | |||||
| <view class='spell-center'> | |||||
| <view class='tilte'>{{item.title}}</view> | |||||
| <view class='remark'>{{item.subTitle}}</view> | |||||
| <view class='spell-num'>{{item.pressLimitNum+'人团'}}</view> | |||||
| <view class='price'> | |||||
| <view class='price01'> | |||||
| <view class='price-num'>{{item.salePriceStr}}</view> | |||||
| <view class='price-unit'>元</view> | |||||
| </view> | |||||
| <view class='price02'>{{item.priceStr}}</view> | |||||
| </view> | |||||
| </view> | |||||
| <view class='spell-right'> | |||||
| <view class='right-button'>去拼团</view> | |||||
| <view class='right-text'>已拼27</view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | </view> | ||||
| <view class='bottom'> | <view class='bottom'> | ||||
| <view class='bottom-left' bindtap="getSpellList" style="background:{{flag=='bargaingoods'?'#FF7250':'#F3453A'}}">拼团商品</view> | <view class='bottom-left' bindtap="getSpellList" style="background:{{flag=='bargaingoods'?'#FF7250':'#F3453A'}}">拼团商品</view> | ||||
| @@ -0,0 +1,21 @@ | |||||
| const spellStatus=[ | |||||
| { | |||||
| name:'拼团中', | |||||
| value:10 | |||||
| }, | |||||
| { | |||||
| name: '拼团成功', | |||||
| value: 11 | |||||
| }, | |||||
| { | |||||
| name: '拼团已过期', | |||||
| value: 12 | |||||
| }, | |||||
| { | |||||
| name: '拼团失败', | |||||
| value: 13 | |||||
| } | |||||
| ] | |||||
| module.exports={ | |||||
| spellStatus | |||||
| } | |||||