diff --git a/app.json b/app.json
index 760cfca..cb2afa4 100644
--- a/app.json
+++ b/app.json
@@ -51,7 +51,8 @@
"pages/paySuccess/paySuccess",
"pages/ConsumeDetail/ConsumeDetail",
"pages/externallinks/index",
- "pages/czdetail/czdetail"
+ "pages/czdetail/czdetail",
+ "pages/joinFrDpell/index"
],
"navigateToMiniProgramAppIdList": [
"wx192b7d2e8dcbefd0",
diff --git a/pages/joinFrDpell/index.js b/pages/joinFrDpell/index.js
new file mode 100644
index 0000000..1dff35f
--- /dev/null
+++ b/pages/joinFrDpell/index.js
@@ -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 () {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/joinFrDpell/index.json b/pages/joinFrDpell/index.json
new file mode 100644
index 0000000..ef25014
--- /dev/null
+++ b/pages/joinFrDpell/index.json
@@ -0,0 +1,5 @@
+{
+ "navigationBarTitleText": "拼团券详情",
+ "enablePullDownRefresh": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/joinFrDpell/index.wxml b/pages/joinFrDpell/index.wxml
new file mode 100644
index 0000000..73ff86f
--- /dev/null
+++ b/pages/joinFrDpell/index.wxml
@@ -0,0 +1,63 @@
+
+
+
+
+
+ {{data.title}}
+
+
+
+ 【拼团购】{{data.pressLimitNum}}人拼团成功,单价仅需
+ {{data.salePriceStr}}元
+
+
+
+
+
+ {{spellData.nickName}}的团还差1人
+
+ {{hour}}:
+ {{min}}:
+ {{sec}}
+
+
+ 去拼团
+
+
+
+ 商品详情:
+ {{data.remark}}
+
+
+ 适用门店
+
+
+
+
+
+ {{item.merchantName}}
+ {{item.addr}}{{item.buildingName}}{{item.floorName}}
+
+
+
+
+
+
+
+ {{data.price}}
+ 元
+
+ 立即购买
+
+
+
+
+ {{data.salePrice}}
+ 元
+
+ 发起拼团
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/joinFrDpell/index.wxss b/pages/joinFrDpell/index.wxss
new file mode 100644
index 0000000..21b7d6c
--- /dev/null
+++ b/pages/joinFrDpell/index.wxss
@@ -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;
+}
\ No newline at end of file
diff --git a/pages/spellDetail/index.js b/pages/spellDetail/index.js
index 675fc10..31678cd 100644
--- a/pages/spellDetail/index.js
+++ b/pages/spellDetail/index.js
@@ -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
})
diff --git a/pages/spellDetail/index.wxml b/pages/spellDetail/index.wxml
index 0632fe1..c5e0829 100644
--- a/pages/spellDetail/index.wxml
+++ b/pages/spellDetail/index.wxml
@@ -14,15 +14,18 @@
-
-
-
+
+
+
-
+
+
+ ?
+
-
+
diff --git a/pages/spellGroup/mySpellGroup/index.js b/pages/spellGroup/mySpellGroup/index.js
index 5f6e0de..f9dfe41 100644
--- a/pages/spellGroup/mySpellGroup/index.js
+++ b/pages/spellGroup/mySpellGroup/index.js
@@ -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
+ });
+ }
+ });
+ },
/**
* 获取券详情信息
*/
diff --git a/pages/spellGroup/mySpellGroup/index.wxml b/pages/spellGroup/mySpellGroup/index.wxml
index 2cebbc7..9e261f8 100644
--- a/pages/spellGroup/mySpellGroup/index.wxml
+++ b/pages/spellGroup/mySpellGroup/index.wxml
@@ -10,18 +10,18 @@
【拼团购】{{data.pressLimitNum}}人拼团成功,单价仅需
{{data.salePriceStr}}元
-
+
-
+
- 金城武的团还差4人
+ {{spellData.nickName}}的团还差1人
- 13:
- 24:
- 59
+ {{hour}}:
+ {{min}}:
+ {{sec}}
- 去拼团
+ 去拼团
diff --git a/pages/spellGroup/spellGroup.js b/pages/spellGroup/spellGroup.js
index eb30e60..1889ac5 100644
--- a/pages/spellGroup/spellGroup.js
+++ b/pages/spellGroup/spellGroup.js
@@ -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 () {
diff --git a/pages/spellGroup/spellGroup.wxml b/pages/spellGroup/spellGroup.wxml
index 588108e..8655ac5 100644
--- a/pages/spellGroup/spellGroup.wxml
+++ b/pages/spellGroup/spellGroup.wxml
@@ -26,7 +26,7 @@
剩余{{item.remainInventory}}
-
+
@@ -42,7 +42,14 @@
- {{item.statusText}}
+
+
+
+ {{item.statusText}}
+
+ {{item.statusText}}
+
+ {{item.statusText}}