mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-06-12 10:00:57 +08:00
加入用户二维码功能
This commit is contained in:
parent
b9556ec973
commit
e277ff6875
@ -217,5 +217,31 @@ export function queryDict(_objData){
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询活动列表
|
||||
*/
|
||||
export function generatorUserQrCode( _that) {
|
||||
let obj = {
|
||||
tel: '123'
|
||||
};
|
||||
return new Promise(
|
||||
(resolve, reject) => {
|
||||
request({
|
||||
url: url.generatorUserQrCode,
|
||||
method: "POST",
|
||||
data: obj,
|
||||
//动态数据
|
||||
success: function(res) {
|
||||
uni.hideLoading();
|
||||
resolve(res.data);
|
||||
},
|
||||
fail: function(e) {
|
||||
uni.hideLoading();
|
||||
reject();
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -9,7 +9,9 @@
|
||||
<text class="username">{{ userName }}</text>
|
||||
<text class="userphone">{{ userPhone }}</text>
|
||||
<text class="userarea" @tap="_changeCommunity()">{{ communityName }} <text class="cuIcon-settings text-white margin-left-sm"></text></text>
|
||||
|
||||
</view>
|
||||
<view class="text-right" @click="_viewUserQrCode">
|
||||
<text class="cuIcon-qrcode text-white margin-left" ></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wait" v-else @tap="showLongModel">
|
||||
@ -218,6 +220,11 @@
|
||||
url: '/pages/coupon/myCoupons',
|
||||
})
|
||||
},
|
||||
_viewUserQrCode:function(){
|
||||
this.vc.navigateTo({
|
||||
url:'/pages/my/userQrCode'
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -285,4 +292,8 @@
|
||||
background: #eee;
|
||||
}
|
||||
}
|
||||
.cuIcon-qrcode{
|
||||
font-size: 48upx;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -207,7 +207,7 @@ export default {
|
||||
listCommunityPublicity: baseUrl + "app/publicity.listCommunityPublicity",
|
||||
listChargeMonthOrder: baseUrl + "app/chargeCard.listChargeMonthOrder",
|
||||
listChargeMonthCard: baseUrl + "app/chargeCard.listChargeMonthCard",
|
||||
|
||||
generatorUserQrCode: baseUrl + "app/user.generatorUserQrCode",
|
||||
|
||||
NEED_NOT_LOGIN_PAGE: [
|
||||
'pages/login/login',
|
||||
|
||||
@ -898,6 +898,15 @@
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "pages/my/userQrCode",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "用户二维码",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
],
|
||||
"tabBar": {
|
||||
"color": "#272636",
|
||||
|
||||
@ -60,8 +60,8 @@
|
||||
data() {
|
||||
return {
|
||||
logoUrl: '',
|
||||
username: '',
|
||||
password: '',
|
||||
username: '17797171234',
|
||||
password: '123456',
|
||||
appId: "",
|
||||
code: "",
|
||||
loginByPhone: false,
|
||||
|
||||
71
pages/my/userQrCode.vue
Normal file
71
pages/my/userQrCode.vue
Normal file
@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="padding-xl margin-top">
|
||||
<canvas style="width: 520upx;height: 520upx; margin: 0 auto;" canvas-id="userQrcode"></canvas>
|
||||
</view>
|
||||
|
||||
<view class="padding text-center">
|
||||
二维码有效期为5分钟
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const qrCode = require('@/lib/weapp-qrcode.js')
|
||||
import {generatorUserQrCode} from '../../api/user/userApi.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
qrCode:''
|
||||
}
|
||||
},
|
||||
onLoad(options){
|
||||
this.vc.onLoad(options);
|
||||
this._generatorQrCode();
|
||||
},
|
||||
methods: {
|
||||
_generatorQrCode:function(){
|
||||
let _that = this;
|
||||
//生成二维码
|
||||
generatorUserQrCode(this).then((res)=>{
|
||||
let data = res;
|
||||
let msg = '';
|
||||
if(data.code != 0){
|
||||
wx.showToast({
|
||||
title: data.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return ;
|
||||
}
|
||||
_that.qrCode = data.data
|
||||
new qrCode('userQrcode', {
|
||||
text: _that.qrCode?_that.qrCode:'生成二维码失败',
|
||||
width: 250,
|
||||
height: 250,
|
||||
colorDark: "#333333",
|
||||
colorLight: "#FFFFFF",
|
||||
correctLevel: qrCode.CorrectLevel.L
|
||||
})
|
||||
},(err)=>{
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
title: err,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
},
|
||||
_closeModal:function(){
|
||||
uni.navigateBack({
|
||||
delta:1
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user