...
|
...
|
@@ -70,7 +70,7 @@ |
|
|
// 长按复制
|
|
|
copy: function(e) {
|
|
|
console.log(e)
|
|
|
var index=e.currentTarget.dataset.index
|
|
|
var index = e.currentTarget.dataset.index
|
|
|
var recordList = this.data.recordList
|
|
|
var chargenum = recordList[index].redeem_code
|
|
|
var that = this;
|
...
|
...
|
@@ -86,32 +86,6 @@ |
|
|
},
|
|
|
|
|
|
|
|
|
//参与的组团
|
|
|
takeGroup() {
|
|
|
let url = '/portal/Group/group_list'
|
|
|
let params = {
|
|
|
page: this.data.page
|
|
|
}
|
|
|
let header = {
|
|
|
"XX-Token": wx.getStorageSync('token')
|
|
|
}
|
|
|
app.post(url, params, header).then((res) => {
|
|
|
var groupList = res.list
|
|
|
var goodsList = this.data.goodsList
|
|
|
console.log(groupList.length)
|
|
|
for (var i = 0; i < groupList.length; i++) {
|
|
|
goodsList.push({
|
|
|
actEndTime:''
|
|
|
})
|
|
|
goodsList[i].actEndTime = groupList[i].over_time
|
|
|
}
|
|
|
this.setData({
|
|
|
groupList: res.list,
|
|
|
goodsList: goodsList
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
|
|
|
//成交记录
|
|
|
record() {
|
|
|
let url = '/portal/Group/group_complete'
|
...
|
...
|
@@ -142,7 +116,7 @@ |
|
|
"XX-Token": wx.getStorageSync('token')
|
|
|
}
|
|
|
app.post(url, params, header).then((res) => {
|
|
|
console.log('团购配置人数加个:',res)
|
|
|
console.log('团购配置人数加个:', res)
|
|
|
this.setData({
|
|
|
pay_info: res.info
|
|
|
})
|
...
|
...
|
@@ -217,22 +191,60 @@ |
|
|
icon: 'none'
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
|
|
|
|
|
|
//参与的组团
|
|
|
takeGroup() {
|
|
|
let url = '/portal/Group/group_list'
|
|
|
let params = {
|
|
|
page: this.data.page
|
|
|
}
|
|
|
let header = {
|
|
|
"XX-Token": wx.getStorageSync('token')
|
|
|
}
|
|
|
app.post(url, params, header).then((res) => {
|
|
|
var groupList = res.list
|
|
|
var goodsList = this.data.goodsList
|
|
|
console.log(groupList.length)
|
|
|
for (var i = 0; i < groupList.length; i++) {
|
|
|
goodsList.push({
|
|
|
actEndTime: ''
|
|
|
})
|
|
|
// goodsList[i].actEndTime = '2018-12-27 13:59:44'
|
|
|
goodsList[i].actEndTime = groupList[i].over_time
|
|
|
}
|
|
|
goodsList.pop()
|
|
|
let endTimeList = [];
|
|
|
goodsList.forEach(o => {
|
|
|
endTimeList.push(o.actEndTime)
|
|
|
})
|
|
|
this.setData({
|
|
|
actEndTimeList: endTimeList
|
|
|
});
|
|
|
// console.log(endTimeList)
|
|
|
this.countDown();
|
|
|
this.setData({
|
|
|
groupList: res.list,
|
|
|
goodsList: goodsList
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
|
|
|
timeFormat(param) { //小于10的格式化函数
|
|
|
return param < 10 ? '0' + param : param;
|
|
|
},
|
|
|
|
|
|
countDown() { //倒计时函数
|
|
|
// 获取当前时间,同时得到活动结束时间数组
|
|
|
let newTime = new Date().getTime();
|
|
|
let endTimeList = this.data.actEndTimeList;
|
|
|
// console.log(endTimeList)
|
|
|
let countDownArr = [];
|
|
|
|
|
|
// 对结束时间进行处理渲染到页面
|
|
|
endTimeList.forEach(o => {
|
|
|
let endTime = new Date(o).getTime();
|
|
|
// console.log(endTime)
|
|
|
let obj = null;
|
|
|
// 如果活动未结束,对时间进行处理
|
|
|
if (endTime - newTime > 0) {
|
...
|
...
|
@@ -258,10 +270,21 @@ |
|
|
}
|
|
|
countDownArr.push(obj);
|
|
|
})
|
|
|
|
|
|
var groupList = this.data.groupList
|
|
|
for (var i = 0; i < groupList.length; i++) {
|
|
|
for (var j = 0; j < countDownArr.length; j++) {
|
|
|
groupList[i].hou = countDownArr[i].hou
|
|
|
groupList[i].min = countDownArr[i].min
|
|
|
groupList[i].sec = countDownArr[i].sec
|
|
|
}
|
|
|
}
|
|
|
// 渲染,然后每隔一秒执行一次倒计时函数
|
|
|
this.setData({
|
|
|
countDownList: countDownArr
|
|
|
countDownList: countDownArr,
|
|
|
groupList: groupList
|
|
|
})
|
|
|
// console.log(this.data.countDownList)
|
|
|
setTimeout(this.countDown, 1000);
|
|
|
},
|
|
|
|
...
|
...
|
@@ -272,16 +295,7 @@ |
|
|
this.takeGroup()
|
|
|
this.record()
|
|
|
this.PayDetail()
|
|
|
let endTimeList = [];
|
|
|
// 将活动的结束时间参数提成一个单独的数组,方便操作
|
|
|
this.data.goodsList.forEach(o => {
|
|
|
endTimeList.push(o.actEndTime)
|
|
|
})
|
|
|
this.setData({
|
|
|
actEndTimeList: endTimeList
|
|
|
});
|
|
|
// 执行倒计时函数
|
|
|
this.countDown();
|
|
|
|
|
|
|
|
|
},
|
|
|
|
...
|
...
|
|