Commit 34a1aaa3 authored by 黄奎's avatar 黄奎

页面修改

parent a4615cfe
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
movieTime: 0, movieTime: 0,
movieTimmer: null, movieTimmer: null,
fiveMinutes: 300, fiveMinutes: 300,
ServerUrl:"http://47.96.23.199:5002" ServerUrl: "http://47.96.23.199:5002"
}; };
}, },
mounted() { mounted() {
...@@ -194,7 +194,6 @@ ...@@ -194,7 +194,6 @@
this.addVideo(txt); this.addVideo(txt);
}); });
audio.addEventListener('ended', function () { audio.addEventListener('ended', function () {
console.log("audio", _this.endVideo)
if (_this.endVideo && _this.endVideo != '') { if (_this.endVideo && _this.endVideo != '') {
audio.src = _this.endVideo audio.src = _this.endVideo
_this.endVideo = '' _this.endVideo = ''
...@@ -223,14 +222,39 @@ ...@@ -223,14 +222,39 @@
} else if (this.movieTime >= this.fiveMinutes && !this.movieShow) { } else if (this.movieTime >= this.fiveMinutes && !this.movieShow) {
this.movieShow = true this.movieShow = true
} else { } else {
let st = document.getElementsByTagName('video')[0].readyState try {
let play = document.getElementsByTagName('video')[0].paused let st = document.getElementsByTagName('video')[0].readyState
if (st == 4 && play) { let play = document.getElementsByTagName('video')[0].paused
document.getElementsByTagName('video')[0].play() if (st == 4 && play) {
document.getElementsByTagName('video')[0].play()
}
} catch(err) {
} }
return return
} }
}, },
getDateStr() {
var myDate = new Date();
//获取当前年
var year = myDate.getFullYear();
//获取当前月
var month = myDate.getMonth() + 1;
//获取当前日
var date = myDate.getDate();
var h = myDate.getHours(); //获取当前小时数(0-23)
var m = myDate.getMinutes(); //获取当前分钟数(0-59)
var s = myDate.getSeconds();
//获取当前时间
var now = year + '-' + this.conver(month) + "-" + this.conver(date) + " " + this.conver(h) + ':' + this
.conver(m) + ":" +
this.conver(s);
return now;
},
//日期时间处理
conver(s) {
return s < 10 ? '0' + s : s;
},
nextVideo: function (f) { nextVideo: function (f) {
if (f) { // 根据f 删除一播放的数据 if (f) { // 根据f 删除一播放的数据
this.movie.splice(this.movieNum, 1) this.movie.splice(this.movieNum, 1)
...@@ -249,65 +273,67 @@ ...@@ -249,65 +273,67 @@
}, },
connec() { connec() {
let _this = this let _this = this
let url = this.ServerUrl+"/data_server"; let url = this.ServerUrl + "/data_server";
let userInfo = this.getLocalStorage() let userInfo = this.getLocalStorage()
this.socket = this.$socketio.connect(url) this.socket = this.$socketio.connect(url)
console.log("this.socket_" + this.getDateStr(), this.socket)
//报名信息 //报名信息
this.socket.on('sign_info', function (msg) { this.socket.on('sign_info', function (msg) {
_this.data.signInfo = msg.data _this.data.signInfo = msg.data
_this.movieTime = 0 _this.movieTime = 0
_this.movieShow = false _this.movieShow = false
console.log("sign_info", msg, "_this.movieTime", _this.movieTime, "_this.movieShow", _this console.log("sign_info_" + _this.getDateStr(), msg, "_this.movieTime", _this.movieTime,
"_this.movieShow", _this
.movieShow) .movieShow)
}); });
//销售排行榜 //销售排行榜
this.socket.on('emp_sales_rank', function (msg) { this.socket.on('emp_sales_rank', function (msg) {
_this.data.empSalesRank = msg.data _this.data.empSalesRank = msg.data
console.log("emp_sales_rank_销售排行榜", msg) console.log("emp_sales_rank_销售排行榜_" + _this.getDateStr(), msg)
}); });
//销售额 //销售额
this.socket.on('sales', function (msg) { this.socket.on('sales', function (msg) {
_this.data.sales = msg.data; _this.data.sales = msg.data;
console.log("sales_销售额", msg) console.log("sales_销售额_" + _this.getDateStr(), msg)
}); });
//测试 //测试
this.socket.on('server_response', function (msg) { this.socket.on('server_response', function (msg) {
console.log("server_response_测试", msg) console.log("server_response_测试_" + _this.getDateStr(), msg)
}); });
//收客数 //收客数
this.socket.on('guest_num', function (msg) { this.socket.on('guest_num', function (msg) {
_this.data.guestNum = msg.data _this.data.guestNum = msg.data
console.log('guest_num_收客数', msg) console.log("guest_num_收客数_" + _this.getDateStr(), msg)
}); });
//平台收客 //平台收客
this.socket.on('platform_guest', function (msg) { this.socket.on('platform_guest', function (msg) {
_this.data.platformGuest = msg.data; _this.data.platformGuest = msg.data;
console.log("platform_guest_平台收客", msg.data) console.log("platform_guest_平台收客_" + _this.getDateStr(), msg.data)
}); });
//销售部门排名 //销售部门排名
this.socket.on('sales_department_rank', function (msg) { this.socket.on('sales_department_rank', function (msg) {
_this.data.salesDepartmentRank = msg.data _this.data.salesDepartmentRank = msg.data
console.log("sales_department_rank_销售部门排名", msg.data) console.log("sales_department_rank_销售部门排名_" + _this.getDateStr(), msg.data)
}); });
//销售线路排名 //销售线路排名
this.socket.on('line_guest_rank', function (msg) { this.socket.on('line_guest_rank', function (msg) {
_this.data.lineGuestRank = msg.data; _this.data.lineGuestRank = msg.data;
console.log("line_guest_rank_销售线路排名", msg.data) console.log("line_guest_rank_销售线路排名_" + _this.getDateStr(), msg.data)
}); });
//营业额走势图 //营业额走势图
this.socket.on('turnover_trend', function (msg) { this.socket.on('turnover_trend', function (msg) {
_this.data.turnoverTrend = msg.data _this.data.turnoverTrend = msg.data
console.log("turnover_trend_营业额走势图", msg.data) console.log("turnover_trend_营业额走势图_" + _this.getDateStr(), msg.data)
}); });
//广告 //广告
this.socket.on('advert', function (msg) { this.socket.on('advert', function (msg) {
_this.advert = msg.data; _this.advert = msg.data;
console.log("advert_广告", msg.data); console.log("advert_广告_" + _this.getDateStr(), msg.data);
}); });
//热词 //热词
this.socket.on('hot_word', function (msg) { this.socket.on('hot_word', function (msg) {
_this.hotWord = msg.data _this.hotWord = msg.data
console.log("hot_word_热词", msg.data); console.log("hot_word_热词_" + _this.getDateStr(), msg.data);
}); });
}, },
getTime() { getTime() {
...@@ -321,13 +347,13 @@ ...@@ -321,13 +347,13 @@
this.times.push(m) this.times.push(m)
}, },
init() { init() {
let url =this.ServerUrl+'/api/user/get_init_data'; let url = this.ServerUrl + '/api/user/get_init_data';
let msg = { let msg = {
tdsourcetag: 's_pcqq_aiomsg' tdsourcetag: 's_pcqq_aiomsg'
} }
this.apiRequest(url, msg, r => { this.apiRequest(url, msg, r => {
this.data = r.data.data this.data = r.data.data
console.log("get_init_data",this.data) console.log("get_init_data", this.data)
this.hotWord = this.data.hotWord this.hotWord = this.data.hotWord
this.advert = this.data.advertInfo this.advert = this.data.advertInfo
this.isReady = true this.isReady = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment