Commit 12166e3d57fa6b9debab69bc1ca45aa5a2999d9a
1 parent
879a397e
会员码增加条码
Showing
6 changed files
with
55 additions
and
16 deletions
packageG/pages/user/userinfo/userinfo.js
| ... | ... | @@ -5,7 +5,7 @@ function e(e, a, r) { |
| 5 | 5 | configurable: !0, |
| 6 | 6 | writable: !0 |
| 7 | 7 | }) : e[a] = r, e; |
| 8 | -} | |
| 8 | +} | |
| 9 | 9 | |
| 10 | 10 | var a = getApp(), |
| 11 | 11 | r = a.globalData.setting, |
| ... | ... | @@ -76,7 +76,9 @@ Page({ |
| 76 | 76 | getusercode_vailtime:10,//会员二维码时效 |
| 77 | 77 | |
| 78 | 78 | sele_ing:0, |
| 79 | - set_isstcsp:0 | |
| 79 | + set_isstcsp:0, | |
| 80 | + brcode:'', | |
| 81 | + showtext1:'点击可查看条形数据' | |
| 80 | 82 | |
| 81 | 83 | }, |
| 82 | 84 | //通过路径跳转到其他页面 |
| ... | ... | @@ -85,6 +87,11 @@ Page({ |
| 85 | 87 | var url = e.currentTarget.dataset.url; |
| 86 | 88 | getApp().goto(url); |
| 87 | 89 | }, |
| 90 | + showtext:function(){ | |
| 91 | + this.setData({ | |
| 92 | + showtext1:this.data.brcode | |
| 93 | + }) | |
| 94 | + }, | |
| 88 | 95 | //获取配置信息 |
| 89 | 96 | get_config: function() { |
| 90 | 97 | var th = this; |
| ... | ... | @@ -922,10 +929,12 @@ Page({ |
| 922 | 929 | //base64_encode($user.mobile.'|'.date('Y-m-d H:i:s') |
| 923 | 930 | var val = that.data.userInfo.mobile + "|" +getnowtime+"|"+that.data.getusercode_vailtime; |
| 924 | 931 | val = "^" + ut.base64_encode(val); |
| 925 | - | |
| 926 | - qrcode('qrcode', val, 480, 480, that); | |
| 932 | + let userInfo = getApp().globalData.userInfo; | |
| 933 | + qrcode('qrcode', val, 350, 350, that); | |
| 934 | + barcode('barcode', userInfo.userQrcode, 480,140); | |
| 927 | 935 | that.setData({ |
| 928 | 936 | tc_hide: false, |
| 937 | + brcode:userInfo.userQrcode | |
| 929 | 938 | }); |
| 930 | 939 | } |
| 931 | 940 | } | ... | ... |
packageG/pages/user/userinfo/userinfo.wxml
| 1 | 1 | <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> |
| 2 | 2 | <view class="container"> |
| 3 | 3 | |
| 4 | - <!-- 头像,昵称,多个卡 --> | |
| 4 | + <!-- 头像,昵称,多个卡 --> | |
| 5 | 5 | <view class="head flex-space-between"> |
| 6 | 6 | <view class="flex-center"> |
| 7 | 7 | |
| ... | ... | @@ -310,10 +310,15 @@ |
| 310 | 310 | <view class='txt2' wx:if="{{user.address}}">{{user.address}}</view> |
| 311 | 311 | </view> |
| 312 | 312 | </view> |
| 313 | - <view class="m_ta"> | |
| 313 | + <view class="canvas_box"> | |
| 314 | 314 | <canvas class="g_img" canvas-id="qrcode" /> |
| 315 | 315 | </view> |
| 316 | - <view class="s_sao">扫一扫上面的二维码图案,即可消费</view> | |
| 316 | + <view style="width: 100%;display: flex;justify-content: center;"> | |
| 317 | + <canvas class="barcode" style="width: 100%;height: 140rpx;" canvas-id="barcode" /> | |
| 318 | + </view> | |
| 319 | + <view catchtap="showtext" class="fs24" style="width: 100%;color: #898989;display: flex;text-align: center;align-content: center;justify-content: center;"> | |
| 320 | + {{showtext1}} | |
| 321 | + </view> | |
| 317 | 322 | </view> |
| 318 | 323 | </view> |
| 319 | 324 | </view> | ... | ... |
packageG/pages/user/userinfo/userinfo.wxss
| ... | ... | @@ -271,8 +271,8 @@ input { |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | .g_img { |
| 274 | - width: 480rpx; | |
| 275 | - height: 480rpx; | |
| 274 | + width: 350rpx; | |
| 275 | + height: 350rpx; | |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | .s_sao { |
| ... | ... | @@ -666,3 +666,9 @@ input { |
| 666 | 666 | .lb_txt{ |
| 667 | 667 | color: red; font-size: 24rpx; |
| 668 | 668 | } |
| 669 | +.canvas_box{ | |
| 670 | + display: flex; | |
| 671 | + align-items: center; | |
| 672 | + justify-content: center; | |
| 673 | + /* margin-top: 20rpx; */ | |
| 674 | +} | |
| 669 | 675 | \ No newline at end of file | ... | ... |
pages/user/index/index.js
| ... | ... | @@ -52,7 +52,9 @@ Page({ |
| 52 | 52 | |
| 53 | 53 | has_rj:0, |
| 54 | 54 | rfmName:'成长值', |
| 55 | - is_close_chuzhi:0 | |
| 55 | + is_close_chuzhi:0, | |
| 56 | + brcode:'', | |
| 57 | + showtext1:'点击可查看条形数据' | |
| 56 | 58 | |
| 57 | 59 | |
| 58 | 60 | }, |
| ... | ... | @@ -595,7 +597,11 @@ Page({ |
| 595 | 597 | url: "/packageD/pages/error/error?msg=还未购买小程序", |
| 596 | 598 | }); |
| 597 | 599 | }, |
| 598 | - | |
| 600 | + showtext:function(){ | |
| 601 | + this.setData({ | |
| 602 | + showtext1:this.data.brcode | |
| 603 | + }) | |
| 604 | + }, | |
| 599 | 605 | /** |
| 600 | 606 | * 页面上拉触底事件的处理函数 |
| 601 | 607 | */ |
| ... | ... | @@ -654,9 +660,11 @@ Page({ |
| 654 | 660 | var val = that.data.userInfo.mobile + "|" +getnowtime+"|"+that.data.getusercode_vailtime; |
| 655 | 661 | val = "^" + ut.base64_encode(val); |
| 656 | 662 | |
| 657 | - qrcode('qrcode', val, 480, 480, that); | |
| 663 | + qrcode('qrcode', val, 350, 350, that); | |
| 664 | + barcode('barcode', that.data.userInfo.userQrcode, 480,140); | |
| 658 | 665 | that.setData({ |
| 659 | 666 | tc_hide: false, |
| 667 | + brcode:that.data.userInfo.userQrcode | |
| 660 | 668 | }); |
| 661 | 669 | } |
| 662 | 670 | } | ... | ... |
pages/user/index/index.wxml
| ... | ... | @@ -376,11 +376,16 @@ |
| 376 | 376 | <view wx:if="{{userInfo.address}}" class='txt2'>{{userInfo.address}}</view> |
| 377 | 377 | </view> |
| 378 | 378 | </view> |
| 379 | - <view class="m_ta"> | |
| 379 | + <view class=" canvas_box" > | |
| 380 | 380 | <!--<image class='g_img' src='https://mshop.yolipai.net//index.php?m=Home&c=Index&a=qr_code&data={{userInfo.mobile}}'></image>--> |
| 381 | 381 | <canvas class="g_img" canvas-id="qrcode" /> |
| 382 | 382 | </view> |
| 383 | - <view class="s_sao">前台收银扫此二维码,即可享受优惠!</view> | |
| 383 | + <view style="width: 100%;display: flex;justify-content: center;"> | |
| 384 | + <canvas class="barcode" style="width: 100%;height: 140rpx;" canvas-id="barcode" /> | |
| 385 | + </view> | |
| 386 | + <view catchtap="showtext" class="fs24" style="width: 100%;color: #898989;display: flex;text-align: center;align-content: center;justify-content: center;"> | |
| 387 | + {{showtext1}} | |
| 388 | + </view> | |
| 384 | 389 | </view> |
| 385 | 390 | </view> |
| 386 | 391 | </view> | ... | ... |
pages/user/index/index.wxss
| ... | ... | @@ -600,8 +600,8 @@ |
| 600 | 600 | } |
| 601 | 601 | |
| 602 | 602 | .g_img { |
| 603 | - width: 480rpx; | |
| 604 | - height: 480rpx; | |
| 603 | + width: 350rpx; | |
| 604 | + height: 350rpx; | |
| 605 | 605 | } |
| 606 | 606 | |
| 607 | 607 | .s_sao { |
| ... | ... | @@ -778,4 +778,10 @@ button::after { |
| 778 | 778 | width: 25rpx; |
| 779 | 779 | height: 25rpx; |
| 780 | 780 | margin-right: 5rpx; |
| 781 | +} | |
| 782 | +.canvas_box{ | |
| 783 | + display: flex; | |
| 784 | + align-items: center; | |
| 785 | + justify-content: center; | |
| 786 | + /* margin-top: 20rpx; */ | |
| 781 | 787 | } |
| 782 | 788 | \ No newline at end of file | ... | ... |