更新
This commit is contained in:
parent
ee07d0a26a
commit
bcfcca966b
@ -21,22 +21,23 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="">内部管理</view>
|
<view class="">内部管理</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="box" :class="{active: aindex == 3}" @click="getgogo(3)">-->
|
<!-- <view class="box" :class="{active: aindex == 3}" @click="getgogo(3)">-->
|
||||||
<!-- <view class="imgs">-->
|
<!-- <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.png" v-show="aindex != 3"></image>-->
|
||||||
<!-- <image mode="aspectFit" src="@/static/icons/tabbar/my-checked.png" v-show="aindex == 3"></image>-->
|
<!-- <image mode="aspectFit" src="@/static/icons/tabbar/my-checked.png" v-show="aindex == 3"></image>-->
|
||||||
<!-- </view>-->
|
<!-- </view>-->
|
||||||
<!-- <view class="">我的</view>-->
|
<!-- <view class="">我的</view>-->
|
||||||
<!-- </view>-->
|
<!-- </view>-->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '../../utils/request';
|
import request from '../../utils/request';
|
||||||
import {
|
import {
|
||||||
getToken,getUserInfo
|
getToken,
|
||||||
|
getUserInfo
|
||||||
} from '@/utils/auth'
|
} from '@/utils/auth'
|
||||||
let innerAudioContext ='';
|
let innerAudioContext = '';
|
||||||
// #ifdef APP || H5
|
// #ifdef APP || H5
|
||||||
const jyJPush = uni.requireNativePlugin('JY-JPush');
|
const jyJPush = uni.requireNativePlugin('JY-JPush');
|
||||||
// #endif
|
// #endif
|
||||||
@ -45,17 +46,17 @@
|
|||||||
return {
|
return {
|
||||||
msgSocket: this.$msgSocket,
|
msgSocket: this.$msgSocket,
|
||||||
// 是否正在播放
|
// 是否正在播放
|
||||||
ifPlay:false,
|
ifPlay: false,
|
||||||
aindex: 1,
|
aindex: 1,
|
||||||
msgNum: null,
|
msgNum: null,
|
||||||
identity: 'user',
|
identity: 'user',
|
||||||
nowPageInterval: null,
|
nowPageInterval: null,
|
||||||
userInfo:{},
|
userInfo: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
msg: {
|
msg: {
|
||||||
type: String|Number,
|
type: String | Number,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
@ -98,20 +99,20 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
dianyidain() {
|
dianyidain() {
|
||||||
if(!this.ifPlay){
|
if (!this.ifPlay) {
|
||||||
console.log('执行了,dianyidain');
|
console.log('执行了,dianyidain');
|
||||||
if(innerAudioContext!=""){
|
if (innerAudioContext != "") {
|
||||||
try {
|
try {
|
||||||
console.log('调用前先销毁');
|
console.log('调用前先销毁');
|
||||||
innerAudioContext.stop();
|
innerAudioContext.stop();
|
||||||
innerAudioContext.destroy();
|
innerAudioContext.destroy();
|
||||||
innerAudioContext="";
|
innerAudioContext = "";
|
||||||
}catch (e){
|
} catch (e) {
|
||||||
console.log('销毁出错');
|
console.log('销毁出错');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
innerAudioContext = uni.createInnerAudioContext();
|
innerAudioContext = uni.createInnerAudioContext();
|
||||||
this.ifPlay=true
|
this.ifPlay = true
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
innerAudioContext.src = '../../static/msgV.mp3';
|
innerAudioContext.src = '../../static/msgV.mp3';
|
||||||
// #endif
|
// #endif
|
||||||
@ -125,13 +126,13 @@
|
|||||||
innerAudioContext.play();
|
innerAudioContext.play();
|
||||||
// 震动
|
// 震动
|
||||||
uni.vibrateLong({
|
uni.vibrateLong({
|
||||||
success: function () {
|
success: function() {
|
||||||
console.log('success');
|
console.log('success');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
innerAudioContext.onError((err) => {
|
innerAudioContext.onError((err) => {
|
||||||
console.error('播放错误', err);
|
console.error('播放错误', err);
|
||||||
this.ifPlay=false
|
this.ifPlay = false
|
||||||
innerAudioContext.stop();
|
innerAudioContext.stop();
|
||||||
innerAudioContext.destroy(); // 播放错误后释放实例
|
innerAudioContext.destroy(); // 播放错误后释放实例
|
||||||
});
|
});
|
||||||
@ -145,20 +146,20 @@
|
|||||||
innerAudioContext.play();
|
innerAudioContext.play();
|
||||||
// 震动
|
// 震动
|
||||||
uni.vibrateLong({
|
uni.vibrateLong({
|
||||||
success: function () {
|
success: function() {
|
||||||
console.log('success');
|
console.log('success');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 播放完成,可以在这里添加额外的逻辑
|
// 播放完成,可以在这里添加额外的逻辑
|
||||||
console.log('播放完成');
|
console.log('播放完成');
|
||||||
this.ifPlay=false
|
this.ifPlay = false
|
||||||
//及时释放资源
|
//及时释放资源
|
||||||
innerAudioContext.stop();
|
innerAudioContext.stop();
|
||||||
innerAudioContext.destroy();
|
innerAudioContext.destroy();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
console.log('正在播放音频,拒绝播放请求');
|
console.log('正在播放音频,拒绝播放请求');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -169,7 +170,10 @@
|
|||||||
this.msgSocket.onMessage(res => {
|
this.msgSocket.onMessage(res => {
|
||||||
console.log("发出提示音", res);
|
console.log("发出提示音", res);
|
||||||
// this.getbottom();
|
// this.getbottom();
|
||||||
|
const ifHint = uni.getStorageSync("ifHint")
|
||||||
|
if (ifHint) {
|
||||||
this.dianyidain()
|
this.dianyidain()
|
||||||
|
}
|
||||||
this.$emit('socketSuccess')
|
this.$emit('socketSuccess')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -193,7 +197,7 @@
|
|||||||
const userInfo = getUserInfo()
|
const userInfo = getUserInfo()
|
||||||
if (index == 1) {
|
if (index == 1) {
|
||||||
this.aindex = index
|
this.aindex = index
|
||||||
if (userInfo.roleCodes.includes("repair_warehouse")){
|
if (userInfo.roleCodes.includes("repair_warehouse")) {
|
||||||
//跳转首页
|
//跳转首页
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages-warehouse/home/home'
|
url: '/pages-warehouse/home/home'
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
汇报内容
|
汇报内容
|
||||||
</view>
|
</view>
|
||||||
<!-- <u--textarea v-if="type != 'look'" v-model="report.reportContent" placeholder="请输入内容"></u--textarea> -->
|
<!-- <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="x_"></view>
|
||||||
<view class="d_b" @click="handleUpload" v-if="type != 'look'">
|
<view class="d_b" @click="handleUpload" v-if="type != 'look'">
|
||||||
<view class="">附件</view>
|
<view class="">附件</view>
|
||||||
|
|||||||
@ -263,7 +263,7 @@
|
|||||||
:localdata="insuranceTypeList"></uni-data-checkbox>
|
:localdata="insuranceTypeList"></uni-data-checkbox>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="display: flex;align-items: center">
|
<!-- <view style="display: flex;align-items: center">
|
||||||
<view class="infoItem" style="flex: 1">
|
<view class="infoItem" style="flex: 1">
|
||||||
<text class="label">上年保费</text>
|
<text class="label">上年保费</text>
|
||||||
<view style="display: flex">
|
<view style="display: flex">
|
||||||
@ -273,7 +273,7 @@
|
|||||||
placeholder="请输入商业险保费" />
|
placeholder="请输入商业险保费" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<view style="display: flex;align-items: center">
|
<view style="display: flex;align-items: center">
|
||||||
<view class="infoItem" style="flex: 1">
|
<view class="infoItem" style="flex: 1">
|
||||||
<text class="label">救援费</text>
|
<text class="label">救援费</text>
|
||||||
|
|||||||
@ -6,24 +6,32 @@
|
|||||||
<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 v-if="''==customInfo.avatar || null == customInfo.avatar" :src="defaultAvatar" class="avatar" mode="scaleToFill"
|
<image v-if="''==customInfo.avatar || null == customInfo.avatar" :src="defaultAvatar" class="avatar"
|
||||||
style="width: 64rpx;height: 64rpx;border-radius: 50%;"></image>
|
mode="scaleToFill" style="width: 64rpx;height: 64rpx;border-radius: 50%;"></image>
|
||||||
<image v-else :src="imgUrlPrex+customInfo.avatar" class="avatar" mode="scaleToFill"
|
<image v-else :src="imgUrlPrex+customInfo.avatar" class="avatar" mode="scaleToFill"
|
||||||
style="width: 64rpx;height: 64rpx;border-radius: 50%;"></image>
|
style="width: 64rpx;height: 64rpx;border-radius: 50%;"></image>
|
||||||
</view>
|
</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>
|
||||||
<view class="formItem">
|
<view class="formItem">
|
||||||
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_2.png"></image>
|
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_2.png"></image>
|
||||||
<text class="formLabel">账号昵称</text>
|
<text class="formLabel">账号昵称</text>
|
||||||
<text class="formValue">{{ customInfo.nickname }}</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>
|
||||||
<view class="formItem">
|
<view class="formItem">
|
||||||
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_3.png"></image>
|
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_3.png"></image>
|
||||||
<text class="formLabel">绑定电话</text>
|
<text class="formLabel">绑定电话</text>
|
||||||
<text class="formValue">{{ customInfo.mobile }}</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>
|
||||||
<view class="formItem" v-if="showUniCode">
|
<view class="formItem" v-if="showUniCode">
|
||||||
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_3.png"></image>
|
<image class="formIcon" mode="aspectFit" src="/static/icons/userInfo_3.png"></image>
|
||||||
@ -32,7 +40,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view style="padding-bottom: 60rpx;border-bottom: 1px solid #ddd;" class="formItem" v-if="showUniCode">
|
<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>
|
<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>
|
||||||
|
|
||||||
<view class="btn" @click="logout">
|
<view class="btn" @click="logout">
|
||||||
@ -43,54 +51,58 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import VNavigationBarVue from '../../components/VNavigationBar.vue';
|
import VNavigationBarVue from '../../components/VNavigationBar.vue';
|
||||||
import config from '@/config'
|
import config from '@/config'
|
||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import {
|
import {
|
||||||
getToken,
|
getToken,
|
||||||
getUserInfo,
|
getUserInfo,
|
||||||
getJSONData,
|
getJSONData,
|
||||||
removeTenantId,
|
removeTenantId,
|
||||||
removeToken,removeUserInfo,removeJSONData,removeStrData
|
removeToken,
|
||||||
} from '@/utils/auth'
|
removeUserInfo,
|
||||||
import {
|
removeJSONData,
|
||||||
|
removeStrData
|
||||||
|
} from '@/utils/auth'
|
||||||
|
import {
|
||||||
closeMsgSocket,
|
closeMsgSocket,
|
||||||
} from '@/utils/tebBarSocket'
|
} from '@/utils/tebBarSocket'
|
||||||
const UQRCode = require('uqrcodejs');
|
const UQRCode = require('uqrcodejs');
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
VNavigationBarVue
|
VNavigationBarVue
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
imgUrlPrex:config.baseImageUrl,
|
imgUrlPrex: config.baseImageUrl,
|
||||||
shareUrl:config.shareUrl,
|
shareUrl: config.shareUrl,
|
||||||
customInfo: {},
|
customInfo: {},
|
||||||
//员工个人信息
|
//员工个人信息
|
||||||
staff:{},
|
staff: {},
|
||||||
//是否显示二维码
|
//是否显示二维码
|
||||||
showUniCode:false,
|
showUniCode: false,
|
||||||
defaultAvatar: require('@/static/icons/avatar.png')
|
defaultAvatar: require('@/static/icons/avatar.png'),
|
||||||
|
checked: uni.getStorageSync('ifHint')
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if(!getToken()){
|
if (!getToken()) {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/login/login'
|
url: '/pages/login/login'
|
||||||
})
|
})
|
||||||
}else{
|
} else {
|
||||||
//直接取缓存中的用户信息
|
//直接取缓存中的用户信息
|
||||||
this.customInfo = getUserInfo()
|
this.customInfo = getUserInfo()
|
||||||
this.staff = getJSONData("staffInfo")
|
this.staff = getJSONData("staffInfo")
|
||||||
if(this.staff.uniqueCode){
|
if (this.staff.uniqueCode) {
|
||||||
this.showUniCode =true
|
this.showUniCode = true
|
||||||
this.generateUniCode(this.staff.uniqueCode)
|
this.generateUniCode(this.staff.uniqueCode)
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods: {
|
||||||
generateUniCode(code){
|
generateUniCode(code) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
// 获取uQRCode实例
|
// 获取uQRCode实例
|
||||||
const qr = new UQRCode();
|
const qr = new UQRCode();
|
||||||
@ -108,7 +120,7 @@ export default {
|
|||||||
qr.drawCanvas();
|
qr.drawCanvas();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
logout(){
|
logout() {
|
||||||
request({
|
request({
|
||||||
url: '/admin-api/company/staff/logout',
|
url: '/admin-api/company/staff/logout',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
@ -127,24 +139,31 @@ export default {
|
|||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/login/login'
|
url: '/pages/login/login'
|
||||||
})
|
})
|
||||||
if(this.$msgSocket){
|
if (this.$msgSocket) {
|
||||||
closeMsgSocket(this.$msgSocket)
|
closeMsgSocket(this.$msgSocket)
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: 'none'
|
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>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.container {
|
.container {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
|
||||||
@ -206,5 +225,5 @@ export default {
|
|||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
Loading…
Reference in New Issue
Block a user