diff --git a/app.json b/app.json index ada6d48..181f49f 100644 --- a/app.json +++ b/app.json @@ -1,7 +1,7 @@ { "pages": [ - "pages/scanPay/scanPay", "pages/index/index", + "pages/scanPay/scanPay", "pages/edit/edit", "pages/cartest/cartest", "pages/actdetail/actdetail", diff --git a/assets/images/gift.png b/assets/images/gift.png new file mode 100644 index 0000000..48f239a Binary files /dev/null and b/assets/images/gift.png differ diff --git a/assets/images/no.png b/assets/images/no.png new file mode 100644 index 0000000..78d1912 Binary files /dev/null and b/assets/images/no.png differ diff --git a/assets/images/yes.png b/assets/images/yes.png new file mode 100644 index 0000000..7c402fd Binary files /dev/null and b/assets/images/yes.png differ diff --git a/pages/ConsumeDetail/ConsumeDetail.wxml b/pages/ConsumeDetail/ConsumeDetail.wxml index 8ea5bc2..06dcfe6 100644 --- a/pages/ConsumeDetail/ConsumeDetail.wxml +++ b/pages/ConsumeDetail/ConsumeDetail.wxml @@ -16,7 +16,7 @@ - 使用门店: + 适用门店: - 交易明细: + 交易明细: {{item.merchantName}} diff --git a/pages/cardorder/index/index.wxml b/pages/cardorder/index/index.wxml index f8f5edb..1b4f23b 100644 --- a/pages/cardorder/index/index.wxml +++ b/pages/cardorder/index/index.wxml @@ -30,7 +30,7 @@ 扫一扫付款 已过期 - 余额不足 + 余额已用完 已线下退款 diff --git a/pages/rushToBuy/index.wxml b/pages/rushToBuy/index.wxml index 5891c6e..fc38a7a 100644 --- a/pages/rushToBuy/index.wxml +++ b/pages/rushToBuy/index.wxml @@ -37,7 +37,7 @@ - + 请您敬请期待 我们正在筹备一大堆优惠活动 diff --git a/pages/scanPay/scanPay.js b/pages/scanPay/scanPay.js index c95fa62..d4aacbd 100644 --- a/pages/scanPay/scanPay.js +++ b/pages/scanPay/scanPay.js @@ -10,7 +10,9 @@ Page({ data: { merChant: {}, focus: true, - inputValue: '' + inputValue: '', + cardList: [], + showModel: false, }, /** @@ -23,8 +25,6 @@ Page({ cardid: options.cardid, remainingAmount: options.remainingAmount }) - console.log(that.data.remainingAmount) - console.log("------------------remainingAmount-------------------") }, bindKeyInput(e) { console.log(e) @@ -34,99 +34,160 @@ Page({ }, gotoPayMoney: function() { let that = this; - Http.post({ - url: config.api.cardPayOrder, - data: { - cardId: that.data.cardid, - merchantCode: that.data.merChant.merchant_id, - totalFee: that.data.inputValue - } - }) - .then(res => { - console.log(res); - wx.navigateTo({ - url: '/pages/paySuccess/paySuccess', + // 卡余额充足的时候,才可以付钱 + console.log(Number(that.data.remainingAmount) >= Number(that.data.inputValue)) + if (that.data.inputValue != "" && Number(that.data.remainingAmount) >= Number(that.data.inputValue)) { + Http.post({ + url: config.api.cardPayOrder, + data: { + cardId: that.data.cardid, + merchantCode: that.data.merChant.merchant_id, + totalFee: that.data.inputValue + } }) - }) - .catch(err => { - wx.showModal({ - title: "抱歉", - content: err.message, - showCancel: false + .then(res => { + console.log(res); + if(res.code==200){ + that.startAuth(); + } }) + .catch(err => { + wx.showModal({ + title: "抱歉", + content: err.message, + showCancel: false + }) + }) + } else if (that.data.inputValue == "") { + wx.showModal({ + title: '抱歉', + content: '请输入金额', + showCancel: false + }) + } else if (that.data.inputValue != "" && Number(that.data.remainingAmount) < Number(that.data.inputValue)) { + // wx.showModal({ + // title: '抱歉', + // content: '余额不足', + // showCancel: false + // }) + that.setData({ + showModel: true }) + that.getList(); + } }, // 指纹识别 startAuth() { let that = this; - // 卡余额充足的时候,才可以付钱 - if (that.data.inputValue != "" && that.data.remainingAmount >= that.data.inputValue) { - const startSoterAuthentication = () => { - wx.startSoterAuthentication({ - requestAuthModes: [AUTH_MODE], - challenge: 'test', - authContent: '小程序支付', - success: (res) => { - this.gotoPayMoney(); - }, - fail: (err) => { + const startSoterAuthentication = () => { + wx.startSoterAuthentication({ + requestAuthModes: [AUTH_MODE], + challenge: 'test', + authContent: '请验证已有的指纹以继续', + success: (res) => { + wx.navigateTo({ + url: '/pages/paySuccess/paySuccess', + }) + }, + fail: (err) => { - } - }) - } - const checkIsEnrolled = () => { - wx.checkIsSoterEnrolledInDevice({ - checkAuthMode: AUTH_MODE, - success: (res) => { - console.log(res) - if (parseInt(res.isEnrolled) <= 0) { - wx.showModal({ - title: '错误', - content: '您暂未录入指纹信息,请录入后重试', - showCancel: false - }) - return - } - startSoterAuthentication(); - }, - fail: (err) => { - console.error(err) - } - }) - } - wx.checkIsSupportSoterAuthentication({ + } + }) + } + const checkIsEnrolled = () => { + wx.checkIsSoterEnrolledInDevice({ + checkAuthMode: AUTH_MODE, success: (res) => { console.log(res) - checkIsEnrolled() + if (parseInt(res.isEnrolled) <= 0) { + wx.showModal({ + title: '错误', + content: '您暂未录入指纹信息,请录入后重试', + showCancel: false + }) + return + } + startSoterAuthentication(); }, fail: (err) => { - console.error(err); - wx.showModal({ - title: '错误', - content: '您的设备不支持指纹识别', - showCancel: false - }) + console.error(err) } }) - } else if (that.data.inputValue == ""){ - wx.showModal({ - title: '抱歉', - content: '请输入金额', - showCancel: false + } + wx.checkIsSupportSoterAuthentication({ + success: (res) => { + console.log(res) + checkIsEnrolled() + }, + fail: (err) => { + console.error(err); + wx.showModal({ + title: '抱歉', + content: '您的设备不支持指纹识别', + showCancel: false + }) + } + }) + }, + gotonewcard: function() { + wx.navigateTo({ + url: '/pages/discountCardList/discountCardList' + }) + this.setData({ + showModel: false + }) + }, + getList() { + var that = this; + var data = { + pageNum: 1, + pageSize: 100, + couponType: "7", + couponOrderStatus: 4 + } + Http.get({ + url: config.api.cardorderList, + data: data }) - } else if (that.data.inputValue != ""&&that.data.remainingAmount < that.data.inputValue){ - wx.showModal({ - title: '抱歉', - content: '余额不足', - showCancel:false + .then(res => { + console.log(res) + 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 + } + }) + }) + that.setData({ + showPage: true, + cardList: res.data.list + }) + } + }) + .catch(err => { + wx.showModal({ + title: '提示', + content: err.errMsg, + showCancel: false + }) }) - } }, - /** - * 生命周期函数--监听页面显示 - */ - onShow: function() { + check: function(e) { + let ids = e.currentTarget.dataset.id; + this.setData({ + ids: ids, + cardId: ids, + remainingAmount: e.currentTarget.dataset.remainingamount + }) + + }, + showModel: function() { + this.setData({ + showModel: false + }) }, /** diff --git a/pages/scanPay/scanPay.wxml b/pages/scanPay/scanPay.wxml index 48fe478..5e7a82f 100644 --- a/pages/scanPay/scanPay.wxml +++ b/pages/scanPay/scanPay.wxml @@ -8,88 +8,35 @@ ¥ - + - + - + 余额不足,请选择其他优惠卡支付 - - + + - - 万达标准卡 + + + + {{item.title}} - 余额:2000 - - - - - - - 万达标准卡 - - - 余额:2000 - - - - - - - 万达标准卡 - - - 余额:2000 - - - - - - - 万达标准卡 - - - 余额:2000 - - - - - - - 万达标准卡 - - - 余额:2000 - - - - - - - 万达标准卡 - - - 余额:2000 - + 余额:{{item.remainingAmount/100}}元 + + + + - + diff --git a/pages/scanPay/scanPay.wxss b/pages/scanPay/scanPay.wxss index 7fc4021..580ade9 100644 --- a/pages/scanPay/scanPay.wxss +++ b/pages/scanPay/scanPay.wxss @@ -81,7 +81,7 @@ .card-top{ height: 75rpx; width: 100%; - background: rgb(200, 89, 99); + background: #E67663; line-height: 75rpx; text-align: center; font-size:30rpx; @@ -96,22 +96,31 @@ .card-content image{ width: 64rpx; height: 64rpx; + border-radius:10rpx; + position: absolute; + left: 20rpx; + top: 0; + bottom: 0; + margin: auto; } .card-items{ + position: relative; height: 130rpx; line-height: 130rpx; overflow: hidden; width: 94%; margin: 0 auto; - border-bottom: 1rpx solid #cecece; + border-bottom: 1rpx solid #eee; } .card-items-left{ width: 50%; float: left; + font-size: 30rpx; } .card-items-right{ width: 50%; - float: left; + float: right; + font-size: 30rpx; } .card-items-left-img{ width: 30%; @@ -133,6 +142,21 @@ width: 20%; } .checkcard-box{ - width: 80%; + width: 84%; background: #02C0FF!important; +} +.opcacity{ + opacity: .2!important; +} +.icons{ + width: 40rpx; + height: 40rpx; + position: absolute; + top: 0; + bottom: 0; + right: 20rpx; + margin: auto; +} +.icons image{ + width:100%; } \ No newline at end of file diff --git a/pages/specialcourtesy/specialcourtesy.wxml b/pages/specialcourtesy/specialcourtesy.wxml index 5d4f7f0..5885c7f 100644 --- a/pages/specialcourtesy/specialcourtesy.wxml +++ b/pages/specialcourtesy/specialcourtesy.wxml @@ -5,7 +5,7 @@ 以下为商城会员对应门店的优惠折扣 - + >