本地开发
This commit is contained in:
@@ -46,8 +46,8 @@ import axios from "axios";
|
||||
import Swiper from 'swiper'; // 注意引入的是Swiper
|
||||
import 'swiper/css/swiper.min.css' // 注意这里的引入
|
||||
import {Notify, Dialog} from 'vant';
|
||||
|
||||
import {getStatisFileUrl} from '../utils/publicFun'
|
||||
import service from "@/utils/service";
|
||||
import {getStatisFileUrl, getUrlParam} from '../utils/publicFun'
|
||||
|
||||
/* eslint-disable */
|
||||
export default {
|
||||
@@ -93,21 +93,30 @@ export default {
|
||||
console.log(location.href)
|
||||
console.log(location.href)
|
||||
|
||||
this.isPublish = this.$route.query.isPublish;
|
||||
this.isPlayer = this.$route.query.isPlayer;
|
||||
this.uid = this.$route.query.uid;
|
||||
this.roomId = this.$route.query.room;
|
||||
this.inviteName = this.$route.query.inviteName || '';
|
||||
this.topVideo = this.uid;
|
||||
this.showConfirmDialog = this.$route.query.showConfirmDialog;
|
||||
this.showInviteConfirmDialog = this.$route.query.showInviteConfirmDialog;
|
||||
|
||||
this.isPublish = getUrlParam("isPublish");
|
||||
this.isPlayer = getUrlParam("isPlayer");
|
||||
this.uid = getUrlParam("uid");
|
||||
this.uname = getUrlParam("uname");
|
||||
this.roomId = getUrlParam("room");
|
||||
this.inviteName = getUrlParam("inviteName");
|
||||
console.log("this.inviteName" + this.inviteName)
|
||||
this.topVideo = getUrlParam("uid");
|
||||
this.showConfirmDialog = getUrlParam("showConfirmDialog");
|
||||
this.showInviteConfirmDialog = getUrlParam("showInviteConfirmDialog");
|
||||
|
||||
this.voiceImg = getStatisFileUrl("/media/voice_open.png")
|
||||
this.cameraImg = getStatisFileUrl("/media/camera_open.png")
|
||||
this.switchCameraImg = getStatisFileUrl("/media/switch.png")
|
||||
this.callDwonImg = getStatisFileUrl("/media/call_down.png")
|
||||
|
||||
if (getUrlParam("hasVideo") != 1) {
|
||||
// hasVideo
|
||||
this.constraints.video = false
|
||||
this.isCloseCamera = true
|
||||
this.cameraImg = getStatisFileUrl("/media/camera_close.png")
|
||||
|
||||
}
|
||||
|
||||
this.token = this.$route.query.token || "";
|
||||
if (this.token > 10) {
|
||||
localStorage.setItem("hd_token", this.token)
|
||||
@@ -130,12 +139,17 @@ export default {
|
||||
Dialog.confirm({
|
||||
title: '提示',
|
||||
message: `确认是否发起视频聊天?`,
|
||||
}).then(() => {
|
||||
console.log("确认")
|
||||
try {
|
||||
this.init();
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
// on confirm
|
||||
})
|
||||
.then(() => {
|
||||
this.init();
|
||||
// on confirm
|
||||
})
|
||||
.catch(() => {
|
||||
console.log("取消")
|
||||
window.history.go(-1);
|
||||
// on cancel
|
||||
});
|
||||
@@ -190,6 +204,7 @@ export default {
|
||||
this.beginPublish()
|
||||
},
|
||||
closeCamera() {
|
||||
|
||||
this.constraints.video = false;
|
||||
//如果视频是开启状态
|
||||
if (!this.isCloseCamera) {
|
||||
@@ -198,7 +213,7 @@ export default {
|
||||
this.cameraImg = getStatisFileUrl("/media/camera_close.png")
|
||||
} else {
|
||||
let deviceId = {
|
||||
exact: ""
|
||||
exact: this.cameraDevices[this.cameraIndex].deviceId
|
||||
}
|
||||
deviceId.exact = this.cameraDevices[this.cameraIndex].deviceId
|
||||
this.constraints.video = {}
|
||||
@@ -206,6 +221,8 @@ export default {
|
||||
this.isCloseCamera = false
|
||||
this.cameraImg = getStatisFileUrl("/media/camera_open.png")
|
||||
}
|
||||
console.log(this.constraints)
|
||||
// return;
|
||||
this.beginPublish()
|
||||
},
|
||||
switchCamera() {
|
||||
@@ -327,7 +344,7 @@ export default {
|
||||
video.onloadedmetadata = function (e) {
|
||||
if (publishId == _this.uid)
|
||||
video.volume = 0
|
||||
video.play();
|
||||
video.play();
|
||||
};
|
||||
|
||||
// $('#rtc_media_player').prop('srcObject', sdk.stream);
|
||||
@@ -444,14 +461,40 @@ export default {
|
||||
|
||||
},
|
||||
videoDownAction() {
|
||||
location.href = "uniwebview://action?function=restartCamera";
|
||||
this.publishSdk.close();
|
||||
if (this.showConfirmDialog == 1) {
|
||||
console.log("挂断视频")
|
||||
location.href = "uniwebview://action?function=refuseVideoInvite";
|
||||
} else {
|
||||
window.history.go(-1);
|
||||
const roomInfo = {
|
||||
roomId: this.roomId
|
||||
}
|
||||
|
||||
console.log("============videoDownAction")
|
||||
console.log("============videoDownAction")
|
||||
console.log("============videoDownAction")
|
||||
|
||||
service.post(`/api/im/app/wsMsg`, {
|
||||
msgType: "10000",
|
||||
msgId: JSON.stringify(roomInfo),
|
||||
cmd: "hangUp",
|
||||
msgTxt: this.uname || ""
|
||||
}).then((res) => {
|
||||
if (res.status == 200) {
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
try {
|
||||
// location.href = "uniwebview://action?function=restartCamera";
|
||||
// location.href = "uniwebview://action?function=refuseVideoInvite";
|
||||
//
|
||||
// this.publishSdk.close();
|
||||
// if (this.showConfirmDialog == 1) {
|
||||
// console.log("挂断视频")
|
||||
// location.href = "uniwebview://action?function=refuseVideoInvite";
|
||||
// } else {
|
||||
// window.history.go(-1);
|
||||
// }
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ import * as interaction from 'ol/interaction'; // 交互
|
||||
import {OL as ol} from "plot-ol/plottingol";
|
||||
import GeoJSON from 'ol/format/GeoJSON'
|
||||
import service from "@/utils/service";
|
||||
import {appInit, getStatisFileUrl} from "../utils/publicFun";
|
||||
import {appInit, getStatisFileUrl, getUrlParam} from "../utils/publicFun";
|
||||
|
||||
|
||||
export default {
|
||||
@@ -131,12 +131,11 @@ export default {
|
||||
this.page = this.$route.query.page;
|
||||
this.pageType = this.$route.query.type;
|
||||
|
||||
this.token = this.$route.query.token || "";
|
||||
if (this.token > 10) {
|
||||
this.token = getUrlParam("token")
|
||||
if (this.token !=null) {
|
||||
localStorage.setItem("hd_token", this.token)
|
||||
}
|
||||
|
||||
|
||||
setInterval(() => {
|
||||
let hd_gps_location = localStorage.getItem("hd_gps_location")
|
||||
if (hd_gps_location) {
|
||||
@@ -580,6 +579,7 @@ export default {
|
||||
pageNo: 1,
|
||||
pageSize: 50
|
||||
}
|
||||
|
||||
}).then((res) => {
|
||||
if (res.status == 200) {
|
||||
this.map.removeLayer(this.equipmentLayer)
|
||||
@@ -739,11 +739,19 @@ export default {
|
||||
// anchor: [0.5, 0.5],
|
||||
scale: 0.4,
|
||||
}),
|
||||
text: new Text({
|
||||
testAlign: 'center',
|
||||
text: [record.equipmentName, 'bold 16px sans-serif', '\n',''],
|
||||
font: 'bold 20px 微软雅黑',
|
||||
fill: new Fill({
|
||||
color: 'rgb(155, 155, 155)',
|
||||
}),
|
||||
offsetY: 36
|
||||
})
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if (record.isOnline == "true") {
|
||||
// 未接受告警数量为0,全部都接受 绿色
|
||||
if(alarmNum==0){
|
||||
@@ -755,6 +763,14 @@ export default {
|
||||
// anchor: [0.5, 0.5],
|
||||
scale: 0.4,
|
||||
}),
|
||||
text: new Text({
|
||||
testAlign: 'center',
|
||||
text: [record.equipmentName, 'bold 16px sans-serif', '\n',''],
|
||||
font: 'bold 20px 微软雅黑',
|
||||
fill: new Fill({
|
||||
color: 'rgb(22, 206, 129)',
|
||||
})
|
||||
})
|
||||
})
|
||||
);
|
||||
}
|
||||
@@ -769,10 +785,10 @@ export default {
|
||||
}),
|
||||
text:new Text({
|
||||
testAlign: 'center',
|
||||
text: `${alarmNum}条告警未接受`,
|
||||
text: [record.equipmentName, 'bold 16px sans-serif', '\n','',`${alarmNum}条告警未接受`, 'bold 16px sans-serif',],
|
||||
font: 'bold 16px 微软雅黑',
|
||||
fill: new Fill({
|
||||
color: '#369FFF',
|
||||
color: 'rgb(54, 159, 255)',
|
||||
}),
|
||||
// offsetX: 40,
|
||||
offsetY: 26
|
||||
|
||||
@@ -158,8 +158,14 @@ export default {
|
||||
this.moveUserId = this.$route.query.uerId||getUrlParam("uerId");
|
||||
this.workOrderNo = this.$route.query.workOrderNo||getUrlParam("workOrderNo");
|
||||
|
||||
this.token = this.$route.query.token ||getUrlParam("page");
|
||||
localStorage.setItem("hd_token", this.token)
|
||||
if(this.token!=null){
|
||||
if (this.token.length > 16) {
|
||||
console.log("获取到token")
|
||||
localStorage.setItem("hd_token", this.token)
|
||||
}else {
|
||||
console.log("未获取到token")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
setInterval(() => {
|
||||
|
||||
@@ -177,8 +177,8 @@ export default {
|
||||
|
||||
this.token = getUrlParam("token")
|
||||
|
||||
if(this.token){
|
||||
if (this.token.length > 10) {
|
||||
if(this.token!=null){
|
||||
if (this.token.length > 16) {
|
||||
console.log("获取到token")
|
||||
localStorage.setItem("hd_token", this.token)
|
||||
}else {
|
||||
|
||||
@@ -17,11 +17,10 @@ export function getUrlParam(name) {
|
||||
if (search) {
|
||||
var r = search.substr(0).match(reg);
|
||||
if (r !== null) {
|
||||
return unescape(r[2]);
|
||||
return decodeURIComponent(r[2]);
|
||||
}
|
||||
return null;
|
||||
} else return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user