From b9032d7e88ff2ae2eb2c75c73426831f58043174 Mon Sep 17 00:00:00 2001 From: meo <958484406@qq.com> Date: Fri, 31 Aug 2018 10:57:58 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=88=91=E7=9A=84=E8=AE=A2=E5=8D=95=E8=B7=AF?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=8C=E6=88=91=E7=9A=84=E5=88=B8=E5=8C=85?= =?UTF-8?q?=E5=88=97=E8=A1=A8][=E4=BF=AE=E6=94=B9]:=E6=88=91=E7=9A=84?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E5=92=8C=E6=88=91=E7=9A=84?= =?UTF-8?q?=E5=88=B8=E5=8C=85=E5=88=97=E8=A1=A8=E4=B8=8A=E6=8B=89=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/couponorder/detail/index.wxml | 8 +-- pages/couponorder/index/index.js | 32 +++++++-- pages/couponorder/index/index.wxml | 5 +- pages/couponorder/index/index.wxss | 14 ++++ pages/order/index/index.js | 38 ++++++++--- pages/order/index/index.wxml | 5 +- pages/order/index/index.wxss | 14 ++++ pages/rushToBuy/index.js | 4 -- pages/rushToBuy/index.wxss | 100 +++++++++++++++++----------- 9 files changed, 149 insertions(+), 71 deletions(-) diff --git a/pages/couponorder/detail/index.wxml b/pages/couponorder/detail/index.wxml index 9e47fd6..afd8e8a 100644 --- a/pages/couponorder/detail/index.wxml +++ b/pages/couponorder/detail/index.wxml @@ -79,13 +79,7 @@ 购买须知 - 有效期2018.01.16 至 2018.09.20 - 除特价酒水及特价菜外全场通用 - 无需预约,消费g高峰时可能需要等位 - 没人最多购买2张 - 不可使用包间 - 堂食外带均可,可免费打包 - 每桌限用2张 + {{data.remark}} \ No newline at end of file diff --git a/pages/couponorder/index/index.js b/pages/couponorder/index/index.js index 16d6d9f..6c878d9 100644 --- a/pages/couponorder/index/index.js +++ b/pages/couponorder/index/index.js @@ -25,7 +25,9 @@ Page({ current: "0", current_scroll: "0", page: 1, - allow_load: true + allow_load: true, + loading: true, //"上拉加载"的变量,默认false,隐藏 + content:"", }, onLoad() { this.getList(0, 0); @@ -56,9 +58,10 @@ Page({ console.log(key); console.log(pageNum); if (that.data.allow_load) { - wx.showLoading({ - title: "加载中" - }); + that.setData({ + loading:true, + content:'小主,我在玩命加载中...' + }) Http.get({ url: config.api.couponOrderList, data: { @@ -71,14 +74,20 @@ Page({ res.data.list.map(file => { file.expiredTime = util.fmtDate(file.expiredTime); }); - console.log("姐姐的订单列表"); setTimeout(function() { - wx.hideLoading(); - }, 1200); + that.setData({ + loading:false, + }) + }, 1400); if (pageNum >= res.data.pages) { that.setData({ allow_load: false }); + setTimeout(function() { + that.setData({ + loading:false, + }) + }, 1400); } /** * 先赋值后渲染页面 @@ -92,6 +101,15 @@ Page({ }); } else { console.log("加载完成allow_load设置成false"); + that.setData({ + loading:true, + content:"^_^再拉裤子就掉啦ʅ(´◔౪◔)ʃ" + }) + setTimeout(function(){ + that.setData({ + loading:false, + }) + },1400) } }, handleChange({ detail }) { diff --git a/pages/couponorder/index/index.wxml b/pages/couponorder/index/index.wxml index 8b97360..340a8ec 100644 --- a/pages/couponorder/index/index.wxml +++ b/pages/couponorder/index/index.wxml @@ -11,7 +11,7 @@ - + + + {{content}} + \ No newline at end of file diff --git a/pages/couponorder/index/index.wxss b/pages/couponorder/index/index.wxss index 11c3bab..d988751 100644 --- a/pages/couponorder/index/index.wxss +++ b/pages/couponorder/index/index.wxss @@ -110,3 +110,17 @@ width: 70%; margin: 30rpx auto 0; } + +.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 6576a5c..bf70ee1 100644 --- a/pages/order/index/index.js +++ b/pages/order/index/index.js @@ -23,7 +23,9 @@ Page({ current: "", current_scroll: "1", page: 1, - allow_load: true + allow_load: true, + loading: true, //"上拉加载"的变量,默认false,隐藏 + content:"", }, onLoad(e) { this.getList(e.id, 1); @@ -39,9 +41,7 @@ Page({ }, getList(key, pageNum) { let that = this; - console.log(key); - /** * key==0 * 不发送该字段 @@ -62,23 +62,31 @@ Page({ } if (that.data.allow_load) { - wx.showLoading({ - title: "加载中" - }); + that.setData({ + loading:true, + content:'小主,我在玩命加载中...' + }) + Http.get({ url: config.api.orderList, data: variable }).then(res => { console.log(res); - console.log("姐姐的订单列表"); - setTimeout(function() { - wx.hideLoading(); - }, 1200); if (pageNum >= res.data.pages) { that.setData({ allow_load: false }); + setTimeout(function() { + that.setData({ + loading:false, + }) + }, 1400); } + setTimeout(function() { + that.setData({ + loading:false, + }) + }, 1400); /** * 先赋值后渲染页面 * concat 不会改变原数组值 @@ -89,7 +97,6 @@ Page({ list: that.data.list }); for(let i=0; i 查看详情 - + 支付 @@ -49,4 +49,7 @@ 暂无订单 + + {{content}} + \ No newline at end of file diff --git a/pages/order/index/index.wxss b/pages/order/index/index.wxss index cbb1da3..9063790 100644 --- a/pages/order/index/index.wxss +++ b/pages/order/index/index.wxss @@ -138,3 +138,17 @@ width: 100rpx; margin: 0 auto 16rpx; } + +.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/rushToBuy/index.js b/pages/rushToBuy/index.js index ea8a5be..4d823fa 100644 --- a/pages/rushToBuy/index.js +++ b/pages/rushToBuy/index.js @@ -55,10 +55,6 @@ Page({ //当前时间与优惠券下架时间做计算 console.log(that.data.day); if (page >= res.data.pages) { - // wx.showToast({ - // title: "加载完成喽", - // icon: "success" - // }); that.setData({ allow_load: false }); diff --git a/pages/rushToBuy/index.wxss b/pages/rushToBuy/index.wxss index b65a381..af36e7a 100644 --- a/pages/rushToBuy/index.wxss +++ b/pages/rushToBuy/index.wxss @@ -1,61 +1,69 @@ -.flashSale{ +.flashSale { width: 100%; height: 100%; background: #fff; } -.loading{ + +.loading { text-align: center; height: 80rpx; line-height: 80rpx; font-size: 26rpx; color: #999; } -.loading image{ + +.loading image { width: 40rpx; height: 40rpx; vertical-align: middle; margin-right: 10rpx; } -.flashSaleItemWrap{ + +.flashSaleItemWrap { width: 100%; height: 410rpx; border-bottom: 10rpx solid #ededed; } -.flashSaleItem{ + +.flashSaleItem { width: 90%; height: 410rpx; display: flex; - flex-direction: column; - background: #fff; - margin: 0 auto; + flex-direction: column; + background: #fff; + margin: 0 auto; } -.flashSaleItemTop{ + +.flashSaleItemTop { display: flex; padding-top: 28rpx; - flex-direction:row; + flex-direction: row; padding-bottom: 25rpx; border-bottom: 1rpx solid #ededed; - } -.flashSaleItemTopL{ + +.flashSaleItemTopL { flex: 1; } -.food{ + +.food { width: 248rpx; + border-radius: 10rpx; height: 184rpx; - border-radius: 30rpx; } -.flashSaleItemTopR{ + +.flashSaleItemTopR { flex: 2; flex-direction: column; margin-left: 20rpx; - } -.flashSaleItemTopRTop{ + +.flashSaleItemTopRTop { display: flex; flex-direction: column; } -.foodname{ + +.foodname { font-size: 32rpx; height: 40rpx; line-height: 40rpx; @@ -64,65 +72,77 @@ width: 406rpx; overflow: hidden; } -.small{ + +.small { font-size: 24rpx; - color: #00C0FF; + color: #00c0ff; margin-top: 15rpx; } -.flashSaleItemTopRBottom{ + +.flashSaleItemTopRBottom { margin-top: 24rpx; } -.presentPrice{ + +.presentPrice { font-size: 36rpx; color: #f96563; } -.originalPrice{ + +.originalPrice { margin-left: 20rpx; - color:#B4B4B4; + color: #b4b4b4; text-decoration: line-through; font-size: 24rpx; } -.flashSaleItemBottom{ - margin-top: 20rpx; - position: relative; + +.flashSaleItemBottom { + margin-top: 20rpx; + position: relative; } -.remainingTime{ + +.remainingTime { font-size: 28rpx; - color: #B4B4B4; + color: #b4b4b4; } -.realRemainingTime{ + +.realRemainingTime { margin-left: 10rpx; - color:#f96563; + color: #f96563; font-size: 28rpx; } -.flashSaleItemBottomBottm{ + +.flashSaleItemBottomBottm { display: flex; flex-direction: row; } -.view1{ + +.view1 { width: 550rpx; display: block; } -.remainingNumber{ + +.remainingNumber { font-size: 28rpx; - color: #B4B4B4; + color: #b4b4b4; } -.realnumber{ + +.realnumber { margin-left: 10rpx; color: #f96563; font-size: 28rpx; } -.buy{ + +.buy { position: absolute; top: 34rpx; bottom: 0; right: 20rpx; - width:114rpx; + width: 114rpx; height: 50rpx; line-height: 50rpx; text-align: center; - background: #00C0FF; + background: #00c0ff; color: #fff; border-radius: 10rpx; font-size: 28rpx; -} \ No newline at end of file +}