| @@ -51,7 +51,8 @@ | |||
| "pages/paySuccess/paySuccess", | |||
| "pages/ConsumeDetail/ConsumeDetail", | |||
| "pages/externallinks/index", | |||
| "pages/czdetail/czdetail" | |||
| "pages/czdetail/czdetail", | |||
| "pages/joinFrDpell/index" | |||
| ], | |||
| "navigateToMiniProgramAppIdList": [ | |||
| "wx192b7d2e8dcbefd0", | |||
| @@ -0,0 +1,451 @@ | |||
| // pages/spellGroup/mySpellGroup/index.js | |||
| var config = require("../../config/config.js"); | |||
| const Http = require("../../utils/HttpBasics"); | |||
| const imgurl = require("../../utils/imgurl"); | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| data: { | |||
| teljpgUrl: imgurl.teljpg.url, | |||
| couponChannelId: '', | |||
| couponId: '', | |||
| data: [], | |||
| spellData: null, | |||
| canSpell: true, | |||
| canBuyIf: true, | |||
| clock: "00", | |||
| day: "00", | |||
| hour: "00", | |||
| min: "00", | |||
| sec: "00", | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function (options) { | |||
| this.setData({ | |||
| couponChannelId: options.couponChannelId, | |||
| couponId: options.couponId, | |||
| orderGroupId: options.orderGroupId | |||
| }) | |||
| this.getDetail(options.couponChannelId); | |||
| this.getOneSpell(options.couponId) | |||
| }, | |||
| /** | |||
| * 拨打电话 | |||
| */ | |||
| phone: function (e) { | |||
| let that = this; | |||
| wx.makePhoneCall({ | |||
| phoneNumber: e.target.dataset.merchantlinkphone | |||
| }); | |||
| }, | |||
| /** | |||
| * 直接购买 | |||
| */ | |||
| gotoBuy() { | |||
| console.log(22222) | |||
| this.setData({ | |||
| canBuyIf: false | |||
| }) | |||
| this.orderFunc() | |||
| }, | |||
| // 时间格式化输出,如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) | |||
| }, | |||
| /** | |||
| * 发起拼团 | |||
| */ | |||
| gotoSpell() { | |||
| console.log(111111111) | |||
| this.setData({ | |||
| canSpell: false | |||
| }) | |||
| this.orderFunc(0) | |||
| }, | |||
| //参与别人的拼团 | |||
| gotoPartner() { | |||
| wx.navigateTo({ | |||
| url: `/pages/spellDetail/index?orderId=${this.data.spellData.orderId}&couponId=${this.data.spellData.couponId}&orderGroupId=${this.data.spellData.orderGroupId}` | |||
| }); | |||
| }, | |||
| /** | |||
| * 获取一个拼团信息 | |||
| */ | |||
| getOneSpell(couponId) { | |||
| let that = this; | |||
| Http.get({ | |||
| url: config.api.queryRemainOne, | |||
| data: { | |||
| couponId: couponId | |||
| } | |||
| }).then(res => { | |||
| if (res.data) { | |||
| that.countdown(res.data.expiredDate); | |||
| that.setData({ | |||
| spellData: res.data | |||
| }); | |||
| } | |||
| }); | |||
| }, | |||
| /** | |||
| * 获取券详情信息 | |||
| */ | |||
| getDetail(couponChannelId) { | |||
| let that = this; | |||
| Http.get({ | |||
| url: config.api.couponDetail, | |||
| data: { | |||
| couponChannelId: couponChannelId | |||
| } | |||
| }).then(res => { | |||
| let data = res.data; | |||
| data.price = (data.price / 100).toFixed(2) | |||
| data.salePrice = (data.salePrice / 100).toFixed(2) | |||
| that.setData({ | |||
| data | |||
| }); | |||
| }); | |||
| }, | |||
| /** | |||
| * 去拼团 | |||
| */ | |||
| goToOrderGroup(orderId, orderGroupId, _this) { | |||
| console.log(22222222) | |||
| let that = this; | |||
| // 支付成功 | |||
| Http.post({ | |||
| url: config.api.toOrderGroup, | |||
| data: { | |||
| id: orderGroupId, | |||
| orderId, | |||
| couponId: _this.data.data.couponId | |||
| } | |||
| }) | |||
| .then(res => { | |||
| wx.navigateTo({ | |||
| url: `/pages/spellDetail/index?orderId=${orderId}&couponId=${_this.data.data.couponId}&orderGroupId=${res.data.orderGroupId}` | |||
| }); | |||
| }) | |||
| .catch(err => { | |||
| console.log(err); | |||
| }) | |||
| // return; | |||
| }, | |||
| /** | |||
| * 支付订单更新 | |||
| */ | |||
| payOrderUpdate: (orderId, payOrderId, status, reason, _this, orderGroupId) => { | |||
| let that = this; | |||
| // 支付成功 | |||
| Http.post({ | |||
| url: config.api.payOrderUpdate, | |||
| data: { | |||
| payOrderId: payOrderId, | |||
| orderId: orderId, | |||
| status: status, | |||
| reason: reason | |||
| } | |||
| }) | |||
| .then(res => { | |||
| wx.hideLoading() | |||
| _this.goToOrderGroup(orderId, res.data.orderGroupId, _this) | |||
| }) | |||
| .catch(err => { | |||
| console.log(err); | |||
| if (err.code != 12002) { | |||
| setTimeout(function () { | |||
| _this.payOrderUpdate(orderId, payOrderId, status, reason, _this, orderGroupId); | |||
| }, 2000) | |||
| } | |||
| }) | |||
| }, | |||
| /** | |||
| * 发起支付 | |||
| */ | |||
| orderFunc(orderGroupId) { | |||
| let data = { | |||
| couponChannelId: this.data.data.id, | |||
| couponId: this.data.data.couponId | |||
| } | |||
| /** | |||
| * 拼团订单 | |||
| */ | |||
| if (orderGroupId == 0) { | |||
| data.orderGroupId = orderGroupId | |||
| } | |||
| var that = this; | |||
| Http.post({ | |||
| url: config.api.checkPhoneStatus, | |||
| data: {} | |||
| }) | |||
| .then(res => { | |||
| /** | |||
| * orderSave 下单 | |||
| */ | |||
| return Http.post({ | |||
| url: config.api.orderSave, | |||
| data: data | |||
| }); | |||
| }) | |||
| .catch(err => { | |||
| console.log(err); | |||
| that.setData({ | |||
| showbutton: false, | |||
| showbutton1: false | |||
| }) | |||
| if (err.code == 2011) { | |||
| wx.showToast({ | |||
| title: "商户信息没找到", | |||
| image: './../../../assets/images/fail.png', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| } else if (err.code == 2013) { | |||
| wx.showToast({ | |||
| title: "商户信息禁用", | |||
| image: './../../../assets/images/fail.png', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| } else if (err.code == 3000) { | |||
| wx.showToast({ | |||
| title: "库存不足", | |||
| image: './../../../assets/images/fail.png', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| } else if (err.code == 3001) { | |||
| wx.showToast({ | |||
| title: "超过限购条件", | |||
| image: './../../../assets/images/fail.png', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| } else if (err.code == 3002) { | |||
| wx.showToast({ | |||
| title: "订单失败", | |||
| image: './../../../assets/images/fail.png', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| } else if (err.code == 3003) { | |||
| wx.showToast({ | |||
| title: "订单不存在", | |||
| image: './../../../assets/images/fail.png', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| } else if (err.code == 3004) { | |||
| wx.showToast({ | |||
| title: "订单不存在", | |||
| image: './../../../assets/images/fail.png', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| } else if (err.code == 4003) { | |||
| wx.showToast({ | |||
| title: "卡券已作废", | |||
| image: './../../../assets/images/fail.png', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| } else if (err.code == 11005) { | |||
| /** | |||
| * 将值传到用户手机号授权的页面 | |||
| * | |||
| */ | |||
| wx.redirectTo({ | |||
| url: "/pages/getphoneInfo/index?path=spell&couponChannelId=" + | |||
| that.data.couponChannelId + '&couponId=' + that.data.couponId | |||
| }); | |||
| } else if (err.code == 11006) { | |||
| // 用户手机已加密 | |||
| wx.redirectTo({ | |||
| url: "/pages/phoneinput/phoneinput?path=spell&couponChannelId=" + | |||
| that.data.couponChannelId + '&couponId=' + that.data.couponId | |||
| }); | |||
| } else { | |||
| wx.showToast({ | |||
| title: err.message, | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| } | |||
| }) | |||
| .then(res => { | |||
| console.log(res) | |||
| if (typeof (res) != "undefined") { | |||
| let orderId = "" + res.data.id; | |||
| that.setData({ | |||
| orderId: orderId | |||
| }); | |||
| // 支付金额不为0 | |||
| /** | |||
| * 支付订单创建 | |||
| */ | |||
| Http.post({ | |||
| url: config.api.payOrderCreate, | |||
| data: { | |||
| orderId: orderId | |||
| } | |||
| }) | |||
| .then(res => { | |||
| var payOrderId = "" + res.data.payOrderId; | |||
| wx.hideLoading(); | |||
| wx.requestPayment({ | |||
| timeStamp: res.data.timeStamp, | |||
| nonceStr: res.data.nonceStr, | |||
| package: res.data.package, | |||
| signType: (res.data.signType) ? res.data.signType : "MD5", | |||
| paySign: res.data.paySign, | |||
| success: res => { | |||
| wx.showLoading({ | |||
| title: '订单正在处理中...', | |||
| }) | |||
| setTimeout(function () { | |||
| wx.hideLoading() | |||
| }, 5000) | |||
| that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', that, orderGroupId); | |||
| if (res.errMsg == "requestPayment:ok") { | |||
| setTimeout(function () { | |||
| wx.hideLoading(); | |||
| }, 2000); | |||
| /** | |||
| * 用户支付成功以后跳转到券包列表 | |||
| */ | |||
| if (that.data.cardType == 100) { | |||
| wx.setStorage({ | |||
| key: 'couponNum2', | |||
| data: "couponNum2" | |||
| }) | |||
| } else if (that.data.data.type != 5) { | |||
| wx.setStorage({ | |||
| key: 'couponNum', | |||
| data: "couponNum" | |||
| }) | |||
| } | |||
| } | |||
| }, | |||
| fail: res => { | |||
| /** | |||
| * 支付失败,需要更新订单的状态 | |||
| */ | |||
| that.payOrderUpdate(that.data.orderId, payOrderId, 2, '', that, orderGroupId); | |||
| that.setData({ | |||
| showbutton: false | |||
| }) | |||
| return; | |||
| }, | |||
| complete: res => { } | |||
| }); | |||
| /// End payment -------- | |||
| }) | |||
| .catch(err => { | |||
| wx.showToast({ | |||
| title: err.message, | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| }) | |||
| } | |||
| }) | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| onReady: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow: function () { | |||
| this.setData({ | |||
| canSpell: true, | |||
| canBuyIf: true | |||
| }) | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面隐藏 | |||
| */ | |||
| onHide: function () { | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面卸载 | |||
| */ | |||
| onUnload: function () { | |||
| }, | |||
| /** | |||
| * 页面相关事件处理函数--监听用户下拉动作 | |||
| */ | |||
| onPullDownRefresh: function () { | |||
| }, | |||
| /** | |||
| * 页面上拉触底事件的处理函数 | |||
| */ | |||
| onReachBottom: function () { | |||
| } | |||
| }) | |||
| @@ -0,0 +1,5 @@ | |||
| { | |||
| "navigationBarTitleText": "拼团券详情", | |||
| "enablePullDownRefresh": true, | |||
| "usingComponents": {} | |||
| } | |||
| @@ -0,0 +1,63 @@ | |||
| <view class="content-box"> | |||
| <view class='content'> | |||
| <view class='top-img'> | |||
| <image src='{{data.coverImg}}'></image> | |||
| </view> | |||
| <view class='title'>{{data.title}}</view> | |||
| <view class='text'> | |||
| <view class='remark'>{{data.subTitle}}</view> | |||
| <view class='des'> | |||
| <view class='des-peoplenum'>【拼团购】{{data.pressLimitNum}}人拼团成功,单价仅需</view> | |||
| <view class='des-saleprice'>{{data.salePriceStr}}元</view> | |||
| </view> | |||
| <view class='status'> | |||
| <view class='status01 st'> | |||
| <image src='{{spellData.avatarUrl}}'></image> | |||
| </view> | |||
| <view class='status02 st'>{{spellData.nickName}}的团还差<view class='r-p-num'>1人</view></view> | |||
| <view class='status03 st'> | |||
| <view class='hh'>{{hour}}</view>: | |||
| <view class='mm'>{{min}}</view>: | |||
| <view class='ss'>{{sec}}</view> | |||
| </view> | |||
| <view class='status04 st'> | |||
| <view class='s-button' bindtap='gotoPartner'>去拼团</view> | |||
| </view> | |||
| </view> | |||
| <view class='p-des'> | |||
| <view class='p-title'>商品详情:</view> | |||
| <view class='p-list'>{{data.remark}}</view> | |||
| </view> | |||
| <view class='posi'> | |||
| <view class='applyshop'>适用门店</view> | |||
| <view class='posi_logo' wx:for="{{data.merchantVoList}}" wx:key="index"> | |||
| <view> | |||
| <image src='{{item.merchantImgUrl}}'></image> | |||
| </view> | |||
| <view> | |||
| <text>{{item.merchantName}}</text> | |||
| <text>{{item.addr}}{{item.buildingName}}{{item.floorName}}</text> | |||
| </view> | |||
| <image bindtap='phone' data-merchantLinkPhone='{{item.merchantLinkPhone}}' class="tel" src="{{teljpgUrl}}" mode="widthFix" /> | |||
| </view> | |||
| </view> | |||
| <view class='edit'> | |||
| <view class='edit-left' bindtap='{{canBuyIf?"gotoBuy":""}}'> | |||
| <view class='edit-left-top'> | |||
| <view class='price'>{{data.price}}</view> | |||
| <view class='price-unit'>元</view> | |||
| </view> | |||
| <view class='edit-left-bottom'>立即购买</view> | |||
| </view> | |||
| <!-- <button class='edit-right' id="shareBtn" open-type="share"></button> --> | |||
| <view class='edit-right' bindtap='{{canSpell?"gotoSpell":""}}'> | |||
| <view class='edit-right-top'> | |||
| <view class='real-price'>{{data.salePrice}}</view> | |||
| <view class='real-price-unit'>元</view> | |||
| </view> | |||
| <view class='edit-right-bottom'>发起拼团</view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| @@ -0,0 +1,319 @@ | |||
| /* pages/spellGroup/mySpellGroup/index.wxss */ | |||
| .top-img{ | |||
| width: 100%; | |||
| height: 533rpx; | |||
| z-index: 1; | |||
| } | |||
| .top-img image{ | |||
| width: 100%; | |||
| height: 533rpx; | |||
| } | |||
| .content-box{ | |||
| box-sizing: content-box; | |||
| height: auto; | |||
| overflow: hidden; | |||
| } | |||
| .content{ | |||
| position: relative; | |||
| width: 100%; | |||
| height: auto; | |||
| background: #fff; | |||
| overflow: hidden; | |||
| padding-bottom: 130rpx; | |||
| } | |||
| .text{ | |||
| padding: 0 30rpx; | |||
| } | |||
| .title{ | |||
| position: absolute; | |||
| top: 503rpx; | |||
| background-color: #fff; | |||
| z-index: 100; | |||
| width: 750rpx; | |||
| padding-top: 30rpx; | |||
| padding-left: 30rpx; | |||
| line-height: 50rpx; | |||
| border-radius:20rpx 20rpx 0px 0px; | |||
| opacity: 1; | |||
| font-size:32rpx; | |||
| font-family:PingFang-SC-Bold; | |||
| font-weight:bold; | |||
| color:rgba(51,51,51,1); | |||
| box-sizing: border-box; | |||
| } | |||
| .remark{ | |||
| margin-top: 48rpx; | |||
| font-size:24rpx; | |||
| font-family:PingFang-SC-Medium; | |||
| font-weight:500; | |||
| color:rgba(134,134,134,1); | |||
| margin-bottom: 12rpx; | |||
| } | |||
| .des{ | |||
| width: 100%; | |||
| height: auto; | |||
| padding-top: 6rpx; | |||
| border-top: 2rpx solid rgb(240, 238, 238); | |||
| } | |||
| .des-peoplenum{ | |||
| display: inline; | |||
| font-size:24rpx; | |||
| font-family:PingFang-SC-Medium; | |||
| font-weight:500; | |||
| color:rgba(0,0,0,1); | |||
| line-height:44rpx; | |||
| margin-right: 15rpx; | |||
| } | |||
| .des-saleprice{ | |||
| display: inline; | |||
| font-size:40rpx; | |||
| font-family:PingFang-SC-Medium; | |||
| font-weight:500; | |||
| color:rgba(255,53,53,1); | |||
| } | |||
| .status{ | |||
| width: 100%; | |||
| border-radius: 15rpx; | |||
| background:rgba(255,235,229,1); | |||
| margin: 30rpx 0; | |||
| overflow: hidden; | |||
| } | |||
| .status01{ | |||
| float: left; | |||
| width: 130rpx; | |||
| height: 130rpx; | |||
| } | |||
| .status01 image{ | |||
| width: 90rpx; | |||
| height: 90rpx; | |||
| border-radius: 45rpx; | |||
| margin: 20rpx 0 0 20rpx; | |||
| } | |||
| .status02{ | |||
| margin-top: 20rpx; | |||
| float: left; | |||
| width: 140rpx; | |||
| font-size:28rpx; | |||
| font-family:PingFang-SC-Medium; | |||
| font-weight:500; | |||
| color:rgba(51,51,51,1); | |||
| } | |||
| .r-p-num{ | |||
| display: inline; | |||
| color: #FF3535; | |||
| } | |||
| .status03{ | |||
| /* width: 160rpx; */ | |||
| float: left; | |||
| padding-left: 80rpx; | |||
| color: #F74812; | |||
| } | |||
| .hh,.mm,.ss{ | |||
| display: inline-block; | |||
| font-size:26rpx; | |||
| font-family:PingFang-SC-Medium; | |||
| font-weight:500; | |||
| color:rgba(255,255,255,1); | |||
| height: 38rpx; | |||
| width: 38rpx; | |||
| background: #F74812; | |||
| border-radius:10rpx; | |||
| margin: 46rpx 8rpx 0 0; | |||
| text-align: center; | |||
| line-height: 38rpx; | |||
| } | |||
| .status04{ | |||
| float: left; | |||
| width: 163rpx; | |||
| } | |||
| .s-button{ | |||
| background:#ED3D2E; | |||
| width: 120rpx; | |||
| height: 48rpx; | |||
| font-size:28rpx; | |||
| font-family:PingFang-SC-Medium; | |||
| font-weight:500; | |||
| color:rgba(255,255,255,1); | |||
| text-align: center; | |||
| line-height: 48rpx; | |||
| border-radius: 24rpx; | |||
| margin: 40rpx auto 0; | |||
| } | |||
| .p-title{ | |||
| font-size:32rpx; | |||
| font-family:PingFang-SC-Bold; | |||
| font-weight:bold; | |||
| color:rgba(51,51,51,1); | |||
| margin: 10rpx 0 20rpx 0; | |||
| } | |||
| .p-list{ | |||
| font-size:24rpx; | |||
| font-family:PingFang-SC-Medium; | |||
| font-weight:500; | |||
| color:rgba(51,51,51,1); | |||
| line-height:50rpx; | |||
| } | |||
| .edit{ | |||
| position: fixed; | |||
| width: 690rpx; | |||
| bottom: 20rpx; | |||
| left: 30rpx; | |||
| } | |||
| .edit-left{ | |||
| float: left; | |||
| width: 330rpx; | |||
| height: 95rpx; | |||
| background:rgba(255,169,2,1); | |||
| box-shadow:0px 8rpx 8rpx 1rpx rgba(255,169,2,0.32); | |||
| border-radius:48rpx; | |||
| } | |||
| .edit-right{ | |||
| float: right; | |||
| width: 330rpx; | |||
| height: 95rpx; | |||
| line-height: 46rpx; | |||
| background:linear-gradient(90deg,rgba(236,59,45,1) 0%,rgba(248,98,52,1) 100%); | |||
| box-shadow:0px 8rpx 8rpx 1rpx rgba(246,93,51,0.32); | |||
| border-radius:48rpx; | |||
| } | |||
| .edit-left-top{ | |||
| height: 46rpx; | |||
| text-align: center; | |||
| } | |||
| .price{ | |||
| display: inline; | |||
| font-size:32rpx; | |||
| line-height: 32rpx; | |||
| font-family:PingFang-SC-Medium; | |||
| font-weight:500; | |||
| color:rgba(254,254,254,1); | |||
| margin-top: 6rpx; | |||
| } | |||
| .price-unit{ | |||
| display: inline; | |||
| font-size:27rpx; | |||
| line-height: 27rpx; | |||
| margin-top: 11rpx; | |||
| font-family:PingFang-SC-Medium; | |||
| font-weight:500; | |||
| color:rgba(254,254,254,1); | |||
| } | |||
| .edit-left-bottom{ | |||
| text-align: center; | |||
| font-size:30rpx; | |||
| line-height: 40rpx; | |||
| font-family:PingFang-SC-Medium; | |||
| font-weight:500; | |||
| color:rgba(254,254,254,1); | |||
| } | |||
| .edit-right-top{ | |||
| line-height: 32rpx; | |||
| text-align: center; | |||
| margin-top: 13rpx; | |||
| } | |||
| .real-price{ | |||
| display: inline; | |||
| font-size:32rpx; | |||
| font-family:PingFang-SC-Medium; | |||
| font-weight:500; | |||
| color:rgba(254,254,254,1); | |||
| } | |||
| .real-price-unit{ | |||
| display: inline; | |||
| font-size:27rpx; | |||
| line-height: 27rpx; | |||
| margin-top: 11rpx; | |||
| font-family:PingFang-SC-Medium; | |||
| font-weight:500; | |||
| color:rgba(254,254,254,1); | |||
| } | |||
| .edit-right-bottom{ | |||
| text-align: center; | |||
| font-size:30rpx; | |||
| line-height: 40rpx; | |||
| font-family:PingFang-SC-Medium; | |||
| font-weight:500; | |||
| color:rgba(254,254,254,1); | |||
| } | |||
| .posi { | |||
| position: relative; | |||
| } | |||
| .applyshop{ | |||
| font-size:32rpx; | |||
| font-family:PingFang-SC-Bold; | |||
| font-weight:bold; | |||
| color:rgba(51,51,51,1); | |||
| margin: 10rpx 0 20rpx 0; | |||
| } | |||
| .posi>view:nth-child(2) { | |||
| width: 100%; | |||
| height: 87rpx; | |||
| display: flex; | |||
| justify-content: space-between; | |||
| line-height: 87rpx; | |||
| } | |||
| .posi>view:nth-child(2) text:nth-child(1) { | |||
| font-size: 30rpx; | |||
| color: #a9a9a9; | |||
| } | |||
| .posi>view:nth-child(2) text:nth-child(2) { | |||
| font-size: 30rpx; | |||
| color: #a9a9a9; | |||
| } | |||
| .posi_logo { | |||
| width: 100%; | |||
| display: flex; | |||
| padding: 20rpx 0; | |||
| background: #fff; | |||
| height: 100rpx; | |||
| margin-bottom: 20rpx; | |||
| } | |||
| .posi_logo view:nth-child(1) { | |||
| width: 100rpx; | |||
| height: 100rpx; | |||
| border-radius: 16rpx; | |||
| } | |||
| .posi_logo view:nth-child(1) image { | |||
| display: block; | |||
| width: 100rpx; | |||
| height: 100rpx; | |||
| border-radius: 16rpx; | |||
| border: 1px solid #e5e5e5; | |||
| } | |||
| .posi_logo view:nth-child(2) { | |||
| display: flex; | |||
| flex-direction: column; | |||
| flex: 8; | |||
| padding-left: 30rpx; | |||
| } | |||
| .posi_logo view:nth-child(2) text:nth-child(1) { | |||
| font-size: 32rpx; | |||
| color: #333; | |||
| letter-spacing: 0; | |||
| } | |||
| .posi_logo view:nth-child(2) text:nth-child(2) { | |||
| font-size: 24rpx; | |||
| color: #b8b8b8; | |||
| padding-top: 3rpx; | |||
| width: 450rpx; | |||
| height: 36rpx; | |||
| overflow: hidden; | |||
| } | |||
| .tel { | |||
| right: 0; | |||
| top: 0; | |||
| bottom: 0; | |||
| margin: auto; | |||
| width: 50rpx; | |||
| height: 50rpx; | |||
| } | |||
| @@ -104,6 +104,10 @@ Page({ | |||
| data.statustext=that.changeSatus(data.status); | |||
| that.countdown(data.expiredDate); | |||
| data.salePrice = (data.salePrice/100).toFixed(2) | |||
| for (let i = 0; i < data.remainPeople;i++){ | |||
| let a={}; | |||
| data.userList.push(a) | |||
| } | |||
| that.setData({ | |||
| data:res.data | |||
| }) | |||
| @@ -14,15 +14,18 @@ | |||
| </view> | |||
| <view class='status-center'> | |||
| <view class='status-lists'> | |||
| <view class='tuanzhang touxiangitems'> | |||
| <view class='touxiang'> | |||
| <image src='{{spellBg}}'></image> | |||
| <view class='tuanzhang touxiangitems' wx:for="{{data.userList}}" wx:key="{{index}}"> | |||
| <view class='touxiang' wx:if='{{item.avatarUrl}}'> | |||
| <image src='{{item.avatarUrl}}'></image> | |||
| </view> | |||
| <view class='tuan-icon'> | |||
| <view class='tuan-icon' wx:if='{{index==0}}'> | |||
| <image src='{{tuanzhang}}'></image> | |||
| </view> | |||
| <view class='no-touxiang' wx:if='{{!item.avatarUrl}}'> | |||
| ? | |||
| </view> | |||
| </view> | |||
| <view class='tuanzhang touxiangitems'> | |||
| <!-- <view class='tuanzhang touxiangitems'> | |||
| <view class='touxiang'> | |||
| <image src='{{spellBg}}'></image> | |||
| </view> | |||
| @@ -31,7 +34,7 @@ | |||
| <view class='no-touxiang'> | |||
| ? | |||
| </view> | |||
| </view> | |||
| </view> --> | |||
| </view> | |||
| </view> | |||
| <view class='status-bottom'> | |||
| @@ -14,7 +14,12 @@ Page({ | |||
| data:[], | |||
| spellData:null, | |||
| canSpell:true, | |||
| canBuyIf:true | |||
| canBuyIf:true, | |||
| clock: "00", | |||
| day: "00", | |||
| hour: "00", | |||
| min: "00", | |||
| sec: "00", | |||
| }, | |||
| /** | |||
| @@ -47,33 +52,26 @@ Page({ | |||
| }) | |||
| this.orderFunc() | |||
| }, | |||
| /** | |||
| * 发起拼团 | |||
| */ | |||
| gotoSpell(){ | |||
| console.log(111111111) | |||
| this.setData({ | |||
| canSpell:false | |||
| }) | |||
| this.orderFunc(0) | |||
| }, | |||
| /** | |||
| * 获取一个拼团信息 | |||
| */ | |||
| getOneSpell(couponId){ | |||
| let that = this; | |||
| Http.get({ | |||
| url: config.api.queryRemainOne, | |||
| data: { | |||
| couponId: couponId | |||
| } | |||
| }).then(res => { | |||
| if(res.data){ | |||
| that.setData({ | |||
| spellData: res.data | |||
| }); | |||
| } | |||
| }); | |||
| // 时间格式化输出,如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; | |||
| @@ -92,18 +90,55 @@ Page({ | |||
| }) | |||
| } else { | |||
| that.setData({ | |||
| spellData:null, | |||
| clock: "00", | |||
| day: "00", | |||
| hour: "00", | |||
| min: "00", | |||
| sec: "00", | |||
| }) | |||
| that.getOneSpell(that.data.couponId) | |||
| } | |||
| setTimeout(function () { | |||
| total_micro_second -= 1000; | |||
| that.countdown(end_time); | |||
| }, 1000) | |||
| }, | |||
| /** | |||
| * 发起拼团 | |||
| */ | |||
| gotoSpell(){ | |||
| console.log(111111111) | |||
| this.setData({ | |||
| canSpell:false | |||
| }) | |||
| this.orderFunc(0) | |||
| }, | |||
| //参与别人的拼团 | |||
| gotoPartner(){ | |||
| wx.navigateTo({ | |||
| url: `/pages/spellDetail/index?orderId=${this.data.spellData.orderId}&couponId=${this.data.spellData.couponId}&orderGroupId=${this.data.spellData.orderGroupId}` | |||
| }); | |||
| }, | |||
| /** | |||
| * 获取一个拼团信息 | |||
| */ | |||
| getOneSpell(couponId){ | |||
| let that = this; | |||
| Http.get({ | |||
| url: config.api.queryRemainOne, | |||
| data: { | |||
| couponId: couponId | |||
| } | |||
| }).then(res => { | |||
| if(res.data){ | |||
| that.countdown(res.data.expiredDate); | |||
| that.setData({ | |||
| spellData: res.data | |||
| }); | |||
| } | |||
| }); | |||
| }, | |||
| /** | |||
| * 获取券详情信息 | |||
| */ | |||
| @@ -10,18 +10,18 @@ | |||
| <view class='des-peoplenum'>【拼团购】{{data.pressLimitNum}}人拼团成功,单价仅需</view> | |||
| <view class='des-saleprice'>{{data.salePriceStr}}元</view> | |||
| </view> | |||
| <view class='status'> | |||
| <view class='status' wx:if="{{spellData!=null}}"> | |||
| <view class='status01 st'> | |||
| <image src='https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/spell-bg.png'></image> | |||
| <image src='{{spellData.avatarUrl}}'></image> | |||
| </view> | |||
| <view class='status02 st'>金城武的团还差<view class='r-p-num'>4人</view></view> | |||
| <view class='status02 st'>{{spellData.nickName}}的团还差<view class='r-p-num'>1人</view></view> | |||
| <view class='status03 st'> | |||
| <view class='hh'>13</view>: | |||
| <view class='mm'>24</view>: | |||
| <view class='ss'>59</view> | |||
| <view class='hh'>{{hour}}</view>: | |||
| <view class='mm'>{{min}}</view>: | |||
| <view class='ss'>{{sec}}</view> | |||
| </view> | |||
| <view class='status04 st'> | |||
| <view class='s-button'>去拼团</view> | |||
| <view class='s-button' bindtap='gotoPartner'>去拼团</view> | |||
| </view> | |||
| </view> | |||
| <view class='p-des'> | |||
| @@ -46,6 +46,12 @@ Page({ | |||
| }) | |||
| this.getList(1, "spellList") | |||
| }, | |||
| //跳转到我的拼团详情 | |||
| gotoStatusDetail(){ | |||
| wx.navigateTo({ | |||
| url: '/pages/spellDetail/index', | |||
| }) | |||
| }, | |||
| //切换我的拼团 | |||
| getmyList(){ | |||
| this.setData({ | |||
| @@ -284,6 +290,12 @@ Page({ | |||
| url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${couponChannelId}&couponId=${couponId}` | |||
| }) | |||
| } | |||
| }, | |||
| /** | |||
| * 用户点击右上角分享 | |||
| */ | |||
| onShareAppMessage: function () { | |||
| }, | |||
| //加载更多 | |||
| onReachBottom: function () { | |||
| @@ -26,7 +26,7 @@ | |||
| <view class='right-text'>剩余{{item.remainInventory}}</view> | |||
| </view> | |||
| </view> | |||
| <view class='sepll-list' wx:if='{{flag=="myspellList"}}' wx:for="{{lists}}" wx:key="{{index}}" data-couponId='{{item.couponId}}' data-id='{{item.id}}' bindtap='invite' style='position:relative;'> | |||
| <view class='sepll-list' wx:if='{{flag=="myspellList"}}' wx:for="{{lists}}" wx:key="{{index}}" data-couponId='{{item.couponId}}' data-id='{{item.id}}' data-='item' bindtap='gotoStatusDetail' style='position:relative;'> | |||
| <view class='spell-left'> | |||
| <image src='{{item.coverImg}}'></image> | |||
| </view> | |||
| @@ -42,7 +42,14 @@ | |||
| </view> | |||
| </view> | |||
| <view class='spell-right' style='position:absolute;width:auto;bottom:30rpx;right:20rpx;'> | |||
| <view class='right-button' data-status='{{item.status}}' bindtap='gotoEdit' style="width:auto;display:inline-block;padding:0 8rpx;">{{item.statusText}}</view> | |||
| <!-- 继续邀请好友 --> | |||
| <button class='share user-motto right-button' open-type="share" id="shareBtn" wx:if='{{item.status==10}}' data-status='{{item.status}}' 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> | |||