Commit 457834ca by 李乾广

修改pc端组件

1 parent aa48bdd2
......@@ -8,6 +8,7 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.26.1",
"core-js": "^3.8.3",
"element-ui": "^2.15.14",
"less": "^4.2.0",
......
import axios from 'axios'
import { Toast } from 'vant';
const baseURL = 'https://store.keliuyun.com';
const Axios = axios.create({
baseURL: baseURL, // 因为我本地做了反向代理
timeout: 0,
// responseType: "json",
changeOrigin: true,//允许跨域
withCredentials: true, // 是否允许带cookie这些
headers: {
"Content-Type": "application/json;charset=UTF-8"
// 'Content-Type': 'application/x-www-form-urlencoded'
}
})
// 请求拦截器
Axios.interceptors.request.use(
config => {
return config;
}, error => {
console.error(error);
return Promise.reject(error.data.msg)
}
)
Axios.interceptors.response.use(
res => {
if (res.data && !res.data.success) {
if (res.data.ecode && res.data.ecode != 200) {
return res.data.enote;
} else if (res.status == 200) {
return res;
}
return Promise.reject(res.data.msg);
} else if (!res.data && res.status == 200) {
return res;
}
return res;
}
)
export default function(method, url, data = null, config = null, bodyDelete) {
method = method.toLowerCase()
if (method == 'post') {
return Axios.post(url, data, config)
} else if (method == 'get') {
let defaultParam = {
_t: Date.parse(new Date()) / 1000
}
return Axios.get(url, { params: {...defaultParam, ...data }, config })
} else if (bodyDelete) {
return Axios.delete(url, { data: data }, config)
} else if (method == 'delete') {
return Axios.delete(url, { params: data }, config)
} else if (method == 'put') {
return Axios.put(url, data, config)
} else {
console.error('unknown method' + method)
return false
}
}
\ No newline at end of file
import req from '@/api/http.js'
const tourApi = {
// 获取通道的视频直播与回放地址
getLiveAndPlaybackAddress(params, config){
return req('GET', `/patrol/patrolDeviceChannel/getLiveAndPlaybackAddress`, params, config)
},
// 云控制
ptzStart(params,config) {
return req('PUT', `/patrol/patrolDeviceChannel/ptzStart`, params, config)
},
ptzStop(params,config) {
return req('PUT', `/patrol/patrolDeviceChannel/ptzStop`, params, config)
},
}
export default tourApi;
\ No newline at end of file
......@@ -47,6 +47,7 @@ export default {
}
},
mounted() {
console.log("this.playUrl", this.playUrl);
this.init();
},
unmounted() {
......@@ -54,6 +55,7 @@ export default {
},
methods:{
init(params = {}) {
console.log("this.playUrl", this.playUrl);
const options = Object.assign({
container: this.$refs.container,
decoder: '/jessibuca-pro/decoder-pro.js',
......@@ -102,7 +104,7 @@ export default {
this._jessibuca = new window.JessibucaPro(options);
this.registerEvent(this._jessibuca);
console.log("this.playUrl", this.playUrl);
if (this.playUrl) {
// 示例上有延迟写法
setTimeout(this.play(this.playUrl), 150);
......
......@@ -2,8 +2,8 @@
<div>
<!-- 添加视频测试 -->
<div>
<el-button type="primary" @click="addPlayer({channelId: '20000000001310000008',address: '52.130.155.147',prefixUrl:'nvsdemo'})">添加视频一</el-button>
<el-button type="primary" @click="addPlayer({channelId: '20000000001310000008',address: '52.130.155.147',prefixUrl:'nvsdemo'})">添加视频二</el-button>
<el-button type="primary" @click="addPlayer({gateUnid: '85de13a8-5775-11ee-94ed-00163e143ecd'})">河南分公司--办公室--办公室监控</el-button>
<el-button type="primary" @click="addPlayer({gateUnid: '85de1aec-5775-11ee-94ed-00163e143ecd',watermarkText:'Demo Store'})">Demo Store--客流相机-入口1</el-button>
</div>
<iframe id="iframe" name="iframe" ref="iframe" style="width: 100vw;height:calc(100vh - 60px);" src="/nvsdemo/#/jplayer-web" frameborder="0"></iframe>
<!-- <iframe name="iframe" ref="iframe" style="width: 100vw;height:calc(100vh - 60px);" src="http://192.168.1.117:8080/" frameborder="0"></iframe> -->
......
......@@ -309,7 +309,7 @@ export default {
this.mouseTimeMin = moment(date).format('mm')
this.mouseTimeSec = moment(date).format('ss')
this.isNoBack = moment(date).format('YYYY-MM-DD HH:mm:ss') == moment().format('YYYY-MM-DD HH:mm:ss')
this.$emit('videoTimeChange',date)
this.$emit('videoTimeChange',moment(date).format('YYYY-MM-DD HH:mm:ss'))
},
changeDate(date, status) {
// console.log("选择时间:" + date + " 播放状态:" + status);
......@@ -322,7 +322,7 @@ export default {
this.$forceUpdate()
}
// console.log(this.nowPlayTime)
this.$emit('videoTimeSync',date)
this.$emit('videoTimeSync',moment(date).format('YYYY-MM-DD HH:mm:ss'))
if (moment(date).format('YYYY-MM-DD') == moment().format('YYYY-MM-DD')) {
this.markTime = [{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!