From ac3020e6d9f684f3dc868865b9ffaed5aa91ac45 Mon Sep 17 00:00:00 2001 From: meo <958484406@qq.com> Date: Fri, 31 Aug 2018 10:34:02 +0800 Subject: [PATCH] =?UTF-8?q?[=E9=A6=96=E9=A1=B5=E4=BC=98=E6=83=A0=E5=88=B8?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=8C=E9=99=90=E6=97=B6=E6=8A=A2=E8=B4=AD?= =?UTF-8?q?=E5=88=97=E8=A1=A8][=E4=BF=AE=E6=94=B9]:=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E5=88=97=E8=A1=A8=E5=92=8C=E9=99=90?= =?UTF-8?q?=E6=97=B6=E6=8A=A2=E8=B4=AD=E5=88=97=E8=A1=A8=EF=BC=8C=E4=B8=8A?= =?UTF-8?q?=E6=8B=89=E5=8A=A0=E8=BD=BD=E6=A0=B7=E5=BC=8F=E7=9A=84=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/img/loading.gif | Bin 0 -> 1737 bytes components/coupons/index.wxml | 2 +- components/coupons/index.wxss | 31 ++++++++++++++++++++------ pages/index/coupons/index.js | 35 +++++++++++++++++++---------- pages/index/coupons/index.wxml | 3 ++- pages/index/coupons/index.wxss | 13 +++++++++++ pages/order/index/index.js | 3 --- pages/order/index/index.wxss | 2 +- pages/rushToBuy/index.js | 39 +++++++++++++++++++++++++++------ pages/rushToBuy/index.wxml | 1 + pages/rushToBuy/index.wxss | 18 ++++++++++++--- 11 files changed, 112 insertions(+), 35 deletions(-) create mode 100644 assets/img/loading.gif diff --git a/assets/img/loading.gif b/assets/img/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..d53de68f71f745361b34de31fa5eb9e8b633d10c GIT binary patch literal 1737 zcmYk+eM}qo8Nl(2A$|b@cDTa{ZjFHy2(J!D&&F@~Y;y)f3?vtl5O6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fru_leDhysGd41_tW+}@?Pngn->hd>7MoLJLJpQl9R%C%hJNp0X# z7g?l5()s)jl&aS7Il8J~+g2UcWw99+h;%i%_aIt3^U(7eE*&Q0Im42?f?J) literal 0 HcmV?d00001 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;