| @@ -25,23 +25,23 @@ Page({ | |||
| loading: true, //"上拉加载"的变量,默认false,隐藏 | |||
| content: "", | |||
| mystatus: '', | |||
| showPage:false | |||
| showPage: false | |||
| }, | |||
| onLoad() { | |||
| this.getList(4, 1); | |||
| }, | |||
| onShow: function () { | |||
| onShow: function() { | |||
| let that = this; | |||
| wx.setStorage({ | |||
| key: 'couponNum', | |||
| data: "couponNum1", | |||
| }) | |||
| wx.hideTabBarRedDot({ | |||
| index:2 | |||
| index: 2 | |||
| }) | |||
| }, | |||
| // 扫一扫去支付 | |||
| gotoPay:function(e){ | |||
| gotoPay: function(e) { | |||
| let that = this; | |||
| wx.scanCode({ | |||
| success: (res) => { | |||
| @@ -55,14 +55,14 @@ Page({ | |||
| }) | |||
| }, | |||
| // 跳转到详情 | |||
| gotoConsumeDetail:function(e){ | |||
| gotoConsumeDetail: function(e) { | |||
| console.log(e.currentTarget.dataset.id) | |||
| wx.navigateTo({ | |||
| url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${e.currentTarget.dataset.id}`, | |||
| }) | |||
| }, | |||
| //点击跳转到券详情页面 | |||
| gotouse: function (e) { | |||
| gotouse: function(e) { | |||
| if (this.data.mystatus == '' || this.data.mystatus == 'undefined') { | |||
| var mystatus = e.currentTarget.dataset.couponorderstatus; | |||
| } else { | |||
| @@ -73,6 +73,11 @@ Page({ | |||
| e.currentTarget.dataset.quancode}&couponorderstatus=${mystatus}` | |||
| }); | |||
| }, | |||
| gotoBuy:function(){ | |||
| wx.navigateTo({ | |||
| url: '/pages/discountCardList/discountCardList', | |||
| }) | |||
| }, | |||
| getList(key, pageNum) { | |||
| var that = this; | |||
| console.log(key) | |||
| @@ -81,14 +86,14 @@ Page({ | |||
| loading: true, | |||
| content: "小主,我在玩命加载中...", | |||
| }); | |||
| if(key==4){ | |||
| if (key == 4) { | |||
| var data = { | |||
| pageNum: pageNum, | |||
| pageSize: 6, | |||
| couponType: "7", | |||
| couponOrderStatus: 4 | |||
| } | |||
| }else if(key=='5,6,7'){ | |||
| } else if (key == '5,6,7') { | |||
| var data = { | |||
| pageNum: pageNum, | |||
| pageSize: 6, | |||
| @@ -97,61 +102,65 @@ Page({ | |||
| } | |||
| } | |||
| 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({ | |||
| 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 { | |||
| that.setData({ | |||
| loading: true, | |||
| content: "——— 再拉裤子就掉了啦 ———" | |||
| }); | |||
| setTimeout(function () { | |||
| setTimeout(function() { | |||
| that.setData({ | |||
| loading: false | |||
| }); | |||
| @@ -165,11 +174,11 @@ Page({ | |||
| list: [], | |||
| allow_load: true, | |||
| current_scroll: detail.key, | |||
| page:1, | |||
| page: 1, | |||
| }); | |||
| this.getList(detail.key, 1); | |||
| }, | |||
| onReachBottom: function () { | |||
| onReachBottom: function() { | |||
| var that = this; | |||
| that.data.page++; | |||
| that.setData({ | |||
| @@ -28,10 +28,17 @@ | |||
| </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' 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 class="loading" wx:if="{{loading}}"> | |||
| @@ -25,6 +25,7 @@ | |||
| } | |||
| .mms { | |||
| position: relative; | |||
| width: 690rpx; | |||
| background: #fff; | |||
| padding: 36rpx 0 0; | |||
| @@ -35,7 +36,7 @@ | |||
| .expiretime { | |||
| display: block; | |||
| width: 100%!important; | |||
| width: 100% !important; | |||
| text-align: left; | |||
| text-indent: 1em; | |||
| height: 40rpx; | |||
| @@ -44,14 +45,17 @@ | |||
| color: #333; | |||
| letter-spacing: 0; | |||
| } | |||
| .expiretime .fr{ | |||
| .expiretime .fr { | |||
| margin-right: 20rpx; | |||
| } | |||
| .money{ | |||
| .money { | |||
| margin-left: 10rpx; | |||
| font-size: 30rpx; | |||
| font-weight: bold; | |||
| } | |||
| .liness { | |||
| display: block; | |||
| width: 100%; | |||
| @@ -108,7 +112,6 @@ | |||
| width: 400rpx; | |||
| } | |||
| .btns { | |||
| height: 80rpx; | |||
| line-height: 80rpx; | |||
| @@ -116,12 +119,12 @@ | |||
| color: #fff; | |||
| font-size: 28rpx; | |||
| margin-top: 46rpx; | |||
| border-top:1px solid #e6e6e6; | |||
| border-top: 1px solid #e6e6e6; | |||
| } | |||
| .active { | |||
| color: #fff; | |||
| opacity: .6; | |||
| opacity: 0.6; | |||
| } | |||
| .txt1 { | |||
| @@ -196,7 +199,39 @@ | |||
| text-align: center; | |||
| line-height: 32px; | |||
| } | |||
| .title .fr{ | |||
| .title .fr { | |||
| width: 30rpx; | |||
| 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: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='flashSaleItemTop'> | |||
| <view class='flashSaleItemTopL'> | |||
| @@ -36,6 +36,11 @@ | |||
| </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}}"> | |||
| <image src="{{loadingUrl}}" mode="widthFix"></image>{{content}} | |||
| </view> | |||
| @@ -1,11 +1,13 @@ | |||
| .flashSale,page{ | |||
| .flashSale, page { | |||
| width: 100%; | |||
| background: #f5f5f5; | |||
| padding-bottom: 30rpx; | |||
| } | |||
| .flashSale > view:nth-of-type(1){ | |||
| .flashSale > view:nth-of-type(1) { | |||
| margin-top: 0!important; | |||
| } | |||
| .loading { | |||
| text-align: center; | |||
| height: 80rpx; | |||
| @@ -13,6 +15,7 @@ | |||
| font-size: 26rpx; | |||
| color: #999; | |||
| } | |||
| .loading image { | |||
| width: 60rpx; | |||
| height: 60rpx; | |||
| @@ -110,7 +113,7 @@ | |||
| } | |||
| .realRemainingTime { | |||
| color: #FF4949; | |||
| color: #ff4949; | |||
| font-size: 28rpx; | |||
| } | |||
| @@ -175,9 +178,35 @@ | |||
| color: #ff4949; | |||
| border: 2rpx solid #ff4949; | |||
| } | |||
| progress{ | |||
| progress { | |||
| display: inline-block; | |||
| width: 200rpx; | |||
| border-radius:60rpx; | |||
| border-radius: 60rpx; | |||
| 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() { | |||
| 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 = () => { | |||
| wx.startSoterAuthentication({ | |||
| requestAuthModes: [AUTH_MODE], | |||
| @@ -44,7 +44,7 @@ | |||
| font-weight:bold; | |||
| color:rgba(51,51,51,1); | |||
| display: inline-block!important; | |||
| width: 300rpx; | |||
| width: 580rpx; | |||
| height: 60rpx; | |||
| margin-top: 20rpx; | |||
| line-height: 60rpx; | |||