Commit d9fd8cd6cd2bc58e094b8ce91a3f06783979259f
Merge branch 'dev' into 'test'
二维码的显示的修改 See merge request !455
Showing
5 changed files
with
20 additions
and
7 deletions
pages/user/index/index.js
| @@ -362,8 +362,8 @@ Page({ | @@ -362,8 +362,8 @@ Page({ | ||
| 362 | show_tc: function() { | 362 | show_tc: function() { |
| 363 | if (!this.data.userInfo) return false; | 363 | if (!this.data.userInfo) return false; |
| 364 | //base64_encode($user.mobile.'|'.date('Y-m-d H:i:s') | 364 | //base64_encode($user.mobile.'|'.date('Y-m-d H:i:s') |
| 365 | - var val= this.data.userInfo.mobile+"|"+ut.formatTime(); | ||
| 366 | - val=ut.base64_encode(val); | 365 | + var val=this.data.userInfo.mobile+"|"+ut.formatTime(); |
| 366 | + val="^"+ut.base64_encode(val); | ||
| 367 | 367 | ||
| 368 | qrcode('qrcode', val, 480, 480, this); | 368 | qrcode('qrcode', val, 480, 480, this); |
| 369 | this.setData({ | 369 | this.setData({ |
pages/user/index/index.wxml
| @@ -284,8 +284,8 @@ | @@ -284,8 +284,8 @@ | ||
| 284 | <image src="{{userInfo.head_pic}}" class="hd_img"></image> | 284 | <image src="{{userInfo.head_pic}}" class="hd_img"></image> |
| 285 | <view class="ctent_txt"> | 285 | <view class="ctent_txt"> |
| 286 | <view class='txt1'>{{userInfo.nickname}} | 286 | <view class='txt1'>{{userInfo.nickname}} |
| 287 | - <image wx:if="{{userInfo.sex==2}}" class="arrow-right" src="{{iurl}}/miniapp/images/user/wum.png"></image> | ||
| 288 | - <image wx:else class="arrow-right fu" src="{{iurl}}/miniapp/images/user/man.png"></image> | 287 | + <image wx:if="{{userInfo.sex==2}}" class="arrow-right" style="width: 35rpx; height:35rpx; top: 5rpx" src="{{iurl}}/miniapp/images/user/wum.png"></image> |
| 288 | + <image wx:else class="arrow-right fu" style="width: 35rpx; height:35rpx;top:5rpx" src="{{iurl}}/miniapp/images/user/man.png"></image> | ||
| 289 | </view> | 289 | </view> |
| 290 | <view wx:if="{{userInfo.address}}" class='txt2'>{{userInfo.address}}</view> | 290 | <view wx:if="{{userInfo.address}}" class='txt2'>{{userInfo.address}}</view> |
| 291 | </view> | 291 | </view> |
pages/user/userinfo/userinfo.js
| @@ -17,6 +17,10 @@ var a = getApp(), | @@ -17,6 +17,10 @@ var a = getApp(), | ||
| 17 | 17 | ||
| 18 | var timestamp = Date.parse(new Date()); | 18 | var timestamp = Date.parse(new Date()); |
| 19 | var date = new Date(timestamp); | 19 | var date = new Date(timestamp); |
| 20 | +const { | ||
| 21 | + barcode, | ||
| 22 | + qrcode | ||
| 23 | +} = require('../../../utils/index.js'); | ||
| 20 | 24 | ||
| 21 | Page({ | 25 | Page({ |
| 22 | data: { | 26 | data: { |
| @@ -713,6 +717,13 @@ Page({ | @@ -713,6 +717,13 @@ Page({ | ||
| 713 | 717 | ||
| 714 | //------卡片的显示和关闭-------- | 718 | //------卡片的显示和关闭-------- |
| 715 | show_tc: function() { | 719 | show_tc: function() { |
| 720 | + if (!getApp().globalData.userInfo) return false; | ||
| 721 | + //base64_encode($user.mobile.'|'.date('Y-m-d H:i:s') | ||
| 722 | + var val=getApp().globalData.userInfo.mobile+"|"+ut.formatTime(); | ||
| 723 | + val="^"+ut.base64_encode(val); | ||
| 724 | + | ||
| 725 | + qrcode('qrcode', val, 480, 480, this); | ||
| 726 | + | ||
| 716 | this.setData({ | 727 | this.setData({ |
| 717 | tc_hide: false, | 728 | tc_hide: false, |
| 718 | }); | 729 | }); |
pages/user/userinfo/userinfo.wxml
| @@ -254,7 +254,7 @@ | @@ -254,7 +254,7 @@ | ||
| 254 | </view> | 254 | </view> |
| 255 | </view> | 255 | </view> |
| 256 | <view class="m_ta"> | 256 | <view class="m_ta"> |
| 257 | - <image class='g_img' src='https://mshop.yolipai.net//index.php?m=Home&c=Index&a=qr_code&data={{user.mobile}}'></image> | 257 | + <canvas class="g_img" canvas-id="qrcode" /> |
| 258 | </view> | 258 | </view> |
| 259 | <view class="s_sao">扫一扫上面的二维码图案,即可消费</view> | 259 | <view class="s_sao">扫一扫上面的二维码图案,即可消费</view> |
| 260 | </view> | 260 | </view> |
pages/user/userinfo/userinfo.wxss
| @@ -246,9 +246,11 @@ input { | @@ -246,9 +246,11 @@ input { | ||
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | .arrow-right { | 248 | .arrow-right { |
| 249 | - width: 30rpx; | ||
| 250 | - height: 30rpx; | 249 | + width: 35rpx; |
| 250 | + height: 35rpx; | ||
| 251 | margin-left: 10rpx; | 251 | margin-left: 10rpx; |
| 252 | + position: relative; | ||
| 253 | + top: 5rpx; | ||
| 252 | } | 254 | } |
| 253 | 255 | ||
| 254 | .code { | 256 | .code { |