| @@ -20,7 +20,7 @@ | |||||
| <view class="coupons-btn"> | <view class="coupons-btn"> | ||||
| <!-- 优惠券价格 --> | <!-- 优惠券价格 --> | ||||
| <view class="coupons-info-price"> | <view class="coupons-info-price"> | ||||
| <view class="coupons-info-name subtitle sy">剩余: {{data.remainInventory}}</view> | |||||
| <view class="coupons-info-name sy">剩余: {{data.remainInventory}}</view> | |||||
| <!-- <text class="coupons-info-price-o"><text class='i'>¥</text>{{data.priceStr}}</text> --> | <!-- <text class="coupons-info-price-o"><text class='i'>¥</text>{{data.priceStr}}</text> --> | ||||
| </view> | </view> | ||||
| <i-button i-class="coupons-btn-gm" wx:if="{{data.salePriceStr==0}}" data-date='{{data}}'>领取</i-button> | <i-button i-class="coupons-btn-gm" wx:if="{{data.salePriceStr==0}}" data-date='{{data}}'>领取</i-button> | ||||
| @@ -1,4 +1,5 @@ | |||||
| @import "../../app.wxss"; | @import "../../app.wxss"; | ||||
| .coupons { | .coupons { | ||||
| flex-direction: row; | flex-direction: row; | ||||
| display: flex; | display: flex; | ||||
| @@ -6,6 +7,7 @@ | |||||
| position: relative; | position: relative; | ||||
| height: 184rpx; | height: 184rpx; | ||||
| } | } | ||||
| .coupons-border { | .coupons-border { | ||||
| height: 1rpx; | height: 1rpx; | ||||
| /* width: 100%; */ | /* width: 100%; */ | ||||
| @@ -15,12 +17,13 @@ | |||||
| position: absolute; | position: absolute; | ||||
| bottom: 0; | bottom: 0; | ||||
| } | } | ||||
| .coupons-img { | .coupons-img { | ||||
| width: 248rpx; | width: 248rpx; | ||||
| height: 184rpx; | height: 184rpx; | ||||
| overflow: hidden; | overflow: hidden; | ||||
| border: 1px solid #f8f8f8; | border: 1px solid #f8f8f8; | ||||
| border-radius: 10rpx; | |||||
| border-radius: 10rpx; | |||||
| } | } | ||||
| .coupons-img image { | .coupons-img image { | ||||
| @@ -39,13 +42,16 @@ | |||||
| letter-spacing: 0; | letter-spacing: 0; | ||||
| line-height: 38rpx; | line-height: 38rpx; | ||||
| } | } | ||||
| .coupons-info-price { | .coupons-info-price { | ||||
| padding: 32rpx 0 0; | padding: 32rpx 0 0; | ||||
| } | } | ||||
| .i{ | |||||
| .i { | |||||
| font-size: 24rpx; | font-size: 24rpx; | ||||
| font-style: normal; | font-style: normal; | ||||
| } | } | ||||
| .coupons-info-price-p { | .coupons-info-price-p { | ||||
| display: inline-block; | display: inline-block; | ||||
| font-size: 36rpx; | font-size: 36rpx; | ||||
| @@ -53,16 +59,18 @@ | |||||
| line-height: 50rpx; | line-height: 50rpx; | ||||
| font-weight: 600; | font-weight: 600; | ||||
| } | } | ||||
| .tit{ | |||||
| .tit { | |||||
| margin-top: 14rpx; | margin-top: 14rpx; | ||||
| overflow: hidden; | overflow: hidden; | ||||
| white-space: nowrap; | white-space: nowrap; | ||||
| text-overflow: ellipsis; | text-overflow: ellipsis; | ||||
| width: 300rpx; | width: 300rpx; | ||||
| height: 40rpx; | height: 40rpx; | ||||
| font-weight:600; | |||||
| font-weight: 600; | |||||
| font-size: 30rpx; | font-size: 30rpx; | ||||
| } | } | ||||
| .coupons-info-price-o { | .coupons-info-price-o { | ||||
| display: block; | display: block; | ||||
| text-align: center; | text-align: center; | ||||
| @@ -101,12 +109,13 @@ | |||||
| padding: 0 !important; | padding: 0 !important; | ||||
| font-family: PingFangSC-Semibold; | font-family: PingFangSC-Semibold; | ||||
| font-size: 28rpx; | font-size: 28rpx; | ||||
| color: #ffffff !important; | |||||
| color: #fff !important; | |||||
| letter-spacing: 0; | letter-spacing: 0; | ||||
| height: 50rpx !important; | height: 50rpx !important; | ||||
| width: 138rpx !important; | width: 138rpx !important; | ||||
| line-height: 50rpx !important; | line-height: 50rpx !important; | ||||
| } | } | ||||
| .subtitle { | .subtitle { | ||||
| font-size: 24rpx; | font-size: 24rpx; | ||||
| color: #6f6f6f; | color: #6f6f6f; | ||||
| @@ -118,8 +127,9 @@ | |||||
| height: 40rpx; | height: 40rpx; | ||||
| margin-top: 8rpx; | margin-top: 8rpx; | ||||
| } | } | ||||
| .coupons-info-manjian { | .coupons-info-manjian { | ||||
| color: #6f6f6f!important; | |||||
| color: #6f6f6f !important; | |||||
| font-weight: normal; | font-weight: normal; | ||||
| font-size: 20rpx; | font-size: 20rpx; | ||||
| line-height: 34rpx; | line-height: 34rpx; | ||||
| @@ -127,6 +137,7 @@ | |||||
| } | } | ||||
| /**上拉加载更多**/ | /**上拉加载更多**/ | ||||
| .userinfo { | .userinfo { | ||||
| display: flex; | display: flex; | ||||
| flex-direction: column; | flex-direction: column; | ||||
| @@ -143,11 +154,17 @@ | |||||
| .userinfo-nickname { | .userinfo-nickname { | ||||
| color: #aaa; | color: #aaa; | ||||
| } | } | ||||
| .sy{ | |||||
| .sy { | |||||
| display: block; | display: block; | ||||
| text-align: center; | text-align: center; | ||||
| width: 120rpx; | width: 120rpx; | ||||
| font-size: 24rpx; | |||||
| color: #6f6f6f; | |||||
| height: 40rpx; | |||||
| margin-top: 8rpx; | |||||
| } | } | ||||
| .usermotto { | .usermotto { | ||||
| margin-top: 200px; | margin-top: 200px; | ||||
| } | } | ||||
| @@ -16,12 +16,13 @@ Component({ | |||||
| tabs: [], | tabs: [], | ||||
| list: [], | list: [], | ||||
| flag: "", | flag: "", | ||||
| loading: true, //"上拉加载"的变量,默认false,隐藏 | |||||
| content:"", | |||||
| return_list: [], | return_list: [], | ||||
| current: 0, | current: 0, | ||||
| current_scroll: 0, | current_scroll: 0, | ||||
| pageNum: 1, // 设置加载的第几次,默认是第一次 | pageNum: 1, // 设置加载的第几次,默认是第一次 | ||||
| pageSize: 10, //返回数据的个数 | pageSize: 10, //返回数据的个数 | ||||
| searchLoading: false, //"上拉加载"的变量,默认false,隐藏 | |||||
| searchLoadingComplete: false, //“没有数据”的变量,默认false,隐藏 | searchLoadingComplete: false, //“没有数据”的变量,默认false,隐藏 | ||||
| allow_load: true // 是否允许继续加载标识 默认 true 允许,false 加载完成 | allow_load: true // 是否允许继续加载标识 默认 true 允许,false 加载完成 | ||||
| }, | }, | ||||
| @@ -67,10 +68,10 @@ Component({ | |||||
| // 券list获取 | // 券list获取 | ||||
| if (that.data.allow_load) { | if (that.data.allow_load) { | ||||
| wx.showLoading({ | |||||
| title: "飞速加载中" | |||||
| }); | |||||
| that.setData({ | |||||
| loading:true, | |||||
| content:'小主,我在玩命加载中...' | |||||
| }) | |||||
| // 根据 key == 0 区分全部或其它tab,决定是否传参数 business | // 根据 key == 0 区分全部或其它tab,决定是否传参数 business | ||||
| if (key == 0) { | if (key == 0) { | ||||
| var param = { | var param = { | ||||
| @@ -92,11 +93,10 @@ Component({ | |||||
| data: param | data: param | ||||
| }).then(res => { | }).then(res => { | ||||
| console.log(res); | console.log(res); | ||||
| /** | |||||
| * 加载完成 | |||||
| */ | |||||
| if (pageNum >= res.data.pages) { | if (pageNum >= res.data.pages) { | ||||
| // wx.showToast({ | |||||
| // title: "加载完成喽", | |||||
| // icon: "success" | |||||
| // }); | |||||
| that.setData({ | that.setData({ | ||||
| allow_load: false | allow_load: false | ||||
| }); | }); | ||||
| @@ -113,10 +113,21 @@ Component({ | |||||
| }); | }); | ||||
| }); | }); | ||||
| setTimeout(function() { | setTimeout(function() { | ||||
| wx.hideLoading(); | |||||
| }, 1000); | |||||
| that.setData({ | |||||
| loading:false, | |||||
| }) | |||||
| }, 1400); | |||||
| } else { | } else { | ||||
| console.info("allow_load==false 已禁止加载"); | console.info("allow_load==false 已禁止加载"); | ||||
| that.setData({ | |||||
| loading:true, | |||||
| content:"^_^再拉裤子就掉啦ʅ(´◔౪◔)ʃ" | |||||
| }) | |||||
| setTimeout(function(){ | |||||
| that.setData({ | |||||
| loading:false, | |||||
| }) | |||||
| },1400) | |||||
| } | } | ||||
| }; | }; | ||||
| @@ -134,7 +145,7 @@ Component({ | |||||
| url: config.api.businessList, | url: config.api.businessList, | ||||
| data: { | data: { | ||||
| pageNum: 1, | pageNum: 1, | ||||
| pageSize: 10, | |||||
| pageSize: 15, | |||||
| type: 1 | type: 1 | ||||
| } | } | ||||
| }).then(res => { | }).then(res => { | ||||
| @@ -2,5 +2,6 @@ | |||||
| <i-tabs current="{{current_scroll}}" scroll bindchange="handleChangeScroll"> | <i-tabs current="{{current_scroll}}" scroll bindchange="handleChangeScroll"> | ||||
| <i-tab wx:for="{{tabs}}" wx:key="unique" key="{{item.id}}" title="{{item.title}}"></i-tab> | <i-tab wx:for="{{tabs}}" wx:key="unique" key="{{item.id}}" title="{{item.title}}"></i-tab> | ||||
| </i-tabs> | </i-tabs> | ||||
| <c-coupons wx:for="{{list}}" paramAtoB="{{scrollHeight}}" wx:key="unique" data="{{item}}" /> | |||||
| <c-coupons wx:for="{{list}}" paramAtoB="{{loading}}" wx:key="unique" data="{{item}}" /> | |||||
| <view class="loading" wx:if="{{loading}}"><image src="./../../../assets/img/loading.gif" mode="widthFix"></image>{{content}}</view> | |||||
| </view> | </view> | ||||
| @@ -1,3 +1,16 @@ | |||||
| .index-coupons{ | .index-coupons{ | ||||
| height:820rpx; | height:820rpx; | ||||
| } | |||||
| .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; | |||||
| } | } | ||||
| @@ -114,13 +114,10 @@ Page({ | |||||
| }, | }, | ||||
| onReachBottom: function() { | onReachBottom: function() { | ||||
| var that = this; | var that = this; | ||||
| console.log(that.data.page); | |||||
| that.data.page++; | that.data.page++; | ||||
| console.log(that.data.page); | |||||
| that.setData({ | that.setData({ | ||||
| page: that.data.page | page: that.data.page | ||||
| }); | }); | ||||
| console.info("after++ " + that.data.page); | |||||
| that.getList(that.data.current_scroll, that.data.page); | that.getList(that.data.current_scroll, that.data.page); | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -31,7 +31,7 @@ | |||||
| .logo { | .logo { | ||||
| width: 248rpx; | width: 248rpx; | ||||
| height: 184rpx; | height: 184rpx; | ||||
| border-radius: 30rpx; | |||||
| border-radius: 30rpx; | |||||
| } | } | ||||
| .logo image { | .logo image { | ||||
| @@ -13,7 +13,9 @@ Page({ | |||||
| allow_load: true, | allow_load: true, | ||||
| day: "", | day: "", | ||||
| hour: "", | hour: "", | ||||
| minute: "" | |||||
| minute: "", | |||||
| loading: true, //"上拉加载"的变量,默认false,隐藏 | |||||
| content:"", | |||||
| }, | }, | ||||
| /** | /** | ||||
| @@ -30,13 +32,17 @@ Page({ | |||||
| * 判断用户是否加载完成 | * 判断用户是否加载完成 | ||||
| */ | */ | ||||
| if (that.data.allow_load) { | if (that.data.allow_load) { | ||||
| wx.showLoading({ | |||||
| title: "加载中" | |||||
| }); | |||||
| // wx.showLoading({ | |||||
| // title: "加载中" | |||||
| // }); | |||||
| that.setData({ | |||||
| loading:true, | |||||
| content:'小主,我在玩命加载中...' | |||||
| }) | |||||
| setTimeout(function() { | |||||
| wx.hideLoading(); | |||||
| }, 1200); | |||||
| // setTimeout(function() { | |||||
| // wx.hideLoading(); | |||||
| // }, 1200); | |||||
| Http.get({ | Http.get({ | ||||
| url: config.api.couponChannelList, | url: config.api.couponChannelList, | ||||
| data: { | data: { | ||||
| @@ -56,7 +62,17 @@ Page({ | |||||
| that.setData({ | that.setData({ | ||||
| allow_load: false | allow_load: false | ||||
| }); | }); | ||||
| setTimeout(function() { | |||||
| that.setData({ | |||||
| loading:false, | |||||
| }) | |||||
| }, 1400); | |||||
| } else { | } else { | ||||
| setTimeout(function() { | |||||
| that.setData({ | |||||
| loading:false, | |||||
| }) | |||||
| }, 1400); | |||||
| /** | /** | ||||
| * 页面上显示的时间 | * 页面上显示的时间 | ||||
| */ | */ | ||||
| @@ -82,6 +98,15 @@ Page({ | |||||
| }); | }); | ||||
| } else { | } else { | ||||
| console.info("allow_load==false 已禁止加载"); | console.info("allow_load==false 已禁止加载"); | ||||
| that.setData({ | |||||
| loading:true, | |||||
| content:"^_^再拉裤子就掉啦ʅ(´◔౪◔)ʃ" | |||||
| }) | |||||
| setTimeout(function(){ | |||||
| that.setData({ | |||||
| loading:false, | |||||
| }) | |||||
| },1400) | |||||
| } | } | ||||
| }; | }; | ||||
| if (app.globalData.token && app.globalData.token != null) { | if (app.globalData.token && app.globalData.token != null) { | ||||
| @@ -31,4 +31,5 @@ | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class="loading" wx:if="{{loading}}"><image src="./../../assets/img/loading.gif" mode="widthFix"></image>{{content}}</view> | |||||
| </view> | </view> | ||||
| @@ -2,13 +2,24 @@ | |||||
| width: 100%; | width: 100%; | ||||
| height: 100%; | height: 100%; | ||||
| background: #fff; | background: #fff; | ||||
| } | |||||
| .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; | |||||
| } | } | ||||
| .flashSaleItemWrap{ | .flashSaleItemWrap{ | ||||
| width: 100%; | width: 100%; | ||||
| height: 410rpx; | height: 410rpx; | ||||
| border-top: 1rpx solid #ededed; | |||||
| border-bottom: 10rpx solid #ededed; | |||||
| } | } | ||||
| .flashSaleItem{ | .flashSaleItem{ | ||||
| width: 90%; | width: 90%; | ||||
| @@ -32,6 +43,7 @@ | |||||
| .food{ | .food{ | ||||
| width: 248rpx; | width: 248rpx; | ||||
| height: 184rpx; | height: 184rpx; | ||||
| border-radius: 30rpx; | |||||
| } | } | ||||
| .flashSaleItemTopR{ | .flashSaleItemTopR{ | ||||
| flex: 2; | flex: 2; | ||||