guhongwei 2 jaren geleden
bovenliggende
commit
55d15f9792
4 gewijzigde bestanden met toevoegingen van 107 en 167 verwijderingen
  1. 20 52
      src/views/brand/index.vue
  2. 29 28
      src/views/contact/index.vue
  3. 27 33
      src/views/news/index.vue
  4. 31 54
      src/views/solve/index.vue

File diff suppressed because it is too large
+ 20 - 52
src/views/brand/index.vue


+ 29 - 28
src/views/contact/index.vue

@@ -6,14 +6,14 @@
           <el-col :span="16" class="one_1">
             <el-carousel height="500px">
               <el-carousel-item v-for="(item, index) in bannerList" :key="index">
-                <el-image class="image" :src="item.url"></el-image>
+                <el-image class="image" :src="item.img_url && item.img_url.length > 0 ? item.img_url[0].url : ''"></el-image>
               </el-carousel-item>
             </el-carousel>
           </el-col>
           <el-col :span="8" class="one_2">
             <el-col :span="24" class="newsList" v-for="(item, index) in newsList" :key="index">
               <el-col :span="24" class="title textOver">{{ item.title }}</el-col>
-              <el-col :span="24" class="date">{{ item.date }}</el-col>
+              <el-col :span="24" class="date">{{ item.create_time }}</el-col>
               <el-col :span="24" class="brief">{{ item.brief }}</el-col>
             </el-col>
           </el-col>
@@ -42,6 +42,9 @@
 <script>
 import AMapLoader from '@amap/amap-jsapi-loader';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('leavemess');
