wuhongyu 5 年之前
父節點
當前提交
016472d314
共有 3 個文件被更改,包括 127 次插入148 次删除
  1. 13 13
      src/store/index.js
  2. 7 23
      src/util/axios-wrapper.js
  3. 107 112
      src/views/direct.vue

+ 13 - 13
src/store/index.js

@@ -1,16 +1,16 @@
-import Vue from "vue";
-import Vuex from "vuex";
-import login from "@common/store/login";
-import chat from "@common/store/live/chat";
-import roomchat from "@common/store/live/room-chat";
-import apply from "@common/store/live/apply";
-import dock from "@common/store/live/dock";
-import news from "@common/store/live/news";
-import market from "@common/store/market/market";
-import marketproduct from "@common/store/market/marketproduct";
-import talentExperts from "@common/store/market/talentExperts";
-import * as ustate from "@common/store/user/state";
-import * as umutations from "@common/store/user/mutations";
+import Vue from 'vue';
+import Vuex from 'vuex';
+import login from '@common/store/login';
+import chat from '@common/store/live/chat';
+import roomchat from '@common/store/live/room-chat';
+import apply from '@common/store/live/apply';
+import dock from '@common/store/live/dock';
+import news from '@common/store/live/news';
+import market from '@common/store/market/market';
+import marketproduct from '@common/store/market/marketproduct';
+import talentExperts from '@common/store/market/talentExperts';
+import * as ustate from '@common/store/user/state';
+import * as umutations from '@common/store/user/mutations';
 Vue.use(Vuex);
 
 export default new Vuex.Store({

+ 7 - 23
src/util/axios-wrapper.js

@@ -37,29 +37,19 @@ export default class AxiosWrapper {
     });
     return uri;
   }
-  //替换路由方法
-  static routerChange(uri, router = {}) {
-    let keys = Object.keys(router);
-    keys.forEach(key => {
-      uri = _.replace(uri, `{${key}}`, router[key]);
-    });
-    return uri;
-  }
 
