shaogen1995 3 anos atrás
pai
commit
9452b6cab7

+ 75 - 75
src/pages/information/information-type.vue

@@ -121,120 +121,120 @@
 </template>
 
 <script>
-//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
-//例如:import 《组件名称》 from '《组件路径》';
-import Paging from "@/components/pagination";
+// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+// 例如:import 《组件名称》 from '《组件路径》';
+import Paging from '@/components/pagination'
 export default {
-  name: "survey",
-  //import引入的组件需要注入到对象中才能使用
+  name: 'survey',
+  // import引入的组件需要注入到对象中才能使用
   components: {
-    Paging,
+    Paging
   },
-  data() {
-    //这里存放数据
+  data () {
+    // 这里存放数据
     return {
-      informationType: "recentNews",
+      informationType: 'recentNews',
       dataList: [],
       paging: {
         pageSize: 10,
         pageNum: 1,
         total: 0,
         showSize: 10,
-        current: 1,
+        current: 1
       },
       params: {
         pageNum: 1,
         pageSize: 10,
-        type: "",
+        type: ''
       },
       typeChange: {
-        recentNews: "news",
-        infor: "info",
-        activity: "activity",
-        book: "book",
-      },
-    };
+        recentNews: 'news',
+        infor: 'info',
+        activity: 'activity',
+        book: 'book'
+      }
+    }
   },
-  //监听属性 类似于data概念
+  // 监听属性 类似于data概念
   computed: {},
-  //监控data中的数据变化
+  // 监控data中的数据变化
   watch: {
     paging: {
       deep: true,
       handler: function () {
         // this.getCollection()
-      },
-    },
+      }
+    }
   },
-  //方法集合
+  // 方法集合
   methods: {
-    async getList() {
+    async getList () {
       let result = await this.$http({
-        method: "post",
-        url: "/api/web/news/list",
-        data: this.params,
-      });
-      this.dataList = result.data.list;
-      this.paging.total = result.data.total;
+        method: 'post',
+        url: '/api/web/news/list',
+        data: this.params
+      })
+      this.dataList = result.data.list
+      this.paging.total = result.data.total
     },
-    async getBookList() {
+    async getBookList () {
       let result = await this.$http({
-        method: "post",
-        url: "/api/web/book/list",
-        data: this.params,
-      });
-      this.dataList = result.data.list;
-      this.paging.total = result.data.total;
+        method: 'post',
+        url: '/api/web/book/list',
+        data: this.params
+      })
+      this.dataList = result.data.list
+      this.paging.total = result.data.total
     },
