作者 lihongjuan

1

{
"pages": [
"pages/register/register",
"pages/index/index",
"pages/messagedetail/messagedetail",
"pages/message/message",
"pages/login/login",
"pages/index/index",
"pages/shop_cart/shop_cart",
"pages/classify/classify",
"pages/my/my",
... ...
... ... @@ -59,6 +59,7 @@ Page({
}
app.post(url, data, "POST").then((r) => {
console.log(r)
console.log(r.msg.residue_time)
that.setData({
xianshilist: r.msg.list,
endTime: r.msg.residue_time
... ... @@ -80,7 +81,8 @@ Page({
date_format(micro_second) {
// 总秒数
var second = Math.floor(micro_second / 1000);
var second = micro_second;
// var second = Math.floor(micro_second / 1000);
// 天数
var day = Math.floor(second / 3600 / 24);
// 小时
... ... @@ -95,8 +97,8 @@ date_format(micro_second) {
// 倒计时
countDown() {
var that = this;
var time = that.data.endTime/1000;
console.log('999',that.data.endTime)
var time = that.data.endTime;
var interval = setInterval(function () {
// 秒数
let day = parseInt(time / (60 * 60 * 24));
... ...
... ... @@ -52,7 +52,7 @@
</view>
<!-- 物流信息 -->
<view class="wuliuinfo">
<view class="wuliuinfo" wx:if="{{kuaidi.length!=0}}">
<view class="page-section page-section-spacing swiper">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" vertical="true" circular="true">
<block wx:for="{{kuaidi}}" wx:key="*this">
... ...
... ... @@ -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()
},
/**
... ...
... ... @@ -33,17 +33,17 @@
<view class="saleprice">¥288</view>
<!-- <view class="yuansaleprice">¥{{}}</view> -->
</view>
<view class="buynow buyactive" wx:if="{{item.status==1}}">未开始</view>
<view class="buynow buyactive" wx:if="{{item.status==2}}">已结束</view>
<view class="buynow" wx:if="{{item.status==3}}">进行中</view>
<view class="buynow buyactive" wx:if="{{status==1}}">未开始</view>
<view class="buynow buyactive" wx:if="{{status==2}}">已结束</view>
<view class="buynow" wx:if="{{status==3&&item.sold!=0}}" data-id="{{item.id}}" bindtap="{{item.sold==0?'':'look_more'}}">立即抢购</view>
<view class="buynow" wx:if="{{status==3&&item.sold==0}}">已抢光</view>
</view>
<view class="miaojindu flextwo">
<view class="miaojinduleft">
<view class="miaojinnei"></view>
<view class="miaojinnei" style="width:{{item.rob}}%"></view>
</view>
<view class="miaojinduright">已抢60%</view>
<view class="miaojinduright">已抢{{item.rob}}%</view>
</view>
... ...
... ... @@ -92,6 +92,7 @@
height:20rpx;
border-radius:18rpx;
border:2rpx solid rgba(239,227,205,1);
margin-right:20rpx;
}
.miaojinnei{
... ... @@ -131,3 +132,6 @@ image{
.buyactive{
background: rgba(156, 156, 156, 1)
}
.miaogood{
margin-top:20rpx;
}
\ No newline at end of file
... ...