From 50c15997f0efe311e8f16678770bd72f972ac0bb Mon Sep 17 00:00:00 2001 From: meo <18801474720@163.com> Date: Fri, 4 Jan 2019 20:22:10 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8D=A1=E6=B6=88=E8=B4=B9]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/ConsumeDetail/ConsumeDetail.js | 29 ++--- pages/cardorder/index/index.js | 180 ++++++++++++++------------- pages/grade/grade.wxss | 6 +- pages/order/detail/index.wxss | 2 +- pages/scanPay/scanPay.js | 13 -- 5 files changed, 110 insertions(+), 120 deletions(-) diff --git a/pages/ConsumeDetail/ConsumeDetail.js b/pages/ConsumeDetail/ConsumeDetail.js index 0351cbb..5abcaab 100644 --- a/pages/ConsumeDetail/ConsumeDetail.js +++ b/pages/ConsumeDetail/ConsumeDetail.js @@ -50,7 +50,7 @@ Page({ display: "none", showbutton: false, hidden: "hidden", - height: "auto", + height: "", more: "点击查看更多", showMore: true }, @@ -63,22 +63,22 @@ Page({ // 点击查看更多 more: function() { let that = this; - if (that.data.height == 'auto') { + if (that.data.more == '点击查看更多') { + this.setData({ + hidden: "", + height: that.data.cardDetail.merchantVoList.length * 140 + 'rpx', + more: "点击收起", + showMore: true + }) + } + else { this.setData({ hidden: "hidden", - height: "auto", + height: 4* 140 + 'rpx', more: "点击查看更多", showMore: true }) - } - // else { - // this.setData({ - // hidden: "", - // height: that.data.cardDetail.merchantVoList.length * 140 + 'rpx', - // more: "点击查看更多", - // showMore: false - // }) - // } + } }, onLoad(options) { let that = this; @@ -141,9 +141,10 @@ Page({ }) if (that.data.cardDetail.merchantVoList && that.data.cardDetail.merchantVoList.length<=4){ that.setData({ - height: that.data.cardDetail.merchantVoList.length * 140 + 'rpx' + height: that.data.cardDetail.merchantVoList.length * 140 + 'rpx', + showMore:false }) - } else if (that.data.cardDetail.merchantVoList && that.data.cardDetail.merchantVoList.length >= 4){ + } else if (that.data.cardDetail.merchantVoList && that.data.cardDetail.merchantVoList.length > 4){ that.setData({ height: 4 * 140 + 'rpx' }) diff --git a/pages/cardorder/index/index.js b/pages/cardorder/index/index.js index de1eeb6..e081b51 100644 --- a/pages/cardorder/index/index.js +++ b/pages/cardorder/index/index.js @@ -29,9 +29,11 @@ Page({ }, onShow: function() { let that = this; - if (that.data.current_scroll==4){ + console.log("onShow") + console.log(that.data.current_scroll) + if (that.data.current_scroll == "4") { that.getList(4, 1); - }else{ + } else { that.getList('5,6,7', 1); } wx.setStorage({ @@ -42,7 +44,7 @@ Page({ index: 2 }) }, - userule:function(){ + userule: function() { wx.navigateTo({ url: '/pages/cardorder/userule/userule', }) @@ -52,15 +54,15 @@ Page({ let that = this; wx.scanCode({ success: (res) => { - console.log(JSON.parse(res.result).merchant_id) - if(JSON.parse(res.result).merchant_id&&e.currentTarget.dataset.cardid&&e.currentTarget.dataset.remainingamount){ + console.log(JSON.parse(res.result).merchant_id) + if (JSON.parse(res.result).merchant_id && e.currentTarget.dataset.cardid && e.currentTarget.dataset.remainingamount) { wx.navigateTo({ url: `/pages/scanPay/scanPay?merChant=${res.result}&cardid=${e.currentTarget.dataset.cardid}&remainingAmount=${e.currentTarget.dataset.remainingamount}`, }) - }else{ + } else { wx.showToast({ - title:"未识别到商户二维码", - icon:"none", + title: "未识别到商户二维码", + icon: "none", mask: false }) } @@ -88,101 +90,101 @@ Page({ e.currentTarget.dataset.quancode}&couponorderstatus=${mystatus}` }); }, - gotoBuy:function(){ + gotoBuy: function() { wx.navigateTo({ url: '/pages/discountCardList/discountCardList', }) }, getList(key, pageNum) { var that = this; - console.log(key) - if (that.data.allow_load) { - that.setData({ - loading: true, - content: "小主,我在玩命加载中...", - }); - if (key == 4) { - var data = { - pageNum: pageNum, - pageSize: 6, - couponType: "7", - couponOrderStatus: 4 - } - } else if (key == '5,6,7') { - var data = { - pageNum: pageNum, - pageSize: 6, - couponType: "7", - statusStr: "5,6,7" - } + // if (that.data.allow_load) { + that.setData({ + loading: true, + content: "小主,我在玩命加载中...", + }); + if (key == "4") { + var data = { + pageNum: pageNum, + pageSize: 6, + couponType: "7", + couponOrderStatus: 4 } - 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.formatTime(file.expiredTime, "yyyy.MM.dd") - 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 && 29900 >= file.remainingAmount) { - file.background = '#7184E2' - } else if (file.remainingAmount >= 30000 && 49900 >= file.remainingAmount) { - file.background = '#63AAE6' - } else if (file.remainingAmount >= 50000 && 99900 >= file.remainingAmount) { - file.background = '#E2A471' - } else if (file.remainingAmount >= 100000){ - file.background = '#E67663' - } + } else if (key == '5,6,7') { + var data = { + pageNum: pageNum, + pageSize: 6, + couponType: "7", + statusStr: "5,6,7" + } + } + Http.get({ + url: config.api.cardorderList, + data: data + }) + .then(res => { + console.log(res) + if (res.code == 200) { + that.setData({ + showPage: true + }) + } + res.data.list.map(file => { + file.expiredTime = util.formatTime(file.expiredTime, "yyyy.MM.dd") + 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 && 29900 >= file.remainingAmount) { + file.background = '#7184E2' + } else if (file.remainingAmount >= 30000 && 49900 >= file.remainingAmount) { + file.background = '#63AAE6' + } else if (file.remainingAmount >= 50000 && 99900 >= file.remainingAmount) { + file.background = '#E2A471' + } else if (file.remainingAmount >= 100000) { + file.background = '#E67663' } + } + }); + setTimeout(function() { + that.setData({ + loading: false }); - setTimeout(function() { - that.setData({ - loading: false - }); - }, 1400); - if (pageNum >= res.data.pages) { - that.setData({ - allow_load: false - }); - } - if (pageNum == 1) { - that.setData({ - list: [] - }) - } - var tmpArr = that.data.list; - tmpArr.push.apply(tmpArr, res.data.list); + }, 1400); + if (pageNum >= res.data.pages && pageNum != 1) { that.setData({ - list: tmpArr + allow_load: false + }); + } + if (pageNum == 1) { + that.setData({ + list: [] }) + } + 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() { - that.setData({ - loading: false - }); - }, 1400); - } + }) + // } else { + // that.setData({ + // loading: true, + // content: "——— 再拉裤子就掉了啦 ———" + // }); + // setTimeout(function() { + // that.setData({ + // loading: false + // }); + // }, 1400); + // } }, handleChangeScroll({ detail diff --git a/pages/grade/grade.wxss b/pages/grade/grade.wxss index 6a7e309..1094f6d 100644 --- a/pages/grade/grade.wxss +++ b/pages/grade/grade.wxss @@ -57,7 +57,7 @@ padding-left: 3rpx; margin-right: 30rpx; } -.scroll-view-item:nth-of-type(1),.scroll-view-item:nth-of-type(8){ +.scroll-view-item:nth-of-type(1){ margin-right: 0; } @@ -191,8 +191,8 @@ visibility: hidden; margin-left: 10rpx; } .growthbg{ - margin:0 40rpx; - padding: 0 30rpx; + margin:80rpx auto 30rpx; + width: 700rpx; } .growthbg image{ display: block; diff --git a/pages/order/detail/index.wxss b/pages/order/detail/index.wxss index a3ca89d..d52acea 100644 --- a/pages/order/detail/index.wxss +++ b/pages/order/detail/index.wxss @@ -140,7 +140,7 @@ page { line-height: 94rpx; display: flex; justify-content: space-between; - border-bottom: 1rpx solid #eee; + /* border-bottom: 1rpx solid #eee; */ } .classif > view text { diff --git a/pages/scanPay/scanPay.js b/pages/scanPay/scanPay.js index 29a7fe2..2973606 100644 --- a/pages/scanPay/scanPay.js +++ b/pages/scanPay/scanPay.js @@ -94,11 +94,6 @@ Page({ success: (res) => { console.log(res) if (parseInt(res.isEnrolled) <= 0) { - // wx.showModal({ - // title: '错误', - // content: '您暂未录入指纹信息,请录入后重试', - // showCancel: false - // }) that.gotoPayMoney(); return } @@ -116,11 +111,6 @@ Page({ }, fail: (err) => { console.error(err); - // wx.showModal({ - // title: '抱歉', - // content: '您的设备不支持指纹识别', - // showCancel: false - // }) that.gotoPayMoney(); } }) @@ -150,7 +140,6 @@ Page({ if (res.code == 200) { res.data.list.map(file => { file.merchantVoList.map(files => { - console.log(files.id) if (files.id == that.data.merChant.merchant_id) { file.flag = true } @@ -177,8 +166,6 @@ Page({ cardId: ids, remainingAmount: e.currentTarget.dataset.remainingamount }) - - }, showModel: function() { this.setData({