-    switchType(type) {
-      this.informationType = type;
-      this.params["type"] = this.typeChange[this.informationType];
-      this.params["pageNum"] = 1;
-      this.paging.current = 1;
-      if(type === 'book') {
-        this.getBookList();
-        return;
+    switchType (type) {
+      this.informationType = type
+      this.params['type'] = this.typeChange[this.informationType]
+      this.params['pageNum'] = 1
+      this.paging.current = 1
+      if (type === 'book') {
+        this.getBookList()
+        return
       }
-      this.getList();
+      this.getList()
     },
-    back() {
-      this.$router.push({ path: "/information" });
+    back () {
+      this.$router.push({ path: '/information' })
     },
-    pageChange(val) {
-      console.log(val);
-      this.paging.current = val;
-      this.params.pageNum = val;
-      this.getList();
+    pageChange (val) {
+      console.log(val)
+      this.paging.current = val
+      this.params.pageNum = val
+      this.getList()
     },
-    toDetail(item) {
+    toDetail (item) {
       // console.log('item',item)
       this.$router.push({
-        path: "/information-detail",
-        query: { ...item, navType: this.informationType },
-      });
-    },
+        path: '/information-detail',
+        query: { ...item, navType: this.informationType }
+      })
+    }
   },
-  //生命周期 - 创建完成(可以访问当前this实例)
-  created() {
+  // 生命周期 - 创建完成(可以访问当前this实例)
+  created () {
     this.informationType =
-      (this.$route.query && this.$route.query["type"]) || "recentNews";
-    this.params["type"] = this.typeChange[this.informationType];
-    if (this.params["type"] === "book") {
-      this.getBookList();
-      return;
+      (this.$route.query && this.$route.query['type']) || 'recentNews'
+    this.params['type'] = this.typeChange[this.informationType]
+    if (this.params['type'] === 'book') {
+      this.getBookList()
+      return
     }
-    this.getList();
+    this.getList()
   },
-  //生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {},
-  beforeCreate() {}, //生命周期 - 创建之前
-  beforeMount() {}, //生命周期 - 挂载之前
-  beforeUpdate() {}, //生命周期 - 更新之前
-  updated() {}, //生命周期 - 更新之后
-  beforeDestroy() {}, //生命周期 - 销毁之前
-  destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
-};
+  // 生命周期 - 挂载完成(可以访问DOM元素)
+  mounted () {},
+  beforeCreate () {}, // 生命周期 - 创建之前
+  beforeMount () {}, // 生命周期 - 挂载之前
+  beforeUpdate () {}, // 生命周期 - 更新之前
+  updated () {}, // 生命周期 - 更新之后
+  beforeDestroy () {}, // 生命周期 - 销毁之前
+  destroyed () {}, // 生命周期 - 销毁完成
+  activated () {} // 如果页面有keep-alive缓存功能,这个函数会触发
+}
 </script>
 <style lang='less' scoped>
 .bg {

+ 48 - 44
src/pages/survey/survey-type.vue

@@ -89,68 +89,68 @@
 </template>
 
 <script>
-//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
-//例如:import 《组件名称》 from '《组件路径》';
+// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+// 例如:import 《组件名称》 from '《组件路径》';
 
 export default {
-  name: "survey",
-  //import引入的组件需要注入到对象中才能使用
+  name: 'survey',
+  // import引入的组件需要注入到对象中才能使用
   components: {},
-  data() {
-    //这里存放数据
+  data () {
+    // 这里存放数据
     return {
-      surveyType: "introduction",
+      surveyType: 'introduction',
       list: [],
       item: {},
       switchTypeObj: {
-        introduction: "introduce",
-        history: "history",
-        mechanism: "organ",
-      },
-    };
+        introduction: 'introduce',
+        history: 'history',
+        mechanism: 'organ'
+      }
+    }
   },
-  //监听属性 类似于data概念
+  // 监听属性 类似于data概念
   computed: {},
-  //监控data中的数据变化
+  // 监控data中的数据变化
   watch: {},
-  //方法集合
+  // 方法集合
   methods: {
-    switchType(type) {
-      this.surveyType = type;
+    switchType (type) {
+      this.surveyType = type
       this.item = this.list.filter((e) => {
-        return e.type === this.switchTypeObj[this.surveyType];
-      })[0];
+        return e.type === this.switchTypeObj[this.surveyType]
+      })[0]
     },
-    back() {
-      this.$router.push({ path: "/survey" });
+    back () {
+      this.$router.push({ path: '/survey' })
     },
-    async getDetail() {
+    async getDetail () {
       let result = await this.$http({
-        method: "post",
-        url: "/api/web/profile/list",
-      });
-      this.list = (result && result["code"] === 0 && result["data"]) || [];
+        method: 'post',
+        url: '/api/web/profile/list'
+      })
+      this.list = (result && result['code'] === 0 && result['data']) || []
       this.item = this.list.filter((e) => {
-        return e.type === this.switchTypeObj[this.surveyType];
-      })[0];
-    },
+        return e.type === this.switchTypeObj[this.surveyType]
+      })[0]
+    }
   },
