guhongwei 3 yıl önce
ebeveyn
işleme
18c905a18f

Dosya farkı çok büyük olduğundan ihmal edildi
+ 15768 - 16
package-lock.json


+ 1 - 0
package.json

@@ -10,6 +10,7 @@
   "dependencies": {
     "@stomp/stompjs": "^6.1.2",
     "axios": "^0.22.0",
+    "babel-polyfill": "^6.26.0",
     "core-js": "^3.6.5",
     "echarts": "^5.2.1",
     "element": "^0.1.4",

+ 1 - 0
src/main.js

@@ -10,6 +10,7 @@ import '@/plugins/check-res';
 import '@/plugins/meta';
 import '@/plugins/loading';
 import '@/plugins/setting';
+import 'babel-polyfill';
 import InitStomp from '@/plugins/stomp';
 import '@/plugins/components';
 import '@frame/src/assets/icon/iconfont.css';

+ 5 - 0
src/router/index.js

@@ -45,6 +45,11 @@ const service = [
     meta: { title: '咨询服务-交流互动' },
     component: () => import('../views/service/interflow/index.vue'),
   },
+  {
+    path: '/service/interflow/detail',
+    meta: { title: '交流互动-详细信息' },
+    component: () => import('../views/service/interflow/detail.vue'),
+  },
 ];
 const account = [
   {

+ 63 - 0
src/views/service/interflow/detail.vue

@@ -0,0 +1,63 @@
+<template>
+  <div id="detail">
+    <admin-frame topType="2" @back="back" :rightArrow="false" :usePage="false" :useNav="false">
+      <template v-slot:info>
+        <info-1 :info="info"></info-1>
+      </template>
+    </admin-frame>
+  </div>
+</template>
+
+<script>
+import info1 from './parts/info-1.vue';
+import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: news } = createNamespacedHelpers('news');
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    adminFrame,
+    info1,
+  },
+  data: function () {
+    return {
+      info: {},
+    };
+  },
+  async created() {
+    if (this.id) await this.search();
+  },
+  methods: {
+    ...news(['fetch']),
+    async search() {
+      let res = await this.fetch(this.id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `info`, res.data);
+      }
+    },
+    // 返回
+    back() {
+      this.$router.push({ path: '/service/interflow/index' });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 35 - 3
src/views/service/interflow/index.vue

@@ -1,31 +1,63 @@
 <template>
   <div id="index">
     <admin-frame @search="search" :limit="limit" :total="total" :useNav="false">
-      <template v-slot:info> 交流互动 </template>
+      <template v-slot:info>
+        <list-1 :list="list" @detail="detail"></list-1>
+      </template>
     </admin-frame>
   </div>
 </template>
 
 <script>
+import list1 from './parts/list-1.vue';
 import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: column } = createNamespacedHelpers('column');
+const { mapActions: news } = createNamespacedHelpers('news');
 export default {
   name: 'index',
   props: {},
   components: {
     adminFrame,
+    list1,
   },
   data: function () {
     return {
+      // 栏目信息
+      columnInfo: {},
+      list: [],
       limit: 5,
       total: 0,
     };
   },
   async created() {
-    await this.search();
+    await this.searchOther();
   },
   methods: {
-    async search({ skip = 0, limit = 10, ...info } = {}) {},
+    ...column({ columnQuery: 'query' }),
+    ...news(['query']),
+    async search({ skip = 0, limit = this.limit, ...info } = {}) {
+      info.column_id = this.columnInfo.id;
+      let res = await this.query({ skip, limit, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    // 详情
+    detail(data) {
+      this.$router.push({ path: '/service/interflow/detail', query: { id: data.id } });
+    },
+    // 查询其他
+    async searchOther() {
+      let res = await this.columnQuery();
+      if (this.$checkRes(res)) {
+        let data = res.data.find((i) => i.site == 'xsjl');
+        console.log(data);
+        if (data) this.$set(this, `columnInfo`, data);
+        this.search();
+      }
+    },
   },
   computed: {
     ...mapState(['user']),

+ 77 - 0
src/views/service/interflow/parts/info-1.vue

@@ -0,0 +1,77 @@
+<template>
+  <div id="info-1">
+    <van-row>
+      <van-col span="24" class="main">
+        <van-col :span="24" class="one">
+          <van-col :span="24" class="name">
+            {{ info.title }}
+          </van-col>
+          <van-col :span="24" class="other">
+            <van-col :span="24" class="otherInfo">
+              信息来源:<span>{{ info.origin }}</span>
+            </van-col>
+            <van-col :span="24" class="otherInfo">
+              发布时间:<span>{{ info.publish_time }}</span>
+            </van-col>
+          </van-col>
+          <van-col :span="24" class="content">
+            <p v-html="info.content"></p>
+          </van-col>
+        </van-col>
+      </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'info-1',
+  props: {
+    info: { ttype: Object },
+  },
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .one {
+    padding: 8px;
+    .name {
+      font-size: 16px;
+      font-weight: bold;
+      margin: 0 0 5px 0;
+      text-align: center;
+    }
+    .other {
+      .otherInfo {
+        font-size: 14px;
+        margin: 0 0 5px 0;
+        color: #666;
+        span {
+          color: #000;
+        }
+      }
+    }
+  }
+}
+</style>

+ 85 - 0
src/views/service/interflow/parts/list-1.vue

@@ -0,0 +1,85 @@
+<template>
+  <div id="list-1">
+    <van-row>
+      <van-col span="24" class="main">
+        <van-col :span="24" class="one">
+          <van-col span="24" class="list" v-for="(item, index) in list" :key="index" @click.native="detail(item)">
+            <van-col :span="24" class="name textOver">
+              {{ item.title }}
+            </van-col>
+            <van-col :span="24" class="other">
+              <van-col :span="24" class="otherInfo">
+                信息来源:<span>{{ item.origin }}</span>
+              </van-col>
+              <van-col :span="24" class="otherInfo">
+                发布时间:<span>{{ item.publish_time }}</span>
+              </van-col>
+            </van-col>
+          </van-col>
+        </van-col>
+      </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'list-1',
+  props: {
+    list: { type: Array },
+  },
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {
+    detail(data) {
+      this.$emit('detail', data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .one {
+    padding: 8px;
+    .list {
+      padding: 8px;
+      margin: 0 0 5px 0;
+      background-color: #fff;
+      border-radius: 5px;
+      .name {
+        font-size: 16px;
+        font-weight: bold;
+        margin: 0 0 5px 0;
+      }
+      .other {
+        .otherInfo {
+          font-size: 14px;
+          margin: 0 0 5px 0;
+          color: #666;
+          span {
+            color: #000;
+          }
+        }
+      }
+    }
+  }
+}
+</style>