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 | 362 | show_tc: function() { |
| 363 | 363 | if (!this.data.userInfo) return false; |
| 364 | 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 | 368 | qrcode('qrcode', val, 480, 480, this); |
| 369 | 369 | this.setData({ | ... | ... |
pages/user/index/index.wxml
| ... | ... | @@ -284,8 +284,8 @@ |
| 284 | 284 | <image src="{{userInfo.head_pic}}" class="hd_img"></image> |
| 285 | 285 | <view class="ctent_txt"> |
| 286 | 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 | 289 | </view> |
| 290 | 290 | <view wx:if="{{userInfo.address}}" class='txt2'>{{userInfo.address}}</view> |
| 291 | 291 | </view> | ... | ... |
pages/user/userinfo/userinfo.js
| ... | ... | @@ -17,6 +17,10 @@ var a = getApp(), |
| 17 | 17 | |
| 18 | 18 | var timestamp = Date.parse(new Date()); |
| 19 | 19 | var date = new Date(timestamp); |
| 20 | +const { | |
| 21 | + barcode, | |
| 22 | + qrcode | |
| 23 | +} = require('../../../utils/index.js'); | |
| 20 | 24 | |
| 21 | 25 | Page({ |
| 22 | 26 | data: { |
| ... | ... | @@ -713,6 +717,13 @@ Page({ |
| 713 | 717 | |
| 714 | 718 | //------卡片的显示和关闭-------- |
| 715 | 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 | 727 | this.setData({ |
| 717 | 728 | tc_hide: false, |
| 718 | 729 | }); | ... | ... |
pages/user/userinfo/userinfo.wxml
| ... | ... | @@ -254,7 +254,7 @@ |
| 254 | 254 | </view> |
| 255 | 255 | </view> |
| 256 | 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 | 258 | </view> |
| 259 | 259 | <view class="s_sao">扫一扫上面的二维码图案,即可消费</view> |
| 260 | 260 | </view> | ... | ... |
pages/user/userinfo/userinfo.wxss