liyongli пре 4 година
родитељ
комит
92cb33332d

+ 2 - 4
src/api/getList.js

@@ -70,11 +70,9 @@ export function getAllcontrast(param) {
  * @param params
  * @returns {AxiosPromise}
  */
-export function getCould(param, name) {
-  // %E8%A5%BF%E5%AE%89%E8%AF%84%E8%AE%BA 西安
+export function getCould(url) {
   return request({
-    url: "data/" + name + ".json",
-    params: param,
+    url: url,
     closeLoading: true,
     method: "get",
   });

+ 1 - 1
src/router/index.js

@@ -7,7 +7,7 @@ Vue.use(VueRouter);
 
 const routes = [
   {
-    path: "/",
+    path: "/contrast",
     name: "index",
     component: Skeleton,
     children: [

+ 1 - 1
src/view/index/components/live/index.vue

@@ -428,7 +428,6 @@ export default {
       let val = "",
         nameText = "";
       let list = this.$parent.$parent.$parent.$parent.config || [];
-      console.log(list);
       for (let i = 0; i < list.length; i++) {
         const v = list[i];
         if (key !== v.name || v.topic_id !== this.baseData.topic_id) continue;
@@ -438,6 +437,7 @@ export default {
       }
       if (!val) return;
       Dialog.alert({
+        confirmButtonText: "关闭",
         title: this.$route.query.title + "-" + nameText,
         message: val,
         confirmButtonColor: "#1989fa",

+ 36 - 84
src/view/index/index.vue

@@ -309,6 +309,7 @@ import {
   getPlatform,
   getList,
   getBase,
+  getCould,
 } from "@/api/getList.js";
 import filters from "@/utils/filters/index";
 import live from "@/view/index/components/live/index.vue";
@@ -364,64 +365,7 @@ export default {
       color: ["#2D4DB6", "#04B67C", "#D1AF07", "#E27914", "#CB4A4D", "#B02690"],
       minFontSize: 12,
       maxFontSize: 18,
-      list: [
-        {
-          name: "云图",
-          value: 1000,
-        },
-        {
-          name: "是个啥",
-          value: 1000,
-        },
-        {
-          name: "他啥都不是",
-          value: 1000,
-        },
-        {
-          name: "他就是词云",
-          value: 1000,
-        },
-        {
-          name: "就是他呆子",
-          value: 1000,
-        },
-        {
-          name: "傻子和疯子",
-          value: 1000,
-        },
-        {
-          name: "营养快线",
-          value: 1000,
-        },
-        {
-          name: "哈哈哈到家",
-          value: 1000,
-        },
-        {
-          name: "瑞士军刀",
-          value: 1000,
-        },
-        {
-          name: "DW情侣对表",
-          value: 1000,
-        },
-        {
-          name: "清风抽纸",
-          value: 1000,
-        },
-        {
-          name: "这一刻更清晰",
-          value: 1000,
-        },
-        {
-          name: "债券评级",
-          value: 1000,
-        },
-        {
-          name: "呵呵旧宫style",
-          value: 1000,
-        },
-      ],
+      list: [ ],
     };
   },
   created() {
@@ -791,8 +735,9 @@ export default {
         nameText = v.content_desc;
         break;
       }
-      if(!nameText) return;
+      if (!nameText) return;
       Dialog.alert({
+        confirmButtonText: "关闭",
         title: this.$route.query.title + "-" + nameText,
         message: val,
         confirmButtonColor: "#1989fa",
@@ -835,31 +780,38 @@ export default {
       call && call();
     },
     cloud() {
-      const RADIUSX = (this.client.width - 150) / 2;
-      const RADIUSY = (this.client.height - 50) / 2;
-      let contentEle = [];
-      for (let i = 0; i < this.list.length; i += 1) {
-        const k = -1 + (2 * (i + 1) - 1) / this.list.length;
-        const a = Math.acos(k);
-        const b = a * Math.sqrt(this.list.length * Math.PI);
-        const x = RADIUSX * Math.sin(a) * Math.cos(b);
-        const y = RADIUSY * Math.sin(a) * Math.sin(b);
-        const z = RADIUSX * Math.cos(a);
-        const fotnS = (this.maxFontSize - this.minFontSize) * Math.random();
-        const singleEle = {
-          name: this.list[i].name,
-          value: this.list[i].value,
-          x,
-          y,
-          z,
-          style: {
-            fontSize: fotnS + this.minFontSize,
-          },
-        };
-        contentEle.push(singleEle);
-      }
-      this.contentEle = contentEle;
-      this.animate();
+      let url = this.baseData.word_cloud_url.replace(
+        /(\u002Epng|\u002Ejpg)$/g,
+        ".json"
+      );
+      getCould(url).then(res => {
+        this.list = res || [];
+        const RADIUSX = (this.client.width - 100) / 2;
+        const RADIUSY = (this.client.height - 50) / 2;
+        let contentEle = [];
+        for (let i = 0; i < this.list.length; i += 1) {
+          const k = -1 + (2 * (i + 1) - 1) / this.list.length;
+          const a = Math.acos(k);
+          const b = a * Math.sqrt(this.list.length * Math.PI);
+          const x = RADIUSX * Math.sin(a) * Math.cos(b);
+          const y = RADIUSY * Math.sin(a) * Math.sin(b);
+          const z = RADIUSX * Math.cos(a);
+          const fotnS = (this.maxFontSize - this.minFontSize) * Math.random();
+          const singleEle = {
+            name: this.list[i].name,
+            value: this.list[i].value,
+            x,
+            y,
+            z,
+            style: {
+              fontSize: fotnS + this.minFontSize,
+            },
+          };
+          contentEle.push(singleEle);
+        }
+        this.contentEle = contentEle;
+        this.animate();
+      });
     },
     animate() {
       let newContentEle = this.rotateXY(this.contentEle);

+ 2 - 2
src/view/skeleton/index.vue

@@ -83,7 +83,7 @@ export default {
       }
       if (this.$route.name == "home") return;
       this.$router.push({
-        path: "home",
+        path: "/contrast/home",
         query: { title: this.fieldValue, season: this.$route.query.season, data: JSON.stringify(data) },
       });
     });
@@ -115,7 +115,7 @@ export default {
         }
       }
       this.$router.push({
-        path: "/home",
+        path: "/contrast/home",
         query: { title: this.fieldValue, season: this.$route.query.season, data: JSON.stringify(D) },
       });
     },