...
|
...
|
@@ -20,9 +20,12 @@ Page({ |
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
this.getxianshi()
|
|
|
this.getxianshi();
|
|
|
this.getxianshik()
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 限时抢购
|
|
|
getxianshi() {
|
|
|
let that = this
|
...
|
...
|
@@ -35,8 +38,38 @@ Page({ |
|
|
app.post(url, data, "POST").then((r) => {
|
|
|
console.log(r)
|
|
|
that.setData({
|
|
|
// xianshilist: that.data.xianshilist.concat(r.msg.list) ,
|
|
|
|
|
|
// status: r.msg.status,
|
|
|
endTime: r.msg.residue_time,
|
|
|
})
|
|
|
|
|
|
|
|
|
that.countDown()
|
|
|
|
|
|
console.log(that.data.xianshilist)
|
|
|
// that.setData({
|
|
|
// messagelist: that.data.messagelist.concat(r.msg)
|
|
|
// })
|
|
|
|
|
|
// console.log(that.data.messagelist)
|
|
|
|
|
|
}).catch((err) => { })
|
|
|
},
|
|
|
getxianshik() {
|
|
|
let that = this
|
|
|
let url = '/special/get_all';
|
|
|
let data = {
|
|
|
page: that.data.page,
|
|
|
pageNum: 10
|
|
|
|
|
|
}
|
|
|
app.post(url, data, "POST").then((r) => {
|
|
|
console.log(r)
|
|
|
that.setData({
|
|
|
xianshilist: that.data.xianshilist.concat(r.msg.list) ,
|
|
|
endTime: r.msg.residue_time
|
|
|
// endTime: r.msg.residue_time,
|
|
|
status: r.msg.status
|
|
|
})
|
|
|
|
|
|
|
...
|
...
|
@@ -51,12 +84,20 @@ Page({ |
|
|
|
|
|
}).catch((err) => { })
|
|
|
},
|
|
|
|
|
|
|
|
|
look_more(e) {
|
|
|
let id = e.currentTarget.dataset.id
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/shop_detail/shop_detail?id=' + id
|
|
|
})
|
|
|
},
|
|
|
// 倒计时
|
|
|
countDown() {
|
|
|
console.log(788)
|
|
|
var that = this;
|
|
|
|
|
|
var time = that.data.endTime / 1000;
|
|
|
var time = that.data.endTime;
|
|
|
var interval = setInterval(function () {
|
|
|
// 秒数
|
|
|
let day = parseInt(time / (60 * 60 * 24));
|
...
|
...
|
@@ -126,7 +167,7 @@ Page({ |
|
|
this.setData({
|
|
|
page:newpage
|
|
|
})
|
|
|
this.getxianshi()
|
|
|
this.getxianshik()
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
|