@@ -25,23 +25,23 @@ Page({ | |||||
loading: true, //"上拉加载"的变量,默认false,隐藏 | loading: true, //"上拉加载"的变量,默认false,隐藏 | ||||
content: "", | content: "", | ||||
mystatus: '', | mystatus: '', | ||||
showPage:false | |||||
showPage: false | |||||
}, | }, | ||||
onLoad() { | onLoad() { | ||||
this.getList(4, 1); | this.getList(4, 1); | ||||
}, | }, | ||||
onShow: function () { | |||||
onShow: function() { | |||||
let that = this; | let that = this; | ||||
wx.setStorage({ | wx.setStorage({ | ||||
key: 'couponNum', | key: 'couponNum', | ||||
data: "couponNum1", | data: "couponNum1", | ||||
}) | }) | ||||
wx.hideTabBarRedDot({ | wx.hideTabBarRedDot({ | ||||
index:2 | |||||
index: 2 | |||||
}) | }) | ||||
}, | }, | ||||
// 扫一扫去支付 | // 扫一扫去支付 | ||||
gotoPay:function(e){ | |||||
gotoPay: function(e) { | |||||
let that = this; | let that = this; | ||||
wx.scanCode({ | wx.scanCode({ | ||||
success: (res) => { | success: (res) => { | ||||
@@ -55,14 +55,14 @@ Page({ | |||||
}) | }) | ||||
}, | }, | ||||
// 跳转到详情 | // 跳转到详情 | ||||
gotoConsumeDetail:function(e){ | |||||
gotoConsumeDetail: function(e) { | |||||
console.log(e.currentTarget.dataset.id) | console.log(e.currentTarget.dataset.id) | ||||
wx.navigateTo({ | wx.navigateTo({ | ||||
url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${e.currentTarget.dataset.id}`, | url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${e.currentTarget.dataset.id}`, | ||||
}) | }) | ||||
}, | }, | ||||
//点击跳转到券详情页面 | //点击跳转到券详情页面 | ||||
gotouse: function (e) { | |||||
gotouse: function(e) { | |||||
if (this.data.mystatus == '' || this.data.mystatus == 'undefined') { | if (this.data.mystatus == '' || this.data.mystatus == 'undefined') { | ||||
var mystatus = e.currentTarget.dataset.couponorderstatus; | var mystatus = e.currentTarget.dataset.couponorderstatus; | ||||
} else { | } else { | ||||
@@ -73,6 +73,11 @@ Page({ | |||||
e.currentTarget.dataset.quancode}&couponorderstatus=${mystatus}` | e.currentTarget.dataset.quancode}&couponorderstatus=${mystatus}` | ||||
}); | }); | ||||
}, | }, | ||||
gotoBuy:function(){ | |||||
wx.navigateTo({ | |||||
url: '/pages/discountCardList/discountCardList', | |||||
}) | |||||
}, | |||||
getList(key, pageNum) { | getList(key, pageNum) { | ||||
var that = this; | var that = this; | ||||
console.log(key) | console.log(key) | ||||
@@ -81,14 +86,14 @@ Page({ | |||||
loading: true, | loading: true, | ||||
content: "小主,我在玩命加载中...", | content: "小主,我在玩命加载中...", | ||||
}); | }); | ||||
if(key==4){ | |||||
if (key == 4) { | |||||
var data = { | var data = { | ||||
pageNum: pageNum, | pageNum: pageNum, | ||||
pageSize: 6, | pageSize: 6, | ||||
couponType: "7", | couponType: "7", | ||||
couponOrderStatus: 4 | couponOrderStatus: 4 | ||||
} | } | ||||
}else if(key=='5,6,7'){ | |||||
} else if (key == '5,6,7') { | |||||
var data = { | var data = { | ||||
pageNum: pageNum, | pageNum: pageNum, | ||||
pageSize: 6, | pageSize: 6, | ||||
@@ -97,61 +102,65 @@ Page({ | |||||
} | } | ||||
} | } | ||||
Http.get({ | Http.get({ | ||||
url: config.api.cardorderList, | |||||
data:data | |||||
}) | |||||
.then(res => { | |||||
if(res.code == 200){ | |||||
that.setData({ | |||||
showPage:true | |||||
}) | |||||
} | |||||
res.data.list.map(file => { | |||||
file.expiredTime = util.fmtDate(file.expiredTime); | |||||
if (file.remainingAmount > 0 && 500 >= file.remainingAmount){ | |||||
file.background = '#7184E2' | |||||
url: config.api.cardorderList, | |||||
data: data | |||||
}) | |||||
.then(res => { | |||||
if (res.code == 200) { | |||||
that.setData({ | |||||
showPage: true | |||||
}) | |||||
} | } | ||||
else if (file.remainingAmount > 500 && 5000 >= file.remainingAmount) { | |||||
file.background = '#63AAE6' | |||||
res.data.list.map(file => { | |||||
file.expiredTime = util.fmtDate(file.expiredTime); | |||||
if (file.couponOrderStatus == 5 || file.couponOrderStatus == 6 || file.couponOrderStatus == 7) { | |||||
file.background = 'rgba(179,180,181,1)'; | |||||
file.showImg = true; | |||||
} else if (file.couponOrderStatus == 4) { | |||||
if (file.remainingAmount > 0 && 500 >= file.remainingAmount) { | |||||
file.background = '#7184E2' | |||||
} else if (file.remainingAmount > 500 && 5000 >= file.remainingAmount) { | |||||
file.background = '#63AAE6' | |||||
} else if (file.remainingAmount > 5000) { | |||||
file.background = '#E2A471' | |||||
} | |||||
} | |||||
}); | |||||
setTimeout(function() { | |||||
that.setData({ | |||||
loading: false | |||||
}); | |||||
}, 1400); | |||||
if (pageNum >= res.data.pages) { | |||||
that.setData({ | |||||
allow_load: false | |||||
}); | |||||
} | } | ||||
else if (file.remainingAmount > 5000) { | |||||
file.background = '#E2A471' | |||||
if (pageNum == 1) { | |||||
that.setData({ | |||||
list: [] | |||||
}) | |||||
} | } | ||||
}); | |||||
setTimeout(function () { | |||||
var tmpArr = that.data.list; | |||||
tmpArr.push.apply(tmpArr, res.data.list); | |||||
that.setData({ | that.setData({ | ||||
loading: false | |||||
}); | |||||
}, 1400); | |||||
if (pageNum >= res.data.pages) { | |||||
that.setData({ | |||||
allow_load: false | |||||
}); | |||||
} | |||||
if (pageNum == 1) { | |||||
that.setData({ | |||||
list: [] | |||||
list: tmpArr | |||||
}) | }) | ||||
} | |||||
var tmpArr = that.data.list; | |||||
tmpArr.push.apply(tmpArr, res.data.list); | |||||
that.setData({ | |||||
list: tmpArr | |||||
}) | }) | ||||
}) | |||||
.catch(err => { | |||||
wx.showModal({ | |||||
title: '提示', | |||||
content: err.errMsg, | |||||
showCancel:false | |||||
.catch(err => { | |||||
wx.showModal({ | |||||
title: '提示', | |||||
content: err.errMsg, | |||||
showCancel: false | |||||
}) | |||||
}) | }) | ||||
}) | |||||
} else { | } else { | ||||
that.setData({ | that.setData({ | ||||
loading: true, | loading: true, | ||||
content: "——— 再拉裤子就掉了啦 ———" | content: "——— 再拉裤子就掉了啦 ———" | ||||
}); | }); | ||||
setTimeout(function () { | |||||
setTimeout(function() { | |||||
that.setData({ | that.setData({ | ||||
loading: false | loading: false | ||||
}); | }); | ||||
@@ -165,11 +174,11 @@ Page({ | |||||
list: [], | list: [], | ||||
allow_load: true, | allow_load: true, | ||||
current_scroll: detail.key, | current_scroll: detail.key, | ||||
page:1, | |||||
page: 1, | |||||
}); | }); | ||||
this.getList(detail.key, 1); | this.getList(detail.key, 1); | ||||
}, | }, | ||||
onReachBottom: function () { | |||||
onReachBottom: function() { | |||||
var that = this; | var that = this; | ||||
that.data.page++; | that.data.page++; | ||||
that.setData({ | that.setData({ | ||||
@@ -28,10 +28,17 @@ | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view hover-class='active' bindtap='gotoPay' data-remainingAmount="{{item.remainingAmount/100}}" data-cardId="{{item.id}}" data-couponorderstatus="{{item.couponOrderStatus}}" wx:if="{{item.couponOrderStatus==4}}" class="btns">扫一扫付款</view> | <view hover-class='active' bindtap='gotoPay' data-remainingAmount="{{item.remainingAmount/100}}" data-cardId="{{item.id}}" data-couponorderstatus="{{item.couponOrderStatus}}" wx:if="{{item.couponOrderStatus==4}}" class="btns">扫一扫付款</view> | ||||
<view hover-class='active' wx:if="{{item.couponOrderStatus!=4}}" class="btns">已失效</view> | |||||
<view hover-class='active' wx:if="{{item.couponOrderStatus!=4}}" class="btns clearfix"> | |||||
<text class='txtstatus fl' wx:if="{{item.couponOrderStatus == 5}}">已过期</text> | |||||
<text class='txtstatus fl' wx:if="{{item.couponOrderStatus == 6}}">余额不足</text> | |||||
<text class='txtstatus fl' wx:if="{{item.couponOrderStatus == 7}}">已线下退款</text> | |||||
<button class='buyagain fr' bindtap='gotoBuy'>再次购买</button> | |||||
</view> | |||||
</view> | |||||
<view class='imgicon' wx:if="{{item.showImg}}"> | |||||
<image src='./../../../assets/images/shixiao.png' mode='widthFix'></image> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="loading" wx:if="{{loading}}"> | <view class="loading" wx:if="{{loading}}"> | ||||
@@ -25,6 +25,7 @@ | |||||
} | } | ||||
.mms { | .mms { | ||||
position: relative; | |||||
width: 690rpx; | width: 690rpx; | ||||
background: #fff; | background: #fff; | ||||
padding: 36rpx 0 0; | padding: 36rpx 0 0; | ||||
@@ -35,7 +36,7 @@ | |||||
.expiretime { | .expiretime { | ||||
display: block; | display: block; | ||||
width: 100%!important; | |||||
width: 100% !important; | |||||
text-align: left; | text-align: left; | ||||
text-indent: 1em; | text-indent: 1em; | ||||
height: 40rpx; | height: 40rpx; | ||||
@@ -44,14 +45,17 @@ | |||||
color: #333; | color: #333; | ||||
letter-spacing: 0; | letter-spacing: 0; | ||||
} | } | ||||
.expiretime .fr{ | |||||
.expiretime .fr { | |||||
margin-right: 20rpx; | margin-right: 20rpx; | ||||
} | } | ||||
.money{ | |||||
.money { | |||||
margin-left: 10rpx; | margin-left: 10rpx; | ||||
font-size: 30rpx; | font-size: 30rpx; | ||||
font-weight: bold; | font-weight: bold; | ||||
} | } | ||||
.liness { | .liness { | ||||
display: block; | display: block; | ||||
width: 100%; | width: 100%; | ||||
@@ -108,7 +112,6 @@ | |||||
width: 400rpx; | width: 400rpx; | ||||
} | } | ||||
.btns { | .btns { | ||||
height: 80rpx; | height: 80rpx; | ||||
line-height: 80rpx; | line-height: 80rpx; | ||||
@@ -116,12 +119,12 @@ | |||||
color: #fff; | color: #fff; | ||||
font-size: 28rpx; | font-size: 28rpx; | ||||
margin-top: 46rpx; | margin-top: 46rpx; | ||||
border-top:1px solid #e6e6e6; | |||||
border-top: 1px solid #e6e6e6; | |||||
} | } | ||||
.active { | .active { | ||||
color: #fff; | color: #fff; | ||||
opacity: .6; | |||||
opacity: 0.6; | |||||
} | } | ||||
.txt1 { | .txt1 { | ||||
@@ -196,7 +199,39 @@ | |||||
text-align: center; | text-align: center; | ||||
line-height: 32px; | line-height: 32px; | ||||
} | } | ||||
.title .fr{ | |||||
.title .fr { | |||||
width: 30rpx; | width: 30rpx; | ||||
margin-right: 10rpx; | margin-right: 10rpx; | ||||
} | |||||
} | |||||
.imgicon { | |||||
position: absolute; | |||||
width: 140rpx; | |||||
height: 100rpx; | |||||
z-index: 100; | |||||
right: 191rpx; | |||||
top: 0; | |||||
} | |||||
.imgicon image { | |||||
width: 100%; | |||||
} | |||||
.buyagain { | |||||
width: 162rpx; | |||||
height: 57rpx; | |||||
background: rgba(255, 255, 255, 1); | |||||
border-radius: 10rpx; | |||||
font-size: 24rpx; | |||||
color: rgba(51, 51, 51, 1); | |||||
margin-right: 25rpx; | |||||
margin-top: 11rpx; | |||||
} | |||||
.txtstatus { | |||||
height: 80rpx; | |||||
font-size: 24rpx; | |||||
color: rgba(255, 53, 53, 1); | |||||
margin-left: 30rpx; | |||||
} |
@@ -1,6 +1,6 @@ | |||||
<!-- 限时抢购 查看更多对应的页面 --> | <!-- 限时抢购 查看更多对应的页面 --> | ||||
<view wx:if="{{showPage}}"> | <view wx:if="{{showPage}}"> | ||||
<view wx:for="{{list}}" wx:if="{{item.targetA!='end'}}" class='flashSaleItemWrap' wx:key="index"> | |||||
<view wx:for="{{list}}" wx:if="{{item.targetA!='end'&&list.length>0}}" class='flashSaleItemWrap' wx:key="index"> | |||||
<view class='flashSaleItem'> | <view class='flashSaleItem'> | ||||
<view class='flashSaleItemTop'> | <view class='flashSaleItemTop'> | ||||
<view class='flashSaleItemTopL'> | <view class='flashSaleItemTopL'> | ||||
@@ -36,6 +36,11 @@ | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class='expect' wx:if="{{list.length==0}}"> | |||||
<image src='./../../assets/images/shixiao.png' mode='widthFix'></image> | |||||
<text>请您敬请期待</text> | |||||
<text>我们正在筹备一大堆优惠活动</text> | |||||
</view> | |||||
<view class="loading" wx:if="{{loading}}"> | <view class="loading" wx:if="{{loading}}"> | ||||
<image src="{{loadingUrl}}" mode="widthFix"></image>{{content}} | <image src="{{loadingUrl}}" mode="widthFix"></image>{{content}} | ||||
</view> | </view> |
@@ -1,11 +1,13 @@ | |||||
.flashSale,page{ | |||||
.flashSale, page { | |||||
width: 100%; | width: 100%; | ||||
background: #f5f5f5; | background: #f5f5f5; | ||||
padding-bottom: 30rpx; | padding-bottom: 30rpx; | ||||
} | } | ||||
.flashSale > view:nth-of-type(1){ | |||||
.flashSale > view:nth-of-type(1) { | |||||
margin-top: 0!important; | margin-top: 0!important; | ||||
} | } | ||||
.loading { | .loading { | ||||
text-align: center; | text-align: center; | ||||
height: 80rpx; | height: 80rpx; | ||||
@@ -13,6 +15,7 @@ | |||||
font-size: 26rpx; | font-size: 26rpx; | ||||
color: #999; | color: #999; | ||||
} | } | ||||
.loading image { | .loading image { | ||||
width: 60rpx; | width: 60rpx; | ||||
height: 60rpx; | height: 60rpx; | ||||
@@ -110,7 +113,7 @@ | |||||
} | } | ||||
.realRemainingTime { | .realRemainingTime { | ||||
color: #FF4949; | |||||
color: #ff4949; | |||||
font-size: 28rpx; | font-size: 28rpx; | ||||
} | } | ||||
@@ -175,9 +178,35 @@ | |||||
color: #ff4949; | color: #ff4949; | ||||
border: 2rpx solid #ff4949; | border: 2rpx solid #ff4949; | ||||
} | } | ||||
progress{ | |||||
progress { | |||||
display: inline-block; | display: inline-block; | ||||
width: 200rpx; | width: 200rpx; | ||||
border-radius:60rpx; | |||||
border-radius: 60rpx; | |||||
overflow: hidden; | overflow: hidden; | ||||
} | |||||
} | |||||
.expect{ | |||||
margin-top: 60rpx; | |||||
} | |||||
.expect text{ | |||||
display: block; | |||||
text-align: center; | |||||
} | |||||
.expect text:nth-of-type(1) { | |||||
margin-top: 91rpx; | |||||
font-size: 36rpx; | |||||
color: rgba(51, 51, 51, 1); | |||||
} | |||||
.expect text:nth-of-type(2) { | |||||
font-size: 28rpx; | |||||
color: rgba(136, 136, 136, 1); | |||||
} | |||||
.expect image { | |||||
display: block; | |||||
width: 247rpx; | |||||
height: 230rpx; | |||||
margin: 0 auto; | |||||
} | |||||
@@ -60,7 +60,7 @@ Page({ | |||||
startAuth() { | startAuth() { | ||||
let that = this; | let that = this; | ||||
// 卡余额充足的时候,才可以付钱 | // 卡余额充足的时候,才可以付钱 | ||||
if (that.data.inputValue != "" && that.data.remainingAmount > that.data.inputValue) { | |||||
if (that.data.inputValue != "" && that.data.remainingAmount >= that.data.inputValue) { | |||||
const startSoterAuthentication = () => { | const startSoterAuthentication = () => { | ||||
wx.startSoterAuthentication({ | wx.startSoterAuthentication({ | ||||
requestAuthModes: [AUTH_MODE], | requestAuthModes: [AUTH_MODE], | ||||
@@ -44,7 +44,7 @@ | |||||
font-weight:bold; | font-weight:bold; | ||||
color:rgba(51,51,51,1); | color:rgba(51,51,51,1); | ||||
display: inline-block!important; | display: inline-block!important; | ||||
width: 300rpx; | |||||
width: 580rpx; | |||||
height: 60rpx; | height: 60rpx; | ||||
margin-top: 20rpx; | margin-top: 20rpx; | ||||
line-height: 60rpx; | line-height: 60rpx; | ||||