加入用户二维码功能

This commit is contained in:
Your Name 2023-05-30 02:29:30 +08:00
parent b9556ec973
commit e277ff6875
6 changed files with 162 additions and 45 deletions

View File

@ -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();
}
});
})
}

View File

@ -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>

View File

@ -142,11 +142,11 @@ export default {
queryShopType: baseUrl + 'app/shopType/queryShopType', //查询店铺类型
// 家政服务类型(菜单)
queryHousekeepingType: baseUrl + 'app/housekeepingType/queryHousekeepingType',
queryMainCategoryAllGoods: baseUrl + "app/productCategory/queryMainCategoryAllGoods",
queryPhoneMainCategoryProduct: baseUrl + "app/product.queryPhoneMainCategoryProduct",
queryMainCategory: baseUrl + "app/productCategory/queryMainCategory",
queryMainCategoryAllGoods: baseUrl + "app/productCategory/queryMainCategoryAllGoods",
queryPhoneMainCategoryProduct: baseUrl + "app/product.queryPhoneMainCategoryProduct",
queryMainCategory: baseUrl + "app/productCategory/queryMainCategory",
queryShopCommunity: baseUrl + "app/shop/queryShopCommunity",
saveAddVisit: baseUrl + "app/visit.saveVisit",
queryReportInfoAnswerByOpenId: baseUrl + "app/reportInfoAnswer/queryReportInfoAnswerByOpenId",
@ -169,45 +169,45 @@ export default {
unifiedPayment: baseUrl + "app/payment.unifiedPayment",
// 修改预约订单
saveCommunitySpacePersonTime: baseUrl + "app/communitySpace.saveCommunitySpacePersonTime",
listEquipmentAccount:baseUrl +"app/equipmentAccount.listEquipmentAccount",
listMaintainanceTaskDetail:baseUrl +"app/maintainanceTask.listMaintainanceTaskDetail",
listInspectionTaskDetails:baseUrl +"app/inspectionTaskDetail.listInspectionTaskDetails",
// 优惠券核销二维码生成
generatorCouponQrcode:baseUrl +"app/couponProperty.generatorCouponQrcode",
computePayFeeCoupon:baseUrl +"app/coupon.computePayFeeCoupon",
//查询停车场
listParkingAreas:baseUrl+"app/parkingArea.listParkingAreas",
couponPropertyUserGiftCar:baseUrl+"app/couponProperty.couponPropertyUserGiftCar",
listReserveCatalog:baseUrl+"app/reserve.listReserveCatalog", // 查询预约目录
listReserveGoods:baseUrl+"app/reserve.listReserveGoods", // 查询预约商品
listReserveParams:baseUrl+"app/reserve.listReserveParams", // 查询预约商品
listReserveGoodsOrderTime:baseUrl+"app/reserveOrder.listMyReserveGoodsOrderTime", // 查询预约订单
deleteReserveGoodsPerson:baseUrl+"app/reserveOrder.deleteReserveGoodsPerson", // 查询预约订单
listProductSeckill: baseUrl + "app/productSeckill.listProductSeckill",
saveCommunitySpacePersonTime: baseUrl + "app/communitySpace.saveCommunitySpacePersonTime",
listEquipmentAccount: baseUrl + "app/equipmentAccount.listEquipmentAccount",
listMaintainanceTaskDetail: baseUrl + "app/maintainanceTask.listMaintainanceTaskDetail",
listInspectionTaskDetails: baseUrl + "app/inspectionTaskDetail.listInspectionTaskDetails",
// 优惠券核销二维码生成
generatorCouponQrcode: baseUrl + "app/couponProperty.generatorCouponQrcode",
computePayFeeCoupon: baseUrl + "app/coupon.computePayFeeCoupon",
//查询停车场
listParkingAreas: baseUrl + "app/parkingArea.listParkingAreas",
couponPropertyUserGiftCar: baseUrl + "app/couponProperty.couponPropertyUserGiftCar",
listReserveCatalog: baseUrl + "app/reserve.listReserveCatalog", // 查询预约目录
listReserveGoods: baseUrl + "app/reserve.listReserveGoods", // 查询预约商品
listReserveParams: baseUrl + "app/reserve.listReserveParams", // 查询预约商品
listReserveGoodsOrderTime: baseUrl + "app/reserveOrder.listMyReserveGoodsOrderTime", // 查询预约订单
deleteReserveGoodsPerson: baseUrl + "app/reserveOrder.deleteReserveGoodsPerson", // 查询预约订单
listProductSeckill: baseUrl + "app/productSeckill.listProductSeckill",
listProductGroup: baseUrl + "app/productGroup.listProductGroup",
listRegisterProtocol: baseUrl + "app/system.listRegisterProtocol",
listRegisterProtocol: baseUrl + "app/system.listRegisterProtocol",
queryCurrentOwner: baseUrl + "app/owner.queryCurrentOwner",
listItemReleaseType: baseUrl+"app/itemRelease.listItemReleaseType",
queryFirstAuditStaff: baseUrl+"app/oaWorkflow.queryFirstAuditStaff",
saveItemRelease: baseUrl+"app/itemRelease.saveItemRelease",
listMyItemRelease: baseUrl+"app/itemRelease.listMyItemRelease",
listItemReleaseRes: baseUrl+"app/itemRelease.listItemReleaseRes",
queryOaWorkflowUser: baseUrl+"app/oaWorkflow/queryOaWorkflowUser",
listChargeMachine:baseUrl+"app/chargeMachine.listChargeMachine",
listChargeMachinePort:baseUrl+"app/chargeMachine.listChargeMachinePort",
listExamineStaff:baseUrl+"app/examine.listExamineStaff", // 查询打分员工
startCharge:baseUrl+"app/chargeMachine.startCharge", // 开始充电
stopCharge:baseUrl+"app/chargeMachine.stopCharge", // 结束充电
listChargeMachineOrder:baseUrl+"app/chargeMachine.listChargeMachineOrder", // 查询充电订单
saveExamineStaffValue:baseUrl+"app/examine.saveExamineStaffValue", // 查询充电订单
listExamineStaffValue:baseUrl+"app/examine.listExamineStaffValue", // 查询充电订单
listMeterMachine:baseUrl+"app/meterMachine.listMeterMachine",
queryDict:baseUrl+"callComponent/core/list",
listCommunityPublicity:baseUrl+"app/publicity.listCommunityPublicity",
listChargeMonthOrder:baseUrl+"app/chargeCard.listChargeMonthOrder",
listChargeMonthCard:baseUrl+"app/chargeCard.listChargeMonthCard",
listItemReleaseType: baseUrl + "app/itemRelease.listItemReleaseType",
queryFirstAuditStaff: baseUrl + "app/oaWorkflow.queryFirstAuditStaff",
saveItemRelease: baseUrl + "app/itemRelease.saveItemRelease",
listMyItemRelease: baseUrl + "app/itemRelease.listMyItemRelease",
listItemReleaseRes: baseUrl + "app/itemRelease.listItemReleaseRes",
queryOaWorkflowUser: baseUrl + "app/oaWorkflow/queryOaWorkflowUser",
listChargeMachine: baseUrl + "app/chargeMachine.listChargeMachine",
listChargeMachinePort: baseUrl + "app/chargeMachine.listChargeMachinePort",
listExamineStaff: baseUrl + "app/examine.listExamineStaff", // 查询打分员工
startCharge: baseUrl + "app/chargeMachine.startCharge", // 开始充电
stopCharge: baseUrl + "app/chargeMachine.stopCharge", // 结束充电
listChargeMachineOrder: baseUrl + "app/chargeMachine.listChargeMachineOrder", // 查询充电订单
saveExamineStaffValue: baseUrl + "app/examine.saveExamineStaffValue", // 查询充电订单
listExamineStaffValue: baseUrl + "app/examine.listExamineStaffValue", // 查询充电订单
listMeterMachine: baseUrl + "app/meterMachine.listMeterMachine",
queryDict: baseUrl + "callComponent/core/list",
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',

View File

@ -898,6 +898,15 @@
}
}
,{
"path" : "pages/my/userQrCode",
"style" :
{
"navigationBarTitleText": "用户二维码",
"enablePullDownRefresh": false
}
}
],
"tabBar": {
"color": "#272636",

View File

@ -60,8 +60,8 @@
data() {
return {
logoUrl: '',
username: '',
password: '',
username: '17797171234',
password: '123456',
appId: "",
code: "",
loginByPhone: false,

71
pages/my/userQrCode.vue Normal file
View 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>