更新
This commit is contained in:
parent
2d8bc14de2
commit
78b0019cf0
@ -149,7 +149,7 @@
|
|||||||
</u-button>
|
</u-button>
|
||||||
<u-button class="button" @click="hge=true;getProject(item)"
|
<u-button class="button" @click="hge=true;getProject(item)"
|
||||||
v-if="isExamine && tapValue == '7'" size="10">重审项目</u-button>
|
v-if="isExamine && tapValue == '7'" size="10">重审项目</u-button>
|
||||||
<u-button class="button" v-if="!detailButtonNoShow.includes(tapValue)"
|
<u-button class="button" v-if="!detailButtonNoShow.includes(tapValue + '')"
|
||||||
@click="godetails(item)" size="10">查看详情</u-button>
|
@click="godetails(item)" size="10">查看详情</u-button>
|
||||||
<u-button class="button" v-if="tapValue == '8'" @click="goMeetOrderCreate(item)"
|
<u-button class="button" v-if="tapValue == '8'" @click="goMeetOrderCreate(item)"
|
||||||
size="10">创建订单</u-button>
|
size="10">创建订单</u-button>
|
||||||
@ -306,7 +306,7 @@
|
|||||||
meetCarButtonShow: ['6'],
|
meetCarButtonShow: ['6'],
|
||||||
adminCanShow: ['7', '8'],
|
adminCanShow: ['7', '8'],
|
||||||
leadMeadShow: ['7', '8'],
|
leadMeadShow: ['7', '8'],
|
||||||
detailButtonNoShow: ['6', '8'],
|
detailButtonNoShow: ['1', '6', '8'],
|
||||||
belowStandardShow: ['7', '4'],
|
belowStandardShow: ['7', '4'],
|
||||||
countMap: [],
|
countMap: [],
|
||||||
csId: [],
|
csId: [],
|
||||||
@ -855,7 +855,8 @@
|
|||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
pageNum: this.pageNum,
|
pageNum: this.pageNum,
|
||||||
userId: this.userId,
|
userId: this.userId,
|
||||||
status: this.tapValue
|
status: this.tapValue,
|
||||||
|
carNum: this.carNum
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
|
|||||||
@ -1,219 +1,367 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<!-- <view class="top-heder">-->
|
<!-- <view class="top-heder">-->
|
||||||
<!-- <view class="t-left" @click="handleBack">-->
|
<!-- <view class="t-left" @click="handleBack">-->
|
||||||
<!-- <uni-icons type="left" size="18"></uni-icons>-->
|
<!-- <uni-icons type="left" size="18"></uni-icons>-->
|
||||||
<!-- </view>-->
|
<!-- </view>-->
|
||||||
<!-- <view class="c-title">个人信息</view>-->
|
<!-- <view class="c-title">个人信息</view>-->
|
||||||
<!-- <view style="width: 5%; height: 10px;"></view>-->
|
<!-- <view style="width: 5%; height: 10px;"></view>-->
|
||||||
<!-- </view>-->
|
<!-- </view>-->
|
||||||
|
|
||||||
<headersVue titles="个人信息" style="position: static !important;">
|
<headersVue titles="个人信息" style="position: static !important;">
|
||||||
<u-icon name="arrow-left" color="#fff" size="18"></u-icon>
|
<u-icon name="arrow-left" color="#fff" size="18"></u-icon>
|
||||||
</headersVue>
|
</headersVue>
|
||||||
|
|
||||||
<view class="body">
|
<view class="body">
|
||||||
<view class="formItem">
|
<view class="formItem">
|
||||||
<image class="formIcon" mode="aspectFit" src="@/static/icons/userInfo_1.png"></image>
|
<image class="formIcon" mode="aspectFit" src="@/static/icons/userInfo_1.png"></image>
|
||||||
<text class="formLabel">头像</text>
|
<text class="formLabel">头像</text>
|
||||||
<view class="formValue">
|
<view class="formValue">
|
||||||
<image style="width: 64rpx;height: 64rpx;border-radius: 50%;"
|
<image style="width: 64rpx;height: 64rpx;border-radius: 50%;"
|
||||||
v-if="customInfo && customInfo.avatar === null" :src="defaultAvatar" mode="scaleToFill" class="avatar"></image>
|
v-if="customInfo && customInfo.avatar === null" :src="defaultAvatar" mode="scaleToFill"
|
||||||
<image v-else :src="customInfo.avatar" class="avatar" mode="scaleToFill"
|
class="avatar"></image>
|
||||||
style="width: 64rpx;height: 64rpx;border-radius: 50%;"></image>
|
<image v-else :src="customInfo.avatar" class="avatar" mode="scaleToFill"
|
||||||
</view>
|
style="width: 64rpx;height: 64rpx;border-radius: 50%;"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="formItem">
|
</view>
|
||||||
<image class="formIcon" mode="aspectFit" src="@/static/icons/userInfo_2.png"></image>
|
<view class="formItem">
|
||||||
<text class="formLabel">账号昵称</text>
|
<image class="formIcon" mode="aspectFit" src="@/static/icons/userInfo_2.png"></image>
|
||||||
<text class="formValue">{{ customInfo.nickname }}</text>
|
<text class="formLabel">账号昵称</text>
|
||||||
<!-- <u-icon color="#999" name="arrow-right" size="12"></u-icon>-->
|
<text class="formValue">{{ customInfo.nickname }}</text>
|
||||||
</view>
|
<!-- <u-icon color="#999" name="arrow-right" size="12"></u-icon>-->
|
||||||
<view class="formItem">
|
</view>
|
||||||
<image class="formIcon" mode="aspectFit" src="@/static/icons/userInfo_3.png"></image>
|
<view class="formItem">
|
||||||
<text class="formLabel">绑定电话</text>
|
<image class="formIcon" mode="aspectFit" src="@/static/icons/userInfo_3.png"></image>
|
||||||
<text class="formValue">{{ customInfo.mobile }}</text>
|
<text class="formLabel">绑定电话</text>
|
||||||
<!-- <u-icon color="#999" name="arrow-right" size="12"></u-icon>-->
|
<text class="formValue">{{ customInfo.mobile }}</text>
|
||||||
</view>
|
<!-- <u-icon color="#999" name="arrow-right" size="12"></u-icon>-->
|
||||||
<!-- <view class="formItem" v-if="showUniCode">-->
|
</view>
|
||||||
<!-- <image class="formIcon" mode="aspectFit" src="@/static/icons/userInfo_3.png"></image>-->
|
<view class="formItem">
|
||||||
<!-- <text class="formLabel">我的邀请码</text>-->
|
<image class="formIcon" mode="aspectFit" src="../../static/icons/userInfo_3.png"></image>
|
||||||
<!-- <text class="formValue"></text>-->
|
<text class="formLabel">我的邀请码</text>
|
||||||
<!-- </view>-->
|
<text class="formValue"></text>
|
||||||
<!-- <view style="padding-bottom: 60rpx;border-bottom: 1px solid #ddd;" class="formItem" v-if="showUniCode">-->
|
</view>
|
||||||
<!-- <canvas id="qrcode" canvas-id="qrcode" style="width: 200px;height: 200px;margin: auto"></canvas>-->
|
<view style="padding-bottom: 60rpx;" class="formItem">
|
||||||
<!-- <!– <image style="width: 200px; height: 200px;margin: auto" class="formIcon" mode="scaleToFill" src="@/pages-home/static/yaoqingma.png"></image>–>-->
|
<canvas id="qrcode" canvas-id="qrcode" style="width: 200px;height: 200px;margin: auto"
|
||||||
<!-- </view>-->
|
@longpress="saveQRCode"></canvas>
|
||||||
|
</view>
|
||||||
|
<text
|
||||||
|
style="display: block; font-weight: bold; text-align: center; color: #000000; font-size: 30rpx; border-bottom: 1px solid #ddd;">
|
||||||
|
长按邀请码可保存到相册
|
||||||
|
</text>
|
||||||
|
<canvas canvas-id="saveCanvas"
|
||||||
|
style="position: fixed; left: -9999px; width: 240px; height: 240px;"></canvas>
|
||||||
|
|
||||||
<view class="btns">
|
<view class="btns">
|
||||||
<view class="btn" @click="logout">
|
<view class="btn" @click="logout">
|
||||||
退出登录
|
退出登录
|
||||||
</view>
|
</view>
|
||||||
<view class="btn" @click="changePassword">
|
<view class="btn" @click="changePassword">
|
||||||
修改密码
|
修改密码
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<uni-popup ref="alertDialog" type="dialog">
|
<uni-popup ref="alertDialog" type="dialog">
|
||||||
<uni-popup-dialog :type="msgType" cancelText="关闭" confirmText="同意" title="通知" content="您确认要退出登录吗" @confirm="dialogConfirm"
|
<uni-popup-dialog :type="msgType" cancelText="关闭" confirmText="同意" title="通知" content="您确认要退出登录吗"
|
||||||
@close="dialogClose"></uni-popup-dialog>
|
@confirm="dialogConfirm" @close="dialogClose"></uni-popup-dialog>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getStorageWithExpiry, setStorageWithExpiry} from "../../utils/auth";
|
import {
|
||||||
import request from '../../utils/request';
|
getStorageWithExpiry,
|
||||||
import config from '@/config'
|
setStorageWithExpiry
|
||||||
import headersVue from "@/components/header/headers.vue";
|
} from "../../utils/auth";
|
||||||
export default {
|
import request from '../../utils/request';
|
||||||
name: "UserInfo",
|
import config from '@/config'
|
||||||
components: {headersVue},
|
const UQRCode = require('uqrcodejs');
|
||||||
data(){
|
import headersVue from "@/components/header/headers.vue";
|
||||||
return{
|
export default {
|
||||||
customInfo: {},
|
name: "UserInfo",
|
||||||
defaultAvatar: require('@/static/icons/avatar.png'),
|
components: {
|
||||||
msgType: 'success',
|
headersVue
|
||||||
}
|
},
|
||||||
},
|
data() {
|
||||||
mounted(){
|
return {
|
||||||
this.getCustomInfo()
|
customInfo: {},
|
||||||
},
|
defaultAvatar: require('@/static/icons/avatar.png'),
|
||||||
methods:{
|
msgType: 'success',
|
||||||
changePassword(){
|
shareUrl: config.shareUrl,
|
||||||
uni.navigateTo({
|
}
|
||||||
url:'/pages/Login/modify'
|
},
|
||||||
})
|
mounted() {
|
||||||
},
|
this.getCustomInfo()
|
||||||
dialogConfirm() {
|
},
|
||||||
uni.clearStorageSync();
|
methods: {
|
||||||
uni.reLaunch({
|
changePassword() {
|
||||||
url:'/pages/Login/login'
|
uni.navigateTo({
|
||||||
})
|
url: '/pages/Login/modify'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
dialogConfirm() {
|
||||||
|
uni.clearStorageSync();
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/Login/login'
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
dialogClose() {
|
dialogClose() {},
|
||||||
},
|
logout() {
|
||||||
logout(){
|
this.$refs.alertDialog.open()
|
||||||
this.$refs.alertDialog.open()
|
},
|
||||||
},
|
getCustomInfo() {
|
||||||
getCustomInfo(){
|
let roleNames = getStorageWithExpiry("roleNames")
|
||||||
let roleNames = getStorageWithExpiry("roleNames")
|
if (!roleNames) {
|
||||||
if (!roleNames){
|
request({
|
||||||
request({
|
url: '/inspection/util/getRoleName',
|
||||||
url: '/inspection/util/getRoleName',
|
method: 'get'
|
||||||
method: 'get'
|
}).then(res => {
|
||||||
}).then(res => {
|
roleNames = res.data
|
||||||
roleNames = res.data
|
setStorageWithExpiry("roleNames", roleNames)
|
||||||
setStorageWithExpiry("roleNames", roleNames)
|
})
|
||||||
})
|
}
|
||||||
}
|
const data = getStorageWithExpiry("userInfo")
|
||||||
const data = getStorageWithExpiry("userInfo")
|
if (!data || !data.uniqueCode) {
|
||||||
if (!data) {
|
request({
|
||||||
request({
|
url: '/inspectionStaff/get',
|
||||||
url: '/system/user/profile/get',
|
method: 'get',
|
||||||
method: 'get'
|
params: {
|
||||||
}).then(res => {
|
id: uni.getStorageSync('userId')
|
||||||
this.customInfo = res.data
|
}
|
||||||
if (this.customInfo.avatar) {
|
}).then(res => {
|
||||||
this.customInfo.avatar = config.baseImageUrl + this.customInfo.avatar
|
this.customInfo = res.data
|
||||||
}
|
if (this.customInfo.avatar) {
|
||||||
this.customInfo.roleNames = roleNames
|
this.customInfo.avatar = config.baseImageUrl + this.customInfo.avatar
|
||||||
setStorageWithExpiry("userInfo", this.customInfo)
|
}
|
||||||
})
|
this.customInfo.roleNames = roleNames
|
||||||
} else {
|
setStorageWithExpiry("userInfo", this.customInfo)
|
||||||
this.customInfo = data
|
this.generateUniCode(this.customInfo.uniqueCode)
|
||||||
}
|
})
|
||||||
},
|
} else {
|
||||||
handleBack(){
|
this.customInfo = data
|
||||||
uni.navigateBack()
|
this.generateUniCode(this.customInfo.uniqueCode)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
handleBack() {
|
||||||
|
uni.navigateBack()
|
||||||
|
},
|
||||||
|
generateUniCode(code) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
// 获取uQRCode实例
|
||||||
|
const qr = new UQRCode();
|
||||||
|
// 设置二维码内容
|
||||||
|
qr.data = this.shareUrl + code;
|
||||||
|
// 设置二维码大小,必须与canvas设置的宽高一致
|
||||||
|
qr.size = 200;
|
||||||
|
// 调用制作二维码方法
|
||||||
|
qr.make();
|
||||||
|
// 获取canvas上下文
|
||||||
|
const canvasContext = uni.createCanvasContext('qrcode', this); // 如果是组件,this必须传入
|
||||||
|
// 设置uQRCode实例的canvas上下文
|
||||||
|
qr.canvasContext = canvasContext;
|
||||||
|
// 调用绘制方法将二维码图案绘制到canvas上
|
||||||
|
qr.drawCanvas();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 弹窗提示
|
||||||
|
saveQRCode() {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要保存邀请码到相册吗?',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
this.doSaveQRCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 保存邀请码
|
||||||
|
async doSaveQRCode() {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '保存中...',
|
||||||
|
mask: true
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 获取原始二维码图片路径
|
||||||
|
const tempPath = await this.getCanvasTempPath('qrcode');
|
||||||
|
|
||||||
|
// 创建一个带留白的新canvas
|
||||||
|
const paddedPath = await this.createPaddedImage(tempPath);
|
||||||
|
|
||||||
|
// 保存带留白的图片
|
||||||
|
await this.saveToAlbum(paddedPath);
|
||||||
|
|
||||||
|
uni.showToast({
|
||||||
|
title: '保存成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.error('保存失败:', err);
|
||||||
|
uni.showToast({
|
||||||
|
title: '保存失败: ' + (err.errMsg || '未知错误'),
|
||||||
|
icon: 'none',
|
||||||
|
duration: 3000
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getCanvasTempPath(canvasId) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
uni.canvasToTempFilePath({
|
||||||
|
canvasId: canvasId,
|
||||||
|
success: resolve,
|
||||||
|
fail: reject
|
||||||
|
}, this);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
createPaddedImage(tempPath) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const padding = 20; // 留白大小(单位:px)
|
||||||
|
const qrSize = 200; // 二维码原始大小
|
||||||
|
const canvasSize = qrSize + padding * 2; // 带留白的总大小
|
||||||
|
const nameHeight = 30; // 姓名区域高度
|
||||||
|
const totalHeight = canvasSize + nameHeight; // 总高度(二维码 + 姓名)
|
||||||
|
|
||||||
|
const ctx = uni.createCanvasContext('saveCanvas', this);
|
||||||
|
|
||||||
|
// 1. 绘制白色背景(扩展到包含姓名区域)
|
||||||
|
ctx.setFillStyle('#ffffff');
|
||||||
|
ctx.fillRect(0, 0, canvasSize, totalHeight);
|
||||||
|
|
||||||
|
// 2. 绘制姓名(居中显示)
|
||||||
|
ctx.setFontSize(16); // 字体大小
|
||||||
|
ctx.setFillStyle('#000000'); // 字体颜色
|
||||||
|
ctx.setTextAlign('center'); // 水平居中
|
||||||
|
console.log('当前信息', this.customInfo);
|
||||||
|
ctx.fillText(this.customInfo.nickname || '未设置姓名', canvasSize / 2, nameHeight - 5);
|
||||||
|
|
||||||
|
// 3. 绘制二维码(在姓名下方)
|
||||||
|
ctx.drawImage(tempPath.tempFilePath, padding, nameHeight, qrSize, qrSize);
|
||||||
|
|
||||||
|
ctx.draw(false, () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.getCanvasTempPath('saveCanvas')
|
||||||
|
.then(resolve)
|
||||||
|
.catch(reject);
|
||||||
|
}, 300);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
saveToAlbum(filePath) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: filePath.tempFilePath,
|
||||||
|
success: resolve,
|
||||||
|
fail: (err) => {
|
||||||
|
// 处理权限问题
|
||||||
|
if (err.errMsg.includes('auth')) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '需要相册权限才能保存图片',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.openSetting();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.top-heder{
|
.top-heder {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 88px;
|
height: 88px;
|
||||||
background: white;
|
background: white;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 5px 15px;
|
padding: 5px 15px;
|
||||||
padding-top: 45px;
|
padding-top: 45px;
|
||||||
}
|
}
|
||||||
.t-left{
|
|
||||||
width: 10%;
|
|
||||||
}
|
|
||||||
.c-title{
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
.body {
|
|
||||||
border-top: 1px solid #ddd;
|
|
||||||
padding: 20rpx 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formItem {
|
.t-left {
|
||||||
box-sizing: border-box;
|
width: 10%;
|
||||||
padding: 40rpx 0;
|
}
|
||||||
|
|
||||||
display: flex;
|
.c-title {
|
||||||
align-items: center;
|
font-weight: bold;
|
||||||
justify-content: space-between;
|
font-size: 18px;
|
||||||
column-gap: 20rpx;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.formIcon {
|
.body {
|
||||||
width: 44rpx;
|
border-top: 1px solid #ddd;
|
||||||
height: 44rpx;
|
padding: 20rpx 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.formLabel {
|
.formItem {
|
||||||
font-size: 32rpx;
|
box-sizing: border-box;
|
||||||
color: #333333;
|
padding: 40rpx 0;
|
||||||
}
|
|
||||||
|
|
||||||
.formValue {
|
display: flex;
|
||||||
flex: 1;
|
align-items: center;
|
||||||
width: 0;
|
justify-content: space-between;
|
||||||
text-align: right;
|
column-gap: 20rpx;
|
||||||
font-size: 32rpx;
|
}
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formBtn {
|
.formIcon {
|
||||||
width: 24rpx;
|
width: 44rpx;
|
||||||
height: 24rpx;
|
height: 44rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.avatar {
|
.formLabel {
|
||||||
width: 108rpx;
|
font-size: 32rpx;
|
||||||
height: 108rpx;
|
color: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.formValue {
|
||||||
width: 520rpx;
|
flex: 1;
|
||||||
height: 80rpx;
|
width: 0;
|
||||||
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
text-align: right;
|
||||||
border: 1rpx solid #999999;
|
font-size: 32rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
margin: 60rpx auto;
|
.formBtn {
|
||||||
|
width: 24rpx;
|
||||||
|
height: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
display: flex;
|
.avatar {
|
||||||
align-items: center;
|
width: 108rpx;
|
||||||
justify-content: center;
|
height: 108rpx;
|
||||||
|
}
|
||||||
|
|
||||||
font-size: 32rpx;
|
.btn {
|
||||||
color: #999999;
|
width: 520rpx;
|
||||||
}
|
height: 80rpx;
|
||||||
|
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
||||||
|
border: 1rpx solid #999999;
|
||||||
|
|
||||||
.btns{
|
margin: 60rpx auto;
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
display: flex;
|
||||||
gap: 20px;
|
align-items: center;
|
||||||
}
|
justify-content: center;
|
||||||
</style>
|
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btns {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 20px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -340,7 +340,6 @@
|
|||||||
this.businessChannelId = result.parent.id
|
this.businessChannelId = result.parent.id
|
||||||
this.cssj = this.customerSourceId
|
this.cssj = this.customerSourceId
|
||||||
}
|
}
|
||||||
console.log(this.customerSource, this.businessChannel);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -50,7 +50,7 @@
|
|||||||
<text>来源:</text>
|
<text>来源:</text>
|
||||||
<text>{{ detailData.customerSource }}</text>
|
<text>{{ detailData.customerSource }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="dis-hui" v-if="roleSelect == 'shop'">
|
<view class="dis-hui" v-if="roleSelect == 'shop' || roleType == 'business'">
|
||||||
<text>¥:</text>
|
<text>¥:</text>
|
||||||
<text>{{ detailData.goodsPrice / 100 }}元</text>
|
<text>{{ detailData.goodsPrice / 100 }}元</text>
|
||||||
</view>
|
</view>
|
||||||
@ -408,6 +408,7 @@
|
|||||||
fileList2: [],
|
fileList2: [],
|
||||||
shelist: [],
|
shelist: [],
|
||||||
type: 1,
|
type: 1,
|
||||||
|
roleType: 1,
|
||||||
isPass: "1",
|
isPass: "1",
|
||||||
remark: '',
|
remark: '',
|
||||||
csId: [],
|
csId: [],
|
||||||
@ -453,6 +454,7 @@
|
|||||||
this.roleSelect = res.data
|
this.roleSelect = res.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
this.roleType = option.type
|
||||||
if (option.type == 'staff') {
|
if (option.type == 'staff') {
|
||||||
const res = await ifHasRoleByDictType("inspection_detail_view")
|
const res = await ifHasRoleByDictType("inspection_detail_view")
|
||||||
this.isShowClient = res
|
this.isShowClient = res
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
<!-- 店铺商铺 -->
|
<!-- 店铺商铺 -->
|
||||||
|
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<view class="ian-box">
|
<view class="ian-box" v-if="showCheckout">
|
||||||
<!-- <view class="on-input" @click="golieb()">
|
<!-- <view class="on-input" @click="golieb()">
|
||||||
<view class="dix">
|
<view class="dix">
|
||||||
<view class="d-icon">
|
<view class="d-icon">
|
||||||
@ -132,7 +132,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="on-input" @click="checkoutRole()">
|
<view class="on-input" @click="checkoutRole()" v-if="showCheckout">
|
||||||
<view class="dix">
|
<view class="dix">
|
||||||
<view class="d-icon">
|
<view class="d-icon">
|
||||||
<image src="../../static/detection/tc.png" mode=""></image>
|
<image src="../../static/detection/tc.png" mode=""></image>
|
||||||
@ -144,6 +144,23 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="ian-box">
|
||||||
|
<view class="formItem">
|
||||||
|
<image class="formIcon" mode="aspectFit" src="../../static/icons/userInfo_3.png"></image>
|
||||||
|
<text class="formLabel">我的邀请码</text>
|
||||||
|
<text class="formValue"></text>
|
||||||
|
</view>
|
||||||
|
<view style="padding-bottom: 60rpx;" class="formItem">
|
||||||
|
<canvas id="qrcode" canvas-id="qrcode" style="width: 200px;height: 200px;margin: auto"
|
||||||
|
@longpress="saveQRCode"></canvas>
|
||||||
|
</view>
|
||||||
|
<text
|
||||||
|
style="display: block; font-weight: bold; text-align: center; color: #000000; font-size: 30rpx; border-bottom: 1px solid #ddd;">
|
||||||
|
长按邀请码可保存到相册
|
||||||
|
</text>
|
||||||
|
<canvas canvas-id="saveCanvas"
|
||||||
|
style="position: fixed; left: -9999px; width: 240px; height: 240px;"></canvas>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<uni-popup ref="alertDialog" type="dialog">
|
<uni-popup ref="alertDialog" type="dialog">
|
||||||
<uni-popup-dialog cancelText="关闭" confirmText="同意" title="通知" content="您确认要退出吗!" @confirm="dialogConfirm"
|
<uni-popup-dialog cancelText="关闭" confirmText="同意" title="通知" content="您确认要退出吗!" @confirm="dialogConfirm"
|
||||||
@ -161,6 +178,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import config from '@/config'
|
import config from '@/config'
|
||||||
import request from '../../utils/request';
|
import request from '../../utils/request';
|
||||||
|
const UQRCode = require('uqrcodejs');
|
||||||
import tabBar from '../../components/staffTabBer/tabBar.vue'
|
import tabBar from '../../components/staffTabBer/tabBar.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -172,7 +190,9 @@
|
|||||||
chooseIdx: undefined,
|
chooseIdx: undefined,
|
||||||
partnerId: '',
|
partnerId: '',
|
||||||
myindex: {},
|
myindex: {},
|
||||||
lookAppointment: false
|
lookAppointment: false,
|
||||||
|
shareUrl: config.shareUrl,
|
||||||
|
showCheckout: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@ -199,6 +219,24 @@
|
|||||||
url: '/pages/modifyPassword/modifyPassword' // 修改密码页面路径
|
url: '/pages/modifyPassword/modifyPassword' // 修改密码页面路径
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
generateUniCode(code) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
// 获取uQRCode实例
|
||||||
|
const qr = new UQRCode();
|
||||||
|
// 设置二维码内容
|
||||||
|
qr.data = this.shareUrl + code;
|
||||||
|
// 设置二维码大小,必须与canvas设置的宽高一致
|
||||||
|
qr.size = 200;
|
||||||
|
// 调用制作二维码方法
|
||||||
|
qr.make();
|
||||||
|
// 获取canvas上下文
|
||||||
|
const canvasContext = uni.createCanvasContext('qrcode', this); // 如果是组件,this必须传入
|
||||||
|
// 设置uQRCode实例的canvas上下文
|
||||||
|
qr.canvasContext = canvasContext;
|
||||||
|
// 调用绘制方法将二维码图案绘制到canvas上
|
||||||
|
qr.drawCanvas();
|
||||||
|
})
|
||||||
|
},
|
||||||
dialogConfirm() {
|
dialogConfirm() {
|
||||||
this.tui()
|
this.tui()
|
||||||
this.$refs.alertDialog.close()
|
this.$refs.alertDialog.close()
|
||||||
@ -232,7 +270,7 @@
|
|||||||
}
|
}
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
}, 1000);
|
}, 500);
|
||||||
this.chooseIdx = uni.getStorageSync("chooseIdx")
|
this.chooseIdx = uni.getStorageSync("chooseIdx")
|
||||||
},
|
},
|
||||||
dialogClose() {
|
dialogClose() {
|
||||||
@ -247,11 +285,21 @@
|
|||||||
// })
|
// })
|
||||||
// this.myindex = res.data
|
// this.myindex = res.data
|
||||||
let ress = await request({
|
let ress = await request({
|
||||||
url: '/system/user/profile/get',
|
url: '/inspectionStaff/get',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
id: uni.getStorageSync('userId')
|
||||||
|
}
|
||||||
})
|
})
|
||||||
console.log('个人信息', ress.data)
|
console.log('个人信息', ress.data)
|
||||||
this.user = ress.data
|
this.user = ress.data
|
||||||
|
this.generateUniCode(ress.data.uniqueCode)
|
||||||
|
// 判断角色是否只有一个业务经理
|
||||||
|
if (ress.data.userRoles.length == 1 && ress.data.userRoles[0].roleCode == 'jcywjl') {
|
||||||
|
this.showCheckout = false
|
||||||
|
} else {
|
||||||
|
this.showCheckout = true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
tui() {
|
tui() {
|
||||||
uni.clearStorageSync();
|
uni.clearStorageSync();
|
||||||
@ -297,7 +345,115 @@
|
|||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/my/shoporder"
|
url: "/pages/my/shoporder"
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
// 弹窗提示
|
||||||
|
saveQRCode() {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要保存邀请码到相册吗?',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
this.doSaveQRCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 保存邀请码
|
||||||
|
async doSaveQRCode() {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '保存中...',
|
||||||
|
mask: true
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 获取原始二维码图片路径
|
||||||
|
const tempPath = await this.getCanvasTempPath('qrcode');
|
||||||
|
|
||||||
|
// 创建一个带留白的新canvas
|
||||||
|
const paddedPath = await this.createPaddedImage(tempPath);
|
||||||
|
|
||||||
|
// 保存带留白的图片
|
||||||
|
await this.saveToAlbum(paddedPath);
|
||||||
|
|
||||||
|
uni.showToast({
|
||||||
|
title: '保存成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.error('保存失败:', err);
|
||||||
|
uni.showToast({
|
||||||
|
title: '保存失败: ' + (err.errMsg || '未知错误'),
|
||||||
|
icon: 'none',
|
||||||
|
duration: 3000
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getCanvasTempPath(canvasId) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
uni.canvasToTempFilePath({
|
||||||
|
canvasId: canvasId,
|
||||||
|
success: resolve,
|
||||||
|
fail: reject
|
||||||
|
}, this);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
createPaddedImage(tempPath) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const padding = 20; // 留白大小(单位:px)
|
||||||
|
const qrSize = 200; // 二维码原始大小
|
||||||
|
const canvasSize = qrSize + padding * 2; // 带留白的总大小
|
||||||
|
const nameHeight = 30; // 姓名区域高度
|
||||||
|
const totalHeight = canvasSize + nameHeight; // 总高度(二维码 + 姓名)
|
||||||
|
|
||||||
|
const ctx = uni.createCanvasContext('saveCanvas', this);
|
||||||
|
|
||||||
|
// 1. 绘制白色背景(扩展到包含姓名区域)
|
||||||
|
ctx.setFillStyle('#ffffff');
|
||||||
|
ctx.fillRect(0, 0, canvasSize, totalHeight);
|
||||||
|
|
||||||
|
// 2. 绘制姓名(居中显示)
|
||||||
|
ctx.setFontSize(16); // 字体大小
|
||||||
|
ctx.setFillStyle('#000000'); // 字体颜色
|
||||||
|
ctx.setTextAlign('center'); // 水平居中
|
||||||
|
ctx.fillText(this.user.nickname || '未设置姓名', canvasSize / 2, nameHeight - 5);
|
||||||
|
|
||||||
|
// 3. 绘制二维码(在姓名下方)
|
||||||
|
ctx.drawImage(tempPath.tempFilePath, padding, nameHeight, qrSize, qrSize);
|
||||||
|
|
||||||
|
ctx.draw(false, () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.getCanvasTempPath('saveCanvas')
|
||||||
|
.then(resolve)
|
||||||
|
.catch(reject);
|
||||||
|
}, 300);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
saveToAlbum(filePath) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: filePath.tempFilePath,
|
||||||
|
success: resolve,
|
||||||
|
fail: (err) => {
|
||||||
|
// 处理权限问题
|
||||||
|
if (err.errMsg.includes('auth')) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '需要相册权限才能保存图片',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.openSetting();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -555,6 +711,39 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.formItem {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 40rpx 0;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
column-gap: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formIcon {
|
||||||
|
width: 44rpx;
|
||||||
|
height: 44rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formLabel {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formValue {
|
||||||
|
flex: 1;
|
||||||
|
width: 0;
|
||||||
|
text-align: right;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formBtn {
|
||||||
|
width: 24rpx;
|
||||||
|
height: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
//.edit-button:hover {
|
//.edit-button:hover {
|
||||||
// text-decoration: underline;
|
// text-decoration: underline;
|
||||||
//}
|
//}
|
||||||
|
|||||||
@ -22,6 +22,21 @@
|
|||||||
<view class="">{{ data2.jxzNum || 0 }}</view>
|
<view class="">{{ data2.jxzNum || 0 }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="d_b"
|
||||||
|
style="border-top: 1px solid #F5F5F5; margin-top: 30rpx;box-sizing: border-box;padding-top: 30rpx;">
|
||||||
|
<view class="three_" @click="goOrderList">
|
||||||
|
<view class="text_">重检数量</view>
|
||||||
|
<view class="">{{ data2.reinspectNum|| 0 }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="three_">
|
||||||
|
<view class="text_">复检数量</view>
|
||||||
|
<view class="">{{ data2.recheckNum || 0 }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="three_">
|
||||||
|
<view class="text_">退办理数量</view>
|
||||||
|
<view class="">{{ data2.tblNum || 0 }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="title_">营业额统计</view>
|
<view class="title_">营业额统计</view>
|
||||||
<view class="box_">
|
<view class="box_">
|
||||||
@ -48,6 +63,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="title_">业务渠道统计</view>
|
<view class="title_">业务渠道统计</view>
|
||||||
<view class="box_" v-if="data3.length > 0">
|
<view class="box_" v-if="data3.length > 0">
|
||||||
|
<uni-datetime-picker v-model="businessRange" type="daterange" @maskClick="maskBusinessClick" />
|
||||||
<view class="box_top">
|
<view class="box_top">
|
||||||
<view class="l_">业务渠道</view>
|
<view class="l_">业务渠道</view>
|
||||||
<view class="n_">数量</view>
|
<view class="n_">数量</view>
|
||||||
@ -157,6 +173,7 @@
|
|||||||
data5: '',
|
data5: '',
|
||||||
fileRes: {},
|
fileRes: {},
|
||||||
range: ['2023-9-28', '2023-10-7'],
|
range: ['2023-9-28', '2023-10-7'],
|
||||||
|
businessRange: ['2023-9-28', '2023-10-7'],
|
||||||
ranges: ['2023-9-28', '2023-10-7'],
|
ranges: ['2023-9-28', '2023-10-7'],
|
||||||
//检测类型统计
|
//检测类型统计
|
||||||
skuList: [],
|
skuList: [],
|
||||||
@ -282,6 +299,9 @@
|
|||||||
ranges(newval) {
|
ranges(newval) {
|
||||||
this.getfive()
|
this.getfive()
|
||||||
},
|
},
|
||||||
|
businessRange(newval) {
|
||||||
|
this.getfive()
|
||||||
|
},
|
||||||
},
|
},
|
||||||
async onLoad() {
|
async onLoad() {
|
||||||
//显示加载框
|
//显示加载框
|
||||||
@ -385,12 +405,13 @@
|
|||||||
var currentTime = year + '-' + month + '-' + date
|
var currentTime = year + '-' + month + '-' + date
|
||||||
this.range[0] = currentTime
|
this.range[0] = currentTime
|
||||||
this.range[1] = currentTime
|
this.range[1] = currentTime
|
||||||
|
this.businessRange[0] = currentTime
|
||||||
|
this.businessRange[1] = currentTime
|
||||||
this.ranges[0] = currentTime
|
this.ranges[0] = currentTime
|
||||||
this.ranges[1] = currentTime
|
this.ranges[1] = currentTime
|
||||||
},
|
},
|
||||||
// 五条
|
// 五条
|
||||||
async getfive() {
|
async getfive() {
|
||||||
|
|
||||||
let data1 = {
|
let data1 = {
|
||||||
startTime: this.range[0],
|
startTime: this.range[0],
|
||||||
endTime: this.range[1]
|
endTime: this.range[1]
|
||||||
@ -493,6 +514,9 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
maskClick(e) {},
|
maskClick(e) {},
|
||||||
|
maskBusinessClick() {
|
||||||
|
|
||||||
|
},
|
||||||
// 折线图
|
// 折线图
|
||||||
async chartLineInspectionAmount() {
|
async chartLineInspectionAmount() {
|
||||||
let data = {
|
let data = {
|
||||||
|
|||||||
@ -364,6 +364,7 @@
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
params: data
|
params: data
|
||||||
})
|
})
|
||||||
|
this.datas = []
|
||||||
if (this.type == 'add') {
|
if (this.type == 'add') {
|
||||||
this.datas = res.data.insertFile
|
this.datas = res.data.insertFile
|
||||||
} else {
|
} else {
|
||||||
@ -388,6 +389,9 @@
|
|||||||
if (this.id == 5) {
|
if (this.id == 5) {
|
||||||
this.getCustomerSourceCount()
|
this.getCustomerSourceCount()
|
||||||
}
|
}
|
||||||
|
if (this.id == 6) {
|
||||||
|
this.getFileBytype()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getback() {
|
getback() {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user