更新
This commit is contained in:
parent
ee07d0a26a
commit
bcfcca966b
@ -21,22 +21,23 @@
|
||||
</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 ='';
|
||||
let innerAudioContext = '';
|
||||
// #ifdef APP || H5
|
||||
const jyJPush = uni.requireNativePlugin('JY-JPush');
|
||||
// #endif
|
||||
@ -45,17 +46,17 @@
|
||||
return {
|
||||
msgSocket: this.$msgSocket,
|
||||
// 是否正在播放
|
||||
ifPlay:false,
|
||||
ifPlay: false,
|
||||
aindex: 1,
|
||||
msgNum: null,
|
||||
identity: 'user',
|
||||
nowPageInterval: null,
|
||||
userInfo:{},
|
||||
userInfo: {},
|
||||
}
|
||||
},
|
||||
props: {
|
||||
msg: {
|
||||
type: String|Number,
|
||||
type: String | Number,
|
||||
default: ''
|
||||
},
|
||||
title: {
|
||||
@ -98,20 +99,20 @@
|
||||
},
|
||||
methods: {
|
||||
dianyidain() {
|
||||
if(!this.ifPlay){
|
||||
if (!this.ifPlay) {
|
||||
console.log('执行了,dianyidain');
|
||||
if(innerAudioContext!=""){
|
||||
if (innerAudioContext != "") {
|
||||
try {
|
||||
console.log('调用前先销毁');
|
||||
innerAudioContext.stop();
|
||||
innerAudioContext.destroy();
|
||||
innerAudioContext="";
|
||||
}catch (e){
|
||||
innerAudioContext = "";
|
||||
} catch (e) {
|
||||
console.log('销毁出错');
|
||||
}
|
||||
}
|
||||
innerAudioContext = uni.createInnerAudioContext();
|
||||
this.ifPlay=true
|
||||
this.ifPlay = true
|
||||
// #ifdef APP-PLUS
|
||||
innerAudioContext.src = '../../static/msgV.mp3';
|
||||
// #endif
|
||||
@ -125,13 +126,13 @@
|
||||
innerAudioContext.play();
|
||||
// 震动
|
||||
uni.vibrateLong({
|
||||
success: function () {
|
||||
success: function() {
|
||||
console.log('success');
|
||||
}
|
||||
});
|
||||
innerAudioContext.onError((err) => {
|
||||
console.error('播放错误', err);
|
||||
this.ifPlay=false
|
||||
this.ifPlay = false
|
||||
innerAudioContext.stop();
|
||||
innerAudioContext.destroy(); // 播放错误后释放实例
|
||||
});
|
||||
@ -145,20 +146,20 @@
|
||||
innerAudioContext.play();
|
||||
// 震动
|
||||
uni.vibrateLong({
|
||||
success: function () {
|
||||
success: function() {
|
||||
console.log('success');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 播放完成,可以在这里添加额外的逻辑
|
||||
console.log('播放完成');
|
||||
this.ifPlay=false
|
||||
this.ifPlay = false
|
||||
//及时释放资源
|
||||
innerAudioContext.stop();
|
||||
innerAudioContext.destroy();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
console.log('正在播放音频,拒绝播放请求');
|
||||
}
|
||||
},
|
||||
@ -169,7 +170,10 @@
|
||||
this.msgSocket.onMessage(res => {
|
||||
console.log("发出提示音", res);
|
||||
// this.getbottom();
|
||||
const ifHint = uni.getStorageSync("ifHint")
|
||||
if (ifHint) {
|
||||
this.dianyidain()
|
||||
}
|
||||
this.$emit('socketSuccess')
|
||||
})
|
||||
}
|
||||
@ -193,7 +197,7 @@
|
||||
const userInfo = getUserInfo()
|
||||
if (index == 1) {
|
||||
this.aindex = index
|
||||
if (userInfo.roleCodes.includes("repair_warehouse")){
|
||||
if (userInfo.roleCodes.includes("repair_warehouse")) {
|
||||
//跳转首页
|
||||
uni.navigateTo({
|
||||
url: '/pages-warehouse/home/home'
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -6,24 +6,32 @@
|
||||
<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-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>-->
|
||||
<!-- <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>-->
|
||||
<!-- <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>-->
|
||||
<!-- <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>
|
||||
@ -32,7 +40,7 @@
|
||||
</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>-->
|
||||
<!-- <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">
|
||||
@ -43,54 +51,58 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VNavigationBarVue from '../../components/VNavigationBar.vue';
|
||||
import config from '@/config'
|
||||
import request from '@/utils/request';
|
||||
import {
|
||||
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 {
|
||||
removeToken,
|
||||
removeUserInfo,
|
||||
removeJSONData,
|
||||
removeStrData
|
||||
} from '@/utils/auth'
|
||||
import {
|
||||
closeMsgSocket,
|
||||
} from '@/utils/tebBarSocket'
|
||||
const UQRCode = require('uqrcodejs');
|
||||
export default {
|
||||
} from '@/utils/tebBarSocket'
|
||||
const UQRCode = require('uqrcodejs');
|
||||
export default {
|
||||
components: {
|
||||
VNavigationBarVue
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imgUrlPrex:config.baseImageUrl,
|
||||
shareUrl:config.shareUrl,
|
||||
imgUrlPrex: config.baseImageUrl,
|
||||
shareUrl: config.shareUrl,
|
||||
customInfo: {},
|
||||
//员工个人信息
|
||||
staff:{},
|
||||
staff: {},
|
||||
//是否显示二维码
|
||||
showUniCode:false,
|
||||
defaultAvatar: require('@/static/icons/avatar.png')
|
||||
showUniCode: false,
|
||||
defaultAvatar: require('@/static/icons/avatar.png'),
|
||||
checked: uni.getStorageSync('ifHint')
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if(!getToken()){
|
||||
if (!getToken()) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
//直接取缓存中的用户信息
|
||||
this.customInfo = getUserInfo()
|
||||
this.staff = getJSONData("staffInfo")
|
||||
if(this.staff.uniqueCode){
|
||||
this.showUniCode =true
|
||||
if (this.staff.uniqueCode) {
|
||||
this.showUniCode = true
|
||||
this.generateUniCode(this.staff.uniqueCode)
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
generateUniCode(code){
|
||||
methods: {
|
||||
generateUniCode(code) {
|
||||
this.$nextTick(() => {
|
||||
// 获取uQRCode实例
|
||||
const qr = new UQRCode();
|
||||
@ -108,7 +120,7 @@ export default {
|
||||
qr.drawCanvas();
|
||||
})
|
||||
},
|
||||
logout(){
|
||||
logout() {
|
||||
request({
|
||||
url: '/admin-api/company/staff/logout',
|
||||
method: 'post'
|
||||
@ -127,24 +139,31 @@ export default {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
if(this.$msgSocket){
|
||||
if (this.$msgSocket) {
|
||||
closeMsgSocket(this.$msgSocket)
|
||||
}
|
||||
|
||||
}else{
|
||||
} 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 {
|
||||
.container {
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
|
||||
@ -206,5 +225,5 @@ export default {
|
||||
font-size: 32rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user