| @@ -145,8 +145,8 @@ Page({ | |||||
| supportTransfer: res.data.supportTransfer || "" | supportTransfer: res.data.supportTransfer || "" | ||||
| }) | }) | ||||
| if (goGive) { | 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) { | if (this.data.supportTransfer == 1) { | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${this.data.eCardId}`, | url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${this.data.eCardId}`, | ||||
| @@ -13,8 +13,11 @@ Page({ | |||||
| myspeacialUrl: imgurl.myspeacial.url, | myspeacialUrl: imgurl.myspeacial.url, | ||||
| teliconUrl: imgurl.telicon.url, | teliconUrl: imgurl.telicon.url, | ||||
| wmhome: imgurl.wmhome.url, | wmhome: imgurl.wmhome.url, | ||||
| memberId:"000000", | |||||
| memberId: "000000", | |||||
| goHomeUrl: "", | goHomeUrl: "", | ||||
| showCode: false, | |||||
| showTimeLine: true, | |||||
| expiredSeconds: 30 | |||||
| }, | }, | ||||
| phone: function (e) { | phone: function (e) { | ||||
| console.log(e) | console.log(e) | ||||
| @@ -41,7 +44,7 @@ Page({ | |||||
| * 生命周期函数--监听页面显示 | * 生命周期函数--监听页面显示 | ||||
| */ | */ | ||||
| onShow: function () { | onShow: function () { | ||||
| this.ifPhoneInfo() | this.ifPhoneInfo() | ||||
| let that = this; | let that = this; | ||||
| that.setData({ | that.setData({ | ||||
| @@ -52,25 +55,25 @@ Page({ | |||||
| url: config.api.getDiscountInfo, | url: config.api.getDiscountInfo, | ||||
| data: {} | 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 () { | goback: function () { | ||||
| @@ -82,7 +85,7 @@ Page({ | |||||
| /** | /** | ||||
| * 二维码 | * 二维码 | ||||
| */ | */ | ||||
| qrcode: function (memberId){ | |||||
| qrcode: function (memberId) { | |||||
| let that = this; | let that = this; | ||||
| var size = that.setCanvasSize(); | var size = that.setCanvasSize(); | ||||
| let url = JSON.stringify({ | let url = JSON.stringify({ | ||||
| @@ -95,7 +98,7 @@ Page({ | |||||
| createQrCode: function (url, canvasId, cavW, cavH) { | createQrCode: function (url, canvasId, cavW, cavH) { | ||||
| //调用插件中的draw方法,绘制二维码图片 | //调用插件中的draw方法,绘制二维码图片 | ||||
| let that = this; | let that = this; | ||||
| QR.api.draw(url, canvasId, cavW, cavH,function(res){ | |||||
| QR.api.draw(url, canvasId, cavW, cavH, function (res) { | |||||
| that.setData({ | that.setData({ | ||||
| tempFilePath: res | tempFilePath: res | ||||
| }) | }) | ||||
| @@ -119,5 +122,5 @@ Page({ | |||||
| } | } | ||||
| return size; | return size; | ||||
| }, | }, | ||||
| }) | }) | ||||
| @@ -1,14 +1,29 @@ | |||||
| <!-- <button class='goback' bindtap='goback'><image src='{{wmhome}}' mode="widthFix"></image></button> --> | <!-- <button class='goback' bindtap='goback'><image src='{{wmhome}}' mode="widthFix"></image></button> --> | ||||
| <navbar back home text="我的特权" background='#FD832D' color="#fff"></navbar> | <navbar back home text="我的特权" background='#FD832D' color="#fff"></navbar> | ||||
| <view style="height:{{navigationBarHeight}} "></view> | <view style="height:{{navigationBarHeight}} "></view> | ||||
| <view class='codeBox'> | |||||
| <view class='codeBox'> | |||||
| <view class='code' > | |||||
| <view class="canWrap"> | |||||
| <canvas canvas-id="mycanvas2" style="width: 1200rpx; height: 800rpx;" /> | |||||
| <view class='code'> | |||||
| <view wx:if="{{showCode}}"> | |||||
| <view class="canWrap"> | |||||
| <canvas canvas-id="mycanvas2" style="width: 1200rpx; height: 800rpx;" /> | |||||
| </view> | |||||
| <image src="{{tempFilePath}}" mode="aspectFit" /> | |||||
| </view> | |||||
| <view wx:else class="negatived"> | |||||
| <view class="canWrap"> | |||||
| <canvas canvas-id="mycanvas2" style="width: 1200rpx; height: 800rpx;" /> | |||||
| </view> | |||||
| <view class="refreshCode">点击刷新</view> | |||||
| <image src="../../assets/images/negatived.png" mode="aspectFit" /> | |||||
| </view> | </view> | ||||
| <image src="{{tempFilePath}}" mode="aspectFit" /> | |||||
| <view class='memCode'><text>会员码:</text><text class="memNum">{{memberId}}</text></view> | |||||
| <view class="coedTiem" wx:if="{{showTimeLine}}">二维码将在 | |||||
| <text style="color:red">{{expiredSeconds}}s</text> | |||||
| 后失效 | |||||
| </view> | |||||
| <view class='memCode'><text>会员码:</text><text class="memNum">{{memberId}}</text></view> | |||||
| <view class='con'> | <view class='con'> | ||||
| <view class="title">会员等级为<text class='level'>[{{level}}]</text>对应门店的优惠折扣</view> | <view class="title">会员等级为<text class='level'>[{{level}}]</text>对应门店的优惠折扣</view> | ||||
| </view> | </view> | ||||
| @@ -20,7 +35,8 @@ | |||||
| <text><i>></i></text> | <text><i>></i></text> | ||||
| </view> | </view> | ||||
| <view class='discount'> | <view class='discount'> | ||||
| <text style='display:inline-block;'>{{item.discount/10}}</text>折</view> | |||||
| <text style='display:inline-block;'>{{item.discount/10}}</text>折 | |||||
| </view> | |||||
| <text class='tit'>{{item.merchantName}}</text> | <text class='tit'>{{item.merchantName}}</text> | ||||
| <view class='clearfix footer'> | <view class='clearfix footer'> | ||||
| <view class='fl' style='margin-top:-30rpx;margin-left:10rpx;'> | <view class='fl' style='margin-top:-30rpx;margin-left:10rpx;'> | ||||
| @@ -38,4 +54,4 @@ | |||||
| 此等级暂未开放折扣,敬请期待! | 此等级暂未开放折扣,敬请期待! | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | |||||
| </view> | |||||
| @@ -1,12 +1,15 @@ | |||||
| @import "../../app.wxss"; | @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%; | height: 100%; | ||||
| overflow: auto; | overflow: auto; | ||||
| } | } | ||||
| .none { | .none { | ||||
| font-size: 24rpx; | font-size: 24rpx; | ||||
| text-align: center; | text-align: center; | ||||
| @@ -15,6 +18,12 @@ page{ | |||||
| float: none !important; | float: none !important; | ||||
| } | } | ||||
| .coedTiem { | |||||
| text-align: center; | |||||
| color: rgba(253, 131, 45, 1); | |||||
| margin-bottom: 10rpx; | |||||
| } | |||||
| .headerbg image { | .headerbg image { | ||||
| display: block; | display: block; | ||||
| width: 100%; | width: 100%; | ||||
| @@ -160,7 +169,7 @@ page{ | |||||
| .code { | .code { | ||||
| width: 690rpx; | width: 690rpx; | ||||
| height: 800rpx; | |||||
| height: 900rpx; | |||||
| background: #fff; | background: #fff; | ||||
| margin: 20rpx auto; | margin: 20rpx auto; | ||||
| border-radius: 10rpx; | border-radius: 10rpx; | ||||
| @@ -172,35 +181,53 @@ page{ | |||||
| height: 150rpx; | height: 150rpx; | ||||
| margin: 0 auto 10rpx; | margin: 0 auto 10rpx; | ||||
| } | } | ||||
| .canWrap{ | |||||
| .canWrap { | |||||
| width: 358rpx; | width: 358rpx; | ||||
| height: 358rpx; | height: 358rpx; | ||||
| } | } | ||||
| .negatived { | |||||
| position: relative; | |||||
| } | |||||
| .negatived .refreshCode { | |||||
| position: absolute; | |||||
| top: 350rpx; | |||||
| left: 50%; | |||||
| transform: translateX(-50%); | |||||
| color: #7a7a7a; | |||||
| font-weight: 600; | |||||
| } | |||||
| .code image { | .code image { | ||||
| width: 500rpx; | width: 500rpx; | ||||
| height: 500rpx; | height: 500rpx; | ||||
| display: block; | display: block; | ||||
| margin:70rpx auto 60rpx; | |||||
| margin: 70rpx auto 60rpx; | |||||
| } | } | ||||
| .memCode{ | |||||
| .memCode { | |||||
| width: 562rpx; | width: 562rpx; | ||||
| height: 88rpx; | height: 88rpx; | ||||
| line-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; | margin: 36rpx auto 0; | ||||
| color: #666; | color: #666; | ||||
| display: block; | display: block; | ||||
| font-size: 24rpx; | font-size: 24rpx; | ||||
| text-align: center; | text-align: center; | ||||
| } | } | ||||
| .memNum{ | |||||
| font-weight:600; | |||||
| .memNum { | |||||
| font-weight: 600; | |||||
| font-size: 32rpx; | font-size: 32rpx; | ||||
| color: #3C3C3C; | color: #3C3C3C; | ||||
| font-family:PingFangSC-Medium; | |||||
| font-family: PingFangSC-Medium; | |||||
| text-align: center; | text-align: center; | ||||
| } | } | ||||
| .building{ | |||||
| .building { | |||||
| display: inline-block; | display: inline-block; | ||||
| } | } | ||||