Commit 8bf0550dfe607924024b0e2589cc4555bbfd554b
合并
Showing
6 changed files
with
58 additions
and
21 deletions
packageG/pages/user/userinfo/userinfo.js
@@ -5,7 +5,7 @@ function e(e, a, r) { | @@ -5,7 +5,7 @@ function e(e, a, r) { | ||
5 | configurable: !0, | 5 | configurable: !0, |
6 | writable: !0 | 6 | writable: !0 |
7 | }) : e[a] = r, e; | 7 | }) : e[a] = r, e; |
8 | -} | 8 | +} |
9 | 9 | ||
10 | var a = getApp(), | 10 | var a = getApp(), |
11 | r = a.globalData.setting, | 11 | r = a.globalData.setting, |
@@ -76,7 +76,9 @@ Page({ | @@ -76,7 +76,9 @@ Page({ | ||
76 | getusercode_vailtime:10,//会员二维码时效 | 76 | getusercode_vailtime:10,//会员二维码时效 |
77 | 77 | ||
78 | sele_ing:0, | 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,6 +87,11 @@ Page({ | ||
85 | var url = e.currentTarget.dataset.url; | 87 | var url = e.currentTarget.dataset.url; |
86 | getApp().goto(url); | 88 | getApp().goto(url); |
87 | }, | 89 | }, |
90 | + showtext:function(){ | ||
91 | + this.setData({ | ||
92 | + showtext1:this.data.brcode | ||
93 | + }) | ||
94 | + }, | ||
88 | //获取配置信息 | 95 | //获取配置信息 |
89 | get_config: function() { | 96 | get_config: function() { |
90 | var th = this; | 97 | var th = this; |
@@ -922,10 +929,12 @@ Page({ | @@ -922,10 +929,12 @@ Page({ | ||
922 | //base64_encode($user.mobile.'|'.date('Y-m-d H:i:s') | 929 | //base64_encode($user.mobile.'|'.date('Y-m-d H:i:s') |
923 | var val = that.data.userInfo.mobile + "|" +getnowtime+"|"+that.data.getusercode_vailtime; | 930 | var val = that.data.userInfo.mobile + "|" +getnowtime+"|"+that.data.getusercode_vailtime; |
924 | val = "^" + ut.base64_encode(val); | 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 | that.setData({ | 935 | that.setData({ |
928 | tc_hide: false, | 936 | tc_hide: false, |
937 | + brcode:userInfo.userQrcode | ||
929 | }); | 938 | }); |
930 | } | 939 | } |
931 | } | 940 | } |
packageG/pages/user/userinfo/userinfo.wxml
1 | <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> | 1 | <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> |
2 | <view class="container"> | 2 | <view class="container"> |
3 | 3 | ||
4 | - <!-- 头像,昵称,多个卡 --> | 4 | + <!-- 头像,昵称,多个卡 --> |
5 | <view class="head flex-space-between"> | 5 | <view class="head flex-space-between"> |
6 | <view class="flex-center"> | 6 | <view class="flex-center"> |
7 | 7 | ||
@@ -310,10 +310,15 @@ | @@ -310,10 +310,15 @@ | ||
310 | <view class='txt2' wx:if="{{user.address}}">{{user.address}}</view> | 310 | <view class='txt2' wx:if="{{user.address}}">{{user.address}}</view> |
311 | </view> | 311 | </view> |
312 | </view> | 312 | </view> |
313 | - <view class="m_ta"> | 313 | + <view class="canvas_box"> |
314 | <canvas class="g_img" canvas-id="qrcode" /> | 314 | <canvas class="g_img" canvas-id="qrcode" /> |
315 | </view> | 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 | </view> | 322 | </view> |
318 | </view> | 323 | </view> |
319 | </view> | 324 | </view> |
packageG/pages/user/userinfo/userinfo.wxss
@@ -271,8 +271,8 @@ input { | @@ -271,8 +271,8 @@ input { | ||
271 | } | 271 | } |
272 | 272 | ||
273 | .g_img { | 273 | .g_img { |
274 | - width: 480rpx; | ||
275 | - height: 480rpx; | 274 | + width: 350rpx; |
275 | + height: 350rpx; | ||
276 | } | 276 | } |
277 | 277 | ||
278 | .s_sao { | 278 | .s_sao { |
@@ -666,3 +666,9 @@ input { | @@ -666,3 +666,9 @@ input { | ||
666 | .lb_txt{ | 666 | .lb_txt{ |
667 | color: red; font-size: 24rpx; | 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 | \ No newline at end of file | 675 | \ No newline at end of file |
pages/user/index/index.js
@@ -47,13 +47,12 @@ Page({ | @@ -47,13 +47,12 @@ Page({ | ||
47 | add_card_data: '', //等级卡的内容 | 47 | add_card_data: '', //等级卡的内容 |
48 | getusercode_vailtime:10,//会员二维码时效 | 48 | getusercode_vailtime:10,//会员二维码时效 |
49 | hiddenCS: true, | 49 | hiddenCS: true, |
50 | - | ||
51 | is_show_recommend:false, | 50 | is_show_recommend:false, |
52 | - | ||
53 | has_rj:0, | 51 | has_rj:0, |
54 | rfmName:'成长值', | 52 | rfmName:'成长值', |
55 | is_close_chuzhi:0, | 53 | is_close_chuzhi:0, |
56 | - | 54 | + brcode:'', |
55 | + showtext1:'点击可查看条形数据', | ||
57 | pshow:0 | 56 | pshow:0 |
58 | 57 | ||
59 | }, | 58 | }, |
@@ -604,7 +603,11 @@ Page({ | @@ -604,7 +603,11 @@ Page({ | ||
604 | url: "/packageD/pages/error/error?msg=还未购买小程序", | 603 | url: "/packageD/pages/error/error?msg=还未购买小程序", |
605 | }); | 604 | }); |
606 | }, | 605 | }, |
607 | - | 606 | + showtext:function(){ |
607 | + this.setData({ | ||
608 | + showtext1:this.data.brcode | ||
609 | + }) | ||
610 | + }, | ||
608 | /** | 611 | /** |
609 | * 页面上拉触底事件的处理函数 | 612 | * 页面上拉触底事件的处理函数 |
610 | */ | 613 | */ |
@@ -663,9 +666,11 @@ Page({ | @@ -663,9 +666,11 @@ Page({ | ||
663 | var val = that.data.userInfo.mobile + "|" +getnowtime+"|"+that.data.getusercode_vailtime; | 666 | var val = that.data.userInfo.mobile + "|" +getnowtime+"|"+that.data.getusercode_vailtime; |
664 | val = "^" + ut.base64_encode(val); | 667 | val = "^" + ut.base64_encode(val); |
665 | 668 | ||
666 | - qrcode('qrcode', val, 480, 480, that); | 669 | + qrcode('qrcode', val, 350, 350, that); |
670 | + barcode('barcode', that.data.userInfo.userQrcode, 480,140); | ||
667 | that.setData({ | 671 | that.setData({ |
668 | tc_hide: false, | 672 | tc_hide: false, |
673 | + brcode:that.data.userInfo.userQrcode | ||
669 | }); | 674 | }); |
670 | } | 675 | } |
671 | } | 676 | } |
pages/user/index/index.wxml
@@ -450,11 +450,17 @@ | @@ -450,11 +450,17 @@ | ||
450 | <view wx:if="{{userInfo.address}}" class='txt2'>{{userInfo.address}}</view> | 450 | <view wx:if="{{userInfo.address}}" class='txt2'>{{userInfo.address}}</view> |
451 | </view> | 451 | </view> |
452 | </view> | 452 | </view> |
453 | - <view class="m_ta"> | ||
454 | - <!--<image class='g_img' src='https://mshop.yolipai.net//index.php?m=Home&c=Index&a=qr_code&data={{userInfo.mobile}}'></image>--> | ||
455 | - <canvas class="g_img" canvas-id="qrcode" /> | ||
456 | - </view> | ||
457 | - <view class="s_sao">前台收银扫此二维码,即可享受优惠!</view> | 453 | + |
454 | + <view class=" canvas_box" > | ||
455 | + <!--<image class='g_img' src='https://mshop.yolipai.net//index.php?m=Home&c=Index&a=qr_code&data={{userInfo.mobile}}'></image>--> | ||
456 | + <canvas class="g_img" canvas-id="qrcode" /> | ||
457 | + </view> | ||
458 | + <view style="width: 100%;display: flex;justify-content: center;"> | ||
459 | + <canvas class="barcode" style="width: 100%;height: 140rpx;" canvas-id="barcode" /> | ||
460 | + </view> | ||
461 | + <view catchtap="showtext" class="fs24" style="width: 100%;color: #898989;display: flex;text-align: center;align-content: center;justify-content: center;"> | ||
462 | + {{showtext1}} | ||
463 | + </view> | ||
458 | </view> | 464 | </view> |
459 | </view> | 465 | </view> |
460 | </view> | 466 | </view> |
pages/user/index/index.wxss
@@ -600,8 +600,8 @@ | @@ -600,8 +600,8 @@ | ||
600 | } | 600 | } |
601 | 601 | ||
602 | .g_img { | 602 | .g_img { |
603 | - width: 480rpx; | ||
604 | - height: 480rpx; | 603 | + width: 350rpx; |
604 | + height: 350rpx; | ||
605 | } | 605 | } |
606 | 606 | ||
607 | .s_sao { | 607 | .s_sao { |
@@ -778,4 +778,10 @@ button::after { | @@ -778,4 +778,10 @@ button::after { | ||
778 | width: 25rpx; | 778 | width: 25rpx; |
779 | height: 25rpx; | 779 | height: 25rpx; |
780 | margin-right: 5rpx; | 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 | \ No newline at end of file | 788 | \ No newline at end of file |