import { getBase, getPlatform, getList, getAllPlatform, // getCould, } from "@/api/getList"; export default { data() { return { timeout: undefined, isdou: false, iskuai: false, could: "", }; }, methods: { select() { let season = sessionStorage.getItem("season"); let title = this.$route.query.title; getBase({ topic_name: title, season, }).then(x => { x = x || {}; this.allList = { read: x.total_pv || 0, talk: x.total_comment || 0, keyWord: title, totalLikes: x.total_digg || 0, totalForward: x.total_forward || 0, totalOri: x.total_ori || 0, live_comment: x.live_comment, live_digg: x.live_digg, live_uv: x.live_uv, }; this.isdou = x.has_live_douyin_data; this.iskuai = x.has_live_kuaishou_data; this.could = x.word_cloud_url || "" }); getAllPlatform({ topic_name: title, season }).then(x => { const list = []; this.platformList.map(className => { let keyValue = "total_forward"; className === "浏览" && (keyValue = "total_pv"); className === "点赞" && (keyValue = "total_digg"); className === "评论" && (keyValue = "total_comment"); if (className === "浏览") { (x || []).map(v => { list.push({ name: className, nickname: v.platform, value: v[keyValue], }); }); } }); this.platformSort = list; }); getPlatform({ topic_name: title, platform: "ALL", season, }).then(x => { this.userSortAll = x || []; this.clickBtn(this.selectIndex); }); getPlatform({ topic_name: title, platform: "douyin", season, }).then(x => { this.douAllList = (x || []).map(v => { // v.nickname = v.nickname.replace(/(?=(\B)(\S{2})+$)/g, "\n"); // v.nickname = v.nickname.replace(/^\n/g, ""); const li = v.nickname.split(""); v.nickname = li .map((nameString, i) => { i !== 0 && (i + 1) % 2 === 0 && (nameString = nameString + "\n"); return nameString; }) .join(""); return v; }); }); getPlatform({ topic_name: title, platform: "kuaishou", season }).then(x => { this.kuaiAllList = (x || []).map(v => { // v.nickname = v.nickname.replace(/(?=(\B)(\S{2})+$)/g, "\n"); // v.nickname = v.nickname.replace(/^\n/g, ""); const li = v.nickname.split(""); v.nickname = li .map((nameString, i) => { i !== 0 && (i + 1) % 2 === 0 && (nameString = nameString + "\n"); return nameString; }) .join(""); return v; }); }); getPlatform({ topic_name: title, platform: "yangshi", season }).then(x => { this.yangAllList = (x || []).map(v => { // v.nickname = v.nickname.replace(/(?=(\B)(\S{2})+$)/g, "\n"); // v.nickname = v.nickname.replace(/^\n/g, ""); const li = v.nickname.split(""); v.nickname = li .map((nameString, i) => { i !== 0 && (i + 1) % 2 === 0 && (nameString = nameString + "\n"); return nameString; }) .join(""); return v; }); }); // let Filename = this.$utils.getUrl("id"); // getCould({}, this.$store.state.p[Filename]).then(res => { // let ori = res || []; // let listOri = []; // ori.map(v => { // listOri.push({ // x: v.name, // value: v.value - 0, // }); // }); // this.listOri = listOri; // }); this.getAllWeibo(); }, selectRead(dateT) { let season = sessionStorage.getItem("season"); getList({ topic_name: this.$route.query.title, time: dateT.type, season }).then(res => { this.read = (res.read || []).map(v => { return { date: v.time, type: "微博-阅读量趋势", value: v.value, }; }); this.readType = dateT.type; }); }, selectMe(dateT) { let season = sessionStorage.getItem("season"); getList({ topic_name: this.$route.query.title, time: dateT.type, season }).then(res => { this.me = (res.me || []).map(v => { return { date: v.time, type: "微博-讨论趋势", value: v.value, }; }); this.meType = dateT.type; }); }, selectOri(dateT) { let season = sessionStorage.getItem("season"); getList({ topic_name: this.$route.query.title, time: dateT.type, season }).then(res => { this.ori = (res.ori || []).map(v => { return { date: v.time, type: "微博-原创趋势", value: v.value, }; }); this.oriType = dateT.type; }); }, getAllWeibo() { let season = sessionStorage.getItem("season"); getList({ topic_name: this.$route.query.title, time: "30d", season }) .then(res => { this.read = (res.read || []).map(v => { return { date: v.time, type: "微博-阅读量趋势", value: v.value, }; }); this.ori = (res.ori || []).map(v => { return { date: v.time, type: "微博-原创趋势", value: v.value, }; }); this.me = (res.me || []).map(v => { return { date: v.time, type: "微博-讨论趋势", value: v.value, }; }); }) .catch(() => { // window.clearInterval(this.timeout) }); }, }, created() {}, mounted() {}, };