-  $get(uri, router, query, options) {
-    return this.$request(uri, null, query, options, router);
+  $get(uri, query, options) {
+    return this.$request(uri, null, query, options);
   }
 
-  $post(uri, data = {}, router, query, options) {
-    return this.$request(uri, data, query, options, router);
+  $post(uri, data = {}, query, options) {
+    return this.$request(uri, data, query, options);
   }
-
   $delete(uri, data = {}, router, query, options = {}) {
     options = { ...options, method: 'delete' };
     return this.$request(uri, data, query, options, router);
   }
-
-  async $request(uri, data, query, options, router) {
+  async $request(uri, data, query, options) {
     // TODO: 合并query和options
     if (_.isObject(query) && _.isObject(options)) {
       options = { ...options, params: query, method: 'get' };
@@ -70,11 +60,7 @@ export default class AxiosWrapper {
     }
     if (!options) options = {};
     if (options.params) options.params = trimData(options.params);
-    let url = AxiosWrapper.merge(uri, options.params);
-    //处理url部分需要替换参数的情况
-    if (_.isObject(router)) {
-      url = AxiosWrapper.routerChange(url, router);
-    }
+    const url = AxiosWrapper.merge(uri, options.params);
     currentRequests += 1;
     // Indicator.open({
     //   spinnerType: 'fading-circle',
@@ -84,9 +70,7 @@ export default class AxiosWrapper {
       const axios = Axios.create({
         baseURL: this.baseUrl,
       });
-      if (sessionStorage.getItem('token')) {
-        axios.defaults.headers.common.Authorization = util.token;
-      }
+      axios.defaults.headers.common.Authorization = util.token;
       let res = await axios.request({
         method: isNullOrUndefined(data) ? 'get' : 'post',
         url,

+ 107 - 112
src/views/direct.vue

@@ -81,24 +81,24 @@
                     <li v-for="(acc, index) in jishulist" :key="index">
                       <el-col :span="14" class="lileft">
                         <p>
-                          <span class="title" @click="dialogVisible = true"> {{ acc.title }}</span>
+                          <span class="title" @click="onclickjs(acc)"> {{ acc.name }}</span>
 
                           <span><el-button class="duijie">对接</el-button></span>
                         </p>
 
                         <p class="newp">
-                          <span class="name"><i class="el-icon-user-solid"></i>{{ acc.name }}</span
-                          ><span> <i class="el-icon-phone"></i>{{ acc.tel }}</span>
+                          <span class="name"><i class="el-icon-user-solid"></i>{{ acc.contact_user }}</span
+                          ><span> <i class="el-icon-phone"></i>{{ acc.contact_tel }}</span>
                         </p>
                         <p>
-                          <span class="pspan">类型:{{ acc.type }}</span
-                          ><span class="pspan">研发阶段:{{ acc.jueduan }}</span
-                          ><span class="pspan">交易方式:{{ acc.status }}</span
-                          ><span class="pspan">交易价格:{{ acc.chanpin }}</span>
+                          <span class="pspan">类型:{{ acc.product_type_name }}</span
+                          ><span class="pspan">研发阶段:{{ acc.phase == '0' ? '阶段成果' : '最终成果' }}</span
+                          ><span class="pspan">交易方式:{{ acc.business == '0' ? '公用' : acc.business == '1' ? '转让' : '竞价' }} </span
+                          ><span class="pspan">交易价格:{{ acc.price }}{{ acc.priceunit }}</span>
                         </p>
                       </el-col>
                       <el-col :span="10" class="liright">
-                        <p>简介:{{ acc.context }}</p>
+                        <p>摘要:{{ acc.introduction }}</p>
                       </el-col>
                     </li>
                   </ul>
@@ -114,7 +114,7 @@
                       </p>
                       <p>
                         <span>研发阶段:{{ item.phase == '0' ? '阶段成果' : '最终成果' }}</span>
-                        <span>发布时间:</span>
+                        <span>发布时间:{{ item.meta | getDate }}</span>
                       </p>
                       <p>
                         <span>需求类型:{{ item.product_type_name }}</span>
@@ -130,7 +130,7 @@
                     <li class="serviceList" v-for="(item, index) in serviceList" :key="index">
                       <p class="company" @click="dialogVisible = true">{{ item.companyName }}</p>
                       <div class="serviceDown">
-                        <el-image :src="item.url"></el-image>
+                        <el-image :src="item.image[0].url"></el-image>
                         <p>
                           <button>立即咨询</button>
                           <span class="type1">服务类型:</span>
@@ -164,7 +164,6 @@
 
           <el-col :span="24" class="newimage2">
             <el-image :src="two" style="width:100%;height:100px;position:relative;"> </el-image>
-         
           </el-col>
 
           <el-col :span="24">
@@ -224,17 +223,41 @@
     </div>
 
     <el-dialog title="技术详情" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
-      <el-col :span="24" class="detail"
-        ><p>名称:</p>
-        <p>联系人:</p>
-        <p>电话:</p>
-        <p>类型:</p>
-        <p>研发阶段:</p>
-        <p>交易方式:</p>
-        <p>头像:<el-image :src="superOnes" class="headimage"> </el-image></p>
-        <p>职务:</p>
-        <p>从事领域:</p>
-        <p>民族:</p>
+      <el-col :span="24" class="detail">
+        <el-col :span="24" class="infoMess">
+          <el-col :span="24" class="info"> 名称:{{ policyInfo.name }} </el-col>
+          <el-col :span="24" class="info"> 类型:{{ policyInfo.product_type_name }} </el-col>
+          <el-col :span="24" class="info"> 单价:{{ policyInfo.price }} </el-col>
+          <el-col :span="24" class="info"> 单位:{{ policyInfo.priceunit }} </el-col>
+          <el-col :span="24">
+            <span class="tupian"> 图片:</span>
+            <el-col :span="6" class="infos" v-for="(acm, index) in policyInfo.image" :key="index">
+              <span><el-image class="newclassimage" style="width:100px;height:100px" :src="acm.url"></el-image></span>
+            </el-col>
+          </el-col>
+
+          <el-col :span="24" class="info"> 产品参数:{{ policyInfo.product_args }} </el-col>
+          <el-col :span="24" class="info">
+            交易方式:{{ policyInfo.business === '0' ? '公用' : policyInfo.business === '1' ? '转让' : policyInfo.business === '2' ? '竞价' : 'underdind' }}
+          </el-col>
+          <el-col :span="24" class="info"> 研发阶段:{{ policyInfo.phase === '0' ? '阶段成果' : policyInfo.phase === '1' ? '最终成果' : 'underdind' }} </el-col>
+          <el-col :span="24" class="info"> 应用领域:{{ policyInfo.field }} </el-col>
+          <el-col :span="24" class="info"> 市场前景:{{ policyInfo.prospect }} </el-col>
+          <el-col :span="24" class="info"> 电子合同:{{ policyInfo.contract }} </el-col>
+          <el-col :span="24" class="info">
+            供/需{{ policyInfo.business === '0' ? '公用' : policyInfo.business === '1' ? '供' : policyInfo.business === '2' ? '需' : 'underdind' }}
+          </el-col>
+          <el-col :span="24" class="info"> 服务范围:{{ policyInfo.scope }} </el-col>
+          <el-col :span="24" class="info"> 描述{{ policyInfo.description }} </el-col>
+          <el-col :span="24" class="info"> 知识产权:{{ policyInfo.property }} </el-col>
+          <el-col :span="24" class="info">
+            状态:{{ policyInfo.status === '0' ? '待审核' : policyInfo.status === '1' ? '通过审核' : policyInfo.status === '2' ? '审核拒绝' : 'underdind' }}
+          </el-col>
+          <!-- <el-col :span="24" class="info"> 是否删除:{{ policyInfo.is_del === '0' ? '否' : policyInfo.is_del === '1' ? '是' : 'underdind' }} </el-col> -->
+          <el-col :span="24" class="info"> 联系人:{{ policyInfo.contact_user }} </el-col>
+          <el-col :span="24" class="info"> 联系电话:{{ policyInfo.contact_tel }} </el-col>
+          <el-col :span="24" class="info"> 简介:{{ policyInfo.introduction }} </el-col>
+        </el-col>
       </el-col>
       <span slot="footer" class="annius">
         <el-button @click="dialogVisible = false">取 消</el-button>
@@ -245,14 +268,28 @@
 </template>
 
 <script>
-import { mapState, createNamespacedHelpers } from 'vuex';
 import liveFoot from '@/layout/live/foot.vue';
 import chat from '@/components/parts/chat.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: mapProduct } = createNamespacedHelpers('marketproduct');
+const { mapActions: market } = createNamespacedHelpers('market');
+const { mapActions: dock } = createNamespacedHelpers('dock');
+const { mapActions: talentExperts } = createNamespacedHelpers('talentExperts');
 
 import _ from 'loadsh';
 export default {
   name: 'hall',
   props: {},
+  filters: {
+    getDate(meta) {
+      let createdAt = _.get(meta, `createdAt`);
+      let date = new Date(createdAt)
+        .toLocaleDateString()
+        .replace('/', '-')
+        .replace('/', '-');
+      return date;
+    },
+  },
   components: {
     chat,
     liveFoot,
@@ -275,48 +312,6 @@ export default {
         name2: '10条数据',
       },
     ],
-    jishulist: [
-      {
-        title: '测试产品1',
-        name: '联系人',
-        tel: '134567788888',
-        type: '类型1',
-        chanpin: '产品1',
-        status: '方式10',
-        jueduan: '阶段1',
-        context: '1测试产品1测试产1试产品1',
-      },
-      {
-        title: '测试产品1',
-        name: '联系人',
-        tel: '134567788888',
-        type: '类型1',
-        chanpin: '123元',
-        status: '方式10',
-        jueduan: '阶段1',
-        context: '1测试产品1测试产1试产品1',
-      },
-      {
-        title: '测试产品1',
-        name: '联系人',
-        tel: '134567788888',
-        type: '类型1',
-        chanpin: '产品1',
-        status: '方式10',
-        jueduan: '阶段1',
-        context: '1测试产品1测试产1试产品1',
-      },
-      {
-        title: '测试产品1',
-        name: '联系人',
-        tel: '134567788888',
-        type: '类型1',
-        chanpin: '产品1',
-        status: '方式10',
-        jueduan: '阶段1',
-        context: '1测试产品1测试产1试产品1',
-      },
-    ],
 
     jiabinlist: [
       {
@@ -345,57 +340,52 @@ export default {
         context: '1231232121212121212121212121212121212121231111111111111111111111111111111111111111121212121212121212121212121212121212121212121212121321',
       },
     ],
+    policyInfo: {},
+    jishulist: [],
     technologyList: [],
     // 找产品
-    demandList: [
-      { name: '测试', product_type_name: '类型1' },
-      { name: '测试', product_type_name: '类型1' },
-      { name: '测试', product_type_name: '类型1' },
-      { name: '测试', product_type_name: '类型1' },
-      { name: '测试', product_type_name: '类型1' },
-      { name: '测试', product_type_name: '类型1' },
-      { name: '测试', product_type_name: '类型1' },
-    ],
+    demandList: [],
     // 找服务
-    serviceList: [
-      { companyName: '名称', url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
-      { companyName: '名称', url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
-      { companyName: '名称', url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
-      { companyName: '名称', url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
-      { companyName: '名称', url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
-      { companyName: '名称', url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
-      { companyName: '名称', url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
-      { companyName: '名称', url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
-      { companyName: '名称', url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' },
-    ],
+    serviceList: [],
     // 找专家
-    expertList: [
-      { imgpath: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', name: '专家', nation: '真nation' },
-      { imgpath: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', name: '专家', nation: '真nation' },
-      { imgpath: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', name: '专家', nation: '真nation' },
-      { imgpath: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', name: '专家', nation: '真nation' },
-      { imgpath: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', name: '专家', nation: '真nation' },
-      { imgpath: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', name: '专家', nation: '真nation' },
-      { imgpath: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', name: '专家', nation: '真nation' },
-      { imgpath: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', name: '专家', nation: '真nation' },
-      { imgpath: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', name: '专家', nation: '真nation' },
-    ],
+    expertList: [],
 
-    luyanList: [
-      { title: '测试路演', num: '1234', city: '测试city', hy: '测试hy', xurz: '测试xurz' },
-      { title: '测试路演', num: '1234', city: '测试city', hy: '测试hy', xurz: '测试xurz' },
-      { title: '测试路演', num: '1234', city: '测试city', hy: '测试hy', xurz: '测试xurz' },
-      { title: '测试路演', num: '1234', city: '测试city', hy: '测试hy', xurz: '测试xurz' },
-      { title: '测试路演', num: '1234', city: '测试city', hy: '测试hy', xurz: '测试xurz' },
-      { title: '测试路演', num: '1234', city: '测试city', hy: '测试hy', xurz: '测试xurz' },
-    ],
+    luyanList: [],
     superOne: require('@/assets/live/main1.png'),
     two: require('@/assets/live/top_bg.png'),
 
     superOnes: require('@/assets/live/测试图片.jpg'),
   }),
-  created() {},
+  created() {
+    this.searchInfo();
+  },
   methods: {
+    ...mapProduct({ mapProductQuery: 'query' }),
+    ...market({ marketFetch: 'fetch' }),
+    ...dock({ dockQuery: 'query' }),
+    ...talentExperts({ expertQuery: 'query' }),
+    async searchInfo() {
+      let res = await this.mapProductQuery({ skip: 0, limit: 4, totaltype: '0' });
+      console.log(res);
+      if (this.$checkRes(res)) this.$set(this, `jishulist`, res.data);
+      res = await this.mapProductQuery({ skip: 0, limit: 4, totaltype: '1' });
+      console.log(res);
+      if (this.$checkRes(res)) this.$set(this, `demandList`, res.data);
+      res = await this.mapProductQuery({ skip: 0, limit: 4, totaltype: '2' });
+      console.log(res);
+
+      if (this.$checkRes(res)) this.$set(this, `serviceList`, res.data);
+      console.log(res);
+      res = await this.expertQuery({ skip: 0, limit: 4 });
+      console.log(res);
+      if (this.$checkRes(res)) this.$set(this, `expertList`, res.data);
+    },
+
+    onclickjs(acc) {
+      console.log();
+      this.dialogVisible = true;
+      this.$set(this, `policyInfo`, acc);
+    },
     handleClose(done) {
       this.$confirm('确认关闭?')
         .then(_ => {
@@ -418,8 +408,7 @@ export default {
 <style lang="less" scoped>
 .w_1200 {
   margin: 0 auto;
-  width: 1200px
-  ;
+  width: 1200px;
 }
 
 .livetop {
@@ -570,7 +559,7 @@ p {
 .newimage span {
   position: absolute;
   top: 30px;
-  left: 650px;
+  left: 46%;
   color: #ffffff;
   font-size: 36px;
   // position: relative;
@@ -721,7 +710,7 @@ p {
   float: left;
   width: 100%;
   border-bottom: 1px dashed #ff8500;
-     padding: 20px 0;
+  padding: 20px 0;
 }
 
 .jiabin .jiabinlist ul li:last-child {
@@ -1001,7 +990,7 @@ p {
 }
 .service .serviceList {
   float: left;
-  width: 30%;
+  width: 29%;
   border: 1px solid #ccc;
   margin: 10px 24px;
   height: 181px;
@@ -1043,7 +1032,7 @@ p {
 .service .serviceList .serviceDown p .type1 {
   float: left;
   width: 100%;
-  padding: 15px 0 15px 20px;
+  padding: 15px 0 3px 20px;
 }
 .service .serviceList .serviceDown p .type2 {
   padding: 0 0 0 20px;
@@ -1068,7 +1057,7 @@ p {
 .expert .expertList {
   height: 117px;
   float: left;
-  width: 49%;
+  width: 48%;
   border: 1px solid #ccc;
   margin: 10px 14px 10px 13px;
   padding: 5px 0 5px 0;
@@ -1179,4 +1168,10 @@ p {
 .annius {
   text-align: center;
 }
+.newclassimage {
+  float: left;
+}
+.tupian {
+  float: left;
+}
 </style>