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

页面修改

parent a4615cfe
......@@ -178,7 +178,7 @@
movieTime: 0,
movieTimmer: null,
fiveMinutes: 300,
ServerUrl:"http://47.96.23.199:5002"
ServerUrl: "http://47.96.23.199:5002"
};
},
mounted() {
......@@ -194,7 +194,6 @@
this.addVideo(txt);
});
audio.addEventListener('ended', function () {
console.log("audio", _this.endVideo)
if (_this.endVideo && _this.endVideo != '') {
audio.src = _this.endVideo
_this.endVideo = ''
......@@ -223,14 +222,39 @@
} else if (this.movieTime >= this.fiveMinutes && !this.movieShow) {
this.movieShow = true
} else {
let st = document.getElementsByTagName('video')[0].readyState
let play = document.getElementsByTagName('video')[0].paused
if (st == 4 && play) {
document.getElementsByTagName('video')[0].play()
try {
let st = document.getElementsByTagName('video')[0].readyState
let play = document.getElementsByTagName('video')[0].paused
if (st == 4 && play) {
document.getElementsByTagName('video')[0].play()
}
} catch(err) {
}
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) {
if (f) { // 根据f 删除一播放的数据
this.movie.splice(this.movieNum, 1)
......@@ -249,65 +273,67 @@
},
connec() {
let _this = this
let url = this.ServerUrl+"/data_server";
let url = this.ServerUrl + "/data_server";
let userInfo = this.getLocalStorage()
this.socket = this.$socketio.connect(url)
console.log("this.socket_" + this.getDateStr(), this.socket)
//报名信息
this.socket.on('sign_info', function (msg) {
_this.data.signInfo = msg.data
_this.movieTime = 0
_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)
});
//销售排行榜
this.socket.on('emp_sales_rank', function (msg) {
_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.data.sales = msg.data;
console.log("sales_销售额", msg)
console.log("sales_销售额_" + _this.getDateStr(), 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.data.guestNum = msg.data
console.log('guest_num_收客数', msg)
console.log("guest_num_收客数_" + _this.getDateStr(), msg)
});
//平台收客
this.socket.on('platform_guest', function (msg) {
_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.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.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.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.advert = msg.data;
console.log("advert_广告", msg.data);
console.log("advert_广告_" + _this.getDateStr(), msg.data);
});
//热词
this.socket.on('hot_word', function (msg) {
_this.hotWord = msg.data
console.log("hot_word_热词", msg.data);
console.log("hot_word_热词_" + _this.getDateStr(), msg.data);
});
},
getTime() {
......@@ -321,13 +347,13 @@
this.times.push(m)
},
init() {
let url =this.ServerUrl+'/api/user/get_init_data';
let url = this.ServerUrl + '/api/user/get_init_data';
let msg = {
tdsourcetag: 's_pcqq_aiomsg'
}
this.apiRequest(url, msg, r => {
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.advert = this.data.advertInfo
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