开云体育

保修查询

服务政策

联系我们

微信公众号

加载中...

扫码关注 TP-LINK服务微信公众号

{{item}}

视频中心

查看更多>
加载中... 加载中... 加载中...

{{item.views}}次播放

{{parseSecond(item.duration)}}

{{item.title}}

{{formatDate(item.modifiedTime)}}

文档中心

查看更多>

{{item.title}}

{{formatDate(item.modifiedTime)}}

下载

{{item.title}}

{{formatDate(item.modifiedTime)}}

下载
{ for (let i = 0; i < result.length; i++) { if (result[i].data.errorCode === 0) { this.videoResult[this.switchEnum[i]] = result[i].data.result; } else { alert(this.switchEnum[i] + ':' + result[i].data.message); } } //console.log(this.videoResult) this.setVideo(); }).catch((error) => { alert(error); }); }, getDocument: function () { let request = []; for (let i = 0; i < this.switchEnum.length; i++) { request.push(axios.get(`${this.websiteDomain}/api/v1/service/document?serviceType=${this.switchEnum[i]}&size=20`)); } Promise.all(request).then((result) => { for (let i = 0; i < result.length; i++) { if (result[i].data.errorCode === 0) { this.documentResult[this.switchEnum[i]] = result[i].data.result; } else { alert(this.switchEnum[i] + ':' + result[i].data.message); } } //console.log(this.documentResult) this.setDocument(); }).catch((error) => { alert(error); }); }, setVideo: function () { if (this.currentSwitch === '家庭网络') { this.videoShow = this.videoResult[this.switchEnum[0]]; } else if (this.currentSwitch === '安防监控') { this.videoShow = this.videoResult[this.switchEnum[1]]; } else if (this.currentSwitch === '智能家居') { this.videoShow = this.videoResult[this.switchEnum[2]]; } else { this.videoShow = [...this.videoResult[this.switchEnum[0]].slice(0, 3), ...this.videoResult[this.switchEnum[1]].slice(0, 3), ...this.videoResult[this.switchEnum[2]].slice(0, 3)]; } }, setDocument: function () { if (this.currentSwitch === '家庭网络') { this.leftDocumentShow = this.documentResult[this.switchEnum[0]].slice(0, 10); this.rightDocumentShow = this.documentResult[this.switchEnum[0]].slice(10, 20); } else if (this.currentSwitch === '安防监控') { this.leftDocumentShow = this.documentResult[this.switchEnum[1]].slice(0, 10); this.rightDocumentShow = this.documentResult[this.switchEnum[1]].slice(10, 20); } else if (this.currentSwitch === '智能家居') { this.leftDocumentShow = this.documentResult[this.switchEnum[2]].slice(0, 10); this.rightDocumentShow = this.documentResult[this.switchEnum[2]].slice(10, 20); } else { this.leftDocumentShow = this.documentResult[this.switchEnum[0]].slice(0, 10); let tmpRight = []; for (let i = 0; i < this.documentResult[this.switchEnum[1]].length; i++) { if (tmpRight.length == 5) { break; } else { let tmp = this.documentResult[this.switchEnum[1]].slice(i, i + 1)[0]; let include = this.documentIncludes(this.leftDocumentShow, tmp); if (!include) { tmpRight.push(tmp); } } } for (let i = 0; i < this.documentResult[this.switchEnum[2]].length; i++) { if (tmpRight.length == 10) { break; } else { let tmp = this.documentResult[this.switchEnum[2]].slice(i, i + 1)[0]; let include = this.documentIncludes(this.leftDocumentShow, tmp); if (!include) { tmpRight.push(tmp); } } } this.rightDocumentShow = tmpRight; //this.rightDocumentShow = [...this.documentResult[this.switchEnum[1]].slice(0, 5), ...this.documentResult[this.switchEnum[2]].slice(0, 5)]; } }, getKeyword: function () { let result = this.keyword.trim(); //if (result.length > 0) { // axios.get('/getKeyword') // .then((response) => { // if (response.data.errCode == 0) { // if (response.data.data.length > 0) { // this.keywordOpen = true; // //this.keywordList = response.data.data; // this.keywordList = ['密码忘记了怎么办?', '密码不安全?', '设置什么样的密码?', '密码多少位?', '密码在哪??']; // } // else { // this.keywordOpen = false; // } // } // else { // this.keywordOpen = false; // } // }) // .catch((error) => { // console.log(error); // }); //} //else { // this.keywordOpen = false; //} }, highlight: function (item) { return item.replaceAll(this.keyword.trim(), `${this.keyword.trim()}`); }, search: function () { let result = this.keyword.trim(); if (result.length > 0) { window.open("https://resource.tp-link.com.cn?keyword=" + encodeURIComponent(result)); } else { $("#customerSearch").focus(); } }, changeNavSwitch: function (item) { this.currentSwitch = item; this.setVideo(); this.setDocument(); }, topIcon: function () { if ($("#blank").get(0).getBoundingClientRect().top + $("#blank").get(0).getBoundingClientRect().height < 50) { $("#switch").addClass("fix"); $("#top").show(); } else { $("#switch").removeClass("fix"); $("#top").hide(); } }, parseSecond: function (value) { let theTime = parseInt(value);// 秒 let middle = 0;// 分 let hour = 0;// 小时 if (theTime >= 60) { middle = parseInt(theTime / 60); theTime = parseInt(theTime % 60); if (middle >= 60) { hour = parseInt(middle / 60); middle = parseInt(middle % 60); } } let result = "" + parseInt(theTime).toString().padStart(2, "0") + ""; if (middle > 0) { result = "" + parseInt(middle).toString().padStart(2, "0") + ":" + result; } else { result = "00:" + result; } if (hour > 0) { result = "" + parseInt(hour).toString().padStart(2, "0") + ":" + result; } return result; }, formatDate: function (date) { return new Date(date).toLocaleDateString().replace(/\//g, '-0').replace(/-0(\d\d)/g, '-$1'); }, replaceSpace: function (str) { return str.replace(/\s*/g, "_"); }, documentIncludes: function (arr, item) { let flag = false; for (let i = 0; i < arr.length; i++) { if (arr[i].id == item.id) { flag = true; break; } } return flag; } }, computed: { getVideoMoreLink: function () { if (this.currentSwitch == '家庭网络') { return 'https://resource.tp-link.com.cn/pc/videoCenter?source=index&active=install&id=737'; } else if (this.currentSwitch == '安防监控') { return 'https://resource.tp-link.com.cn/pc/videoCenter?source=index&active=install&id=734'; } else if (this.currentSwitch == '智能家居') { return 'https://resource.tp-link.com.cn/pc/videoCenter?source=index&active=install&id=735'; } else { return ''; } }, getDocumentMoreLink: function () { if (this.currentSwitch == '家庭网络') { return 'https://resource.tp-link.com.cn/?firstClassId=1000&productorlist=1'; } else if (this.currentSwitch == '安防监控') { return 'https://resource.tp-link.com.cn/?firstClassId=232&secondClassId=2119&productorlist=1'; } else if (this.currentSwitch == '智能家居') { return 'https://resource.tp-link.com.cn/?firstClassId=228&productorlist=1'; } else { return ''; } } }, mounted() { this.getVideo(); this.getDocument(); let that = this; that.topIcon(); window.addEventListener("scroll", function () { that.topIcon(); }, true); } });
开云体育