...
|
...
|
@@ -27,12 +27,14 @@ |
|
|
},
|
|
|
//获取banner
|
|
|
getBanner() {
|
|
|
let url = '/portal/Group/banner'
|
|
|
app.post(url, {}, {}).then((res) => {
|
|
|
// console.log('获取banner',res)
|
|
|
this.setData({banner: res.info});
|
|
|
})
|
|
|
},
|
|
|
let url = '/portal/Group/banner'
|
|
|
app.post(url, {}, {}).then((res) => {
|
|
|
// console.log('获取banner',res)
|
|
|
this.setData({
|
|
|
banner: res.info
|
|
|
});
|
|
|
})
|
|
|
},
|
|
|
//tab切换
|
|
|
tabCharge(e) {
|
|
|
var index = e.currentTarget.dataset.current
|
...
|
...
|
@@ -98,8 +100,10 @@ |
|
|
|
|
|
//成交记录
|
|
|
record() {
|
|
|
if(!this.data.record_has_more) return;
|
|
|
this.setData({record_has_more: false});
|
|
|
if (!this.data.record_has_more) return;
|
|
|
this.setData({
|
|
|
record_has_more: false
|
|
|
});
|
|
|
let url = '/portal/Group/group_complete'
|
|
|
let params = {
|
|
|
page: this.data.record_page_number
|
...
|
...
|
@@ -109,17 +113,21 @@ |
|
|
}
|
|
|
app.post(url, params, header).then((res) => {
|
|
|
console.log(res)
|
|
|
if(res.this_page < res.total_page) {
|
|
|
this.setData({record_has_more: true});
|
|
|
if (res.this_page < res.total_page) {
|
|
|
this.setData({
|
|
|
record_has_more: true
|
|
|
});
|
|
|
}
|
|
|
var recordList= res.list
|
|
|
for(var i=0;i<recordList.length;i++){
|
|
|
var chargeTime = recordList[i].create_time
|
|
|
chargeTime = time.formatTimeTwo(chargeTime, 'Y-M-D')
|
|
|
console.log(chargeTime)
|
|
|
recordList[i].create_time = chargeTime
|
|
|
}
|
|
|
this.setData({recordList: this.data.recordList.concat(recordList)});
|
|
|
var recordList = res.list
|
|
|
for (var i = 0; i < recordList.length; i++) {
|
|
|
var chargeTime = recordList[i].create_time
|
|
|
chargeTime = time.formatTimeTwo(chargeTime, 'Y-M-D')
|
|
|
console.log(chargeTime)
|
|
|
recordList[i].create_time = chargeTime
|
|
|
}
|
|
|
this.setData({
|
|
|
recordList: this.data.recordList.concat(recordList)
|
|
|
});
|
|
|
})
|
|
|
},
|
|
|
|
...
|
...
|
@@ -211,8 +219,10 @@ |
|
|
|
|
|
//参与的组团
|
|
|
takeGroup() {
|
|
|
if(!this.data.group_has_more) return;
|
|
|
this.setData({group_has_more: false});
|
|
|
if (!this.data.group_has_more) return;
|
|
|
this.setData({
|
|
|
group_has_more: false
|
|
|
});
|
|
|
let url = '/portal/Group/group_list'
|
|
|
let params = {
|
|
|
page: this.data.group_page_number
|
...
|
...
|
@@ -223,15 +233,28 @@ |
|
|
app.post(url, params, header).then((res) => {
|
|
|
var groupList = res.list
|
|
|
var goodsList = this.data.goodsList
|
|
|
console.log(groupList.length)
|
|
|
console.log(groupList)
|
|
|
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[i].actEndTime = '2019-05-01 10:00:43'
|
|
|
goodsList[i].actEndTime = groupList[i].over_time.replace(/-/g, "/")
|
|
|
// goodsList = [
|
|
|
// { actEndTime: '2019-05-01 10:00:43' },
|
|
|
// { actEndTime: '2019-04-01 11:00:00' },
|
|
|
// { actEndTime: '2019-06-01 12:45:56' },
|
|
|
// { actEndTime: '2019-07-01 15:00:23' },
|
|
|
// { actEndTime: '2019-05-23 17:00:22' },
|
|
|
// { actEndTime: '2019-05-14 19:00:44' },
|
|
|
// { actEndTime: '2019-05-21 21:00:34' },
|
|
|
// { actEndTime: '2019-06-17 09:00:37' },
|
|
|
// { actEndTime: '2019-03-21 05:00:59' },
|
|
|
// { actEndTime: '2019-04-19 07:00:48' },
|
|
|
// { actEndTime: '2019-04-28 03:00:11' }
|
|
|
// ]
|
|
|
}
|
|
|
goodsList.pop()
|
|
|
// goodsList.pop()
|
|
|
let endTimeList = [];
|
|
|
goodsList.forEach(o => {
|
|
|
endTimeList.push(o.actEndTime)
|
...
|
...
|
@@ -241,13 +264,15 @@ |
|
|
});
|
|
|
// console.log(endTimeList)
|
|
|
this.countDown();
|
|
|
if(res.this_page < res.total_page) {
|
|
|
this.setData({group_has_more: true});
|
|
|
if (res.this_page < res.total_page) {
|
|
|
this.setData({
|
|
|
group_has_more: true
|
|
|
});
|
|
|
}
|
|
|
// console.log('list', list);
|
|
|
this.setData({
|
|
|
groupList: this.data.groupList.concat(res.list),
|
|
|
goodsList: goodsList
|
|
|
groupList: this.data.groupList.concat(res.list),
|
|
|
goodsList: goodsList
|
|
|
});
|
|
|
})
|
|
|
},
|
...
|
...
|
@@ -281,6 +306,7 @@ |
|
|
min: this.timeFormat(min),
|
|
|
sec: this.timeFormat(sec)
|
|
|
}
|
|
|
// console.log(obj)
|
|
|
} else { //活动已结束,全部设置为'00'
|
|
|
obj = {
|
|
|
day: '00',
|
...
|
...
|
@@ -320,36 +346,36 @@ |
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
*/
|
|
|
onReachBottom: function () {
|
|
|
const self = this;
|
|
|
if(+self.data.current === 0) {
|
|
|
if(self.data.group_has_more) {
|
|
|
self.data.group_page_number ++;
|
|
|
self.takeGroup();
|
|
|
}else {
|
|
|
wx.showToast({
|
|
|
title: '没有更多数据了~',
|
|
|
icon: 'none'
|
|
|
});
|
|
|
}
|
|
|
console.log('上拉加载');
|
|
|
}else if(+self.data.current === 1) {
|
|
|
if(self.data.record_has_more) {
|
|
|
self.data.record_page_number ++;
|
|
|
self.record();
|
|
|
}else {
|
|
|
wx.showToast({
|
|
|
title: '没有更多数据了~',
|
|
|
icon: 'none'
|
|
|
});
|
|
|
}
|
|
|
console.log('上拉加载');
|
|
|
}
|
|
|
/**
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
*/
|
|
|
onReachBottom: function() {
|
|
|
const self = this;
|
|
|
if (+self.data.current === 0) {
|
|
|
if (self.data.group_has_more) {
|
|
|
self.data.group_page_number++;
|
|
|
self.takeGroup();
|
|
|
} else {
|
|
|
wx.showToast({
|
|
|
title: '没有更多数据了~',
|
|
|
icon: 'none'
|
|
|
});
|
|
|
}
|
|
|
console.log('上拉加载');
|
|
|
} else if (+self.data.current === 1) {
|
|
|
if (self.data.record_has_more) {
|
|
|
self.data.record_page_number++;
|
|
|
self.record();
|
|
|
} else {
|
|
|
wx.showToast({
|
|
|
title: '没有更多数据了~',
|
|
|
icon: 'none'
|
|
|
});
|
|
|
}
|
|
|
console.log('上拉加载');
|
|
|
}
|
|
|
|
|
|
},
|
|
|
},
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|
...
|
...
|
|