Commit 8b281c3b by xiawei

eslint

parent c50f6d1e
...@@ -281,7 +281,16 @@ module.exports = { ...@@ -281,7 +281,16 @@ module.exports = {
'no-cond-assign': [2, 'except-parens'], 'no-cond-assign': [2, 'except-parens'],
// 禁止出现难以理解的箭头函数,除非用圆括号括起来 // 禁止出现难以理解的箭头函数,除非用圆括号括起来
'no-confusing-arrow': [2, {}], 'no-confusing-arrow': [
2,
{
allowParens: true
}
],
// 禁止使用 console,线上环境检测
'no-console': process.env.NODE_ENV === 'production' ? 1 : 0,
// 禁止 debugger 语句,线上环境检测 // 禁止 debugger 语句,线上环境检测
'no-debugger': process.env.NODE_ENV === 'production' ? 1 : 0, 'no-debugger': process.env.NODE_ENV === 'production' ? 1 : 0,
...@@ -795,6 +804,9 @@ module.exports = { ...@@ -795,6 +804,9 @@ module.exports = {
// @off 没有必要 // @off 没有必要
'prefer-arrow-callback': 0, 'prefer-arrow-callback': 0,
// 声明后不再修改的变量必须使用 const,仅作提醒
'prefer-const': 1,
// 必须使用解构 // 必须使用解构
// @off 没有必要 // @off 没有必要
'prefer-destructuring': 0, 'prefer-destructuring': 0,
......
...@@ -38,7 +38,7 @@ export default { ...@@ -38,7 +38,7 @@ export default {
uin: this.channelInfo.uin uin: this.channelInfo.uin
}); });
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let info = res.data || {}; const info = res.data || {};
if (info.needPayInvalid === 1) { if (info.needPayInvalid === 1) {
this.isWatchPay = false; this.isWatchPay = false;
} else if (info.isCanPlay === 0) { } else if (info.isCanPlay === 0) {
......
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
set_encrypt: 'set_encrypt' set_encrypt: 'set_encrypt'
}), }),
async get_encrypt() { async get_encrypt() {
let passToken = this.$cookie.get(this.tokenKey) || ''; const passToken = this.$cookie.get(this.tokenKey) || '';
if (passToken) { if (passToken) {
const res = await checkPassword({ const res = await checkPassword({
id: this.channelInfo.id, id: this.channelInfo.id,
......
...@@ -56,20 +56,20 @@ export default { ...@@ -56,20 +56,20 @@ export default {
uin: this.channelInfo.uin uin: this.channelInfo.uin
}); });
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let list = res.data || []; const list = res.data || [];
this.list = list.filter(x => { this.list = list.filter(x => {
return x.display; return x.display;
}); });
} }
}, },
_changePlayer(url, id) { _changePlayer(url, id) {
let info = JSON.parse(JSON.stringify(this.playerInfo)); const info = JSON.parse(JSON.stringify(this.playerInfo));
info.playUrl = url; info.playUrl = url;
info.cameraId = id; info.cameraId = id;
this.set_playerInfo(info); this.set_playerInfo(info);
}, },
_scrollGo(go) { _scrollGo(go) {
let page = this.page let page = this.page
if (go === 'left') { if (go === 'left') {
page = page - 1 > 0 ? page - 1 : 0; page = page - 1 > 0 ? page - 1 : 0;
} else if (go === 'right') { } else if (go === 'right') {
......
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
channelInfo: 'channelInfo' channelInfo: 'channelInfo'
}), }),
userHead() { userHead() {
let userHeadImg = this.info.userHeadImg; const userHeadImg = this.info.userHeadImg;
if (userHeadImg === 'phoneHead') { if (userHeadImg === 'phoneHead') {
return this.channelInfo.defaultPhoneHeadAva; return this.channelInfo.defaultPhoneHeadAva;
} else if (userHeadImg === 'default') { } else if (userHeadImg === 'default') {
......
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
set_showRedInfo: 'set_showRedInfo' set_showRedInfo: 'set_showRedInfo'
}), }),
_showRed(type, id) { _showRed(type, id) {
let obj = { const obj = {
type: type, type: type,
id: id id: id
}; };
......
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
set_showRedInfo: 'set_showRedInfo' set_showRedInfo: 'set_showRedInfo'
}), }),
_showRed(type, id) { _showRed(type, id) {
let obj = { const obj = {
type: type, type: type,
id: id id: id
}; };
......
...@@ -28,7 +28,7 @@ export default { ...@@ -28,7 +28,7 @@ export default {
channelInfo: 'channelInfo' channelInfo: 'channelInfo'
}), }),
userHead() { userHead() {
let userHeadImg = this.info.userHeadImg; const userHeadImg = this.info.userHeadImg;
if (userHeadImg === 'phoneHead') { if (userHeadImg === 'phoneHead') {
return this.channelInfo.defaultPhoneHeadAva; return this.channelInfo.defaultPhoneHeadAva;
} else if (userHeadImg === 'default') { } else if (userHeadImg === 'default') {
...@@ -45,7 +45,7 @@ export default { ...@@ -45,7 +45,7 @@ export default {
set_showRedInfo: 'set_showRedInfo' set_showRedInfo: 'set_showRedInfo'
}), }),
_showRed(type, id) { _showRed(type, id) {
let obj = { const obj = {
type: type, type: type,
id: id id: id
}; };
......
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
set_showRedInfo: 'set_showRedInfo' set_showRedInfo: 'set_showRedInfo'
}), }),
_showRed(type, id) { _showRed(type, id) {
let obj = { const obj = {
type: type, type: type,
id: id id: id
}; };
......
...@@ -28,7 +28,7 @@ export default { ...@@ -28,7 +28,7 @@ export default {
channelInfo: 'channelInfo' channelInfo: 'channelInfo'
}), }),
userHead() { userHead() {
let userHeadImg = this.info.userHeadImg; const userHeadImg = this.info.userHeadImg;
if (userHeadImg === 'phoneHead') { if (userHeadImg === 'phoneHead') {
return this.channelInfo.defaultPhoneHeadAva; return this.channelInfo.defaultPhoneHeadAva;
} else if (userHeadImg === 'default') { } else if (userHeadImg === 'default') {
...@@ -45,7 +45,7 @@ export default { ...@@ -45,7 +45,7 @@ export default {
set_showRedInfo: 'set_showRedInfo' set_showRedInfo: 'set_showRedInfo'
}), }),
_showRed(type, id) { _showRed(type, id) {
let obj = { const obj = {
type: type, type: type,
id: id id: id
}; };
......
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
set_showRedInfo: 'set_showRedInfo' set_showRedInfo: 'set_showRedInfo'
}), }),
_showRed(type, id) { _showRed(type, id) {
let obj = { const obj = {
type: type, type: type,
id: id id: id
}; };
......
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
set_showRedInfo: 'set_showRedInfo' set_showRedInfo: 'set_showRedInfo'
}), }),
_showRed(type, id) { _showRed(type, id) {
let obj = { const obj = {
type: type, type: type,
id: id id: id
}; };
......
...@@ -48,7 +48,7 @@ export default { ...@@ -48,7 +48,7 @@ export default {
channelInfo: 'channelInfo' channelInfo: 'channelInfo'
}), }),
userHead() { userHead() {
let userHeadImg = this.info.userHeadImg; const userHeadImg = this.info.userHeadImg;
if (userHeadImg === 'phoneHead') { if (userHeadImg === 'phoneHead') {
return this.channelInfo.defaultPhoneHeadAva; return this.channelInfo.defaultPhoneHeadAva;
} else if (userHeadImg === 'default') { } else if (userHeadImg === 'default') {
...@@ -62,7 +62,7 @@ export default { ...@@ -62,7 +62,7 @@ export default {
}, },
methods: { methods: {
_reply(id, userNick, filterContent) { _reply(id, userNick, filterContent) {
let obj = { const obj = {
id: id, id: id,
userNick: userNick, userNick: userNick,
filterContent: filterContent filterContent: filterContent
......
...@@ -53,12 +53,12 @@ export default { ...@@ -53,12 +53,12 @@ export default {
}, },
methods: { methods: {
getMore() { getMore() {
let chatListBoxDom = this.$refs.chatListBox; const chatListBoxDom = this.$refs.chatListBox;
let chatListDom = this.$refs.chatList; const chatListDom = this.$refs.chatList;
if (chatListBoxDom && chatListDom) { if (chatListBoxDom && chatListDom) {
let boxHeight = chatListBoxDom.clientHeight; const boxHeight = chatListBoxDom.clientHeight;
let boxScrollTop = chatListBoxDom.scrollTop; const boxScrollTop = chatListBoxDom.scrollTop;
let listHeigth = chatListDom.clientHeight; const listHeigth = chatListDom.clientHeight;
if (boxScrollTop <= 100) { if (boxScrollTop <= 100) {
this.getChatList(); this.getChatList();
} }
...@@ -80,8 +80,8 @@ export default { ...@@ -80,8 +80,8 @@ export default {
num: this.num num: this.num
}); });
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let list = res.data || []; const list = res.data || [];
let firstLi = const firstLi =
document.querySelector('#chatList') && document.querySelector('#chatList').children[0]; document.querySelector('#chatList') && document.querySelector('#chatList').children[0];
list.forEach(item => { list.forEach(item => {
this.addChat(item, true); this.addChat(item, true);
...@@ -90,7 +90,7 @@ export default { ...@@ -90,7 +90,7 @@ export default {
if (this.page === 1) { if (this.page === 1) {
this._scrollBottom(); this._scrollBottom();
} else { } else {
let chatListBoxDom = this.$refs.chatListBox; const chatListBoxDom = this.$refs.chatListBox;
if (chatListBoxDom && firstLi) { if (chatListBoxDom && firstLi) {
chatListBoxDom.scrollTop = firstLi.offsetTop; chatListBoxDom.scrollTop = firstLi.offsetTop;
} }
...@@ -110,13 +110,13 @@ export default { ...@@ -110,13 +110,13 @@ export default {
} }
}, },
addChat(obj, order = false) { addChat(obj, order = false) {
let chatObj = obj; const chatObj = obj;
this.list = this.list.filter(x => { this.list = this.list.filter(x => {
return Number(x.id) !== Number(chatObj.id); return Number(x.id) !== Number(chatObj.id);
}); });
if (this.list.length) { if (this.list.length) {
let newTime = chatObj.addTime; const newTime = chatObj.addTime;
let prevTime = order ? this.list[0].addTime : this.list[this.list.length - 1].addTime; const prevTime = order ? this.list[0].addTime : this.list[this.list.length - 1].addTime;
if (Math.abs(newTime - prevTime) > 600) { if (Math.abs(newTime - prevTime) > 600) {
chatObj.showTime = true; chatObj.showTime = true;
} }
...@@ -138,12 +138,12 @@ export default { ...@@ -138,12 +138,12 @@ export default {
}); });
}, },
_scrollKeep() { _scrollKeep() {
let chatListBoxDom = this.$refs.chatListBox; const chatListBoxDom = this.$refs.chatListBox;
let chatListDom = this.$refs.chatList; const chatListDom = this.$refs.chatList;
if (chatListBoxDom && chatListDom) { if (chatListBoxDom && chatListDom) {
let boxHeight = chatListBoxDom.clientHeight; const boxHeight = chatListBoxDom.clientHeight;
let boxScrollTop = chatListBoxDom.scrollTop; const boxScrollTop = chatListBoxDom.scrollTop;
let listHeigth = chatListDom.clientHeight; const listHeigth = chatListDom.clientHeight;
if (boxHeight + boxScrollTop > listHeigth - 250) { if (boxHeight + boxScrollTop > listHeigth - 250) {
this.$nextTick(() => { this.$nextTick(() => {
chatListBoxDom.scrollTop = this.$refs.chatList.clientHeight; chatListBoxDom.scrollTop = this.$refs.chatList.clientHeight;
...@@ -154,10 +154,10 @@ export default { ...@@ -154,10 +154,10 @@ export default {
} }
}, },
_scrollBottom() { _scrollBottom() {
let chatListBoxDom = this.$refs.chatListBox; const chatListBoxDom = this.$refs.chatListBox;
let chatListDom = this.$refs.chatList; const chatListDom = this.$refs.chatList;
if (chatListBoxDom && chatListDom) { if (chatListBoxDom && chatListDom) {
let listHeigth = chatListDom.clientHeight; const listHeigth = chatListDom.clientHeight;
chatListBoxDom.scrollTop = listHeigth; chatListBoxDom.scrollTop = listHeigth;
} }
}, },
...@@ -170,13 +170,13 @@ export default { ...@@ -170,13 +170,13 @@ export default {
} }
}, },
_scrollReply() { _scrollReply() {
let id = this.replyChatId; const id = this.replyChatId;
let el = document.querySelectorAll(`[data-chatid="${id}"]`)[0]; const el = document.querySelectorAll(`[data-chatid="${id}"]`)[0];
if (!el) { if (!el) {
this._scrollBottom(); this._scrollBottom();
return false; return false;
} }
let scrollTop = el.offsetTop; const scrollTop = el.offsetTop;
this.$refs.chatListBox.scrollTop = scrollTop; this.$refs.chatListBox.scrollTop = scrollTop;
this._closeReply(); this._closeReply();
}, },
......
...@@ -45,7 +45,7 @@ export default { ...@@ -45,7 +45,7 @@ export default {
return this.watchNum.custom + this.watchNum.real; return this.watchNum.custom + this.watchNum.real;
}, },
liveNowStatus() { liveNowStatus() {
let status = this.channelInfo.liveNowStatus; const status = this.channelInfo.liveNowStatus;
if (status === 1) { if (status === 1) {
return '<span class="type green"><span class="icon"></span><span class="title">直播中</span></span>'; return '<span class="type green"><span class="icon"></span><span class="title">直播中</span></span>';
} }
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
uin: this.channelInfo.uin uin: this.channelInfo.uin
}); });
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let { customWatchNum, watchNum } = res.data; const { customWatchNum, watchNum } = res.data;
this.watchNum = { this.watchNum = {
custom: Number(customWatchNum) || 0, custom: Number(customWatchNum) || 0,
real: Number(watchNum) || 0 real: Number(watchNum) || 0
......
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
} }
}, },
_play(url) { _play(url) {
let info = JSON.parse(JSON.stringify(this.playerInfo)); const info = JSON.parse(JSON.stringify(this.playerInfo));
info.playUrl = url; info.playUrl = url;
info.cameraId = ''; info.cameraId = '';
this.set_playerInfo(info); this.set_playerInfo(info);
......
...@@ -62,7 +62,7 @@ export default { ...@@ -62,7 +62,7 @@ export default {
}, },
computed: { computed: {
newList() { newList() {
let list = this.list; const list = this.list;
return list.sort((a, b) => { return list.sort((a, b) => {
if (this.sort) { if (this.sort) {
return new Date(b.createTime) - new Date(a.createTime); return new Date(b.createTime) - new Date(a.createTime);
...@@ -81,9 +81,9 @@ export default { ...@@ -81,9 +81,9 @@ export default {
}, },
methods: { methods: {
getMore() { getMore() {
let listBoxT = this.$refs.listBox && this.$refs.listBox.scrollTop; const listBoxT = this.$refs.listBox && this.$refs.listBox.scrollTop;
let listBoxH = this.$refs.listBox && this.$refs.listBox.clientHeight; const listBoxH = this.$refs.listBox && this.$refs.listBox.clientHeight;
let listH = this.$refs.list && this.$refs.list.clientHeight; const listH = this.$refs.list && this.$refs.list.clientHeight;
if (listBoxT + listBoxH > listH - 100) { if (listBoxT + listBoxH > listH - 100) {
this.getList(); this.getList();
} }
...@@ -102,7 +102,7 @@ export default { ...@@ -102,7 +102,7 @@ export default {
this.isMore = true; this.isMore = true;
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
this.count = res.data.count; this.count = res.data.count;
let data = res.data.list; const data = res.data.list;
if (data.length < this.num) { if (data.length < this.num) {
this.isMore = false; this.isMore = false;
} }
...@@ -138,7 +138,7 @@ export default { ...@@ -138,7 +138,7 @@ export default {
time: obj.time time: obj.time
}); });
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let data = res.data; const data = res.data;
if ( if (
this.list.some(x => { this.list.some(x => {
return Number(x.id) === Number(data.id); return Number(x.id) === Number(data.id);
......
...@@ -40,11 +40,11 @@ export default { ...@@ -40,11 +40,11 @@ export default {
playerInfo: 'playerInfo' playerInfo: 'playerInfo'
}), }),
isPeep() { isPeep() {
let peep = this.channelConfig.peep || {}; const peep = this.channelConfig.peep || {};
return !!peep.isEnable; return !!peep.isEnable;
}, },
mpsBackgroundUrl() { mpsBackgroundUrl() {
let bgUrl = this.channelInfo.mpsBackgroundUrl; const bgUrl = this.channelInfo.mpsBackgroundUrl;
return bgUrl ? `${bgUrl}?x-oss-process=style/twzb_origin` : ''; return bgUrl ? `${bgUrl}?x-oss-process=style/twzb_origin` : '';
}, },
mpsOptions() { mpsOptions() {
......
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
set_playerInfo: 'set_playerInfo' set_playerInfo: 'set_playerInfo'
}), }),
_backPlay() { _backPlay() {
let info = JSON.parse(JSON.stringify(this.playerInfo)); const info = JSON.parse(JSON.stringify(this.playerInfo));
info.playUrl = info.saveUrl; info.playUrl = info.saveUrl;
info.cameraId = ''; info.cameraId = '';
this.set_playerInfo(info); this.set_playerInfo(info);
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
} }
}, },
makeColor() { makeColor() {
let colorArray = '0123456789abcdef'; const colorArray = '0123456789abcdef';
let color = ''; let color = '';
for (let i = 0; i < 6; i++) { for (let i = 0; i < 6; i++) {
color += colorArray[Math.floor(Math.random() * 16)]; color += colorArray[Math.floor(Math.random() * 16)];
...@@ -62,18 +62,18 @@ export default { ...@@ -62,18 +62,18 @@ export default {
return color; return color;
}, },
_sendBarrage(str) { _sendBarrage(str) {
let content = str.replace(/(#)[\u4e00-\u9fa5A-Za-z0-9.]+(#)/gi, ''); const content = str.replace(/(#)[\u4e00-\u9fa5A-Za-z0-9.]+(#)/gi, '');
if (!this.mps || !content || !this.showBarrage || this.barrageInfo.status !== 1) { if (!this.mps || !content || !this.showBarrage || this.barrageInfo.status !== 1) {
return false; return false;
} }
let fontColor = this.barrageInfo.fontColor || 'FFFFFF'; const fontColor = this.barrageInfo.fontColor || 'FFFFFF';
let fontSize = this.barrageInfo.fontSize || 2; const fontSize = this.barrageInfo.fontSize || 2;
let fontSpeed = this.barrageInfo.speed || 2; const fontSpeed = this.barrageInfo.speed || 2;
let color = fontColor === 'random' ? this.makeColor() : fontColor; const color = fontColor === 'random' ? this.makeColor() : fontColor;
let sizeArr = { '1': 16, '2': 20, '3': 32 }; const sizeArr = { '1': 16, '2': 20, '3': 32 };
let speedArr = { '1': 100, '2': 50, '3': 20 }; const speedArr = { '1': 100, '2': 50, '3': 20 };
let size = sizeArr[fontSize] || 16; const size = sizeArr[fontSize] || 16;
let speed = speedArr[fontSpeed] || 50; const speed = speedArr[fontSpeed] || 50;
this.mps.sendbarrage2(content, size, '#' + color, speed, '', '微软雅黑'); this.mps.sendbarrage2(content, size, '#' + color, speed, '', '微软雅黑');
} }
}, },
......
...@@ -47,11 +47,11 @@ export default { ...@@ -47,11 +47,11 @@ export default {
} }
}, },
emojiArr() { emojiArr() {
let arr = []; const arr = [];
let num = 20; const num = 20;
for (let key in emoji_icon) { for (const key in emoji_icon) {
if (emoji_icon.hasOwnProperty(key)) { if (emoji_icon.hasOwnProperty(key)) {
let index = parseInt((key - 1) / num, 10); const index = parseInt((key - 1) / num, 10);
if (!arr[index]) { if (!arr[index]) {
arr[index] = []; arr[index] = [];
} }
...@@ -70,7 +70,7 @@ export default { ...@@ -70,7 +70,7 @@ export default {
methods: { methods: {
_initSwiper() { _initSwiper() {
if (!this.swiper) { if (!this.swiper) {
let option = { const option = {
direction: 'horizontal', direction: 'horizontal',
pagination: { pagination: {
el: this.$refs.emojiPagination el: this.$refs.emojiPagination
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
}, },
_remText() { _remText() {
let text = this.content; let text = this.content;
let reg = /(#)[\u4e00-\u9fa5A-Za-z0-9.]+(#)$/; const reg = /(#)[\u4e00-\u9fa5A-Za-z0-9.]+(#)$/;
if (text) { if (text) {
if (text.match(reg) != null) { if (text.match(reg) != null) {
text = text.replace(reg, ''); text = text.replace(reg, '');
......
...@@ -153,13 +153,13 @@ export default { ...@@ -153,13 +153,13 @@ export default {
this.$refs.file.click(); this.$refs.file.click();
}, },
_uploadImg(e) { _uploadImg(e) {
let self = this; const self = this;
let input = e.target; const input = e.target;
if (!input.value) { if (!input.value) {
return false; return false;
} }
if (input.files && input.files[0]) { if (input.files && input.files[0]) {
let reader = new FileReader(); const reader = new FileReader();
reader.onload = function() { reader.onload = function() {
self._createCanvas(reader.result); self._createCanvas(reader.result);
input.value = ''; input.value = '';
...@@ -168,18 +168,18 @@ export default { ...@@ -168,18 +168,18 @@ export default {
} }
}, },
_createCanvas(src) { _createCanvas(src) {
let self = this; const self = this;
let canvas = document.createElement('canvas'); const canvas = document.createElement('canvas');
let cxt = canvas.getContext('2d'); const cxt = canvas.getContext('2d');
let img = new Image(); const img = new Image();
img.src = src; img.src = src;
let maxW = 400; const maxW = 400;
let maxH = 600; const maxH = 600;
img.onload = function() { img.onload = function() {
let w = img.width; let w = img.width;
let h = img.height; let h = img.height;
if (w > maxW || h > maxH) { if (w > maxW || h > maxH) {
let p = w / maxW > h / maxH ? w / maxW : h / maxH; const p = w / maxW > h / maxH ? w / maxW : h / maxH;
w = img.width / p; w = img.width / p;
h = img.height / p; h = img.height / p;
img.width = w; img.width = w;
...@@ -188,7 +188,7 @@ export default { ...@@ -188,7 +188,7 @@ export default {
canvas.width = w; canvas.width = w;
canvas.height = h; canvas.height = h;
cxt.drawImage(img, 0, 0, w, h); cxt.drawImage(img, 0, 0, w, h);
let newsrc = canvas.toDataURL('image/jpeg', 0.9); const newsrc = canvas.toDataURL('image/jpeg', 0.9);
self._sendPhoto(newsrc); self._sendPhoto(newsrc);
}; };
}, },
......
...@@ -44,10 +44,10 @@ export default { ...@@ -44,10 +44,10 @@ export default {
}, },
methods: { methods: {
getMore() { getMore() {
let chatListBoxDom = this.$refs.chatListBox; const chatListBoxDom = this.$refs.chatListBox;
let chatListDom = this.$refs.chatList; const chatListDom = this.$refs.chatList;
if (chatListBoxDom && chatListDom) { if (chatListBoxDom && chatListDom) {
let boxScrollTop = chatListBoxDom.scrollTop; const boxScrollTop = chatListBoxDom.scrollTop;
if (boxScrollTop <= 100) { if (boxScrollTop <= 100) {
this.getChatList(); this.getChatList();
} }
...@@ -66,8 +66,8 @@ export default { ...@@ -66,8 +66,8 @@ export default {
num: this.num num: this.num
}); });
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let list = res.data || []; const list = res.data || [];
let firstLi = const firstLi =
document.querySelector('#chatList') && document.querySelector('#chatList').children[0]; document.querySelector('#chatList') && document.querySelector('#chatList').children[0];
list.forEach(item => { list.forEach(item => {
this.addChat(item, true); this.addChat(item, true);
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
if (this.page === 1) { if (this.page === 1) {
this._scrollBottom(); this._scrollBottom();
} else { } else {
let chatListBoxDom = this.$refs.chatListBox; const chatListBoxDom = this.$refs.chatListBox;
if (chatListBoxDom && firstLi) { if (chatListBoxDom && firstLi) {
chatListBoxDom.scrollTop = firstLi.offsetTop; chatListBoxDom.scrollTop = firstLi.offsetTop;
} }
...@@ -98,13 +98,13 @@ export default { ...@@ -98,13 +98,13 @@ export default {
} }
}, },
addChat(obj, order = false) { addChat(obj, order = false) {
let chatObj = obj; const chatObj = obj;
this.list = this.list.filter(x => { this.list = this.list.filter(x => {
return Number(x.id) !== Number(chatObj.id); return Number(x.id) !== Number(chatObj.id);
}); });
if (this.list.length) { if (this.list.length) {
let newTime = chatObj.addTime; const newTime = chatObj.addTime;
let prevTime = order ? this.list[0].addTime : this.list[this.list.length - 1].addTime; const prevTime = order ? this.list[0].addTime : this.list[this.list.length - 1].addTime;
if (Math.abs(newTime - prevTime) > 600) { if (Math.abs(newTime - prevTime) > 600) {
chatObj.showTime = true; chatObj.showTime = true;
} }
...@@ -125,12 +125,12 @@ export default { ...@@ -125,12 +125,12 @@ export default {
}); });
}, },
_scrollKeep() { _scrollKeep() {
let chatListBoxDom = this.$refs.chatListBox; const chatListBoxDom = this.$refs.chatListBox;
let chatListDom = this.$refs.chatList; const chatListDom = this.$refs.chatList;
if (chatListBoxDom && chatListDom) { if (chatListBoxDom && chatListDom) {
let boxHeight = chatListBoxDom.clientHeight; const boxHeight = chatListBoxDom.clientHeight;
let boxScrollTop = chatListBoxDom.scrollTop; const boxScrollTop = chatListBoxDom.scrollTop;
let listHeigth = chatListDom.clientHeight; const listHeigth = chatListDom.clientHeight;
if (boxHeight + boxScrollTop > listHeigth - 250) { if (boxHeight + boxScrollTop > listHeigth - 250) {
this.$nextTick(() => { this.$nextTick(() => {
chatListBoxDom.scrollTop = this.$refs.chatList.clientHeight; chatListBoxDom.scrollTop = this.$refs.chatList.clientHeight;
...@@ -139,10 +139,10 @@ export default { ...@@ -139,10 +139,10 @@ export default {
} }
}, },
_scrollBottom() { _scrollBottom() {
let chatListBoxDom = this.$refs.chatListBox; const chatListBoxDom = this.$refs.chatListBox;
let chatListDom = this.$refs.chatList; const chatListDom = this.$refs.chatList;
if (chatListBoxDom && chatListDom) { if (chatListBoxDom && chatListDom) {
let listHeigth = chatListDom.clientHeight; const listHeigth = chatListDom.clientHeight;
chatListBoxDom.scrollTop = listHeigth; chatListBoxDom.scrollTop = listHeigth;
} }
} }
......
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
channelInfo: 'channelInfo' channelInfo: 'channelInfo'
}), }),
userHead() { userHead() {
let userHeadImg = this.info.userHeadImg; const userHeadImg = this.info.userHeadImg;
if (userHeadImg === 'phoneHead') { if (userHeadImg === 'phoneHead') {
return this.channelInfo.defaultPhoneHeadAva; return this.channelInfo.defaultPhoneHeadAva;
} else if (userHeadImg === 'default') { } else if (userHeadImg === 'default') {
......
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
userInfo: 'userInfo' userInfo: 'userInfo'
}), }),
userHead() { userHead() {
let userHeadImg = this.info.userHeadImg; const userHeadImg = this.info.userHeadImg;
if (userHeadImg === 'phoneHead') { if (userHeadImg === 'phoneHead') {
return this.channelInfo.defaultPhoneHeadAva; return this.channelInfo.defaultPhoneHeadAva;
} else if (userHeadImg === 'default') { } else if (userHeadImg === 'default') {
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
set_showRedInfo: 'set_showRedInfo' set_showRedInfo: 'set_showRedInfo'
}), }),
_showRed(type, id) { _showRed(type, id) {
let obj = { const obj = {
type: type, type: type,
id: id id: id
}; };
......
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
set_showRedInfo: 'set_showRedInfo' set_showRedInfo: 'set_showRedInfo'
}), }),
_showRed(type, id) { _showRed(type, id) {
let obj = { const obj = {
type: type, type: type,
id: id id: id
}; };
......
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
userInfo: 'userInfo' userInfo: 'userInfo'
}), }),
userHead() { userHead() {
let userHeadImg = this.info.userHeadImg; const userHeadImg = this.info.userHeadImg;
if (userHeadImg === 'phoneHead') { if (userHeadImg === 'phoneHead') {
return this.channelInfo.defaultPhoneHeadAva; return this.channelInfo.defaultPhoneHeadAva;
} else if (userHeadImg === 'default') { } else if (userHeadImg === 'default') {
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
set_showRedInfo: 'set_showRedInfo' set_showRedInfo: 'set_showRedInfo'
}), }),
_showRed(type, id) { _showRed(type, id) {
let obj = { const obj = {
type: type, type: type,
id: id id: id
}; };
......
...@@ -27,7 +27,7 @@ export default { ...@@ -27,7 +27,7 @@ export default {
set_showRedInfo: 'set_showRedInfo' set_showRedInfo: 'set_showRedInfo'
}), }),
_showRed(type, id) { _showRed(type, id) {
let obj = { const obj = {
type: type, type: type,
id: id id: id
}; };
......
...@@ -26,7 +26,7 @@ export default { ...@@ -26,7 +26,7 @@ export default {
channelInfo: 'channelInfo' channelInfo: 'channelInfo'
}), }),
userHead() { userHead() {
let userHeadImg = this.info.userHeadImg; const userHeadImg = this.info.userHeadImg;
if (userHeadImg === 'phoneHead') { if (userHeadImg === 'phoneHead') {
return this.channelInfo.defaultPhoneHeadAva; return this.channelInfo.defaultPhoneHeadAva;
} else if (userHeadImg === 'default') { } else if (userHeadImg === 'default') {
......
...@@ -28,7 +28,7 @@ export default { ...@@ -28,7 +28,7 @@ export default {
}), }),
countDowmInfo() { countDowmInfo() {
let time = 0; let time = 0;
let now = this.nowDate / 1000; const now = this.nowDate / 1000;
if (now) { if (now) {
time = this.channelInfo.liveBegin - now; time = this.channelInfo.liveBegin - now;
} }
......
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
channelConfig: 'channelConfig' channelConfig: 'channelConfig'
}), }),
isShop() { isShop() {
let info = this.channelConfig.shop || {}; const info = this.channelConfig.shop || {};
return info.isShow === 1; return info.isShow === 1;
} }
}, },
......
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
}, },
methods: { methods: {
giftImg(info) { giftImg(info) {
let giftInfo = JSON.parse(info.filterContent || '{}'); const giftInfo = JSON.parse(info.filterContent || '{}');
if (!giftInfo.img) { if (!giftInfo.img) {
giftInfo.img = `${process.env.DEF_OSS}/static/reward/gift-${giftInfo.imgType}.png`; giftInfo.img = `${process.env.DEF_OSS}/static/reward/gift-${giftInfo.imgType}.png`;
} }
......
...@@ -65,11 +65,11 @@ export default { ...@@ -65,11 +65,11 @@ export default {
} }
}, },
top3List() { top3List() {
let list = this.list || []; const list = this.list || [];
return list.slice(0, 3); return list.slice(0, 3);
}, },
otherList() { otherList() {
let list = this.list || []; const list = this.list || [];
return list.slice(3); return list.slice(3);
} }
}, },
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
jumpUrls: 'jumpUrls' jumpUrls: 'jumpUrls'
}), }),
isQuestionnaire() { isQuestionnaire() {
let info = this.channelConfig.questionnaire || {}; const info = this.channelConfig.questionnaire || {};
return info; return info;
} }
}, },
......
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
playerInfo: 'playerInfo' playerInfo: 'playerInfo'
}), }),
mpsBackgroundUrl() { mpsBackgroundUrl() {
let bgUrl = this.channelInfo.mpsBackgroundUrl; const bgUrl = this.channelInfo.mpsBackgroundUrl;
return bgUrl ? `${bgUrl}?x-oss-process=style/twzb_origin` : require('./img/bg.png'); return bgUrl ? `${bgUrl}?x-oss-process=style/twzb_origin` : require('./img/bg.png');
}, },
mpsOptions() { mpsOptions() {
......
...@@ -20,7 +20,7 @@ export default { ...@@ -20,7 +20,7 @@ export default {
showRedInfo: 'showRedInfo' showRedInfo: 'showRedInfo'
}), }),
shareConfig() { shareConfig() {
let self = this; const self = this;
return { return {
title: this.channelInfo.shareTitle || this.channelInfo.channelName, title: this.channelInfo.shareTitle || this.channelInfo.channelName,
desc: this.channelInfo.shareSubTitle || window.location.href, desc: this.channelInfo.shareSubTitle || window.location.href,
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
}, },
// 微信分享init // 微信分享init
_InitWXShare() { _InitWXShare() {
let self = this; const self = this;
window.wx.ready(() => { window.wx.ready(() => {
window.wx.onMenuShareTimeline(self.shareConfig); window.wx.onMenuShareTimeline(self.shareConfig);
window.wx.onMenuShareAppMessage(self.shareConfig); window.wx.onMenuShareAppMessage(self.shareConfig);
......
...@@ -63,7 +63,7 @@ export default { ...@@ -63,7 +63,7 @@ export default {
} }
}, },
editShop(data) { editShop(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 2 && this.channelInfo.id === includeId) { if (type === 2 && this.channelInfo.id === includeId) {
if (this.info.id === goodInfo.id) { if (this.info.id === goodInfo.id) {
this.info = goodInfo; this.info = goodInfo;
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
} }
}, },
deleteShop(data) { deleteShop(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 2 && this.channelInfo.id === includeId) { if (type === 2 && this.channelInfo.id === includeId) {
if (this.info.id === goodInfo.id) { if (this.info.id === goodInfo.id) {
this.info = {}; this.info = {};
...@@ -79,7 +79,7 @@ export default { ...@@ -79,7 +79,7 @@ export default {
} }
}, },
cancelShopBind(data) { cancelShopBind(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 2 && this.channelInfo.id === includeId) { if (type === 2 && this.channelInfo.id === includeId) {
if (goodInfo.id.some(id => id === this.info.id)) { if (goodInfo.id.some(id => id === this.info.id)) {
this.info = {}; this.info = {};
...@@ -87,13 +87,13 @@ export default { ...@@ -87,13 +87,13 @@ export default {
} }
}, },
setTopShop(data) { setTopShop(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 2 && this.channelInfo.id === includeId) { if (type === 2 && this.channelInfo.id === includeId) {
this.info = goodInfo; this.info = goodInfo;
} }
}, },
cancelTopShop(data) { cancelTopShop(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 2 && this.channelInfo.id === includeId) { if (type === 2 && this.channelInfo.id === includeId) {
if (this.info.id === goodInfo.id) { if (this.info.id === goodInfo.id) {
this.info = {}; this.info = {};
......
...@@ -102,9 +102,9 @@ export default { ...@@ -102,9 +102,9 @@ export default {
}, },
methods: { methods: {
getMore() { getMore() {
let shopContainerTop = this.$refs.shopContainer && this.$refs.shopContainer.scrollTop; const shopContainerTop = this.$refs.shopContainer && this.$refs.shopContainer.scrollTop;
let shopContainerHeight = this.$refs.shopContainer && this.$refs.shopContainer.clientHeight; const shopContainerHeight = this.$refs.shopContainer && this.$refs.shopContainer.clientHeight;
let shopBodHeight = this.$refs.shopBody && this.$refs.shopBody.clientHeight; const shopBodHeight = this.$refs.shopBody && this.$refs.shopBody.clientHeight;
if (shopContainerTop + shopContainerHeight > shopBodHeight - 100) { if (shopContainerTop + shopContainerHeight > shopBodHeight - 100) {
this.getList(); this.getList();
} }
...@@ -114,7 +114,7 @@ export default { ...@@ -114,7 +114,7 @@ export default {
return false; return false;
} }
this.isAjax = false; this.isAjax = false;
let res = await goodsList({ const res = await goodsList({
includeId: this.channelInfo.id, includeId: this.channelInfo.id,
uin: this.channelInfo.uin, uin: this.channelInfo.uin,
type: 2, type: 2,
...@@ -123,7 +123,7 @@ export default { ...@@ -123,7 +123,7 @@ export default {
}); });
this.isAjax = true; this.isAjax = true;
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let { list, count } = res.data; const { list, count } = res.data;
this.addList(list, true); this.addList(list, true);
this.count = count; this.count = count;
if (list.length < this.num) { if (list.length < this.num) {
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
} }
}, },
addList(list, sort) { addList(list, sort) {
let fList = list.filter(item => !this.list.some(x => x.id === item.id)); const fList = list.filter(item => !this.list.some(x => x.id === item.id));
if (sort) { if (sort) {
this.list = this.list.concat(fList); this.list = this.list.concat(fList);
} else { } else {
...@@ -142,7 +142,7 @@ export default { ...@@ -142,7 +142,7 @@ export default {
} }
}, },
editShop(data) { editShop(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 2 && this.channelInfo.id === includeId) { if (type === 2 && this.channelInfo.id === includeId) {
this.list = this.list.map(x => { this.list = this.list.map(x => {
if (x.id === goodInfo.id) { if (x.id === goodInfo.id) {
...@@ -153,19 +153,19 @@ export default { ...@@ -153,19 +153,19 @@ export default {
} }
}, },
deleteShop(data) { deleteShop(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 2 && this.channelInfo.id === includeId) { if (type === 2 && this.channelInfo.id === includeId) {
this.list = this.list.filter(x => x.id !== goodInfo.id); this.list = this.list.filter(x => x.id !== goodInfo.id);
} }
}, },
addShopBind(data) { addShopBind(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 2 && this.channelInfo.id === includeId) { if (type === 2 && this.channelInfo.id === includeId) {
this.addList(goodInfo); this.addList(goodInfo);
} }
}, },
cancelShopBind(data) { cancelShopBind(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 2 && this.channelInfo.id === includeId) { if (type === 2 && this.channelInfo.id === includeId) {
this.list = this.list.filter(x => { this.list = this.list.filter(x => {
return !goodInfo.id.some(id => id === x.id); return !goodInfo.id.some(id => id === x.id);
...@@ -173,7 +173,7 @@ export default { ...@@ -173,7 +173,7 @@ export default {
} }
}, },
changeSort(data) { changeSort(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 2 && this.channelInfo.id === includeId) { if (type === 2 && this.channelInfo.id === includeId) {
this.list = this.list.map(x => { this.list = this.list.map(x => {
if (x.id === goodInfo.id) { if (x.id === goodInfo.id) {
......
...@@ -79,23 +79,23 @@ export default { ...@@ -79,23 +79,23 @@ export default {
userInfo: 'userInfo' userInfo: 'userInfo'
}), }),
isOffice() { isOffice() {
let info = this.channelConfig.officeLive || {}; const info = this.channelConfig.officeLive || {};
return info.isEnable === 1; return info.isEnable === 1;
}, },
isDraw() { isDraw() {
return this.channelInfo.drawStatus === 1; return this.channelInfo.drawStatus === 1;
}, },
isInvitation() { isInvitation() {
let info = this.channelConfig.invitation || {}; const info = this.channelConfig.invitation || {};
return info.isInvitation === 1; return info.isInvitation === 1;
}, },
isReward() { isReward() {
let rewardStatus = this.channelInfo.rewardStatus; const rewardStatus = this.channelInfo.rewardStatus;
let rewardGiftStatus = this.channelInfo.rewardGiftStatus; const rewardGiftStatus = this.channelInfo.rewardGiftStatus;
return rewardStatus === 1 || rewardGiftStatus === 1; return rewardStatus === 1 || rewardGiftStatus === 1;
}, },
isPraise() { isPraise() {
let info = this.channelConfig.praise; const info = this.channelConfig.praise;
if (info) { if (info) {
return info.isEnable === 1; return info.isEnable === 1;
} else { } else {
......
...@@ -79,7 +79,7 @@ export default { ...@@ -79,7 +79,7 @@ export default {
} }
}, },
isShowList() { isShowList() {
let info = this.channelConfig.invitation || {}; const info = this.channelConfig.invitation || {};
return info.isShowList === 1; return info.isShowList === 1;
}, },
allWatchNum() { allWatchNum() {
...@@ -99,7 +99,7 @@ export default { ...@@ -99,7 +99,7 @@ export default {
uin: this.channelInfo.uin uin: this.channelInfo.uin
}); });
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let { customWatchNum, watchNum } = res.data; const { customWatchNum, watchNum } = res.data;
this.watchNum = { this.watchNum = {
custom: Number(customWatchNum) || 0, custom: Number(customWatchNum) || 0,
real: Number(watchNum) || 0 real: Number(watchNum) || 0
......
...@@ -42,8 +42,8 @@ export default { ...@@ -42,8 +42,8 @@ export default {
set_advertMiddle: 'set_advertMiddle' set_advertMiddle: 'set_advertMiddle'
}), }),
_initSwiper() { _initSwiper() {
let self = this; const self = this;
let option = { const option = {
direction: 'horizontal', direction: 'horizontal',
loop: true, loop: true,
autoplay: self.list.length > 1 ? { delay: 5000 } : false autoplay: self.list.length > 1 ? { delay: 5000 } : false
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
this.swiper = new this.$swiper(this.$refs.swiper, option); this.swiper = new this.$swiper(this.$refs.swiper, option);
}, },
_close() { _close() {
let info = JSON.parse(JSON.stringify(this.advertMiddle)); const info = JSON.parse(JSON.stringify(this.advertMiddle));
info.status = false; info.status = false;
this.set_advertMiddle(info); this.set_advertMiddle(info);
} }
......
...@@ -42,8 +42,8 @@ export default { ...@@ -42,8 +42,8 @@ export default {
set_advertTop: 'set_advertTop' set_advertTop: 'set_advertTop'
}), }),
_initSwiper() { _initSwiper() {
let self = this; const self = this;
let option = { const option = {
direction: 'vertical', direction: 'vertical',
loop: true, loop: true,
autoplay: self.list.length > 1 ? { delay: 5000 } : false autoplay: self.list.length > 1 ? { delay: 5000 } : false
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
this.swiper = new this.$swiper(this.$refs.swiper, option); this.swiper = new this.$swiper(this.$refs.swiper, option);
}, },
_close() { _close() {
let info = JSON.parse(JSON.stringify(this.advertTop)); const info = JSON.parse(JSON.stringify(this.advertTop));
info.status = false; info.status = false;
this.set_advertTop(info); this.set_advertTop(info);
} }
......
...@@ -44,14 +44,14 @@ export default { ...@@ -44,14 +44,14 @@ export default {
uin: this.channelInfo.uin uin: this.channelInfo.uin
}); });
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let list = res.data || []; const list = res.data || [];
this.list = list.filter(x => { this.list = list.filter(x => {
return x.display; return x.display;
}); });
} }
}, },
_changePlayer(url, id) { _changePlayer(url, id) {
let info = JSON.parse(JSON.stringify(this.playerInfo)); const info = JSON.parse(JSON.stringify(this.playerInfo));
info.playUrl = url; info.playUrl = url;
info.cameraId = id; info.cameraId = id;
this.set_playerInfo(info); this.set_playerInfo(info);
......
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
advertMiddle: 'advertMiddle' advertMiddle: 'advertMiddle'
}), }),
commodity() { commodity() {
let list = this.advertMiddle.list || []; const list = this.advertMiddle.list || [];
return list.map(x => { return list.map(x => {
return { return {
e: null, e: null,
......
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
isShowChat() { isShowChat() {
let index = -1; let index = -1;
for (let i = 0; i < this.menuList.length; i++) { for (let i = 0; i < this.menuList.length; i++) {
let item = this.menuList[i]; const item = this.menuList[i];
if (item.menuType === 'chat') { if (item.menuType === 'chat') {
index = i; index = i;
} }
...@@ -91,8 +91,8 @@ export default { ...@@ -91,8 +91,8 @@ export default {
}, },
methods: { methods: {
_initSwiper() { _initSwiper() {
let self = this; const self = this;
let option = { const option = {
touchRatio: 0.5, touchRatio: 0.5,
on: { on: {
slideChange() { slideChange() {
......
...@@ -67,12 +67,12 @@ export default { ...@@ -67,12 +67,12 @@ export default {
}, },
methods: { methods: {
getMore() { getMore() {
let chatListBoxDom = this.$refs.chatListBox; const chatListBoxDom = this.$refs.chatListBox;
let chatListDom = this.$refs.chatList; const chatListDom = this.$refs.chatList;
if (chatListBoxDom && chatListDom) { if (chatListBoxDom && chatListDom) {
let boxHeight = chatListBoxDom.clientHeight; const boxHeight = chatListBoxDom.clientHeight;
let boxScrollTop = chatListBoxDom.scrollTop; const boxScrollTop = chatListBoxDom.scrollTop;
let listHeigth = chatListDom.clientHeight; const listHeigth = chatListDom.clientHeight;
if (boxScrollTop <= 100) { if (boxScrollTop <= 100) {
this.getChatList(); this.getChatList();
} }
...@@ -96,8 +96,8 @@ export default { ...@@ -96,8 +96,8 @@ export default {
}); });
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let list = res.data || []; const list = res.data || [];
let firstLi = const firstLi =
document.querySelector('#chatList') && document.querySelector('#chatList').children[0]; document.querySelector('#chatList') && document.querySelector('#chatList').children[0];
list.forEach(item => { list.forEach(item => {
this.addChat(item, true); this.addChat(item, true);
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
if (this.page === 1) { if (this.page === 1) {
this._scrollBottom(); this._scrollBottom();
} else { } else {
let chatListBoxDom = this.$refs.chatListBox; const chatListBoxDom = this.$refs.chatListBox;
if (chatListBoxDom && firstLi) { if (chatListBoxDom && firstLi) {
chatListBoxDom.scrollTop = firstLi.offsetTop; chatListBoxDom.scrollTop = firstLi.offsetTop;
} }
...@@ -141,8 +141,8 @@ export default { ...@@ -141,8 +141,8 @@ export default {
}); });
}, },
addChat(obj, order = false) { addChat(obj, order = false) {
let chatObj = obj; const chatObj = obj;
let redType = [3, 8]; // msgType红包类型 const redType = [3, 8]; // msgType红包类型
this.list = this.list.filter(x => { this.list = this.list.filter(x => {
return Number(x.id) !== Number(chatObj.id); return Number(x.id) !== Number(chatObj.id);
}); });
...@@ -151,8 +151,8 @@ export default { ...@@ -151,8 +151,8 @@ export default {
this.addRedList(chatObj, order); this.addRedList(chatObj, order);
} }
if (this.list.length) { if (this.list.length) {
let newTime = chatObj.addTime; const newTime = chatObj.addTime;
let prevTime = order ? this.list[0].addTime : this.list[this.list.length - 1].addTime; const prevTime = order ? this.list[0].addTime : this.list[this.list.length - 1].addTime;
if (Math.abs(newTime - prevTime) > 600) { if (Math.abs(newTime - prevTime) > 600) {
chatObj.showTime = true; chatObj.showTime = true;
} }
...@@ -175,12 +175,12 @@ export default { ...@@ -175,12 +175,12 @@ export default {
this.delRedList(id); this.delRedList(id);
}, },
_scrollKeep() { _scrollKeep() {
let chatListBoxDom = this.$refs.chatListBox; const chatListBoxDom = this.$refs.chatListBox;
let chatListDom = this.$refs.chatList; const chatListDom = this.$refs.chatList;
if (chatListBoxDom && chatListDom) { if (chatListBoxDom && chatListDom) {
let boxHeight = chatListBoxDom.clientHeight; const boxHeight = chatListBoxDom.clientHeight;
let boxScrollTop = chatListBoxDom.scrollTop; const boxScrollTop = chatListBoxDom.scrollTop;
let listHeigth = chatListDom.clientHeight; const listHeigth = chatListDom.clientHeight;
if (boxHeight + boxScrollTop > listHeigth - 250) { if (boxHeight + boxScrollTop > listHeigth - 250) {
this.$nextTick(() => { this.$nextTick(() => {
chatListBoxDom.scrollTop = this.$refs.chatList.clientHeight; chatListBoxDom.scrollTop = this.$refs.chatList.clientHeight;
...@@ -191,10 +191,10 @@ export default { ...@@ -191,10 +191,10 @@ export default {
} }
}, },
_scrollBottom() { _scrollBottom() {
let chatListBoxDom = this.$refs.chatListBox; const chatListBoxDom = this.$refs.chatListBox;
let chatListDom = this.$refs.chatList; const chatListDom = this.$refs.chatList;
if (chatListBoxDom && chatListDom) { if (chatListBoxDom && chatListDom) {
let listHeigth = chatListDom.clientHeight; const listHeigth = chatListDom.clientHeight;
chatListBoxDom.scrollTop = listHeigth; chatListBoxDom.scrollTop = listHeigth;
} }
}, },
...@@ -207,13 +207,13 @@ export default { ...@@ -207,13 +207,13 @@ export default {
} }
}, },
_scrollReply() { _scrollReply() {
let id = this.replyChatId; const id = this.replyChatId;
let el = document.querySelectorAll(`[data-chatid="${id}"]`)[0]; const el = document.querySelectorAll(`[data-chatid="${id}"]`)[0];
if (!el) { if (!el) {
this._scrollBottom(); this._scrollBottom();
return false; return false;
} }
let scrollTop = el.offsetTop; const scrollTop = el.offsetTop;
this.$refs.chatListBox.scrollTop = scrollTop; this.$refs.chatListBox.scrollTop = scrollTop;
this._closeReply(); this._closeReply();
}, },
......
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
channelInfo: 'channelInfo' channelInfo: 'channelInfo'
}), }),
userHead() { userHead() {
let userHeadImg = this.info.userHeadImg; const userHeadImg = this.info.userHeadImg;
if (userHeadImg === 'phoneHead') { if (userHeadImg === 'phoneHead') {
return this.channelInfo.defaultPhoneHeadAva; return this.channelInfo.defaultPhoneHeadAva;
} else if (userHeadImg === 'default') { } else if (userHeadImg === 'default') {
......
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
userInfo: 'userInfo' userInfo: 'userInfo'
}), }),
userHead() { userHead() {
let userHeadImg = this.info.userHeadImg; const userHeadImg = this.info.userHeadImg;
if (userHeadImg === 'phoneHead') { if (userHeadImg === 'phoneHead') {
return this.channelInfo.defaultPhoneHeadAva; return this.channelInfo.defaultPhoneHeadAva;
} else if (userHeadImg === 'default') { } else if (userHeadImg === 'default') {
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
set_showRedInfo: 'set_showRedInfo' set_showRedInfo: 'set_showRedInfo'
}), }),
_showRed(type, id) { _showRed(type, id) {
let obj = { const obj = {
type: type, type: type,
id: id id: id
}; };
......
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
set_showRedInfo: 'set_showRedInfo' set_showRedInfo: 'set_showRedInfo'
}), }),
_showRed(type, id) { _showRed(type, id) {
let obj = { const obj = {
type: type, type: type,
id: id id: id
}; };
......
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
userInfo: 'userInfo' userInfo: 'userInfo'
}), }),
userHead() { userHead() {
let userHeadImg = this.info.userHeadImg; const userHeadImg = this.info.userHeadImg;
if (userHeadImg === 'phoneHead') { if (userHeadImg === 'phoneHead') {
return this.channelInfo.defaultPhoneHeadAva; return this.channelInfo.defaultPhoneHeadAva;
} else if (userHeadImg === 'default') { } else if (userHeadImg === 'default') {
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
set_showRedInfo: 'set_showRedInfo' set_showRedInfo: 'set_showRedInfo'
}), }),
_showRed(type, id) { _showRed(type, id) {
let obj = { const obj = {
type: type, type: type,
id: id id: id
}; };
......
...@@ -27,7 +27,7 @@ export default { ...@@ -27,7 +27,7 @@ export default {
set_showRedInfo: 'set_showRedInfo' set_showRedInfo: 'set_showRedInfo'
}), }),
_showRed(type, id) { _showRed(type, id) {
let obj = { const obj = {
type: type, type: type,
id: id id: id
}; };
......
...@@ -47,7 +47,7 @@ export default { ...@@ -47,7 +47,7 @@ export default {
channelInfo: 'channelInfo' channelInfo: 'channelInfo'
}), }),
userHead() { userHead() {
let userHeadImg = this.info.userHeadImg; const userHeadImg = this.info.userHeadImg;
if (userHeadImg === 'phoneHead') { if (userHeadImg === 'phoneHead') {
return this.channelInfo.defaultPhoneHeadAva; return this.channelInfo.defaultPhoneHeadAva;
} else if (userHeadImg === 'default') { } else if (userHeadImg === 'default') {
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
}, },
methods: { methods: {
_reply(id, name) { _reply(id, name) {
let obj = { const obj = {
id: id, id: id,
name: name name: name
}; };
......
...@@ -127,10 +127,10 @@ export default { ...@@ -127,10 +127,10 @@ export default {
} }
}, },
getMore() { getMore() {
let wrapT = this.$refs.wrapBox.scrollTop; const wrapT = this.$refs.wrapBox.scrollTop;
let wrapH = this.$refs.wrapBox.clientHeight; const wrapH = this.$refs.wrapBox.clientHeight;
if (this.$refs.list) { if (this.$refs.list) {
let listH = this.$refs.list.clientHeight; const listH = this.$refs.list.clientHeight;
if (listH - wrapH - wrapT < 100) { if (listH - wrapH - wrapT < 100) {
this.page++; this.page++;
this._getList(); this._getList();
......
...@@ -64,7 +64,7 @@ export default { ...@@ -64,7 +64,7 @@ export default {
} }
}, },
_play(url) { _play(url) {
let info = JSON.parse(JSON.stringify(this.playerInfo)); const info = JSON.parse(JSON.stringify(this.playerInfo));
info.playUrl = url; info.playUrl = url;
info.cameraId = ''; info.cameraId = '';
this.set_playerInfo(info); this.set_playerInfo(info);
......
...@@ -62,7 +62,7 @@ export default { ...@@ -62,7 +62,7 @@ export default {
}, },
computed: { computed: {
newList() { newList() {
let list = this.list; const list = this.list;
return list.sort((a, b) => { return list.sort((a, b) => {
if (this.sort) { if (this.sort) {
return new Date(b.createTime) - new Date(a.createTime); return new Date(b.createTime) - new Date(a.createTime);
...@@ -81,9 +81,9 @@ export default { ...@@ -81,9 +81,9 @@ export default {
}, },
methods: { methods: {
getMore() { getMore() {
let listBoxT = this.$refs.listBox && this.$refs.listBox.scrollTop; const listBoxT = this.$refs.listBox && this.$refs.listBox.scrollTop;
let listBoxH = this.$refs.listBox && this.$refs.listBox.clientHeight; const listBoxH = this.$refs.listBox && this.$refs.listBox.clientHeight;
let listH = this.$refs.list && this.$refs.list.clientHeight; const listH = this.$refs.list && this.$refs.list.clientHeight;
if (listBoxT + listBoxH > listH - 100) { if (listBoxT + listBoxH > listH - 100) {
this.getList(); this.getList();
} }
...@@ -102,7 +102,7 @@ export default { ...@@ -102,7 +102,7 @@ export default {
this.isMore = true; this.isMore = true;
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
this.count = res.data.count; this.count = res.data.count;
let data = res.data.list; const data = res.data.list;
if (data.length < this.num) { if (data.length < this.num) {
this.isMore = false; this.isMore = false;
} }
...@@ -138,7 +138,7 @@ export default { ...@@ -138,7 +138,7 @@ export default {
time: obj.time time: obj.time
}); });
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let data = res.data; const data = res.data;
if ( if (
this.list.some(x => { this.list.some(x => {
return Number(x.id) === Number(data.id); return Number(x.id) === Number(data.id);
......
...@@ -63,7 +63,7 @@ export default { ...@@ -63,7 +63,7 @@ export default {
} }
}, },
editShop(data) { editShop(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 1 && this.menuId === includeId) { if (type === 1 && this.menuId === includeId) {
if (this.info.id === goodInfo.id) { if (this.info.id === goodInfo.id) {
this.info = goodInfo; this.info = goodInfo;
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
} }
}, },
deleteShop(data) { deleteShop(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 1 && this.menuId === includeId) { if (type === 1 && this.menuId === includeId) {
if (this.info.id === goodInfo.id) { if (this.info.id === goodInfo.id) {
this.info = {}; this.info = {};
...@@ -79,7 +79,7 @@ export default { ...@@ -79,7 +79,7 @@ export default {
} }
}, },
cancelShopBind(data) { cancelShopBind(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 1 && this.menuId === includeId) { if (type === 1 && this.menuId === includeId) {
if (goodInfo.id.some(id => id === this.info.id)) { if (goodInfo.id.some(id => id === this.info.id)) {
this.info = {}; this.info = {};
...@@ -87,13 +87,13 @@ export default { ...@@ -87,13 +87,13 @@ export default {
} }
}, },
setTopShop(data) { setTopShop(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 1 && this.menuId === includeId) { if (type === 1 && this.menuId === includeId) {
this.info = goodInfo; this.info = goodInfo;
} }
}, },
cancelTopShop(data) { cancelTopShop(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 1 && this.menuId === includeId) { if (type === 1 && this.menuId === includeId) {
if (this.info.id === goodInfo.id) { if (this.info.id === goodInfo.id) {
this.info = {}; this.info = {};
......
...@@ -102,9 +102,9 @@ export default { ...@@ -102,9 +102,9 @@ export default {
}, },
methods: { methods: {
getMore() { getMore() {
let shopContainerTop = this.$refs.shopContainer && this.$refs.shopContainer.scrollTop; const shopContainerTop = this.$refs.shopContainer && this.$refs.shopContainer.scrollTop;
let shopContainerHeight = this.$refs.shopContainer && this.$refs.shopContainer.clientHeight; const shopContainerHeight = this.$refs.shopContainer && this.$refs.shopContainer.clientHeight;
let shopBodHeight = this.$refs.shopBody && this.$refs.shopBody.clientHeight; const shopBodHeight = this.$refs.shopBody && this.$refs.shopBody.clientHeight;
if (shopContainerTop + shopContainerHeight > shopBodHeight - 100) { if (shopContainerTop + shopContainerHeight > shopBodHeight - 100) {
this.getList(); this.getList();
} }
...@@ -114,7 +114,7 @@ export default { ...@@ -114,7 +114,7 @@ export default {
return false; return false;
} }
this.isAjax = false; this.isAjax = false;
let res = await goodsList({ const res = await goodsList({
includeId: this.menuId, includeId: this.menuId,
uin: this.channelInfo.uin, uin: this.channelInfo.uin,
type: 1, type: 1,
...@@ -123,7 +123,7 @@ export default { ...@@ -123,7 +123,7 @@ export default {
}); });
this.isAjax = true; this.isAjax = true;
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let { list, count } = res.data; const { list, count } = res.data;
this.addList(list, true); this.addList(list, true);
this.count = count; this.count = count;
if (list.length < this.num) { if (list.length < this.num) {
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
} }
}, },
addList(list, sort) { addList(list, sort) {
let fList = list.filter(item => !this.list.some(x => x.id === item.id)); const fList = list.filter(item => !this.list.some(x => x.id === item.id));
if (sort) { if (sort) {
this.list = this.list.concat(fList); this.list = this.list.concat(fList);
} else { } else {
...@@ -142,7 +142,7 @@ export default { ...@@ -142,7 +142,7 @@ export default {
} }
}, },
editShop(data) { editShop(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 1 && this.menuId === includeId) { if (type === 1 && this.menuId === includeId) {
this.list = this.list.map(x => { this.list = this.list.map(x => {
if (x.id === goodInfo.id) { if (x.id === goodInfo.id) {
...@@ -153,19 +153,19 @@ export default { ...@@ -153,19 +153,19 @@ export default {
} }
}, },
deleteShop(data) { deleteShop(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 1 && this.menuId === includeId) { if (type === 1 && this.menuId === includeId) {
this.list = this.list.filter(x => x.id !== goodInfo.id); this.list = this.list.filter(x => x.id !== goodInfo.id);
} }
}, },
addShopBind(data) { addShopBind(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 1 && this.menuId === includeId) { if (type === 1 && this.menuId === includeId) {
this.addList(goodInfo); this.addList(goodInfo);
} }
}, },
cancelShopBind(data) { cancelShopBind(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 1 && this.menuId === includeId) { if (type === 1 && this.menuId === includeId) {
this.list = this.list.filter(x => { this.list = this.list.filter(x => {
return !goodInfo.id.some(id => id === x.id); return !goodInfo.id.some(id => id === x.id);
...@@ -173,7 +173,7 @@ export default { ...@@ -173,7 +173,7 @@ export default {
} }
}, },
changeSort(data) { changeSort(data) {
let { type, includeId, goodInfo } = data; const { type, includeId, goodInfo } = data;
if (type === 1 && this.menuId === includeId) { if (type === 1 && this.menuId === includeId) {
this.list = this.list.map(x => { this.list = this.list.map(x => {
if (x.id === goodInfo.id) { if (x.id === goodInfo.id) {
......
...@@ -26,7 +26,7 @@ export default { ...@@ -26,7 +26,7 @@ export default {
}), }),
countDowmInfo() { countDowmInfo() {
let time = 0; let time = 0;
let now = this.nowDate / 1000; const now = this.nowDate / 1000;
if (now) { if (now) {
time = this.channelInfo.liveBegin - now; time = this.channelInfo.liveBegin - now;
} }
......
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
playerInfo: 'playerInfo' playerInfo: 'playerInfo'
}), }),
isPeep() { isPeep() {
let peep = this.channelConfig.peep || {}; const peep = this.channelConfig.peep || {};
return !!peep.isEnable; return !!peep.isEnable;
}, },
isDownTime() { isDownTime() {
...@@ -78,7 +78,7 @@ export default { ...@@ -78,7 +78,7 @@ export default {
return false; return false;
}, },
mpsBackgroundUrl() { mpsBackgroundUrl() {
let bgUrl = this.channelInfo.mpsBackgroundUrl; const bgUrl = this.channelInfo.mpsBackgroundUrl;
return bgUrl ? `${bgUrl}?x-oss-process=style/twzb_origin` : ''; return bgUrl ? `${bgUrl}?x-oss-process=style/twzb_origin` : '';
}, },
mpsOptions() { mpsOptions() {
......
...@@ -24,10 +24,10 @@ export default { ...@@ -24,10 +24,10 @@ export default {
channelConfig: 'channelConfig' channelConfig: 'channelConfig'
}), }),
mark() { mark() {
let info = this.channelConfig.mark || {}; const info = this.channelConfig.mark || {};
let position = info.position || { top: '10px', left: '10px' }; const position = info.position || { top: '10px', left: '10px' };
let positionNew = {}; const positionNew = {};
for (let key in position) { for (const key in position) {
if (key) { if (key) {
positionNew[key] = `${position[key].replace('px', '') / 100}rem`; positionNew[key] = `${position[key].replace('px', '') / 100}rem`;
} }
......
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
set_playerInfo: 'set_playerInfo' set_playerInfo: 'set_playerInfo'
}), }),
_backPlay() { _backPlay() {
let info = JSON.parse(JSON.stringify(this.playerInfo)); const info = JSON.parse(JSON.stringify(this.playerInfo));
info.playUrl = info.saveUrl; info.playUrl = info.saveUrl;
info.cameraId = ''; info.cameraId = '';
this.set_playerInfo(info); this.set_playerInfo(info);
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
} }
}, },
makeColor() { makeColor() {
let colorArray = '0123456789abcdef'; const colorArray = '0123456789abcdef';
let color = ''; let color = '';
for (let i = 0; i < 6; i++) { for (let i = 0; i < 6; i++) {
color += colorArray[Math.floor(Math.random() * 16)]; color += colorArray[Math.floor(Math.random() * 16)];
...@@ -62,18 +62,18 @@ export default { ...@@ -62,18 +62,18 @@ export default {
return color; return color;
}, },
_sendBarrage(str) { _sendBarrage(str) {
let content = str.replace(/(#)[\u4e00-\u9fa5A-Za-z0-9.]+(#)/gi, ''); const content = str.replace(/(#)[\u4e00-\u9fa5A-Za-z0-9.]+(#)/gi, '');
if (!this.mps || !content || !this.showBarrage || this.barrageInfo.status !== 1) { if (!this.mps || !content || !this.showBarrage || this.barrageInfo.status !== 1) {
return false; return false;
} }
let fontColor = this.barrageInfo.fontColor || 'FFFFFF'; const fontColor = this.barrageInfo.fontColor || 'FFFFFF';
let fontSize = this.barrageInfo.fontSize || 2; const fontSize = this.barrageInfo.fontSize || 2;
let fontSpeed = this.barrageInfo.speed || 2; const fontSpeed = this.barrageInfo.speed || 2;
let color = fontColor === 'random' ? this.makeColor() : fontColor; const color = fontColor === 'random' ? this.makeColor() : fontColor;
let sizeArr = { '1': 12, '2': 16, '3': 22 }; const sizeArr = { '1': 12, '2': 16, '3': 22 };
let speedArr = { '1': 50, '2': 30, '3': 10 }; const speedArr = { '1': 50, '2': 30, '3': 10 };
let size = sizeArr[fontSize] || 16; const size = sizeArr[fontSize] || 16;
let speed = speedArr[fontSpeed] || 30; const speed = speedArr[fontSpeed] || 30;
this.mps.sendbarrage2(content, size, '#' + color, '', speed, '微软雅黑'); this.mps.sendbarrage2(content, size, '#' + color, '', speed, '微软雅黑');
} }
}, },
......
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
uin: this.channelInfo.uin uin: this.channelInfo.uin
}); });
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let { customWatchNum, watchNum } = res.data; const { customWatchNum, watchNum } = res.data;
this.watchNum = { this.watchNum = {
custom: Number(customWatchNum) || 0, custom: Number(customWatchNum) || 0,
real: Number(watchNum) || 0 real: Number(watchNum) || 0
......
...@@ -46,8 +46,8 @@ export default { ...@@ -46,8 +46,8 @@ export default {
showRedInfo: 'showRedInfo' showRedInfo: 'showRedInfo'
}), }),
list() { list() {
let answerList = this.answerList || []; const answerList = this.answerList || [];
let list = answerList.sort((a, b) => { const list = answerList.sort((a, b) => {
return b.redpacketId - a.redpacketId; return b.redpacketId - a.redpacketId;
}); });
return list; return list;
......
...@@ -146,9 +146,9 @@ export default { ...@@ -146,9 +146,9 @@ export default {
}, },
nextRed() { nextRed() {
this.del_answerList(); this.del_answerList();
let nextInfo = this.answerList[this.redIndex - 1]; const nextInfo = this.answerList[this.redIndex - 1];
if (nextInfo) { if (nextInfo) {
let id = nextInfo.redpacketId; const id = nextInfo.redpacketId;
this.set_showRedInfo({ this.set_showRedInfo({
type: RED_TYPE, type: RED_TYPE,
id: id id: id
......
...@@ -44,8 +44,8 @@ export default { ...@@ -44,8 +44,8 @@ export default {
computed: { computed: {
hasSum() { hasSum() {
let sum = 0; let sum = 0;
let detail = this.luckInfo.detail || {}; const detail = this.luckInfo.detail || {};
for (let key in detail) { for (const key in detail) {
if (detail.hasOwnProperty(key)) { if (detail.hasOwnProperty(key)) {
sum += parseFloat(detail[key].amount); sum += parseFloat(detail[key].amount);
} }
...@@ -53,10 +53,10 @@ export default { ...@@ -53,10 +53,10 @@ export default {
return sum; return sum;
}, },
bestUser() { bestUser() {
let arr = []; const arr = [];
let num = this.luckInfo.num || 1; const num = this.luckInfo.num || 1;
let detail = this.luckInfo.detail || {}; const detail = this.luckInfo.detail || {};
for (let key in detail) { for (const key in detail) {
if (detail.hasOwnProperty(key)) { if (detail.hasOwnProperty(key)) {
arr.push(detail[key]); arr.push(detail[key]);
} }
......
...@@ -59,10 +59,10 @@ export default { ...@@ -59,10 +59,10 @@ export default {
showRedInfo: 'showRedInfo' showRedInfo: 'showRedInfo'
}), }),
list() { list() {
let arr = []; const arr = [];
let businessList = this.businessList; const businessList = this.businessList;
for (let i = 0; i < businessList.length; i++) { for (let i = 0; i < businessList.length; i++) {
let item = this.businessList[i]; const item = this.businessList[i];
if (item.isRob === 2) { if (item.isRob === 2) {
arr.push(item); arr.push(item);
} else { } else {
...@@ -73,9 +73,9 @@ export default { ...@@ -73,9 +73,9 @@ export default {
}, },
rodNum() { rodNum() {
let num = 0; let num = 0;
let businessList = this.businessList; const businessList = this.businessList;
for (let i = 0; i < businessList.length; i++) { for (let i = 0; i < businessList.length; i++) {
let item = this.businessList[i]; const item = this.businessList[i];
if (item.isExpire !== 1 && item.isRob !== 1 && item.isEmpty !== 0) { if (item.isExpire !== 1 && item.isRob !== 1 && item.isEmpty !== 0) {
num++; num++;
} }
......
...@@ -43,10 +43,10 @@ export default { ...@@ -43,10 +43,10 @@ export default {
}, },
computed: { computed: {
bestUser() { bestUser() {
let arr = []; const arr = [];
let num = this.luckInfo.num || 1; const num = this.luckInfo.num || 1;
let detail = this.luckInfo.detail || {}; const detail = this.luckInfo.detail || {};
for (let key in detail) { for (const key in detail) {
if (detail.hasOwnProperty(key)) { if (detail.hasOwnProperty(key)) {
arr.push(detail[key]); arr.push(detail[key]);
} }
......
...@@ -43,10 +43,10 @@ export default { ...@@ -43,10 +43,10 @@ export default {
}, },
computed: { computed: {
bestUser() { bestUser() {
let arr = []; const arr = [];
let num = this.luckInfo.num || 1; const num = this.luckInfo.num || 1;
let detail = this.luckInfo.detail || {}; const detail = this.luckInfo.detail || {};
for (let key in detail) { for (const key in detail) {
if (detail.hasOwnProperty(key)) { if (detail.hasOwnProperty(key)) {
arr.push(detail[key]); arr.push(detail[key]);
} }
......
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
} }
}, },
_shareSuspension() { _shareSuspension() {
let shareList = this.$refs.shareItem; const shareList = this.$refs.shareItem;
if (shareList) { if (shareList) {
this.shareTimer.forEach(obj => { this.shareTimer.forEach(obj => {
clearInterval(obj); clearInterval(obj);
...@@ -78,15 +78,15 @@ export default { ...@@ -78,15 +78,15 @@ export default {
_position(dom) { _position(dom) {
let x = Math.random() > 0.5 ? 1 : -1; let x = Math.random() > 0.5 ? 1 : -1;
let y = Math.random() > 0.5 ? 1 : -1; let y = Math.random() > 0.5 ? 1 : -1;
let AW = Math.floor(Math.random() * window.innerWidth); const AW = Math.floor(Math.random() * window.innerWidth);
let AH = Math.floor(Math.random() * window.innerHeight); const AH = Math.floor(Math.random() * window.innerHeight);
if (!dom.style.top) { if (!dom.style.top) {
dom.style.top = AH + 'px'; dom.style.top = AH + 'px';
} }
if (!dom.style.left) { if (!dom.style.left) {
dom.style.left = AW + 'px'; dom.style.left = AW + 'px';
} }
let tiemr = setInterval(function() { const tiemr = setInterval(function() {
let top = parseInt(dom.offsetTop, 10); let top = parseInt(dom.offsetTop, 10);
let left = parseInt(dom.offsetLeft, 10); let left = parseInt(dom.offsetLeft, 10);
y = top <= 0 ? 1 : top >= window.innerHeight - 30 ? -1 : y; y = top <= 0 ? 1 : top >= window.innerHeight - 30 ? -1 : y;
......
...@@ -47,11 +47,11 @@ export default { ...@@ -47,11 +47,11 @@ export default {
} }
}, },
emojiArr() { emojiArr() {
let arr = []; const arr = [];
let num = 20; const num = 20;
for (let key in emoji_icon) { for (const key in emoji_icon) {
if (emoji_icon.hasOwnProperty(key)) { if (emoji_icon.hasOwnProperty(key)) {
let index = parseInt((key - 1) / num, 10); const index = parseInt((key - 1) / num, 10);
if (!arr[index]) { if (!arr[index]) {
arr[index] = []; arr[index] = [];
} }
...@@ -70,7 +70,7 @@ export default { ...@@ -70,7 +70,7 @@ export default {
methods: { methods: {
_initSwiper() { _initSwiper() {
if (!this.swiper) { if (!this.swiper) {
let option = { const option = {
direction: 'horizontal', direction: 'horizontal',
pagination: { pagination: {
el: this.$refs.emojiPagination el: this.$refs.emojiPagination
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
}, },
_remText() { _remText() {
let text = this.content; let text = this.content;
let reg = /(#)[\u4e00-\u9fa5A-Za-z0-9.]+(#)$/; const reg = /(#)[\u4e00-\u9fa5A-Za-z0-9.]+(#)$/;
if (text) { if (text) {
if (text.match(reg) != null) { if (text.match(reg) != null) {
text = text.replace(reg, ''); text = text.replace(reg, '');
......
...@@ -56,7 +56,7 @@ export default { ...@@ -56,7 +56,7 @@ export default {
jumpUrls: 'jumpUrls' jumpUrls: 'jumpUrls'
}), }),
isQuestionnaire() { isQuestionnaire() {
let info = this.channelConfig.questionnaire || {}; const info = this.channelConfig.questionnaire || {};
return info; return info;
} }
}, },
...@@ -80,13 +80,13 @@ export default { ...@@ -80,13 +80,13 @@ export default {
} }
}, },
_uploadImg(e) { _uploadImg(e) {
let self = this; const self = this;
let input = e.target; const input = e.target;
if (!input.value) { if (!input.value) {
return false; return false;
} }
if (input.files && input.files[0]) { if (input.files && input.files[0]) {
let reader = new FileReader(); const reader = new FileReader();
reader.onload = function() { reader.onload = function() {
self._createCanvas(reader.result); self._createCanvas(reader.result);
input.value = ''; input.value = '';
...@@ -95,18 +95,18 @@ export default { ...@@ -95,18 +95,18 @@ export default {
} }
}, },
_createCanvas(src) { _createCanvas(src) {
let self = this; const self = this;
let canvas = document.createElement('canvas'); const canvas = document.createElement('canvas');
let cxt = canvas.getContext('2d'); const cxt = canvas.getContext('2d');
let img = new Image(); const img = new Image();
img.src = src; img.src = src;
let maxW = window.innerWidth > 300 ? window.innerWidth : 300; const maxW = window.innerWidth > 300 ? window.innerWidth : 300;
let maxH = window.innerHeight > 300 ? window.innerHeight : 300; const maxH = window.innerHeight > 300 ? window.innerHeight : 300;
img.onload = function() { img.onload = function() {
let w = img.width; let w = img.width;
let h = img.height; let h = img.height;
if (w > maxW || h > maxH) { if (w > maxW || h > maxH) {
let p = w / maxW > h / maxH ? w / maxW : h / maxH; const p = w / maxW > h / maxH ? w / maxW : h / maxH;
w = img.width / p; w = img.width / p;
h = img.height / p; h = img.height / p;
img.width = w; img.width = w;
...@@ -115,20 +115,20 @@ export default { ...@@ -115,20 +115,20 @@ export default {
canvas.width = w; canvas.width = w;
canvas.height = h; canvas.height = h;
cxt.drawImage(img, 0, 0, w, h); cxt.drawImage(img, 0, 0, w, h);
let newsrc = canvas.toDataURL('image/jpeg', 0.9); const newsrc = canvas.toDataURL('image/jpeg', 0.9);
self._sendPhoto(newsrc); self._sendPhoto(newsrc);
}; };
}, },
_uplaod() { _uplaod() {
let self = this; const self = this;
if (UserAgent.isWx()) { if (UserAgent.isWx()) {
let wx = window.wx; const wx = window.wx;
wx.chooseImage({ wx.chooseImage({
count: 1, count: 1,
sizeType: ['original', 'compressed'], sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'], sourceType: ['album', 'camera'],
success(res) { success(res) {
let localIds = res.localIds; const localIds = res.localIds;
wx.uploadImage({ wx.uploadImage({
localId: localIds[0], localId: localIds[0],
success(e) { success(e) {
......
...@@ -20,7 +20,7 @@ export default { ...@@ -20,7 +20,7 @@ export default {
showRedInfo: 'showRedInfo' showRedInfo: 'showRedInfo'
}), }),
shareConfig() { shareConfig() {
let self = this; const self = this;
return { return {
title: this.channelInfo.shareTitle || this.channelInfo.channelName, title: this.channelInfo.shareTitle || this.channelInfo.channelName,
desc: this.channelInfo.shareSubTitle || window.location.href, desc: this.channelInfo.shareSubTitle || window.location.href,
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
}, },
// 微信分享init // 微信分享init
_InitWXShare() { _InitWXShare() {
let self = this; const self = this;
window.wx.ready(() => { window.wx.ready(() => {
window.wx.onMenuShareTimeline(self.shareConfig); window.wx.onMenuShareTimeline(self.shareConfig);
window.wx.onMenuShareAppMessage(self.shareConfig); window.wx.onMenuShareAppMessage(self.shareConfig);
......
...@@ -329,8 +329,8 @@ const allSkin = { ...@@ -329,8 +329,8 @@ const allSkin = {
jieri_61 jieri_61
}; };
const skin = color => { const skin = color => {
let layoutColor = color; const layoutColor = color;
let defStyle = allSkin.def; const defStyle = allSkin.def;
let style = ''; let style = '';
if (layoutColor) { if (layoutColor) {
if (layoutColor.indexOf('#') !== -1) { if (layoutColor.indexOf('#') !== -1) {
...@@ -339,7 +339,7 @@ const skin = color => { ...@@ -339,7 +339,7 @@ const skin = color => {
style = allSkin[layoutColor]; style = allSkin[layoutColor];
} }
} }
let styleHtml = ` const styleHtml = `
:root{ :root{
${style || defStyle} ${style || defStyle}
} }
......
...@@ -83,23 +83,23 @@ export default { ...@@ -83,23 +83,23 @@ export default {
userInfo: 'userInfo' userInfo: 'userInfo'
}), }),
isOffice() { isOffice() {
let info = this.channelConfig.officeLive || {}; const info = this.channelConfig.officeLive || {};
return info.isEnable === 1; return info.isEnable === 1;
}, },
isDraw() { isDraw() {
return this.channelInfo.drawStatus === 1; return this.channelInfo.drawStatus === 1;
}, },
isInvitation() { isInvitation() {
let info = this.channelConfig.invitation || {}; const info = this.channelConfig.invitation || {};
return info.isInvitation === 1; return info.isInvitation === 1;
}, },
isReward() { isReward() {
let rewardStatus = this.channelInfo.rewardStatus; const rewardStatus = this.channelInfo.rewardStatus;
let rewardGiftStatus = this.channelInfo.rewardGiftStatus; const rewardGiftStatus = this.channelInfo.rewardGiftStatus;
return rewardStatus === 1 || rewardGiftStatus === 1; return rewardStatus === 1 || rewardGiftStatus === 1;
}, },
isPraise() { isPraise() {
let info = this.channelConfig.praise; const info = this.channelConfig.praise;
if (info) { if (info) {
return info.isEnable === 1; return info.isEnable === 1;
} else { } else {
...@@ -107,7 +107,7 @@ export default { ...@@ -107,7 +107,7 @@ export default {
} }
}, },
redPacketFilterButton() { redPacketFilterButton() {
let info = this.channelConfig.redPacketFilterButton || {}; const info = this.channelConfig.redPacketFilterButton || {};
return info.isEnable === 1; return info.isEnable === 1;
}, },
isToggle() { isToggle() {
......
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
} }
}, },
_jump() { _jump() {
let info = JSON.parse(JSON.stringify(this.welcomeInfo)); const info = JSON.parse(JSON.stringify(this.welcomeInfo));
info.imgState = 2; info.imgState = 2;
this.set_welcomeInfo(info); this.set_welcomeInfo(info);
} }
......
...@@ -15,8 +15,8 @@ const mixin = { ...@@ -15,8 +15,8 @@ const mixin = {
channelConfig: 'channelConfig' channelConfig: 'channelConfig'
}), }),
isFront() { isFront() {
let info = this.channelConfig.questionnaire || {}; const info = this.channelConfig.questionnaire || {};
let { isEnable, isFront } = info; const { isEnable, isFront } = info;
return isEnable && isFront; return isEnable && isFront;
} }
}, },
...@@ -32,11 +32,11 @@ const mixin = { ...@@ -32,11 +32,11 @@ const mixin = {
referralUrl: window.location.href referralUrl: window.location.href
}); });
if (questionnaireHasRes.code === 200 && questionnaireHasRes.errorCode === 0) { if (questionnaireHasRes.code === 200 && questionnaireHasRes.errorCode === 0) {
let { url: questionnaire_url, isJoin } = questionnaireHasRes.data; const { url: questionnaire_url, isJoin } = questionnaireHasRes.data;
if (noback) { if (noback) {
if (isJoin === 0 && questionnaire_url) { if (isJoin === 0 && questionnaire_url) {
if (!this.userInfo.id) { if (!this.userInfo.id) {
let loginUrl = `${this.jumpUrls.login_noback}${encodeURIComponent( const loginUrl = `${this.jumpUrls.login_noback}${encodeURIComponent(
questionnaire_url questionnaire_url
)}`; )}`;
window.location.replace(loginUrl); window.location.replace(loginUrl);
......
...@@ -93,7 +93,7 @@ export default { ...@@ -93,7 +93,7 @@ export default {
this.showEdit = true; this.showEdit = true;
}, },
del(id) { del(id) {
let self = this; const self = this;
this.$layer.sConfirm({ this.$layer.sConfirm({
title: '提示', title: '提示',
msg: '是否删除该地址?', msg: '是否删除该地址?',
......
...@@ -102,9 +102,9 @@ export default { ...@@ -102,9 +102,9 @@ export default {
}, },
computed: { computed: {
provinceList() { provinceList() {
let province = this.cityData[100000]; const province = this.cityData[100000];
let arr = []; const arr = [];
for (let key in province) { for (const key in province) {
if (province[key]) { if (province[key]) {
arr.push({ arr.push({
val: key, val: key,
...@@ -115,9 +115,9 @@ export default { ...@@ -115,9 +115,9 @@ export default {
return arr; return arr;
}, },
cityList() { cityList() {
let city = this.cityData[this.changeCity.province] || {}; const city = this.cityData[this.changeCity.province] || {};
let arr = []; const arr = [];
for (let key in city) { for (const key in city) {
if (city[key]) { if (city[key]) {
arr.push({ arr.push({
val: key, val: key,
...@@ -128,9 +128,9 @@ export default { ...@@ -128,9 +128,9 @@ export default {
return arr; return arr;
}, },
areaList() { areaList() {
let area = this.cityData[this.changeCity.city] || {}; const area = this.cityData[this.changeCity.city] || {};
let arr = []; const arr = [];
for (let key in area) { for (const key in area) {
if (area[key]) { if (area[key]) {
arr.push({ arr.push({
val: key, val: key,
...@@ -166,8 +166,8 @@ export default { ...@@ -166,8 +166,8 @@ export default {
this.changeCity.province = ''; this.changeCity.province = '';
this.changeCity.city = ''; this.changeCity.city = '';
this.changeCity.area = ''; this.changeCity.area = '';
let address = this.address || '浙江省-杭州市-西湖区'; const address = this.address || '浙江省-杭州市-西湖区';
let arr = address.split('-'); const arr = address.split('-');
for (let i = 0; i < this.provinceList.length; i++) { for (let i = 0; i < this.provinceList.length; i++) {
if (this.provinceList[i].name === arr[0]) { if (this.provinceList[i].name === arr[0]) {
this.changeCity.province = this.provinceList[i].val; this.changeCity.province = this.provinceList[i].val;
...@@ -258,7 +258,7 @@ export default { ...@@ -258,7 +258,7 @@ export default {
}, },
touchMove(e, type) { touchMove(e, type) {
e.preventDefault(); e.preventDefault();
let y = e.targetTouches[0].pageY - this.pageY; const y = e.targetTouches[0].pageY - this.pageY;
this.pageY = e.targetTouches[0].pageY; this.pageY = e.targetTouches[0].pageY;
this.translateY = y + this.translateY; this.translateY = y + this.translateY;
switch (type) { switch (type) {
...@@ -317,10 +317,10 @@ export default { ...@@ -317,10 +317,10 @@ export default {
this.$emit('input', false); this.$emit('input', false);
}, },
sub() { sub() {
let province = this.cityData[100000][this.changeCity.province] || ''; const province = this.cityData[100000][this.changeCity.province] || '';
let city = this.cityData[this.changeCity.province][this.changeCity.city] || ''; const city = this.cityData[this.changeCity.province][this.changeCity.city] || '';
let area = this.cityData[this.changeCity.city][this.changeCity.area] || ''; const area = this.cityData[this.changeCity.city][this.changeCity.area] || '';
let address = `${province}-${city}-${area}`; const address = `${province}-${city}-${area}`;
this.$emit('setCity', false, { this.$emit('setCity', false, {
address: address, address: address,
province: province, province: province,
......
...@@ -38,9 +38,9 @@ export default { ...@@ -38,9 +38,9 @@ export default {
confStr() { confStr() {
let str = ''; let str = '';
for (let i = 0; i < this.choiceList.length; i++) { for (let i = 0; i < this.choiceList.length; i++) {
let listItem = this.choiceList[i]; const listItem = this.choiceList[i];
for (let j = 0; j < listItem.spec_value.length; j++) { for (let j = 0; j < listItem.spec_value.length; j++) {
let item = listItem.spec_value[j]; const item = listItem.spec_value[j];
if (item.select) { if (item.select) {
str += str ? `,${item.name}` : item.name; str += str ? `,${item.name}` : item.name;
} }
......
...@@ -46,9 +46,9 @@ export default { ...@@ -46,9 +46,9 @@ export default {
confStr() { confStr() {
let str = ''; let str = '';
for (let i = 0; i < this.choiceList.length; i++) { for (let i = 0; i < this.choiceList.length; i++) {
let listItem = this.choiceList[i]; const listItem = this.choiceList[i];
for (let j = 0; j < listItem.spec_value.length; j++) { for (let j = 0; j < listItem.spec_value.length; j++) {
let item = listItem.spec_value[j]; const item = listItem.spec_value[j];
if (item.select) { if (item.select) {
str += str ? `,${item.name}` : item.name; str += str ? `,${item.name}` : item.name;
} }
......
...@@ -86,9 +86,9 @@ export default { ...@@ -86,9 +86,9 @@ export default {
}, },
goodsKey() { goodsKey() {
let keyStr = ''; let keyStr = '';
let choiceList = this.choiceList || []; const choiceList = this.choiceList || [];
choiceList.forEach(choiceItem => { choiceList.forEach(choiceItem => {
let spec_value = choiceItem.spec_value || []; const spec_value = choiceItem.spec_value || [];
spec_value.forEach(item => { spec_value.forEach(item => {
if (item.select) { if (item.select) {
keyStr = keyStr ? `${keyStr}:${item.key}` : item.key; keyStr = keyStr ? `${keyStr}:${item.key}` : item.key;
...@@ -98,9 +98,9 @@ export default { ...@@ -98,9 +98,9 @@ export default {
return keyStr; return keyStr;
}, },
goodsInfo() { goodsInfo() {
let shopInfo = this.shopInfo || {}; const shopInfo = this.shopInfo || {};
let goodsList = shopInfo.specInfo || {}; const goodsList = shopInfo.specInfo || {};
let goodsInfo = goodsList[this.goodsKey] || { const goodsInfo = goodsList[this.goodsKey] || {
price: shopInfo.price, price: shopInfo.price,
stock: shopInfo.stock stock: shopInfo.stock
}; };
...@@ -114,7 +114,7 @@ export default { ...@@ -114,7 +114,7 @@ export default {
setChoiceList() { setChoiceList() {
let choiceList = this.shopInfo.spec || []; let choiceList = this.shopInfo.spec || [];
choiceList = choiceList.map(choiceItem => { choiceList = choiceList.map(choiceItem => {
let spec_value = choiceItem.spec_value || []; const spec_value = choiceItem.spec_value || [];
return { return {
id: choiceItem.id, id: choiceItem.id,
name: choiceItem.name, name: choiceItem.name,
...@@ -133,7 +133,7 @@ export default { ...@@ -133,7 +133,7 @@ export default {
changeChoice(choiceItem, itemId) { changeChoice(choiceItem, itemId) {
for (let i = 0; i < choiceItem.spec_value.length; i++) { for (let i = 0; i < choiceItem.spec_value.length; i++) {
if (choiceItem.spec_value[i].id === itemId) { if (choiceItem.spec_value[i].id === itemId) {
let select = !choiceItem.spec_value[i].select; const select = !choiceItem.spec_value[i].select;
choiceItem.spec_value[i].select = select; choiceItem.spec_value[i].select = select;
} else { } else {
choiceItem.spec_value[i].select = false; choiceItem.spec_value[i].select = false;
...@@ -141,7 +141,7 @@ export default { ...@@ -141,7 +141,7 @@ export default {
} }
}, },
sub() { sub() {
let goodsKeyLen = this.goodsKey ? this.goodsKey.split(':').length : 0; const goodsKeyLen = this.goodsKey ? this.goodsKey.split(':').length : 0;
if (this.choiceList.length && goodsKeyLen !== this.choiceList.length) { if (this.choiceList.length && goodsKeyLen !== this.choiceList.length) {
this.$layer.msg('请选择商品分类!'); this.$layer.msg('请选择商品分类!');
return false; return false;
......
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
}, },
methods: { methods: {
async getGoodsMsg() { async getGoodsMsg() {
let res = await getGoodsMsg({ const res = await getGoodsMsg({
uin: this.channelInfo.uin, uin: this.channelInfo.uin,
goodsId: this.goodsId goodsId: this.goodsId
}); });
......
...@@ -101,7 +101,7 @@ export default { ...@@ -101,7 +101,7 @@ export default {
} }
}, },
changeAddressInfo() { changeAddressInfo() {
let arr = this.addressList.filter(item => { const arr = this.addressList.filter(item => {
return item.id === this.addressId; return item.id === this.addressId;
}); });
return arr[0] || this.addressList[0] || {}; return arr[0] || this.addressList[0] || {};
...@@ -138,20 +138,20 @@ export default { ...@@ -138,20 +138,20 @@ export default {
payType: 1 payType: 1
}); });
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let { tradeType, prepayInfo } = res.data; const { tradeType, prepayInfo } = res.data;
let { uin } = this.channelInfo; const { uin } = this.channelInfo;
if (res.data.url) { if (res.data.url) {
window.location.href = res.data.url; window.location.href = res.data.url;
} else if (tradeType === 'MWEB') { } else if (tradeType === 'MWEB') {
let wxh5pay = `https://web.guangdianyun.tv/pay/wxh5pay?uin=${uin}`; const wxh5pay = `https://web.guangdianyun.tv/pay/wxh5pay?uin=${uin}`;
let backUrl = encodeURIComponent(window.location.href); const backUrl = encodeURIComponent(window.location.href);
let transferUrl = encodeURIComponent(`${wxh5pay}&url=${backUrl}`); const transferUrl = encodeURIComponent(`${wxh5pay}&url=${backUrl}`);
let payUrl = encodeURIComponent(`${prepayInfo.mweb_url}&redirect_url=${transferUrl}`); const payUrl = encodeURIComponent(`${prepayInfo.mweb_url}&redirect_url=${transferUrl}`);
let url = `${wxh5pay}&url=${payUrl}`; const url = `${wxh5pay}&url=${payUrl}`;
window.location.href = url; window.location.href = url;
} else if (tradeType === 'JSAPI') { } else if (tradeType === 'JSAPI') {
let data = encodeURIComponent(JSON.stringify(res.data)); const data = encodeURIComponent(JSON.stringify(res.data));
let url = `//web.guangdianyun.tv/pay/wxpay?uin=${uin}&payconfig=${data}`; const url = `//web.guangdianyun.tv/pay/wxpay?uin=${uin}&payconfig=${data}`;
window.location.href = url; window.location.href = url;
} else { } else {
this.$layer.msg('网络错误,请稍后重试!'); this.$layer.msg('网络错误,请稍后重试!');
......
...@@ -35,8 +35,8 @@ export default { ...@@ -35,8 +35,8 @@ export default {
this.isShow = false; this.isShow = false;
}, },
_copy() { _copy() {
let self = this; const self = this;
let clipboardObj = new Clipboard('#copySourceCommand', { const clipboardObj = new Clipboard('#copySourceCommand', {
text: () => { text: () => {
return this.content; return this.content;
} }
......
...@@ -21,14 +21,14 @@ export default { ...@@ -21,14 +21,14 @@ export default {
channelInfo: 'channelInfo' channelInfo: 'channelInfo'
}), }),
countDowm() { countDowm() {
let now = this.nowDate / 1000; const now = this.nowDate / 1000;
if (!this.info.id) { if (!this.info.id) {
return '未开始'; return '未开始';
} }
if (this.info.endTime <= now) { if (this.info.endTime <= now) {
return '已结束'; return '已结束';
} else if (this.info.startTime >= now) { } else if (this.info.startTime >= now) {
let time = this.info.startTime - now; const time = this.info.startTime - now;
return this.$options.filters.formatTime(time, 'mm:ss'); return this.$options.filters.formatTime(time, 'mm:ss');
} else { } else {
return '进行中'; return '进行中';
...@@ -40,10 +40,10 @@ export default { ...@@ -40,10 +40,10 @@ export default {
if (!this.userInfo.id) { if (!this.userInfo.id) {
this.$Bus.$emit('bus-showLogin', true); this.$Bus.$emit('bus-showLogin', true);
} else { } else {
let { previewUrl } = this.info; const { previewUrl } = this.info;
let channelId = this.channelInfo.id; const channelId = this.channelInfo.id;
let type = this.type; const type = this.type;
let backUrl = encodeURIComponent(window.location.href); const backUrl = encodeURIComponent(window.location.href);
window.location.href = `${previewUrl}&stype=${type}&sid=${channelId}&backUrl=${backUrl}`; window.location.href = `${previewUrl}&stype=${type}&sid=${channelId}&backUrl=${backUrl}`;
} }
} }
......
...@@ -29,10 +29,10 @@ export default { ...@@ -29,10 +29,10 @@ export default {
this.$layer.msg('请先登录'); this.$layer.msg('请先登录');
this.$Bus.$emit('bus-showLogin', true); this.$Bus.$emit('bus-showLogin', true);
} else { } else {
let uin = this.channelInfo.uin; const uin = this.channelInfo.uin;
let channelId = this.channelInfo.id; const channelId = this.channelInfo.id;
let type = this.type; const type = this.type;
let watchUrl = `${window.location.origin}${window.location.pathname}?uin=${uin}`; const watchUrl = `${window.location.origin}${window.location.pathname}?uin=${uin}`;
window.location.href = `/invite/?id=${channelId}&uin=${uin}&type=${type}&watchUrl=${encodeURIComponent( window.location.href = `/invite/?id=${channelId}&uin=${uin}&type=${type}&watchUrl=${encodeURIComponent(
watchUrl watchUrl
)}`; )}`;
......
...@@ -59,8 +59,8 @@ export default { ...@@ -59,8 +59,8 @@ export default {
}, },
pageUrlRule() { pageUrlRule() {
if (this.form.pageUrlRule) { if (this.form.pageUrlRule) {
let sql = this.form.name.split('.'); const sql = this.form.name.split('.');
let type = sql[sql.length - 1]; const type = sql[sql.length - 1];
let pagePath = this.form.currentPage; let pagePath = this.form.currentPage;
if (type === 'xlsx' || type === 'xls') { if (type === 'xlsx' || type === 'xls') {
pagePath = `s1/${this.form.currentPage}`; pagePath = `s1/${this.form.currentPage}`;
...@@ -89,8 +89,8 @@ export default { ...@@ -89,8 +89,8 @@ export default {
}; };
}, },
_copy() { _copy() {
let self = this; const self = this;
let clipboardObj = new Clipboard('#copyDownUrl', { const clipboardObj = new Clipboard('#copyDownUrl', {
text: () => { text: () => {
return this.form.downUrl; return this.form.downUrl;
} }
...@@ -110,11 +110,11 @@ export default { ...@@ -110,11 +110,11 @@ export default {
this.full = !this.full; this.full = !this.full;
}, },
_prev() { _prev() {
let page = this.form.currentPage - 1; const page = this.form.currentPage - 1;
this.form.currentPage = page <= 1 ? 1 : page; this.form.currentPage = page <= 1 ? 1 : page;
}, },
_next() { _next() {
let page = this.form.currentPage + 1; const page = this.form.currentPage + 1;
this.form.currentPage = page >= this.form.pageCount ? this.form.pageCount : page; this.form.currentPage = page >= this.form.pageCount ? this.form.pageCount : page;
}, },
_colse() { _colse() {
......
...@@ -36,8 +36,8 @@ export default { ...@@ -36,8 +36,8 @@ export default {
id: this.channelInfo.id id: this.channelInfo.id
}); });
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let praiseNum = Number(res.data.praiseNum) || 0; const praiseNum = Number(res.data.praiseNum) || 0;
let customPraiseNum = Number(res.data.customPraiseNum) || 0; const customPraiseNum = Number(res.data.customPraiseNum) || 0;
this.praiseTotal = praiseNum + customPraiseNum; this.praiseTotal = praiseNum + customPraiseNum;
} }
}, },
...@@ -78,8 +78,8 @@ export default { ...@@ -78,8 +78,8 @@ export default {
} }
}, },
_add(type) { _add(type) {
let div = document.createElement('div'); const div = document.createElement('div');
let a = Math.floor(Math.random() * 7); const a = Math.floor(Math.random() * 7);
div.style.backgroundPosition = `-${a * 0.6}rem 0`; div.style.backgroundPosition = `-${a * 0.6}rem 0`;
div.style.transform = `matrix(1, 0, 0, 1, 0, 0)`; div.style.transform = `matrix(1, 0, 0, 1, 0, 0)`;
this.$refs.praisBox.appendChild(div); this.$refs.praisBox.appendChild(div);
......
...@@ -41,20 +41,20 @@ export default { ...@@ -41,20 +41,20 @@ export default {
payType: 1 payType: 1
}); });
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let { tradeType, prepayInfo } = res.data; const { tradeType, prepayInfo } = res.data;
let { uin } = this.channelInfo; const { uin } = this.channelInfo;
if (res.data.url) { if (res.data.url) {
window.location.href = res.data.url; window.location.href = res.data.url;
} else if (tradeType === 'MWEB') { } else if (tradeType === 'MWEB') {
let wxh5pay = `https://web.guangdianyun.tv/pay/wxh5pay?uin=${uin}`; const wxh5pay = `https://web.guangdianyun.tv/pay/wxh5pay?uin=${uin}`;
let backUrl = encodeURIComponent(window.location.href); const backUrl = encodeURIComponent(window.location.href);
let transferUrl = encodeURIComponent(`${wxh5pay}&url=${backUrl}`); const transferUrl = encodeURIComponent(`${wxh5pay}&url=${backUrl}`);
let payUrl = encodeURIComponent(`${prepayInfo.mweb_url}&redirect_url=${transferUrl}`); const payUrl = encodeURIComponent(`${prepayInfo.mweb_url}&redirect_url=${transferUrl}`);
let url = `${wxh5pay}&url=${payUrl}`; const url = `${wxh5pay}&url=${payUrl}`;
window.location.href = url; window.location.href = url;
} else if (tradeType === 'JSAPI') { } else if (tradeType === 'JSAPI') {
let data = encodeURIComponent(JSON.stringify(res.data)); const data = encodeURIComponent(JSON.stringify(res.data));
let url = `//web.guangdianyun.tv/pay/wxpay?uin=${uin}&payconfig=${data}`; const url = `//web.guangdianyun.tv/pay/wxpay?uin=${uin}&payconfig=${data}`;
window.location.href = url; window.location.href = url;
} else { } else {
this.$layer.msg('网络错误,请稍后重试!'); this.$layer.msg('网络错误,请稍后重试!');
......
...@@ -45,12 +45,12 @@ export default { ...@@ -45,12 +45,12 @@ export default {
userInfo: 'userInfo' userInfo: 'userInfo'
}), }),
giftInfo() { giftInfo() {
let list = this.list || []; const list = this.list || [];
return list[this.changeIndex] || {}; return list[this.changeIndex] || {};
}, },
priceSum() { priceSum() {
if (this.giftInfo.id) { if (this.giftInfo.id) {
let price = Number(this.giftInfo.price) || 0; const price = Number(this.giftInfo.price) || 0;
return (price * this.giftNum).toFixed(2); return (price * this.giftNum).toFixed(2);
} else { } else {
return 0; return 0;
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
} }
}, },
_setCount(step) { _setCount(step) {
let num = Number(this.giftNum) + step; const num = Number(this.giftNum) + step;
this.giftNum = num; this.giftNum = num;
}, },
async _giftReward() { async _giftReward() {
...@@ -95,20 +95,20 @@ export default { ...@@ -95,20 +95,20 @@ export default {
payType: 1 payType: 1
}); });
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let { tradeType, prepayInfo } = res.data; const { tradeType, prepayInfo } = res.data;
let { uin } = this.channelInfo; const { uin } = this.channelInfo;
if (res.data.url) { if (res.data.url) {
window.location.href = res.data.url; window.location.href = res.data.url;
} else if (tradeType === 'MWEB') { } else if (tradeType === 'MWEB') {
let wxh5pay = `https://web.guangdianyun.tv/pay/wxh5pay?uin=${uin}`; const wxh5pay = `https://web.guangdianyun.tv/pay/wxh5pay?uin=${uin}`;
let backUrl = encodeURIComponent(window.location.href); const backUrl = encodeURIComponent(window.location.href);
let transferUrl = encodeURIComponent(`${wxh5pay}&url=${backUrl}`); const transferUrl = encodeURIComponent(`${wxh5pay}&url=${backUrl}`);
let payUrl = encodeURIComponent(`${prepayInfo.mweb_url}&redirect_url=${transferUrl}`); const payUrl = encodeURIComponent(`${prepayInfo.mweb_url}&redirect_url=${transferUrl}`);
let url = `${wxh5pay}&url=${payUrl}`; const url = `${wxh5pay}&url=${payUrl}`;
window.location.href = url; window.location.href = url;
} else if (tradeType === 'JSAPI') { } else if (tradeType === 'JSAPI') {
let data = encodeURIComponent(JSON.stringify(res.data)); const data = encodeURIComponent(JSON.stringify(res.data));
let url = `//web.guangdianyun.tv/pay/wxpay?uin=${uin}&payconfig=${data}`; const url = `//web.guangdianyun.tv/pay/wxpay?uin=${uin}&payconfig=${data}`;
window.location.href = url; window.location.href = url;
} else { } else {
this.$layer.msg('网络错误,请稍后重试!'); this.$layer.msg('网络错误,请稍后重试!');
...@@ -118,7 +118,7 @@ export default { ...@@ -118,7 +118,7 @@ export default {
}, },
watch: { watch: {
giftNum(nVal) { giftNum(nVal) {
let num = nVal > 999 ? 999 : nVal < 1 ? 1 : nVal; const num = nVal > 999 ? 999 : nVal < 1 ? 1 : nVal;
this.giftNum = parseInt(num, 10); this.giftNum = parseInt(num, 10);
} }
} }
......
...@@ -25,8 +25,8 @@ export default { ...@@ -25,8 +25,8 @@ export default {
if (!this.userInfo.id) { if (!this.userInfo.id) {
this.$Bus.$emit('bus-showLogin', true); this.$Bus.$emit('bus-showLogin', true);
} else { } else {
let id = this.info.id; const id = this.info.id;
let uin = this.channelInfo.uin; const uin = this.channelInfo.uin;
window.location.href = `/vote/?id=${id}&uin=${uin}`; window.location.href = `/vote/?id=${id}&uin=${uin}`;
} }
} }
......
...@@ -48,7 +48,7 @@ export default { ...@@ -48,7 +48,7 @@ export default {
jumpUrls: 'jumpUrls' jumpUrls: 'jumpUrls'
}), }),
isPeep() { isPeep() {
let peep = this.channelConfig.peep || {}; const peep = this.channelConfig.peep || {};
return !!peep.isEnable; return !!peep.isEnable;
} }
}, },
...@@ -72,7 +72,7 @@ export default { ...@@ -72,7 +72,7 @@ export default {
uin: this.channelInfo.uin uin: this.channelInfo.uin
}); });
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
let info = res.data.watchUserInfo; const info = res.data.watchUserInfo;
if (!info.id && this.isPeep) { if (!info.id && this.isPeep) {
this._toggleLogin(true); this._toggleLogin(true);
return false; return false;
......
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
channelConfig: 'channelConfig' channelConfig: 'channelConfig'
}), }),
watchWhite() { watchWhite() {
let watchWhiteList = this.channelConfig.watchWhiteList || {}; const watchWhiteList = this.channelConfig.watchWhiteList || {};
return watchWhiteList; return watchWhiteList;
}, },
tokenKey() { tokenKey() {
...@@ -39,8 +39,8 @@ export default { ...@@ -39,8 +39,8 @@ export default {
set_white: 'set_white' set_white: 'set_white'
}), }),
async get_watchWhite() { async get_watchWhite() {
let watchObj = this.$cookie.get(this.tokenKey) || '{}'; const watchObj = this.$cookie.get(this.tokenKey) || '{}';
let { ticket, code } = JSON.parse(watchObj); const { ticket, code } = JSON.parse(watchObj);
if (ticket) { if (ticket) {
const res = await checkWatchList({ const res = await checkWatchList({
uin: this.channelInfo.uin, uin: this.channelInfo.uin,
......
const packageEnv = require('../package.json'); const packageEnv = require('../package.json');
/* sentry */ /* sentry */
function getEnv() { function getEnv() {
let env = process.env.mode || ''; const env = process.env.mode || '';
let environment = ''; let environment = '';
switch (env) { switch (env) {
case 'test': case 'test':
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
import REPORT from '@/plugins/report'; import REPORT from '@/plugins/report';
export default { export default {
async mounted() { async mounted() {
let uin = this.$route.query.uin; const uin = this.$route.query.uin;
let id = this.$route.params.id; const id = this.$route.params.id;
REPORT(this.$sentry, { AppId: id, Uin: uin }); REPORT(this.$sentry, { AppId: id, Uin: uin });
} }
}; };
......
...@@ -19,7 +19,7 @@ service.interceptors.request.use( ...@@ -19,7 +19,7 @@ service.interceptors.request.use(
config.headers['token'] = config.headers['token'] =
Cookie.get('token') || Cookie.get('BCC_PROGRAM_USER_LOGIN_TOKEN') || ''; Cookie.get('token') || Cookie.get('BCC_PROGRAM_USER_LOGIN_TOKEN') || '';
} }
let noMsg = config.headers['noMsg'] || ''; const noMsg = config.headers['noMsg'] || '';
if (config.headers.hasOwnProperty('noMsg')) { if (config.headers.hasOwnProperty('noMsg')) {
delete config.headers['noMsg']; delete config.headers['noMsg'];
} }
...@@ -66,7 +66,7 @@ service.interceptors.response.use( ...@@ -66,7 +66,7 @@ service.interceptors.response.use(
); );
const get = (url, params, config = {}) => { const get = (url, params, config = {}) => {
let default_config = { const default_config = {
method: 'get', method: 'get',
url: url, url: url,
params: params, params: params,
...@@ -75,7 +75,7 @@ const get = (url, params, config = {}) => { ...@@ -75,7 +75,7 @@ const get = (url, params, config = {}) => {
return service(default_config); return service(default_config);
}; };
const post = (url, data, config = {}) => { const post = (url, data, config = {}) => {
let default_config = { const default_config = {
method: 'post', method: 'post',
url: url, url: url,
data: qs.stringify(data), data: qs.stringify(data),
......
...@@ -12,9 +12,9 @@ function getTarget(dom) { ...@@ -12,9 +12,9 @@ function getTarget(dom) {
} }
Vue.directive("transfer-dom", { Vue.directive("transfer-dom", {
inserted(el, { value }, vnode) { inserted(el, { value }, vnode) {
let parentNode = el.parentNode; const parentNode = el.parentNode;
if (!parentNode) return; if (!parentNode) return;
let home = document.createComment(""); const home = document.createComment("");
let hasMovedOut = false; let hasMovedOut = false;
if (value !== false) { if (value !== false) {
...@@ -32,11 +32,11 @@ Vue.directive("transfer-dom", { ...@@ -32,11 +32,11 @@ Vue.directive("transfer-dom", {
} }
}, },
componentUpdated(el, { value }) { componentUpdated(el, { value }) {
let ref$1 = el.__transferDomData; const ref$1 = el.__transferDomData;
if (!ref$1) return; if (!ref$1) return;
let parentNode = ref$1.parentNode; const parentNode = ref$1.parentNode;
let home = ref$1.home; const home = ref$1.home;
let hasMovedOut = ref$1.hasMovedOut; const hasMovedOut = ref$1.hasMovedOut;
if (!hasMovedOut && value) { if (!hasMovedOut && value) {
parentNode.replaceChild(home, el); parentNode.replaceChild(home, el);
...@@ -56,7 +56,7 @@ Vue.directive("transfer-dom", { ...@@ -56,7 +56,7 @@ Vue.directive("transfer-dom", {
} }
}, },
unbind(el) { unbind(el) {
let ref$1 = el.__transferDomData; const ref$1 = el.__transferDomData;
if (!ref$1) return; if (!ref$1) return;
if (el.__transferDomData.hasMovedOut === true) { if (el.__transferDomData.hasMovedOut === true) {
el.__transferDomData.parentNode && el.__transferDomData.parentNode &&
......
import icons from './icons'; import icons from './icons';
export default str => { export default str => {
let text = str; let text = str;
for (let key in icons) { for (const key in icons) {
if (icons[key]) { if (icons[key]) {
let reg = new RegExp(`#${icons[key]}#`, 'ig'); const reg = new RegExp(`#${icons[key]}#`, 'ig');
text = text.replace( text = text.replace(
reg, reg,
`<img class="emoji" src="${process.env.DEF_OSS}/static/emoji/newqq/${key}.gif">` `<img class="emoji" src="${process.env.DEF_OSS}/static/emoji/newqq/${key}.gif">`
......
...@@ -3,8 +3,8 @@ export default (time, fmt) => { ...@@ -3,8 +3,8 @@ export default (time, fmt) => {
if (!time) { if (!time) {
return ""; return "";
} }
let date = new Date(parseInt(time, 10)); const date = new Date(parseInt(time, 10));
let o = { const o = {
"y+": date.getFullYear(), "y+": date.getFullYear(),
"M+": date.getMonth() + 1, "M+": date.getMonth() + 1,
"d+": date.getDate(), "d+": date.getDate(),
...@@ -13,7 +13,7 @@ export default (time, fmt) => { ...@@ -13,7 +13,7 @@ export default (time, fmt) => {
"s+": date.getSeconds() "s+": date.getSeconds()
}; };
for (let k in o) { for (const k in o) {
if (new RegExp(`(${k})`).test(format)) { if (new RegExp(`(${k})`).test(format)) {
let str = o[k] + ""; let str = o[k] + "";
str = str.length > 1 ? str : 0 + str; str = str.length > 1 ? str : 0 + str;
......
let msg = (message = '提示', time = 1500) => { const msg = (message = '提示', time = 1500) => {
let div = document.createElement('div'); const div = document.createElement('div');
div.className = 's-layer'; div.className = 's-layer';
div.innerHTML = `<div class="s-layer-tips">${message}</>`; div.innerHTML = `<div class="s-layer-tips">${message}</>`;
document.body.appendChild(div); document.body.appendChild(div);
...@@ -9,16 +9,16 @@ let msg = (message = '提示', time = 1500) => { ...@@ -9,16 +9,16 @@ let msg = (message = '提示', time = 1500) => {
}, time); }, time);
} }
}; };
let close = () => { const close = () => {
let layer = document.querySelectorAll('.s-layer'); const layer = document.querySelectorAll('.s-layer');
layer.forEach(item => { layer.forEach(item => {
document.body.removeChild(item); document.body.removeChild(item);
}); });
}; };
let sConfirm = conf => { const sConfirm = conf => {
let title = conf.title ? conf.title : '提示'; const title = conf.title ? conf.title : '提示';
let message = conf.msg ? conf.msg : '提示'; const message = conf.msg ? conf.msg : '提示';
let div = document.createElement('div'); const div = document.createElement('div');
div.className = 's-layer'; div.className = 's-layer';
div.innerHTML = `<div class="s-layer-confirm"> div.innerHTML = `<div class="s-layer-confirm">
<div class="s-layer-box"> <div class="s-layer-box">
......
...@@ -16,9 +16,9 @@ const mixin = { ...@@ -16,9 +16,9 @@ const mixin = {
}), }),
reportDms() { reportDms() {
let dms = ''; let dms = '';
let menuList = this.menuList || []; const menuList = this.menuList || [];
for (let i = 0; i < menuList.length; i++) { for (let i = 0; i < menuList.length; i++) {
let item = menuList[i]; const item = menuList[i];
if (item.menuType === 'report' && item.menuInfo) { if (item.menuType === 'report' && item.menuInfo) {
dms = `pic_text_${item.menuInfo}`; dms = `pic_text_${item.menuInfo}`;
} }
...@@ -26,7 +26,7 @@ const mixin = { ...@@ -26,7 +26,7 @@ const mixin = {
return dms; return dms;
}, },
otherTopic() { otherTopic() {
let channelInfo = this.channelInfo || {}; const channelInfo = this.channelInfo || {};
return { return {
audience: `dms_${channelInfo.uin}_audience`, audience: `dms_${channelInfo.uin}_audience`,
config: `channel_config_${channelInfo.id}` config: `channel_config_${channelInfo.id}`
...@@ -57,15 +57,15 @@ const mixin = { ...@@ -57,15 +57,15 @@ const mixin = {
}, },
_makeClientId() { _makeClientId() {
ROP.Leave(); ROP.Leave();
let uin = this.channelInfo.uin || '0'; const uin = this.channelInfo.uin || '0';
let channelId = this.channelInfo.id || '0'; const channelId = this.channelInfo.id || '0';
let timeStr = String(new Date().getTime() + Math.floor(Math.random() * 100000)); const timeStr = String(new Date().getTime() + Math.floor(Math.random() * 100000));
let clientId = `${uin}_${channelId}_${timeStr}`; const clientId = `${uin}_${channelId}_${timeStr}`;
console.log(clientId); console.log(clientId);
ROP.Enter('', this.channelInfo.sub_key, clientId, true); ROP.Enter('', this.channelInfo.sub_key, clientId, true);
}, },
_DMSInit() { _DMSInit() {
let self = this; const self = this;
// chat连接成功后的消息 // chat连接成功后的消息
ROP.On('enter_suc', function() { ROP.On('enter_suc', function() {
console.log('服务器连接成功'); console.log('服务器连接成功');
...@@ -94,7 +94,7 @@ const mixin = { ...@@ -94,7 +94,7 @@ const mixin = {
}); });
// chat接收到的消息 // chat接收到的消息
ROP.On('publish_data', function(res, topic) { ROP.On('publish_data', function(res, topic) {
let data = JSON.parse(res); const data = JSON.parse(res);
switch (topic) { switch (topic) {
case self.channelInfo.dmsTopic: case self.channelInfo.dmsTopic:
case self.channelInfo.dmsRewardTopic: case self.channelInfo.dmsRewardTopic:
...@@ -130,14 +130,14 @@ const mixin = { ...@@ -130,14 +130,14 @@ const mixin = {
}, },
_dmsChat(data) { _dmsChat(data) {
if (data.cmd === 'watchCode') { if (data.cmd === 'watchCode') {
let tokenKey = `white-${this.type}-${this.channelInfo.id}`; const tokenKey = `white-${this.type}-${this.channelInfo.id}`;
if (data.clearAll === 1) { if (data.clearAll === 1) {
this.set_white(true); this.set_white(true);
this.$cookie.remove(tokenKey); this.$cookie.remove(tokenKey);
} else { } else {
let watchObj = this.$cookie.get(tokenKey) || '{}'; const watchObj = this.$cookie.get(tokenKey) || '{}';
let { ticket, code } = JSON.parse(watchObj); const { ticket, code } = JSON.parse(watchObj);
let watchData = data.watchData; const watchData = data.watchData;
if (watchData.ticket === ticket && watchData.code === code) { if (watchData.ticket === ticket && watchData.code === code) {
this.set_white(true); this.set_white(true);
this.$cookie.remove(tokenKey); this.$cookie.remove(tokenKey);
...@@ -194,34 +194,34 @@ const mixin = { ...@@ -194,34 +194,34 @@ const mixin = {
} }
if (data.cmd === 'chatDisable') { if (data.cmd === 'chatDisable') {
// 是否全员禁言 // 是否全员禁言
let info = JSON.parse(JSON.stringify(this.channelInfo)); const info = JSON.parse(JSON.stringify(this.channelInfo));
info.chatDisable = data.status; info.chatDisable = data.status;
this.set_channelInfo(info); this.set_channelInfo(info);
return false; return false;
} }
if (data.cmd === 'chatLogin') { if (data.cmd === 'chatLogin') {
// 是否禁止游客聊天 // 是否禁止游客聊天
let info = JSON.parse(JSON.stringify(this.channelInfo)); const info = JSON.parse(JSON.stringify(this.channelInfo));
info.chatLogin = data.status; info.chatLogin = data.status;
this.set_channelInfo(info); this.set_channelInfo(info);
} }
if (data.cmd === 'chatSee') { if (data.cmd === 'chatSee') {
// 聊天是否自己可见 // 聊天是否自己可见
let info = JSON.parse(JSON.stringify(this.channelInfo)); const info = JSON.parse(JSON.stringify(this.channelInfo));
info.chatSee = data.status; info.chatSee = data.status;
this.set_channelInfo(info); this.set_channelInfo(info);
return false; return false;
} }
if (data.cmd === 'chatCountStatus') { if (data.cmd === 'chatCountStatus') {
// 是否显示聊天数 // 是否显示聊天数
let info = JSON.parse(JSON.stringify(this.channelInfo)); const info = JSON.parse(JSON.stringify(this.channelInfo));
info.chatCountStatus = data.status; info.chatCountStatus = data.status;
this.set_channelInfo(info); this.set_channelInfo(info);
return false; return false;
} }
if (data.cmd === 'living') { if (data.cmd === 'living') {
// 开启结束直播 // 开启结束直播
let info = JSON.parse(JSON.stringify(this.channelInfo)); const info = JSON.parse(JSON.stringify(this.channelInfo));
info.liveStatus = data.status; info.liveStatus = data.status;
this.set_channelInfo(info); this.set_channelInfo(info);
return false; return false;
...@@ -244,7 +244,7 @@ const mixin = { ...@@ -244,7 +244,7 @@ const mixin = {
// 删除聊天 // 删除聊天
if (typeof data.id === 'string') { if (typeof data.id === 'string') {
let ids = data.id.split(','); const ids = data.id.split(',');
ids.forEach(item => { ids.forEach(item => {
this.$Bus.$emit('bus-delTopChat', Number(item)); this.$Bus.$emit('bus-delTopChat', Number(item));
this.$Bus.$emit('bus-delChat', Number(item)); this.$Bus.$emit('bus-delChat', Number(item));
...@@ -320,18 +320,18 @@ const mixin = { ...@@ -320,18 +320,18 @@ const mixin = {
} }
}, },
_dmsAudience(data) { _dmsAudience(data) {
let ids = data.ids.map(x => Number(x)); const ids = data.ids.map(x => Number(x));
if (ids.indexOf(Number(this.userInfo.id)) === -1) { if (ids.indexOf(Number(this.userInfo.id)) === -1) {
return false; return false;
} }
if (data.cmd === 'disableChat') { if (data.cmd === 'disableChat') {
let info = JSON.parse(JSON.stringify(this.userInfo)); const info = JSON.parse(JSON.stringify(this.userInfo));
info.isDisableChat = Number(data.isDisable); info.isDisableChat = Number(data.isDisable);
this.set_userInfo(info); this.set_userInfo(info);
return false; return false;
} }
if (data.cmd === 'setStatus') { if (data.cmd === 'setStatus') {
let info = JSON.parse(JSON.stringify(this.userInfo)); const info = JSON.parse(JSON.stringify(this.userInfo));
info.status = Number(data.status); info.status = Number(data.status);
this.set_userInfo(info); this.set_userInfo(info);
return false; return false;
...@@ -339,8 +339,8 @@ const mixin = { ...@@ -339,8 +339,8 @@ const mixin = {
}, },
_dmsChannelConfig(data) { _dmsChannelConfig(data) {
if (data.cmd === 'commodity') { if (data.cmd === 'commodity') {
let list = []; const list = [];
let { cad } = data; const { cad } = data;
if (cad) { if (cad) {
list.push(cad); list.push(cad);
} }
......
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 sign in to comment