From 361b6351080dacb55182061744fb5b3f62681442 Mon Sep 17 00:00:00 2001 From: XiaoXinPro 14 IAH5R <568170040@qq.com> Date: Wed, 22 Mar 2023 17:59:44 +0800 Subject: [PATCH] upload --- pages/exchangeCard/exchangeCard.js | 4 +- pages/specialcourtesy/specialcourtesy.js | 49 ++++++++++--------- pages/specialcourtesy/specialcourtesy.wxml | 32 +++++++++---- pages/specialcourtesy/specialcourtesy.wxss | 55 ++++++++++++++++------ 4 files changed, 93 insertions(+), 47 deletions(-) diff --git a/pages/exchangeCard/exchangeCard.js b/pages/exchangeCard/exchangeCard.js index d32bcf4..08b58c6 100644 --- a/pages/exchangeCard/exchangeCard.js +++ b/pages/exchangeCard/exchangeCard.js @@ -145,8 +145,8 @@ Page({ supportTransfer: res.data.supportTransfer || "" }) if (goGive) { - if ((this.data.ownerUserId && this.data.eCardId) || e.detail.value.code) { - if ((this.data.owned && this.data.owned == 1) || e.detail.value.code) { + if ((this.data.ownerUserId && this.data.eCardId) || this.data.code) { + if ((this.data.owned && this.data.owned == 1) || this.data.code) { if (this.data.supportTransfer == 1) { wx.navigateTo({ url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${this.data.eCardId}`, diff --git a/pages/specialcourtesy/specialcourtesy.js b/pages/specialcourtesy/specialcourtesy.js index 22fe444..fb3939d 100644 --- a/pages/specialcourtesy/specialcourtesy.js +++ b/pages/specialcourtesy/specialcourtesy.js @@ -13,8 +13,11 @@ Page({ myspeacialUrl: imgurl.myspeacial.url, teliconUrl: imgurl.telicon.url, wmhome: imgurl.wmhome.url, - memberId:"000000", + memberId: "000000", goHomeUrl: "", + showCode: false, + showTimeLine: true, + expiredSeconds: 30 }, phone: function (e) { console.log(e) @@ -41,7 +44,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + this.ifPhoneInfo() let that = this; that.setData({ @@ -52,25 +55,25 @@ Page({ url: config.api.getDiscountInfo, data: {} }) - .then(res=>{ - that.setData({ - level: res.data.level ? res.data.level : '' - }) - that.qrcode(res.data.id); - that.setData({ - memberId: res.data.id - }) - console.log(res.data.levelMerchantList) - let discountMerchantList = []; - res.data.levelMerchantList.map(file=>{ - if (file.discount != 100){ - discountMerchantList.push(file); - } + .then(res => { + that.setData({ + level: res.data.level ? res.data.level : '' + }) + that.qrcode(res.data.id); + that.setData({ + memberId: res.data.id + }) + console.log(res.data.levelMerchantList) + let discountMerchantList = []; + res.data.levelMerchantList.map(file => { + if (file.discount != 100) { + discountMerchantList.push(file); + } + }) + that.setData({ + discountMerchantList: discountMerchantList, + }) }) - that.setData({ - discountMerchantList: discountMerchantList, - }) - }) }, goback: function () { @@ -82,7 +85,7 @@ Page({ /** * 二维码 */ - qrcode: function (memberId){ + qrcode: function (memberId) { let that = this; var size = that.setCanvasSize(); let url = JSON.stringify({ @@ -95,7 +98,7 @@ Page({ createQrCode: function (url, canvasId, cavW, cavH) { //调用插件中的draw方法,绘制二维码图片 let that = this; - QR.api.draw(url, canvasId, cavW, cavH,function(res){ + QR.api.draw(url, canvasId, cavW, cavH, function (res) { that.setData({ tempFilePath: res }) @@ -119,5 +122,5 @@ Page({ } return size; }, - + }) \ No newline at end of file diff --git a/pages/specialcourtesy/specialcourtesy.wxml b/pages/specialcourtesy/specialcourtesy.wxml index 46f21bb..4a4d3c4 100644 --- a/pages/specialcourtesy/specialcourtesy.wxml +++ b/pages/specialcourtesy/specialcourtesy.wxml @@ -1,14 +1,29 @@ - + - - - + + + + + + + + + + + + + 点击刷新 + - - 会员码:{{memberId}} + + 二维码将在 + {{expiredSeconds}}s + 后失效 + + 会员码:{{memberId}} 会员等级为[{{level}}]对应门店的优惠折扣 @@ -20,7 +35,8 @@ > - {{item.discount/10}} + {{item.discount/10}}折 + {{item.merchantName}} @@ -38,4 +54,4 @@ 此等级暂未开放折扣,敬请期待! - + \ No newline at end of file diff --git a/pages/specialcourtesy/specialcourtesy.wxss b/pages/specialcourtesy/specialcourtesy.wxss index c46eec2..fb2e9e8 100644 --- a/pages/specialcourtesy/specialcourtesy.wxss +++ b/pages/specialcourtesy/specialcourtesy.wxss @@ -1,12 +1,15 @@ @import "../../app.wxss"; -page{ - background:linear-gradient(180deg,#FD832D 0%,#FE4A16 100%); + +page { + background: linear-gradient(180deg, #FD832D 0%, #FE4A16 100%); } -.codeBox{ - background:linear-gradient(180deg,#FD832D 0%,#FE4A16 100%); + +.codeBox { + background: linear-gradient(180deg, #FD832D 0%, #FE4A16 100%); height: 100%; overflow: auto; } + .none { font-size: 24rpx; text-align: center; @@ -15,6 +18,12 @@ page{ float: none !important; } +.coedTiem { + text-align: center; + color: rgba(253, 131, 45, 1); + margin-bottom: 10rpx; +} + .headerbg image { display: block; width: 100%; @@ -160,7 +169,7 @@ page{ .code { width: 690rpx; - height: 800rpx; + height: 900rpx; background: #fff; margin: 20rpx auto; border-radius: 10rpx; @@ -172,35 +181,53 @@ page{ height: 150rpx; margin: 0 auto 10rpx; } -.canWrap{ + +.canWrap { width: 358rpx; height: 358rpx; } + +.negatived { + position: relative; +} + +.negatived .refreshCode { + position: absolute; + top: 350rpx; + left: 50%; + transform: translateX(-50%); + color: #7a7a7a; + font-weight: 600; +} + .code image { width: 500rpx; height: 500rpx; display: block; - margin:70rpx auto 60rpx; + margin: 70rpx auto 60rpx; } -.memCode{ + +.memCode { width: 562rpx; height: 88rpx; line-height: 88rpx; - border-radius:16rpx; - border:1px solid rgba(225,225,225,1); + border-radius: 16rpx; + border: 1px solid rgba(225, 225, 225, 1); margin: 36rpx auto 0; color: #666; display: block; font-size: 24rpx; text-align: center; } -.memNum{ - font-weight:600; + +.memNum { + font-weight: 600; font-size: 32rpx; color: #3C3C3C; - font-family:PingFangSC-Medium; + font-family: PingFangSC-Medium; text-align: center; } -.building{ + +.building { display: inline-block; } \ No newline at end of file