lrf 3 年之前
父节点
当前提交
3b7171b7a2

+ 4 - 20
src/layout/innovate/learning/info.vue

@@ -10,14 +10,12 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions } = createNamespacedHelpers('usual');
 export default {
   name: 'info',
-  props: {},
+  props: { info: { type: Object, default: () => {} } },
   components: {},
   data: function () {
     return {
-      info: {},
       fields: [
         { label: '活动名称', model: 'name' },
         { label: '组织者', model: 'usernames' },
@@ -27,23 +25,9 @@ export default {
       ],
     };
   },
-  created() {
-    this.search();
-  },
-  methods: {
-    ...mapActions(['fetch']),
-    async search() {
-      const res = await this.fetch({ table: 'Loso', id: this.id });
-      if (this.$checkRes(res)) {
-        this.$set(this, 'info', res.data);
-      }
-    },
-  },
-  computed: {
-    id() {
-      return this.$route.query.id;
-    },
-  },
+  created() {},
+  methods: {},
+  computed: {},
   metaInfo() {
     return { title: this.$route.meta.title };
   },

+ 36 - 0
src/layout/innovate/service/info.vue

@@ -0,0 +1,36 @@
+<template>
+  <div id="info">
+    <van-form>
+      <template v-for="(i, index) in fields">
+        <van-field v-model="info[i.model]" :key="`f${index}`" :label="i.label" :readonly="true" />
+      </template>
+    </van-form>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'info',
+  props: { info: { type: Object, default: () => {} } },
+  components: {},
+  data: function () {
+    return {
+      fields: [
+        { label: '活动名称', model: 'name' },
+        { label: '类型', model: 'type' },
+        { label: '服务形式', model: 'servicetype' },
+        { label: '服务受众及人数', model: 'serviceusers' },
+        { label: '转移形式及内容', model: 'transfertype' },
+        { label: '结果(效果、效益)', model: 'result' },
+      ],
+    };
+  },
+  created() {},
+  methods: {},
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 95 - 0
src/layout/innovate/service/list.vue

@@ -0,0 +1,95 @@
+<template>
+  <div id="list">
+    <van-row>
+      <van-col span="24" class="main">
+        <van-col span="24" class="list" v-for="(item, index) in list" :key="index">
+          <van-col span="24" class="title textOver">
+            {{ item.name }}
+          </van-col>
+          <van-col span="24" class="other">
+            <van-col span="24" class="otherInfo">
+              类型:<span>{{ item.type || '暂无' }}</span>
+            </van-col>
+            <van-col span="24" class="otherInfo">
+              服务形式:<span>{{ item.servicetype || '暂无' }}</span>
+            </van-col>
+          </van-col>
+          <van-col span="24" style="text-align: center">
+            <van-button type="info" @click="toView(item)" size="small">详细信息</van-button>
+          </van-col>
+        </van-col>
+      </van-col>
+    </van-row>
+    <van-dialog class="dialog" v-model="dialog.show" :title="dialog.title" :show-confirm-button="false" show-cancel-button cancel-button-text="返回">
+      <info-1 :info="info"></info-1>
+    </van-dialog>
+  </div>
+</template>
+
+<script>
+import info1 from './info.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('usual');
+export default {
+  name: 'list',
+  props: { list: { type: Array, default: () => [] } },
+  components: { info1 },
+  data: function () {
+    return {
+      dialog: { show: false, title: '详细信息' },
+      info: {},
+    };
+  },
+  created() {},
+  methods: {
+    ...mapActions(['fetch']),
+    async toView(data) {
+      const res = await this.fetch({ table: 'Lote', id: data.id });
+      if (this.$checkRes(res)) {
+        this.$set(this, 'info', res.data);
+        this.dialog.show = true;
+      }
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .list {
+    background-color: #fff;
+    margin: 0 0 8px 0;
+    padding: 8px;
+    border-radius: 5px;
+    border: 1px solid #f1f1f1;
+    .title {
+      font-size: 16px;
+      font-weight: bold;
+      margin: 0 0 5px 0;
+    }
+    .other {
+      margin: 0 0 5px 0;
+      .otherInfo {
+        font-size: 14px;
+        color: #666;
+        margin: 0 0 5px 0;
+        span {
+          color: #000;
+        }
+      }
+    }
+    .btn {
+      text-align: center;
+      .van-button {
+        margin: 0 5px;
+      }
+    }
+  }
+}
+.dialog {
+  /deep/.van-dialog__content {
+    max-height: 350px;
+    overflow-y: auto;
+  }
+}
+</style>

+ 26 - 16
src/views/innovate/service/index.vue

@@ -1,35 +1,45 @@
 <template>
   <div id="index">
-    <van-row>
-      <van-col span="24" class="main"> test </van-col>
-    </van-row>
+    <admin-frame @search="search" :limit="limit" :total="total" :useNav="false">
+      <template v-slot:info>
+        <list-1 :list="list"></list-1>
+      </template>
+    </admin-frame>
   </div>
 </template>
 
 <script>
+import list1 from '@/layout/innovate/service/list.vue';
+import adminFrame from '@common/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('usual');
 export default {
   name: 'index',
   props: {},
-  components: {},
+  components: { adminFrame, list1 },
   data: function () {
-    return {};
+    return {
+      list: [],
+      total: 0,
+      limit: 4,
+    };
   },
-  created() {},
-  methods: {},
-  computed: {
-    ...mapState(['user']),
+  created() {
+    this.search();
+  },
+  methods: {
+    ...mapActions(['query']),
+    async search({ skip = 0, limit = this.limit, ...condition } = {}) {
+      const res = await this.query({ table: 'Lote', skip, limit, ...condition });
+      if (this.$checkRes(res)) {
+        this.$set(this, 'list', res.data);
+        this.$set(this, 'total', res.total);
+      }
+    },
   },
   metaInfo() {
     return { title: this.$route.meta.title };
   },
-  watch: {
-    test: {
-      deep: true,
-      immediate: true,
-      handler(val) {},
-    },
-  },
 };
 </script>