diff --git a/assets/img/loading.gif b/assets/img/loading.gif new file mode 100644 index 0000000..d53de68 Binary files /dev/null and b/assets/img/loading.gif differ diff --git a/components/coupons/index.wxml b/components/coupons/index.wxml index ee55585..5ac41d0 100644 --- a/components/coupons/index.wxml +++ b/components/coupons/index.wxml @@ -20,7 +20,7 @@ - 剩余: {{data.remainInventory}} + 剩余: {{data.remainInventory}} 领取 diff --git a/components/coupons/index.wxss b/components/coupons/index.wxss index 7996467..603fa6c 100644 --- a/components/coupons/index.wxss +++ b/components/coupons/index.wxss @@ -1,4 +1,5 @@ @import "../../app.wxss"; + .coupons { flex-direction: row; display: flex; @@ -6,6 +7,7 @@ position: relative; height: 184rpx; } + .coupons-border { height: 1rpx; /* width: 100%; */ @@ -15,12 +17,13 @@ position: absolute; bottom: 0; } + .coupons-img { width: 248rpx; height: 184rpx; overflow: hidden; border: 1px solid #f8f8f8; - border-radius: 10rpx; + border-radius: 10rpx; } .coupons-img image { @@ -39,13 +42,16 @@ letter-spacing: 0; line-height: 38rpx; } + .coupons-info-price { padding: 32rpx 0 0; } -.i{ + +.i { font-size: 24rpx; font-style: normal; } + .coupons-info-price-p { display: inline-block; font-size: 36rpx; @@ -53,16 +59,18 @@ line-height: 50rpx; font-weight: 600; } -.tit{ + +.tit { margin-top: 14rpx; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 300rpx; height: 40rpx; - font-weight:600; + font-weight: 600; font-size: 30rpx; } + .coupons-info-price-o { display: block; text-align: center; @@ -101,12 +109,13 @@ padding: 0 !important; font-family: PingFangSC-Semibold; font-size: 28rpx; - color: #ffffff !important; + color: #fff !important; letter-spacing: 0; height: 50rpx !important; width: 138rpx !important; line-height: 50rpx !important; } + .subtitle { font-size: 24rpx; color: #6f6f6f; @@ -118,8 +127,9 @@ height: 40rpx; margin-top: 8rpx; } + .coupons-info-manjian { - color: #6f6f6f!important; + color: #6f6f6f !important; font-weight: normal; font-size: 20rpx; line-height: 34rpx; @@ -127,6 +137,7 @@ } /**上拉加载更多**/ + .userinfo { display: flex; flex-direction: column; @@ -143,11 +154,17 @@ .userinfo-nickname { color: #aaa; } -.sy{ + +.sy { display: block; text-align: center; width: 120rpx; + font-size: 24rpx; + color: #6f6f6f; + height: 40rpx; + margin-top: 8rpx; } + .usermotto { margin-top: 200px; } diff --git a/pages/index/coupons/index.js b/pages/index/coupons/index.js index ff31dc1..4b53e61 100644 --- a/pages/index/coupons/index.js +++ b/pages/index/coupons/index.js @@ -16,12 +16,13 @@ Component({ tabs: [], list: [], flag: "", + loading: true, //"上拉加载"的变量,默认false,隐藏 + content:"", return_list: [], current: 0, current_scroll: 0, pageNum: 1, // 设置加载的第几次,默认是第一次 pageSize: 10, //返回数据的个数 - searchLoading: false, //"上拉加载"的变量,默认false,隐藏 searchLoadingComplete: false, //“没有数据”的变量,默认false,隐藏 allow_load: true // 是否允许继续加载标识 默认 true 允许,false 加载完成 }, @@ -67,10 +68,10 @@ Component({ // 券list获取 if (that.data.allow_load) { - wx.showLoading({ - title: "飞速加载中" - }); - + that.setData({ + loading:true, + content:'小主,我在玩命加载中...' + }) // 根据 key == 0 区分全部或其它tab,决定是否传参数 business if (key == 0) { var param = { @@ -92,11 +93,10 @@ Component({ data: param }).then(res => { console.log(res); + /** + * 加载完成 + */ if (pageNum >= res.data.pages) { - // wx.showToast({ - // title: "加载完成喽", - // icon: "success" - // }); that.setData({ allow_load: false }); @@ -113,10 +113,21 @@ Component({ }); }); setTimeout(function() { - wx.hideLoading(); - }, 1000); + that.setData({ + loading:false, + }) + }, 1400); } else { 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, data: { pageNum: 1, - pageSize: 10, + pageSize: 15, type: 1 } }).then(res => { diff --git a/pages/index/coupons/index.wxml b/pages/index/coupons/index.wxml index d3bf9e3..7eae47f 100644 --- a/pages/index/coupons/index.wxml +++ b/pages/index/coupons/index.wxml @@ -2,5 +2,6 @@ - + + {{content}} \ No newline at end of file diff --git a/pages/index/coupons/index.wxss b/pages/index/coupons/index.wxss index d3f6a45..f55ce4e 100644 --- a/pages/index/coupons/index.wxss +++ b/pages/index/coupons/index.wxss @@ -1,3 +1,16 @@ .index-coupons{ 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; } \ No newline at end of file diff --git a/pages/order/index/index.js b/pages/order/index/index.js index 99e1fff..6576a5c 100644 --- a/pages/order/index/index.js +++ b/pages/order/index/index.js @@ -114,13 +114,10 @@ Page({ }, onReachBottom: function() { var that = this; - console.log(that.data.page); that.data.page++; - console.log(that.data.page); that.setData({ page: that.data.page }); - console.info("after++ " + that.data.page); that.getList(that.data.current_scroll, that.data.page); } }); diff --git a/pages/order/index/index.wxss b/pages/order/index/index.wxss index 5da4ce1..cbb1da3 100644 --- a/pages/order/index/index.wxss +++ b/pages/order/index/index.wxss @@ -31,7 +31,7 @@ .logo { width: 248rpx; height: 184rpx; - border-radius: 30rpx; + border-radius: 30rpx; } .logo image { diff --git a/pages/rushToBuy/index.js b/pages/rushToBuy/index.js index 9961841..ea8a5be 100644 --- a/pages/rushToBuy/index.js +++ b/pages/rushToBuy/index.js @@ -13,7 +13,9 @@ Page({ allow_load: true, day: "", hour: "", - minute: "" + minute: "", + loading: true, //"上拉加载"的变量,默认false,隐藏 + content:"", }, /** @@ -30,13 +32,17 @@ Page({ * 判断用户是否加载完成 */ 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({ url: config.api.couponChannelList, data: { @@ -56,7 +62,17 @@ Page({ that.setData({ allow_load: false }); + setTimeout(function() { + that.setData({ + loading:false, + }) + }, 1400); } else { + setTimeout(function() { + that.setData({ + loading:false, + }) + }, 1400); /** * 页面上显示的时间 */ @@ -82,6 +98,15 @@ Page({ }); } else { 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) { diff --git a/pages/rushToBuy/index.wxml b/pages/rushToBuy/index.wxml index 0a2d42a..4f6f930 100644 --- a/pages/rushToBuy/index.wxml +++ b/pages/rushToBuy/index.wxml @@ -31,4 +31,5 @@ + {{content}} \ No newline at end of file diff --git a/pages/rushToBuy/index.wxss b/pages/rushToBuy/index.wxss index 18925a7..b65a381 100644 --- a/pages/rushToBuy/index.wxss +++ b/pages/rushToBuy/index.wxss @@ -2,13 +2,24 @@ width: 100%; height: 100%; 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{ width: 100%; height: 410rpx; - border-top: 1rpx solid #ededed; + border-bottom: 10rpx solid #ededed; } .flashSaleItem{ width: 90%; @@ -32,6 +43,7 @@ .food{ width: 248rpx; height: 184rpx; + border-radius: 30rpx; } .flashSaleItemTopR{ flex: 2;