+const { mapActions: banner } = createNamespacedHelpers('banner');
+const { mapActions: news } = createNamespacedHelpers('news');
 export default {
   name: 'index',
   props: {},
@@ -49,30 +52,9 @@ export default {
   data: function () {
     return {
       // 轮播图
-      bannerList: [{ url: require('@a/contact_1.jpg') }],
+      bannerList: [],
       // 新闻
-      newsList: [
-        {
-          title: 'Android端Cortana更新控制通知设置',
-          date: '2023-02-02',
-          brief: '跨境购商城是指能够在线开展跨境电子商务交易的商城,和普通商城的区别在于,它可以直接连入中国电子口岸通关服务系统,',
-        },
-        {
-          title: 'Android端Cortana更新控制通知设置',
-          date: '2023-02-02',
-          brief: '跨境购商城是指能够在线开展跨境电子商务交易的商城,和普通商城的区别在于,它可以直接连入中国电子口岸通关服务系统,',
-        },
-        {
-          title: 'Android端Cortana更新控制通知设置',
-          date: '2023-02-02',
-          brief: '跨境购商城是指能够在线开展跨境电子商务交易的商城,和普通商城的区别在于,它可以直接连入中国电子口岸通关服务系统,',
-        },
-        {
-          title: 'Android端Cortana更新控制通知设置',
-          date: '2023-02-02',
-          brief: '跨境购商城是指能够在线开展跨境电子商务交易的商城,和普通商城的区别在于,它可以直接连入中国电子口岸通关服务系统,',
-        },
-      ],
+      newsList: [],
       map: null,
       form: {},
       rules: {
@@ -89,11 +71,30 @@ export default {
       ],
     };
   },
-  created() {},
+  created() {
+    this.search();
+  },
   methods: {
+    ...mapActions(['create']),
+    ...banner({ bQuery: 'query' }),
+    ...news({ nQuery: 'query' }),
+    async search() {
+      let res;
+      // 轮播图
+      res = await this.bQuery({ skip: 0, limit: 6, is_use: '0', place: this.$route.meta.place });
+      if (this.$checkRes(res)) {
+        this.$set(this, `bannerList`, res.data);
+      }
+      // 新闻
+      res = await this.nQuery({ skip: 0, limit: 6, is_use: '0', place: this.$route.meta.place });
+      if (this.$checkRes(res)) {
+        this.$set(this, `newsList`, res.data);
+      }
+    },
     // 保存
-    toSave({ data }) {
-      console.log(data);
+    async toSave({ data }) {
+      let res = await this.create(data);
+      if (this.$checkRes(res, '留言成功', res.errmsg)) this.form = {};
     },
   },
   computed: {

+ 27 - 33
src/views/news/index.vue

@@ -6,14 +6,14 @@
           <el-col :span="16" class="one_1">
             <el-carousel height="500px">
               <el-carousel-item v-for="(item, index) in bannerList" :key="index">
-                <el-image class="image" :src="item.url"></el-image>
+                <el-image class="image" :src="item.img_url && item.img_url.length > 0 ? item.img_url[0].url : ''"></el-image>
               </el-carousel-item>
             </el-carousel>
           </el-col>
           <el-col :span="8" class="one_2">
             <el-col :span="24" class="newsList" v-for="(item, index) in newsList" :key="index">
               <el-col :span="24" class="title textOver">{{ item.title }}</el-col>
-              <el-col :span="24" class="date">{{ item.date }}</el-col>
+              <el-col :span="24" class="date">{{ item.create_time }}</el-col>
               <el-col :span="24" class="brief">{{ item.brief }}</el-col>
             </el-col>
           </el-col>
@@ -28,13 +28,13 @@
             <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
               <el-col :span="2" class="date">
                 <p>
-                  <span>{{ getDate(item.date, 'day') }}</span>
-                  <span>{{ getDate(item.date, 'year') }}</span>
+                  <span>{{ getDate(item.create_time, 'day') }}</span>
+                  <span>{{ getDate(item.create_time, 'year') }}</span>
                 </p>
               </el-col>
               <el-col :span="2" class="info">
-                <el-col :span="24" class="title">{{ item.name }}</el-col>
-                <el-col :span="24" class="brief">{{ item.path || '暂无' }}</el-col>
+                <el-col :span="24" class="title">{{ item.title }}</el-col>
+                <el-col :span="24" class="brief">{{ item.brief || '暂无' }}</el-col>
               </el-col>
             </el-col>
             <el-col :span="24" class="page">
@@ -49,9 +49,9 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions } = createNamespacedHelpers('program');
+const { mapActions: banner } = createNamespacedHelpers('banner');
+const { mapActions: news } = createNamespacedHelpers('news');
 const moment = require('moment');
-
 export default {
   name: 'index',
   props: {},
@@ -59,42 +59,23 @@ export default {
   data: function () {
     return {
       // 轮播图
-      bannerList: [{ url: require('@a/news_1.jpg') }],
+      bannerList: [],
       // 新闻
-      newsList: [
-        {
-          title: '软件定义一切 下一个数据中心模式?',
-          date: '2023-02-02',
-          brief: '虚拟化在数据中心的应用意味着软件定义计算逐渐成为主流,而在软件定义计算的成功摸下下,软件定义存储也迅速获得市场的认.',
-        },
-        {
-          title: '软件定义一切 下一个数据中心模式?',
-          date: '2023-02-02',
-          brief: '虚拟化在数据中心的应用意味着软件定义计算逐渐成为主流,而在软件定义计算的成功摸下下,软件定义存储也迅速获得市场的认.',
-        },
-        {
-          title: '软件定义一切 下一个数据中心模式?',
-          date: '2023-02-02',
-          brief: '虚拟化在数据中心的应用意味着软件定义计算逐渐成为主流,而在软件定义计算的成功摸下下,软件定义存储也迅速获得市场的认.',
-        },
-        {
-          title: '软件定义一切 下一个数据中心模式?',
-          date: '2023-02-02',
-          brief: '虚拟化在数据中心的应用意味着软件定义计算逐渐成为主流,而在软件定义计算的成功摸下下,软件定义存储也迅速获得市场的认.',
-        },
-      ],
+      newsList: [],
       list: [],
       total: 0,
       limit: 6,
     };
   },
   created() {
+    this.searchOther();
     this.search();
   },
   methods: {
-    ...mapActions(['query']),
+    ...banner({ bQuery: 'query' }),
+    ...news({ nQuery: 'query' }),
     async search({ skip = 0, limit = this.limit, ...info } = {}) {
-      let res = await this.query({ skip, limit, ...info });
+      let res = await this.nQuery({ skip, limit, ...info });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);
@@ -112,6 +93,19 @@ export default {
         else '暂无';
       }
     },
+    async searchOther() {
+      let res;
+      // 轮播图
+      res = await this.bQuery({ skip: 0, limit: 6, is_use: '0', place: this.$route.meta.place });
+      if (this.$checkRes(res)) {
+        this.$set(this, `bannerList`, res.data);
+      }
+      // 新闻
+      res = await this.nQuery({ skip: 0, limit: 6, is_use: '0', place: this.$route.meta.place });
+      if (this.$checkRes(res)) {
+        this.$set(this, `newsList`, res.data);
+      }
+    },
   },
   computed: {
     ...mapState(['user']),

+ 31 - 54
src/views/solve/index.vue

@@ -6,14 +6,14 @@
           <el-col :span="16" class="one_1">
             <el-carousel height="500px">
               <el-carousel-item v-for="(item, index) in bannerList" :key="index">
-                <el-image class="image" :src="item.url"></el-image>
+                <el-image class="image" :src="item.img_url && item.img_url.length > 0 ? item.img_url[0].url : ''"></el-image>
               </el-carousel-item>
             </el-carousel>
           </el-col>
           <el-col :span="8" class="one_2">
             <el-col :span="24" class="newsList" v-for="(item, index) in newsList" :key="index">
               <el-col :span="24" class="title textOver">{{ item.title }}</el-col>
-              <el-col :span="24" class="date">{{ item.date }}</el-col>
+              <el-col :span="24" class="date">{{ item.create_time }}</el-col>
               <el-col :span="24" class="brief">{{ item.brief }}</el-col>
             </el-col>
           </el-col>
@@ -46,7 +46,7 @@
           </el-col>
           <el-col :span="24" class="thr_2">
             <el-col :span="8" class="thrList" v-for="(item, index) in thrList" :key="index">
-              <el-image class="image" :src="item.url"></el-image>
+              <el-image class="image" :src="item.img_url && item.img_url.length > 0 ? item.img_url[0].url : ''"></el-image>
               <el-col :span="24" class="title textOver">{{ item.title }}</el-col>
             </el-col>
           </el-col>
@@ -58,6 +58,10 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: banner } = createNamespacedHelpers('banner');
+const { mapActions: news } = createNamespacedHelpers('news');
+const { mapActions: cases } = createNamespacedHelpers('cases');
+
 export default {
   name: 'index',
   props: {},
@@ -67,66 +71,39 @@ export default {
       // 基本信息
       siteInfo: {},
       // 轮播图
-      bannerList: [{ url: require('@a/photo_2.jpg') }],
+      bannerList: [],
       // 新闻
-      newsList: [
-        {
-          title: '物联网应用开发实时操作系统Zephyr',
-          date: '2023-02-02',
-          brief: '作为网购整个流程中的重要一环,快递的作用可想而知,作为网购整个流程中的重要一环,快递的作用可想而知,',
-        },
-        {
-          title: '物联网应用开发实时操作系统Zephyr',
-          date: '2023-02-02',
-          brief: '作为网购整个流程中的重要一环,快递的作用可想而知,作为网购整个流程中的重要一环,快递的作用可想而知,',
-        },
-        {
-          title: '物联网应用开发实时操作系统Zephyr',
-          date: '2023-02-02',
-          brief: '作为网购整个流程中的重要一环,快递的作用可想而知,作为网购整个流程中的重要一环,快递的作用可想而知,',
-        },
-        {
-          title: '物联网应用开发实时操作系统Zephyr',
-          date: '2023-02-02',
-          brief: '作为网购整个流程中的重要一环,快递的作用可想而知,作为网购整个流程中的重要一环,快递的作用可想而知,',
-        },
-      ],
-      // 第三部分
-      thrList: [
-        {
-          url: require('@a/solve_4.jpg'),
-          title: '软件开发品牌Modulor 视觉识别系统',
-        },
-        {
-          url: require('@a/solve_5.jpg'),
-          title: '软件开发品牌Modulor 视觉识别系统',
-        },
-        {
-          url: require('@a/solve_6.jpg'),
-          title: '软件开发品牌Modulor 视觉识别系统',
-        },
-        {
-          url: require('@a/solve_7.jpg'),
-          title: '软件开发品牌Modulor 视觉识别系统',
-        },
-        {
-          url: require('@a/solve_8.jpg'),
-          title: '软件开发品牌Modulor 视觉识别系统',
-        },
-        {
-          url: require('@a/solve_9.jpg'),
-          title: '软件开发品牌Modulor 视觉识别系统',
-        },
-      ],
+      newsList: [],
+      // 案例
+      thrList: [],
     };
   },
   created() {
     this.search();
   },
   methods: {
-    search() {
+    ...banner({ bQuery: 'query' }),
+    ...news({ nQuery: 'query' }),
+    ...cases({ cQuery: 'query' }),
+    async search() {
+      let res;
       let companyInfo = sessionStorage.getItem('companyInfo');
       this.$set(this, `siteInfo`, JSON.parse(companyInfo));
+      // 轮播图
+      res = await this.bQuery({ skip: 0, limit: 6, is_use: '0', place: this.$route.meta.place });
+      if (this.$checkRes(res)) {
+        this.$set(this, `bannerList`, res.data);
+      }
+      // 新闻
+      res = await this.nQuery({ skip: 0, limit: 6, is_use: '0', place: this.$route.meta.place });
+      if (this.$checkRes(res)) {
+        this.$set(this, `newsList`, res.data);
+      }
+      // 案例
+      res = await this.cQuery({ skip: 0, limit: 6, is_use: '0' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `thrList`, res.data);
+      }
     },
   },
   computed: {