@@ -79,13 +79,7 @@ | |||
<text>购买须知</text> | |||
</view> | |||
<view> | |||
<text><text class='spot'></text>有效期2018.01.16 至 2018.09.20</text> | |||
<text><text class='spot'></text>除特价酒水及特价菜外全场通用</text> | |||
<text><text class='spot'></text>无需预约,消费g高峰时可能需要等位</text> | |||
<text><text class='spot'></text>没人最多购买2张</text> | |||
<text><text class='spot'></text>不可使用包间</text> | |||
<text><text class='spot'></text>堂食外带均可,可免费打包</text> | |||
<text><text class='spot'></text>每桌限用2张</text> | |||
<text><text class='spot'></text>{{data.remark}}</text> | |||
</view> | |||
</view> | |||
</view> |
@@ -25,7 +25,9 @@ Page({ | |||
current: "0", | |||
current_scroll: "0", | |||
page: 1, | |||
allow_load: true | |||
allow_load: true, | |||
loading: true, //"上拉加载"的变量,默认false,隐藏 | |||
content:"", | |||
}, | |||
onLoad() { | |||
this.getList(0, 0); | |||
@@ -56,9 +58,10 @@ Page({ | |||
console.log(key); | |||
console.log(pageNum); | |||
if (that.data.allow_load) { | |||
wx.showLoading({ | |||
title: "加载中" | |||
}); | |||
that.setData({ | |||
loading:true, | |||
content:'小主,我在玩命加载中...' | |||
}) | |||
Http.get({ | |||
url: config.api.couponOrderList, | |||
data: { | |||
@@ -71,14 +74,20 @@ Page({ | |||
res.data.list.map(file => { | |||
file.expiredTime = util.fmtDate(file.expiredTime); | |||
}); | |||
console.log("姐姐的订单列表"); | |||
setTimeout(function() { | |||
wx.hideLoading(); | |||
}, 1200); | |||
that.setData({ | |||
loading:false, | |||
}) | |||
}, 1400); | |||
if (pageNum >= res.data.pages) { | |||
that.setData({ | |||
allow_load: false | |||
}); | |||
setTimeout(function() { | |||
that.setData({ | |||
loading:false, | |||
}) | |||
}, 1400); | |||
} | |||
/** | |||
* 先赋值后渲染页面 | |||
@@ -92,6 +101,15 @@ Page({ | |||
}); | |||
} else { | |||
console.log("加载完成allow_load设置成false"); | |||
that.setData({ | |||
loading:true, | |||
content:"^_^再拉裤子就掉啦ʅ(´◔౪◔)ʃ" | |||
}) | |||
setTimeout(function(){ | |||
that.setData({ | |||
loading:false, | |||
}) | |||
},1400) | |||
} | |||
}, | |||
handleChange({ detail }) { | |||
@@ -11,7 +11,7 @@ | |||
<button>去领券</button> | |||
</navigator> | |||
</view> | |||
<view class='section' wx:for='{{list}}' wx:key='{{index}}' bindtap="gotouse" data-quancode="{{item.id}}"> | |||
<view class='detail_msg'> | |||
<view class='logo'> | |||
@@ -30,5 +30,8 @@ | |||
</view> | |||
</view> | |||
</view> | |||
<view class="loading" wx:if="{{loading}}"> | |||
<image src="./../../../assets/img/loading.gif" mode="widthFix"></image>{{content}} | |||
</view> | |||
</view> | |||
</view> |
@@ -110,3 +110,17 @@ | |||
width: 70%; | |||
margin: 30rpx auto 0; | |||
} | |||
.loading{ | |||
text-align: center; | |||
height: 80rpx; | |||
line-height: 80rpx; | |||
font-size: 26rpx; | |||
color: #999; | |||
} | |||
.loading image{ | |||
width: 40rpx; | |||
height: 40rpx; | |||
vertical-align: middle; | |||
margin-right: 10rpx; | |||
} |
@@ -23,7 +23,9 @@ Page({ | |||
current: "", | |||
current_scroll: "1", | |||
page: 1, | |||
allow_load: true | |||
allow_load: true, | |||
loading: true, //"上拉加载"的变量,默认false,隐藏 | |||
content:"", | |||
}, | |||
onLoad(e) { | |||
this.getList(e.id, 1); | |||
@@ -39,9 +41,7 @@ Page({ | |||
}, | |||
getList(key, pageNum) { | |||
let that = this; | |||
console.log(key); | |||
/** | |||
* key==0 | |||
* 不发送该字段 | |||
@@ -62,23 +62,31 @@ Page({ | |||
} | |||
if (that.data.allow_load) { | |||
wx.showLoading({ | |||
title: "加载中" | |||
}); | |||
that.setData({ | |||
loading:true, | |||
content:'小主,我在玩命加载中...' | |||
}) | |||
Http.get({ | |||
url: config.api.orderList, | |||
data: variable | |||
}).then(res => { | |||
console.log(res); | |||
console.log("姐姐的订单列表"); | |||
setTimeout(function() { | |||
wx.hideLoading(); | |||
}, 1200); | |||
if (pageNum >= res.data.pages) { | |||
that.setData({ | |||
allow_load: false | |||
}); | |||
setTimeout(function() { | |||
that.setData({ | |||
loading:false, | |||
}) | |||
}, 1400); | |||
} | |||
setTimeout(function() { | |||
that.setData({ | |||
loading:false, | |||
}) | |||
}, 1400); | |||
/** | |||
* 先赋值后渲染页面 | |||
* concat 不会改变原数组值 | |||
@@ -89,7 +97,6 @@ Page({ | |||
list: that.data.list | |||
}); | |||
for(let i=0; i<that.data.list.length; i++){ | |||
console.log(i); | |||
that.setData({ | |||
createDate:util.fmtDate(that.data.list[i].createDate) | |||
}) | |||
@@ -97,6 +104,15 @@ Page({ | |||
}); | |||
} else { | |||
console.log("加载完成allow_load设置成false"); | |||
that.setData({ | |||
loading:true, | |||
content:"^_^再拉裤子就掉啦ʅ(´◔౪◔)ʃ" | |||
}) | |||
setTimeout(function(){ | |||
that.setData({ | |||
loading:false, | |||
}) | |||
},1400) | |||
} | |||
}, | |||
handleChange({ detail }) { | |||
@@ -35,7 +35,7 @@ | |||
<view wx:if="{{item.orderStatus==1}}" class="btn" data-id="{{item.id}}" bindtap="gotopay"> | |||
<text>查看详情</text> | |||
</view> | |||
<view wx:if="{{item.orderStatus==0}}" class="btn" data-id="{{item.id}}" bindtap="gotopay"> | |||
<view wx:if="{{item.orderStatus==0}}" class="btn" data-id="{{item.id}}" bindtap="gotopay"> | |||
<text>支付</text> | |||
</view> | |||
<view wx:if="{{item.orderStatus==2}}" style="background:#999;" class="btn"> | |||
@@ -49,4 +49,7 @@ | |||
<text>暂无订单</text> | |||
</view> | |||
</view> | |||
<view class="loading" wx:if="{{loading}}"> | |||
<image src="./../../../assets/img/loading.gif" mode="widthFix"></image>{{content}} | |||
</view> | |||
</view> |
@@ -138,3 +138,17 @@ | |||
width: 100rpx; | |||
margin: 0 auto 16rpx; | |||
} | |||
.loading{ | |||
text-align: center; | |||
height: 80rpx; | |||
line-height: 80rpx; | |||
font-size: 26rpx; | |||
color: #999; | |||
} | |||
.loading image{ | |||
width: 40rpx; | |||
height: 40rpx; | |||
vertical-align: middle; | |||
margin-right: 10rpx; | |||
} |
@@ -55,10 +55,6 @@ Page({ | |||
//当前时间与优惠券下架时间做计算 | |||
console.log(that.data.day); | |||
if (page >= res.data.pages) { | |||
// wx.showToast({ | |||
// title: "加载完成喽", | |||
// icon: "success" | |||
// }); | |||
that.setData({ | |||
allow_load: false | |||
}); | |||
@@ -1,61 +1,69 @@ | |||
.flashSale{ | |||
.flashSale { | |||
width: 100%; | |||
height: 100%; | |||
background: #fff; | |||
} | |||
.loading{ | |||
.loading { | |||
text-align: center; | |||
height: 80rpx; | |||
line-height: 80rpx; | |||
font-size: 26rpx; | |||
color: #999; | |||
} | |||
.loading image{ | |||
.loading image { | |||
width: 40rpx; | |||
height: 40rpx; | |||
vertical-align: middle; | |||
margin-right: 10rpx; | |||
} | |||
.flashSaleItemWrap{ | |||
.flashSaleItemWrap { | |||
width: 100%; | |||
height: 410rpx; | |||
border-bottom: 10rpx solid #ededed; | |||
} | |||
.flashSaleItem{ | |||
.flashSaleItem { | |||
width: 90%; | |||
height: 410rpx; | |||
display: flex; | |||
flex-direction: column; | |||
background: #fff; | |||
margin: 0 auto; | |||
flex-direction: column; | |||
background: #fff; | |||
margin: 0 auto; | |||
} | |||
.flashSaleItemTop{ | |||
.flashSaleItemTop { | |||
display: flex; | |||
padding-top: 28rpx; | |||
flex-direction:row; | |||
flex-direction: row; | |||
padding-bottom: 25rpx; | |||
border-bottom: 1rpx solid #ededed; | |||
} | |||
.flashSaleItemTopL{ | |||
.flashSaleItemTopL { | |||
flex: 1; | |||
} | |||
.food{ | |||
.food { | |||
width: 248rpx; | |||
border-radius: 10rpx; | |||
height: 184rpx; | |||
border-radius: 30rpx; | |||
} | |||
.flashSaleItemTopR{ | |||
.flashSaleItemTopR { | |||
flex: 2; | |||
flex-direction: column; | |||
margin-left: 20rpx; | |||
} | |||
.flashSaleItemTopRTop{ | |||
.flashSaleItemTopRTop { | |||
display: flex; | |||
flex-direction: column; | |||
} | |||
.foodname{ | |||
.foodname { | |||
font-size: 32rpx; | |||
height: 40rpx; | |||
line-height: 40rpx; | |||
@@ -64,65 +72,77 @@ | |||
width: 406rpx; | |||
overflow: hidden; | |||
} | |||
.small{ | |||
.small { | |||
font-size: 24rpx; | |||
color: #00C0FF; | |||
color: #00c0ff; | |||
margin-top: 15rpx; | |||
} | |||
.flashSaleItemTopRBottom{ | |||
.flashSaleItemTopRBottom { | |||
margin-top: 24rpx; | |||
} | |||
.presentPrice{ | |||
.presentPrice { | |||
font-size: 36rpx; | |||
color: #f96563; | |||
} | |||
.originalPrice{ | |||
.originalPrice { | |||
margin-left: 20rpx; | |||
color:#B4B4B4; | |||
color: #b4b4b4; | |||
text-decoration: line-through; | |||
font-size: 24rpx; | |||
} | |||
.flashSaleItemBottom{ | |||
margin-top: 20rpx; | |||
position: relative; | |||
.flashSaleItemBottom { | |||
margin-top: 20rpx; | |||
position: relative; | |||
} | |||
.remainingTime{ | |||
.remainingTime { | |||
font-size: 28rpx; | |||
color: #B4B4B4; | |||
color: #b4b4b4; | |||
} | |||
.realRemainingTime{ | |||
.realRemainingTime { | |||
margin-left: 10rpx; | |||
color:#f96563; | |||
color: #f96563; | |||
font-size: 28rpx; | |||
} | |||
.flashSaleItemBottomBottm{ | |||
.flashSaleItemBottomBottm { | |||
display: flex; | |||
flex-direction: row; | |||
} | |||
.view1{ | |||
.view1 { | |||
width: 550rpx; | |||
display: block; | |||
} | |||
.remainingNumber{ | |||
.remainingNumber { | |||
font-size: 28rpx; | |||
color: #B4B4B4; | |||
color: #b4b4b4; | |||
} | |||
.realnumber{ | |||
.realnumber { | |||
margin-left: 10rpx; | |||
color: #f96563; | |||
font-size: 28rpx; | |||
} | |||
.buy{ | |||
.buy { | |||
position: absolute; | |||
top: 34rpx; | |||
bottom: 0; | |||
right: 20rpx; | |||
width:114rpx; | |||
width: 114rpx; | |||
height: 50rpx; | |||
line-height: 50rpx; | |||
text-align: center; | |||
background: #00C0FF; | |||
background: #00c0ff; | |||
color: #fff; | |||
border-radius: 10rpx; | |||
font-size: 28rpx; | |||
} | |||
} |