guhongwei 4 jaren geleden
bovenliggende
commit
fb56d543a9

+ 6 - 0
src/router/index.js

@@ -180,6 +180,12 @@ const routes = [
     meta: { title: '在线服务', isleftarrow: false },
     component: () => import('../viewTwo/service/index.vue'),
   },
+  {
+    path: '/viewTwo/service/detail',
+    name: 'service',
+    meta: { title: '在线服务', isleftarrow: true },
+    component: () => import('../viewTwo/service/detail.vue'),
+  },
   // 调查问卷
   {
     path: '/viewTwo/question/index',

+ 143 - 0
src/viewTwo/service/detail.vue

@@ -0,0 +1,143 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="top">
+          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow" @onClickLeft="back"> </NavBar>
+        </el-col>
+        <el-col :span="24" class="main">
+          <el-col :span="24" class="message">
+            <p>
+              <span>产品名称</span>
+              <span>{{ info.name || '暂无' }}</span>
+            </p>
+            <p>
+              <span>信息属性</span>
+              <span>{{ info.messattribute || '暂无' }}</span>
+            </p>
+            <p>
+              <span>需求程度</span>
+              <span>{{ info.demand || '暂无' }}</span>
+            </p>
+            <p>
+              <span>联系人</span>
+              <span>{{ info.contacts || '暂无' }}</span>
+            </p>
+            <p>
+              <span>联系方式</span>
+              <span>{{ info.qqwx || '暂无' }}</span>
+            </p>
+            <p>
+              <span>信息描述</span>
+              <span>{{ info.informationdesc || '暂无' }}</span>
+            </p>
+            <p>
+              <span>核心要素</span>
+              <span>{{ info.coreelements || '暂无' }}</span>
+            </p>
+
+            <p>
+              <span>价格信息</span>
+              <span>{{ info.priceinfo || '暂无' }}</span>
+            </p>
+            <p>
+              <span>商务预期</span>
+              <span>{{ info.businessexpect || '暂无' }}</span>
+            </p>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import NavBar from '@/layout/common/topInfo.vue';
+const { mapActions: product } = createNamespacedHelpers('product');
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  name: 'detail',
+  props: {},
+  components: {
+    NavBar,
+  },
+  data: function() {
+    return {
+      // 头部标题
+      title: '',
+      // meta为true
+      isleftarrow: '',
+      // 返回
+      navShow: true,
+      noimage: require('@/assets/noimage.jpg'),
+      info: {},
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...product(['fetch']),
+    async search() {
+      const res = await this.fetch(this.id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `info`, res.data);
+      }
+    },
+    back() {
+      this.$router.push({ path: '/viewTwo/service/index' });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  mounted() {
+    this.title = this.$route.meta.title;
+    this.isleftarrow = this.$route.meta.isleftarrow;
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped>
+.detail {
+  width: 100%;
+  min-height: 667px;
+  position: relative;
+  background-color: #f9fafc;
+}
+.top {
+  height: 46px;
+  overflow: hidden;
+}
+.main {
+  min-height: 570px;
+  .message {
+    background: #fff;
+    padding: 0 15px;
+    min-height: 50px;
+    p {
+      min-height: 50px;
+      line-height: 50px;
+      border-bottom: 1px solid #ccc;
+      span {
+        color: #000;
+      }
+      span:nth-child(1) {
+        display: inline-block;
+        width: 80px;
+        color: #ccc;
+      }
+    }
+    p:last-child {
+      border-bottom: none;
+    }
+  }
+}
+</style>

+ 76 - 7
src/viewTwo/service/index.vue

@@ -1,32 +1,101 @@
 <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 list from './parts/list.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+import NavBar from '@/layout/common/topInfo.vue';
+const { mapActions: product } = createNamespacedHelpers('product');
 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: {
+    ...product(['query']),
+    async search({ ...info } = {}) {
+      if (this.name) info.name = this.name;
+      let res = await this.query({ type: 2, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.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: 45px;
+    overflow: hidden;
+  }
+  .down {
+    .search {
+      position: fixed;
+      width: 100%;
+      z-index: 999;
+      border-bottom: 1px dashed #ccc;
+    }
+    .data {
+      position: absolute;
+      width: 100%;
+      top: 100px;
+    }
+  }
+}
+</style>

+ 74 - 0
src/viewTwo/service/parts/list.vue

@@ -0,0 +1,74 @@
+<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="24" class="name textOver">
+            {{ item.name }}
+          </el-col>
+          <el-col :span="24" class="company textOver"> 服务单位:{{ item.company || '暂无' }} </el-col>
+          <el-col :span="24" class="other">
+            <span class="textOver">信息属性:{{ item.messattribute || '暂无' }}</span>
+            <span class="textOver">联系人:{{ item.qqwx || '暂无' }}</span>
+          </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/service/detail', query: { id: data.id } });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.tec {
+  padding: 0 10px;
+  .list {
+    border-bottom: 1px dashed #ccc;
+    padding: 10px 0;
+    .name {
+      font-size: 18px;
+      font-weight: bold;
+    }
+    .company {
+      font-size: 16px;
+      color: #666;
+      padding: 5px 0 0 0;
+    }
+    .other {
+      font-size: 16px;
+      color: #666;
+      padding: 5px 0 0 0;
+      span {
+        display: inline-block;
+        width: 50%;
+      }
+    }
+  }
+}
+</style>

+ 1 - 1
src/viewTwo/techol/index.vue

@@ -54,7 +54,7 @@ export default {
     ...product(['query']),
     async search({ ...info } = {}) {
       if (this.name) info.name = this.name;
-      let res = await this.query({ type: 0, limit: 5, ...info });
+      let res = await this.query({ type: 0, ...info });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
       }