This commit is contained in:
xyc 2025-08-25 10:04:53 +08:00
parent ee07d0a26a
commit bcfcca966b
4 changed files with 348 additions and 325 deletions

View File

@ -21,50 +21,51 @@
</view>
<view class="">内部管理</view>
</view>
<!-- <view class="box" :class="{active: aindex == 3}" @click="getgogo(3)">-->
<!-- <view class="imgs">-->
<!-- <image mode="aspectFit" src="@/static/icons/tabbar/my.png" v-show="aindex != 3"></image>-->
<!-- <image mode="aspectFit" src="@/static/icons/tabbar/my-checked.png" v-show="aindex == 3"></image>-->
<!-- </view>-->
<!-- <view class="">我的</view>-->
<!-- </view>-->
<!-- <view class="box" :class="{active: aindex == 3}" @click="getgogo(3)">-->
<!-- <view class="imgs">-->
<!-- <image mode="aspectFit" src="@/static/icons/tabbar/my.png" v-show="aindex != 3"></image>-->
<!-- <image mode="aspectFit" src="@/static/icons/tabbar/my-checked.png" v-show="aindex == 3"></image>-->
<!-- </view>-->
<!-- <view class="">我的</view>-->
<!-- </view>-->
</view>
</template>
<script>
import request from '../../utils/request';
import {
getToken,getUserInfo
getToken,
getUserInfo
} from '@/utils/auth'
let innerAudioContext ='';
// #ifdef APP || H5
const jyJPush = uni.requireNativePlugin('JY-JPush');
// #endif
let innerAudioContext = '';
// #ifdef APP || H5
const jyJPush = uni.requireNativePlugin('JY-JPush');
// #endif
export default {
data() {
return {
msgSocket: this.$msgSocket,
//
ifPlay:false,
msgSocket: this.$msgSocket,
//
ifPlay: false,
aindex: 1,
msgNum: null,
identity: 'user',
identity: 'user',
nowPageInterval: null,
userInfo:{},
userInfo: {},
}
},
props: {
msg: {
type: String|Number,
default: ''
},
title: {
type: String,
default: '工单'
},
msg: {
type: String | Number,
default: ''
},
title: {
type: String,
default: '工单'
},
},
onLoad() {
this.userInfo = getUserInfo();
this.userInfo = getUserInfo();
console.log('tabbag', uni.getStorageSync('identity'));
},
onUnload() {
@ -76,105 +77,108 @@
// #ifdef APP || H5
this.identity = uni.getStorageSync('identity');
// #endif
if (!this.nowPageInterval) {
this.nowPageInterval = setInterval(() => {
// console.log('this.$msgSocket: ',this.$msgSocket);
this.msgSocket = this.$msgSocket
}, 3000);
}
console.log(this.aindex);
setTimeout(() => {
this.msgInfo()
}, 2000);
if (!this.nowPageInterval) {
this.nowPageInterval = setInterval(() => {
// console.log('this.$msgSocket: ',this.$msgSocket);
this.msgSocket = this.$msgSocket
}, 3000);
}
console.log(this.aindex);
setTimeout(() => {
this.msgInfo()
}, 2000);
this.aindex = this.msg
},
watch: {
msgSocket(newVal, oldVal) {
console.log('msgSocket值发生变化', newVal, oldVal)
this.msgInfo()
},
deep: true,
},
watch: {
msgSocket(newVal, oldVal) {
console.log('msgSocket值发生变化', newVal, oldVal)
this.msgInfo()
},
deep: true,
},
methods: {
dianyidain() {
if(!this.ifPlay){
console.log('执行了dianyidain');
if(innerAudioContext!=""){
try {
console.log('调用前先销毁');
innerAudioContext.stop();
innerAudioContext.destroy();
innerAudioContext="";
}catch (e){
console.log('销毁出错');
}
}
innerAudioContext = uni.createInnerAudioContext();
this.ifPlay=true
// #ifdef APP-PLUS
innerAudioContext.src = '../../static/msgV.mp3';
// #endif
// #ifndef APP-PLUS
innerAudioContext.src = 'https://www.nuoyunr.com/lananRsc/rescue/msgV.mp3';
// #endif
//
const playCount = 4;
let currentCount = 0;
//
innerAudioContext.play();
//
uni.vibrateLong({
success: function () {
console.log('success');
}
});
innerAudioContext.onError((err) => {
console.error('播放错误', err);
this.ifPlay=false
innerAudioContext.stop();
innerAudioContext.destroy(); //
});
//
innerAudioContext.onEnded(() => {
//
currentCount++;
//
if (currentCount < playCount) {
//
innerAudioContext.play();
//
uni.vibrateLong({
success: function () {
console.log('success');
}
});
} else {
//
console.log('播放完成');
this.ifPlay=false
//
innerAudioContext.stop();
innerAudioContext.destroy();
}
});
}else{
console.log('正在播放音频,拒绝播放请求');
}
},
msgInfo() {
console.log(this.msgSocket, 'msgSocket')
if (this.msgSocket) {
console.log('消息回调启动成功')
this.msgSocket.onMessage(res => {
console.log("发出提示音", res);
// this.getbottom();
this.dianyidain()
this.$emit('socketSuccess')
})
}
dianyidain() {
if (!this.ifPlay) {
console.log('执行了dianyidain');
if (innerAudioContext != "") {
try {
console.log('调用前先销毁');
innerAudioContext.stop();
innerAudioContext.destroy();
innerAudioContext = "";
} catch (e) {
console.log('销毁出错');
}
}
innerAudioContext = uni.createInnerAudioContext();
this.ifPlay = true
// #ifdef APP-PLUS
innerAudioContext.src = '../../static/msgV.mp3';
// #endif
// #ifndef APP-PLUS
innerAudioContext.src = 'https://www.nuoyunr.com/lananRsc/rescue/msgV.mp3';
// #endif
//
const playCount = 4;
let currentCount = 0;
//
innerAudioContext.play();
//
uni.vibrateLong({
success: function() {
console.log('success');
}
});
innerAudioContext.onError((err) => {
console.error('播放错误', err);
this.ifPlay = false
innerAudioContext.stop();
innerAudioContext.destroy(); //
});
//
innerAudioContext.onEnded(() => {
//
currentCount++;
//
if (currentCount < playCount) {
//
innerAudioContext.play();
//
uni.vibrateLong({
success: function() {
console.log('success');
}
});
} else {
//
console.log('播放完成');
this.ifPlay = false
//
innerAudioContext.stop();
innerAudioContext.destroy();
}
});
} else {
console.log('正在播放音频,拒绝播放请求');
}
},
msgInfo() {
console.log(this.msgSocket, 'msgSocket')
if (this.msgSocket) {
console.log('消息回调启动成功')
this.msgSocket.onMessage(res => {
console.log("发出提示音", res);
// this.getbottom();
const ifHint = uni.getStorageSync("ifHint")
if (ifHint) {
this.dianyidain()
}
this.$emit('socketSuccess')
})
}
},
},
async getbottom() {
if (!getToken()) {
return
@ -190,19 +194,19 @@
}
},
getgogo(index) {
const userInfo = getUserInfo()
if (index == 1) {
const userInfo = getUserInfo()
if (index == 1) {
this.aindex = index
if (userInfo.roleCodes.includes("repair_warehouse")){
//
uni.navigateTo({
url: '/pages-warehouse/home/home'
})
} else {
uni.reLaunch({
url: '/pages-home/home/home'
})
}
if (userInfo.roleCodes.includes("repair_warehouse")) {
//
uni.navigateTo({
url: '/pages-warehouse/home/home'
})
} else {
uni.reLaunch({
url: '/pages-home/home/home'
})
}
}
if (index == 2) {
this.aindex = index
@ -280,4 +284,4 @@
color: white;
font-size: 2px;
}
</style>
</style>

View File

@ -25,7 +25,7 @@
汇报内容
</view>
<!-- <u--textarea v-if="type != 'look'" v-model="report.reportContent" placeholder="请输入内容"></u--textarea> -->
<textarea auto-height v-model="report.reportContent" placeholder="请输入内容" disabled></textarea>
<textarea auto-height v-model="report.reportContent" placeholder="请输入内容"></textarea>
<view class="x_"></view>
<view class="d_b" @click="handleUpload" v-if="type != 'look'">
<view class="">附件</view>

View File

@ -263,7 +263,7 @@
:localdata="insuranceTypeList"></uni-data-checkbox>
</view>
</view>
<view style="display: flex;align-items: center">
<!-- <view style="display: flex;align-items: center">
<view class="infoItem" style="flex: 1">
<text class="label">上年保费</text>
<view style="display: flex">
@ -273,7 +273,7 @@
placeholder="请输入商业险保费" />
</view>
</view>
</view>
</view> -->
<view style="display: flex;align-items: center">
<view class="infoItem" style="flex: 1">
<text class="label">救援费</text>

View File

@ -1,210 +1,229 @@
<template>
<view class="container">
<VNavigationBarVue backgroundColor="#fff" title="个人信息" titleColor="#333"></VNavigationBarVue>
<view class="body">
<view class="formItem">
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_1.png"></image>
<text class="formLabel">头像</text>
<view class="formValue">
<image v-if="''==customInfo.avatar || null == customInfo.avatar" :src="defaultAvatar" class="avatar" mode="scaleToFill"
style="width: 64rpx;height: 64rpx;border-radius: 50%;"></image>
<image v-else :src="imgUrlPrex+customInfo.avatar" class="avatar" mode="scaleToFill"
style="width: 64rpx;height: 64rpx;border-radius: 50%;"></image>
</view>
<!-- <u-icon color="#999" name="arrow-right" size="12"></u-icon>-->
</view>
<view class="formItem">
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_2.png"></image>
<text class="formLabel">账号昵称</text>
<text class="formValue">{{ customInfo.nickname }}</text>
<!-- <u-icon color="#999" name="arrow-right" size="12"></u-icon>-->
</view>
<view class="formItem">
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_3.png"></image>
<text class="formLabel">绑定电话</text>
<text class="formValue">{{ customInfo.mobile }}</text>
<!-- <u-icon color="#999" name="arrow-right" size="12"></u-icon>-->
</view>
<view class="formItem" v-if="showUniCode">
<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;border-bottom: 1px solid #ddd;" class="formItem" v-if="showUniCode">
<canvas id="qrcode" canvas-id="qrcode" style="width: 200px;height: 200px;margin: auto"></canvas>
<!-- <image style="width: 200px; height: 200px;margin: auto" class="formIcon" mode="scaleToFill" src="@/pages-home/static/yaoqingma.png"></image>-->
</view>
<view class="container">
<VNavigationBarVue backgroundColor="#fff" title="个人信息" titleColor="#333"></VNavigationBarVue>
<view class="body">
<view class="formItem">
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_1.png"></image>
<text class="formLabel">头像</text>
<view class="formValue">
<image v-if="''==customInfo.avatar || null == customInfo.avatar" :src="defaultAvatar" class="avatar"
mode="scaleToFill" style="width: 64rpx;height: 64rpx;border-radius: 50%;"></image>
<image v-else :src="imgUrlPrex+customInfo.avatar" class="avatar" mode="scaleToFill"
style="width: 64rpx;height: 64rpx;border-radius: 50%;"></image>
</view>
<!-- <u-icon color="#999" name="arrow-right" size="12"></u-icon>-->
</view>
<view class="formItem">
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_2.png"></image>
<text class="formLabel">账号昵称</text>
<text class="formValue">{{ customInfo.nickname }}</text>
<!-- <u-icon color="#999" name="arrow-right" size="12"></u-icon>-->
</view>
<view class="formItem">
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_3.png"></image>
<text class="formLabel">绑定电话</text>
<text class="formValue">{{ customInfo.mobile }}</text>
<!-- <u-icon color="#999" name="arrow-right" size="12"></u-icon>-->
</view>
<view class="formItem">
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_3.png"></image>
<text class="formLabel">声音提醒</text>
<text class="formValue">
<switch :checked="checked" @change="switch1Change" />
</text>
<!-- <u-icon color="#999" name="arrow-right" size="12"></u-icon>-->
</view>
<view class="formItem" v-if="showUniCode">
<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;border-bottom: 1px solid #ddd;" class="formItem" v-if="showUniCode">
<canvas id="qrcode" canvas-id="qrcode" style="width: 200px;height: 200px;margin: auto"></canvas>
<!-- <image style="width: 200px; height: 200px;margin: auto" class="formIcon" mode="scaleToFill" src="@/pages-home/static/yaoqingma.png"></image>-->
</view>
<view class="btn" @click="logout">
退出登录
</view>
</view>
</view>
<view class="btn" @click="logout">
退出登录
</view>
</view>
</view>
</template>
<script>
import VNavigationBarVue from '../../components/VNavigationBar.vue';
import config from '@/config'
import request from '@/utils/request';
import {
getToken,
getUserInfo,
getJSONData,
removeTenantId,
removeToken,removeUserInfo,removeJSONData,removeStrData
} from '@/utils/auth'
import {
closeMsgSocket,
} from '@/utils/tebBarSocket'
const UQRCode = require('uqrcodejs');
export default {
components: {
VNavigationBarVue
},
data() {
return {
imgUrlPrex:config.baseImageUrl,
shareUrl:config.shareUrl,
customInfo: {},
//
staff:{},
//
showUniCode:false,
defaultAvatar: require('@/static/icons/avatar.png')
};
},
onShow() {
if(!getToken()){
uni.reLaunch({
url: '/pages/login/login'
})
}else{
//
this.customInfo = getUserInfo()
this.staff = getJSONData("staffInfo")
if(this.staff.uniqueCode){
this.showUniCode =true
this.generateUniCode(this.staff.uniqueCode)
this.$forceUpdate()
}
}
},
methods:{
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
// uQRCodecanvas
qr.canvasContext = canvasContext;
// canvas
qr.drawCanvas();
})
},
logout(){
request({
url: '/admin-api/company/staff/logout',
method: 'post'
}).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '退出成功',
icon: 'none'
})
removeToken()
removeUserInfo()
removeJSONData("staffInfo")
removeStrData("userId")
removeTenantId()
//
uni.navigateTo({
url: '/pages/login/login'
})
if(this.$msgSocket){
closeMsgSocket(this.$msgSocket)
}
import VNavigationBarVue from '../../components/VNavigationBar.vue';
import config from '@/config'
import request from '@/utils/request';
import {
getToken,
getUserInfo,
getJSONData,
removeTenantId,
removeToken,
removeUserInfo,
removeJSONData,
removeStrData
} from '@/utils/auth'
import {
closeMsgSocket,
} from '@/utils/tebBarSocket'
const UQRCode = require('uqrcodejs');
export default {
components: {
VNavigationBarVue
},
data() {
return {
imgUrlPrex: config.baseImageUrl,
shareUrl: config.shareUrl,
customInfo: {},
//
staff: {},
//
showUniCode: false,
defaultAvatar: require('@/static/icons/avatar.png'),
checked: uni.getStorageSync('ifHint')
};
},
onShow() {
if (!getToken()) {
uni.reLaunch({
url: '/pages/login/login'
})
} else {
//
this.customInfo = getUserInfo()
this.staff = getJSONData("staffInfo")
if (this.staff.uniqueCode) {
this.showUniCode = true
this.generateUniCode(this.staff.uniqueCode)
this.$forceUpdate()
}
}
},
methods: {
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
// uQRCodecanvas
qr.canvasContext = canvasContext;
// canvas
qr.drawCanvas();
})
},
logout() {
request({
url: '/admin-api/company/staff/logout',
method: 'post'
}).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '退出成功',
icon: 'none'
})
removeToken()
removeUserInfo()
removeJSONData("staffInfo")
removeStrData("userId")
removeTenantId()
//
uni.navigateTo({
url: '/pages/login/login'
})
if (this.$msgSocket) {
closeMsgSocket(this.$msgSocket)
}
}else{
uni.showToast({
title: res.msg,
icon: 'none'
})
}
})
}
}
}
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
})
},
switch1Change(e) {
console.log('开关选择', e);
this.checked = e.detail.value
uni.setStorageSync('ifHint', e.detail.value)
const res = uni.getStorageSync('ifHint')
console.log(res);
}
}
}
</script>
<style lang="less" scoped>
.container {
height: 100%;
background: #fff;
.container {
height: 100%;
background: #fff;
.body {
border-top: 1px solid #ddd;
padding: 20rpx 32rpx;
}
.body {
border-top: 1px solid #ddd;
padding: 20rpx 32rpx;
}
.formItem {
box-sizing: border-box;
padding: 40rpx 0;
.formItem {
box-sizing: border-box;
padding: 40rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
column-gap: 20rpx;
}
display: flex;
align-items: center;
justify-content: space-between;
column-gap: 20rpx;
}
.formIcon {
width: 44rpx;
height: 44rpx;
}
.formIcon {
width: 44rpx;
height: 44rpx;
}
.formLabel {
font-size: 32rpx;
color: #333333;
}
.formLabel {
font-size: 32rpx;
color: #333333;
}
.formValue {
flex: 1;
width: 0;
text-align: right;
font-size: 32rpx;
color: #999999;
}
.formValue {
flex: 1;
width: 0;
text-align: right;
font-size: 32rpx;
color: #999999;
}
.formBtn {
width: 24rpx;
height: 24rpx;
}
.formBtn {
width: 24rpx;
height: 24rpx;
}
.avatar {
width: 108rpx;
height: 108rpx;
}
.avatar {
width: 108rpx;
height: 108rpx;
}
.btn {
width: 520rpx;
height: 80rpx;
border-radius: 40rpx 40rpx 40rpx 40rpx;
border: 1rpx solid #999999;
.btn {
width: 520rpx;
height: 80rpx;
border-radius: 40rpx 40rpx 40rpx 40rpx;
border: 1rpx solid #999999;
margin: 60rpx auto;
margin: 60rpx auto;
display: flex;
align-items: center;
justify-content: center;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
color: #999999;
}
}
</style>
font-size: 32rpx;
color: #999999;
}
}
</style>