소스 검색

调查问卷

guhongwei 4 년 전
부모
커밋
329a0d280e
2개의 변경된 파일160개의 추가작업 그리고 7개의 파일을 삭제
  1. 77 7
      src/viewTwo/question/index.vue
  2. 83 0
      src/viewTwo/question/parts/list.vue

+ 77 - 7
src/viewTwo/question/index.vue

@@ -1,32 +1,102 @@
 <template>
   <div id="index">
     <el-row>
-      <el-col :span="24">
-        <p>调查问卷</p>
+      <el-col :span="24" class="style">
+        <el-col :span="24" class="top">
+          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
+        </el-col>
+        <el-col :span="24" class="down">
+          <el-col :span="24" class="search">
+            <van-search v-model="name" @search="search" placeholder="请输入信息标题" />
+          </el-col>
+          <el-col :span="24" class="data">
+            <list :list="list"></list>
+          </el-col>
+        </el-col>
       </el-col>
     </el-row>
   </div>
 </template>
 
 <script>
+import NavBar from '@/layout/common/topInfo.vue';
+import list from './parts/list.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+
 export default {
   metaInfo() {
     return { title: this.$route.meta.title };
   },
   name: 'index',
   props: {},
-  components: {},
+  components: {
+    NavBar,
+    list,
+  },
   data: function() {
-    return {};
+    return {
+      // 头部标题
+      title: '',
+      // meta为true
+      isleftarrow: '',
+      // 返回
+      navShow: true,
+      active: 0,
+      // 查询
+      name: '',
+      list: [],
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    async search({ ...info } = {}) {
+      let data = [
+        {
+          name: '调查问卷标题',
+          create_date: '2020-12-12',
+          brief: '信息简介',
+        },
+      ];
+      this.$set(this, `list`, data);
+    },
   },
-  created() {},
-  methods: {},
   computed: {
     ...mapState(['user']),
   },
+  mounted() {
+    this.title = this.$route.meta.title;
+    this.isleftarrow = this.$route.meta.isleftarrow;
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
   watch: {},
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.style {
+  width: 100%;
+  height: 100%;
+  position: relative;
+  background-color: #f9fafc;
+  .top {
+    height: 40px;
+    overflow: hidden;
+  }
+  .down {
+    .search {
+      position: fixed;
+      width: 100%;
+      z-index: 999;
+    }
+    .data {
+      position: absolute;
+      width: 100%;
+      top: 95px;
+    }
+  }
+}
+</style>

+ 83 - 0
src/viewTwo/question/parts/list.vue

@@ -0,0 +1,83 @@
+<template>
+  <div id="tec">
+    <el-row>
+      <el-col :span="24" class="tec">
+        <el-col :span="24" class="list" v-for="(item, index) in list" :key="index" @click.native="detailBtn(item)">
+          <el-col :span="19" class="textOver title">
+            {{ item.name }}
+          </el-col>
+          <el-col :span="5" class="date">
+            {{ item.create_date }}
+          </el-col>
+          <el-col :span="24" class="titlejj">
+            {{ item.brief }}
+          </el-col>
+        </el-col>
+      </el-col>
+      <el-backtop :bottom="50" :right="10"> </el-backtop>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  name: 'tec',
+  props: {
+    list: { type: Array },
+  },
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {
+    //详情
+    detailBtn(data) {
+      // this.$router.push({ path: '/viewTwo/question/detail', query: { id: data.id } });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.tec {
+  padding: 0 10px;
+  .list {
+    padding: 5px 0;
+    border-bottom: 1px dashed #ccc;
+    .title {
+      font-size: 16px;
+      font-weight: bold;
+    }
+    .date {
+      font-size: 14px;
+      text-align: right;
+      padding: 3px 0 0 0;
+    }
+    .orgin {
+      font-size: 14px;
+      padding: 5px 0;
+      span {
+        color: #999;
+      }
+    }
+    .titlejj {
+      font-size: 14px;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      -webkit-line-clamp: 2;
+      word-break: break-all;
+      display: -webkit-box;
+      -webkit-box-orient: vertical;
+      height: 42px;
+    }
+  }
+}
+</style>