-  //生命周期 - 创建完成(可以访问当前this实例)
-  created() {
+  // 生命周期 - 创建完成(可以访问当前this实例)
+  created () {
     this.surveyType =
-      (this.$route.query && this.$route.query["type"]) || "introduction";
-    this.getDetail();
+      (this.$route.query && this.$route.query['type']) || 'introduction'
+    this.getDetail()
   },
-  //生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {},
-  beforeCreate() {}, //生命周期 - 创建之前
-  beforeMount() {}, //生命周期 - 挂载之前
-  beforeUpdate() {}, //生命周期 - 更新之前
-  updated() {}, //生命周期 - 更新之后
-  beforeDestroy() {}, //生命周期 - 销毁之前
-  destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
-};
+  // 生命周期 - 挂载完成(可以访问DOM元素)
+  mounted () {},
+  beforeCreate () {}, // 生命周期 - 创建之前
+  beforeMount () {}, // 生命周期 - 挂载之前
+  beforeUpdate () {}, // 生命周期 - 更新之前
+  updated () {}, // 生命周期 - 更新之后
+  beforeDestroy () {}, // 生命周期 - 销毁之前
+  destroyed () {}, // 生命周期 - 销毁完成
+  activated () {} // 如果页面有keep-alive缓存功能,这个函数会触发
+}
 </script>
 <style lang='less' scoped>
 .bg {
@@ -255,6 +255,10 @@ export default {
             width: 83%;
             margin: 0 auto;
             text-align: center;
+            text-indent: 2em;
+            /deep/img {
+              margin-left: -34px;
+            }
           }
           .title {
             margin-top: 94px;
@@ -284,7 +288,7 @@ export default {
             text-align: left;
             /deep/img {
               width: 682px;
-              height: 453px;
+              // height: 453px;
             }
           }
           .title {

+ 50 - 50
src/pages/survey/survey.vue

@@ -58,74 +58,74 @@
 </template>
 
 <script>
-//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
-//例如:import 《组件名称》 from '《组件路径》';
+// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+// 例如:import 《组件名称》 from '《组件路径》';
 
 export default {
-  name: "survey",
-  //import引入的组件需要注入到对象中才能使用
+  name: 'survey',
+  // import引入的组件需要注入到对象中才能使用
   components: {},
-  data() {
-    //这里存放数据
+  data () {
+    // 这里存放数据
     return {
       // 控制选中的文字的颜色
-      select:'',
+      select: '',
       introductionHover: false,
       historyHover: false,
-      mechanismHover: false,
-    };
+      mechanismHover: false
+    }
   },
-  //监听属性 类似于data概念
+  // 监听属性 类似于data概念
   computed: {},
-  //监控data中的数据变化
+  // 监控data中的数据变化
   watch: {},
-  //方法集合
+  // 方法集合
   methods: {
-    toType(type) {
-      this.$router.push({ path: "/survey-type", query: { type } });
+    toType (type) {
+      this.$router.push({ path: '/survey-type', query: { type } })
     },
-    mouseOver(type) {
-      //鼠标移动文字的颜色改变
-      this.select=type
+    mouseOver (type) {
+      // 鼠标移动文字的颜色改变
+      this.select = type
       switch (type) {
-        case "introduction":
-          this.introductionHover = true;
-          break;
-        case "history":
-          this.historyHover = true;
-          break;
-        case "mechanism":
-          this.mechanismHover = true;
-          break;
+        case 'introduction':
+          this.introductionHover = true
+          break
+        case 'history':
+          this.historyHover = true
+          break
+        case 'mechanism':
+          this.mechanismHover = true
+          break
       }
     },
-    mouseLeave(type) {
-      this.select=''
+    mouseLeave (type) {
+      this.select = ''
       switch (type) {
-        case "introduction":
-          this.introductionHover = false;
-          break;
-        case "history":
-          this.historyHover = false;
-          break;
-        case "mechanism":
-          this.mechanismHover = false;
-          break;
+        case 'introduction':
+          this.introductionHover = false
+          break
+        case 'history':
+          this.historyHover = false
+          break
+        case 'mechanism':
+          this.mechanismHover = false
+          break
       }
-    },
+    }
   },
-  //生命周期 - 创建完成(可以访问当前this实例)
-  created() {},
-  //生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {},
-  beforeCreate() {}, //生命周期 - 创建之前
-  beforeMount() {}, //生命周期 - 挂载之前
-  beforeUpdate() {}, //生命周期 - 更新之前
-  updated() {}, //生命周期 - 更新之后
-  beforeDestroy() {}, //生命周期 - 销毁之前
-  destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
-};
+  // 生命周期 - 创建完成(可以访问当前this实例)
+  created () {},
+  // 生命周期 - 挂载完成(可以访问DOM元素)
+  mounted () {},
+  beforeCreate () {}, // 生命周期 - 创建之前
+  beforeMount () {}, // 生命周期 - 挂载之前
+  beforeUpdate () {}, // 生命周期 - 更新之前
+  updated () {}, // 生命周期 - 更新之后
+  beforeDestroy () {}, // 生命周期 - 销毁之前
+  destroyed () {}, // 生命周期 - 销毁完成
+  activated () {} // 如果页面有keep-alive缓存功能,这个函数会触发
+}
 </script>
 <style lang='less' scoped>
 .survey {