guhongwei 4 years ago
parent
commit
1919b7087c

+ 24 - 9
src/layout/supermarket/infomate.vue

@@ -7,24 +7,24 @@
         </el-col>
         <el-col :span="24" class="list">
           <ul>
-            <li class="schoolList" v-for="(item, index) in serveList" :key="index">
+            <li class="schoolList" v-for="(item, index) in list" :key="index">
               <el-col :span="24" class="image">
-                <el-image style="width:219px;height:170px;" :src="item.url"></el-image>
+                <el-image style="width:219px;height:170px;" :src="url"></el-image>
               </el-col>
               <el-col :span="24" class="title textOver">
                 {{ item.name }}
               </el-col>
-              <el-col :span="12" class="yen textOver"> ¥{{ item.price }}/{{ item.priceunit }}</el-col>
-              <el-col :span="12" class="type"> {{ item.product_type_name }}</el-col>
+              <el-col :span="12" class="yen textOver"> {{ item.messattribute }}</el-col>
+              <el-col :span="12" class="type"> {{ item.type == '0' ? '技术' : item.ype == '1' ? '产品' : '服务' }}</el-col>
             </li>
           </ul>
           <el-col :span="24" class="page">
             <el-pagination
-              @size-change="handleSizeChange"
               @current-change="handleCurrentChange"
               :current-page="currentPage"
               layout="total, prev, pager, next, jumper"
               :total="serveTotal"
+              :page-size="pageSize"
             >
             </el-pagination>
           </el-col>
@@ -35,6 +35,7 @@
 </template>
 
 <script>
+import _ from 'lodash';
 export default {
   name: 'infomate',
   props: {
@@ -44,15 +45,29 @@ export default {
   components: {},
   data: () => ({
     currentPage: 1,
+    pageSize: 10,
+    origin: [],
+    list: [],
+    url: require('@a/fabu.jpg'),
   }),
   created() {},
   computed: {},
   methods: {
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
+    search(page = 1) {
+      this.$set(this, `list`, this.origin[page - 1]);
     },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
+    handleCurrentChange(currentPage) {
+      this.search(currentPage);
+    },
+  },
+  watch: {
+    serveList: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
+        this.search();
+      },
     },
   },
 };

+ 22 - 8
src/layout/supermarket/product.vue

@@ -9,22 +9,22 @@
           <ul>
             <li class="schoolList" v-for="(item, index) in serveList" :key="index">
               <el-col :span="24" class="image">
-                <el-image style="width:219px;height:170px;" :src="item.url"></el-image>
+                <el-image style="width:219px;height:170px;" v-if="item.image && item.image.length > 0" :src="item.image[0].url"></el-image>
               </el-col>
               <el-col :span="24" class="title textOver">
                 {{ item.name }}
               </el-col>
-              <el-col :span="12" class="yen textOver"> ¥{{ item.price }}/{{ item.priceunit }}</el-col>
-              <el-col :span="12" class="type"> {{ item.product_type_name }}</el-col>
+              <el-col :span="19" class="yen textOver">{{ item.achievestatus }}</el-col>
+              <el-col :span="5" class="type"> {{ item.type == '0' ? '技术' : item.ype == '1' ? '产品' : '服务' }}</el-col>
             </li>
           </ul>
           <el-col :span="24" class="page">
             <el-pagination
-              @size-change="handleSizeChange"
               @current-change="handleCurrentChange"
               :current-page="currentPage"
               layout="total, prev, pager, next, jumper"
               :total="serveTotal"
+              :page-size="pageSize"
             >
             </el-pagination>
           </el-col>
@@ -35,6 +35,7 @@
 </template>
 
 <script>
+import _ from 'lodash';
 export default {
   name: 'product',
   props: {
@@ -44,15 +45,28 @@ export default {
   components: {},
   data: () => ({
     currentPage: 1,
+    pageSize: 15,
+    origin: [],
+    list: [],
   }),
   created() {},
   computed: {},
   methods: {
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
+    search(page = 1) {
+      this.$set(this, `list`, this.origin[page - 1]);
     },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
+    handleCurrentChange(currentPage) {
+      this.search(currentPage);
+    },
+  },
+  watch: {
+    serveList: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
+        this.search();
+      },
     },
   },
 };

+ 14 - 14
src/layout/supermarket/rightcont.vue

@@ -21,15 +21,16 @@
         <el-tab-pane name="1">
           <span slot="label">技术供求</span>
           <el-col :span="12" class="jishuList" v-for="(item, index) in jishuList" :key="index" @click.native="detailjishu(item)">
-            <!-- <el-link :underline="false" > -->
             <el-col :span="24" class="title">
               <span class="textOver">{{ item.name }}</span>
             </el-col>
             <el-col :span="15" class="type">
-              <span>技术类型:{{ item.product_type_name }}</span>
+              <span>技术类型:{{ item.type == '0' ? '技术' : item.ype == '1' ? '产品' : '服务' }}</span>
             </el-col>
             <el-col :span="9" class="date">日期:{{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}</el-col>
-            <el-col :span="24" class="yen">价格:¥{{ item.price }}/{{ item.priceunit }}</el-col>
+            <el-col :span="24" class="yen">
+              所属领域:<span>{{ item.field }}</span> 合作方式:<span>{{ item.cooperation }}</span>
+            </el-col>
             <!-- </el-link> -->
           </el-col>
         </el-tab-pane>
@@ -44,9 +45,9 @@
             <el-col :span="24" class="title">
               <span class="textOver">{{ item.name }}</span>
             </el-col>
-            <el-col :span="14" class="yen"> ¥{{ item.price }}/{{ item.priceunit }}</el-col>
-            <el-col :span="10" class="type">
-              {{ item.product_type_name }}
+            <el-col :span="19" class="yen">{{ item.achievestatus }}</el-col>
+            <el-col :span="5" class="type">
+              {{ item.type == '0' ? '技术' : item.ype == '1' ? '产品' : '服务' }}
             </el-col>
           </el-col>
         </el-tab-pane>
@@ -56,8 +57,8 @@
             <el-col :span="10" class="title">
               <span class="textOver">{{ item.name }}</span>
             </el-col>
-            <el-col :span="6" class="type"> 服务类型:{{ item.product_type_name }} </el-col>
-            <el-col :span="5" class="yen"> ¥{{ item.price }}/{{ item.priceunit }} </el-col>
+            <el-col :span="6" class="type"> 信息属性:{{ item.messattribute }} </el-col>
+            <el-col :span="5" class="yen">需求程度:{{ item.demand }} </el-col>
             <el-col :span="3" class="date">
               {{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}
             </el-col>
@@ -68,10 +69,6 @@
         </el-tab-pane>
       </el-tabs>
       <el-button class="more" type="text" @click="clickmore"><el-image :src="more"></el-image></el-button>
-      <!-- 
-      <el-link class="more" span="24" href="/personnel/personnel?totaltype=0" v-if="this.activeName == '1'"> <el-image :src="more"></el-image> </el-link>
-      <el-link class="more" span="24" href="/personnel/personnel?totaltype=1" v-else-if="this.activeName == '2'"> <el-image :src="more"></el-image> </el-link>
-      <el-link class="more" span="24" href="/personnel/personnel?totaltype=2" v-else-if="this.activeName == '3'"> <el-image :src="more"></el-image> </el-link> -->
     </el-col>
   </div>
 </template>
@@ -229,9 +226,12 @@ export default {
   text-align: right;
 }
 .jishuList .yen {
-  color: #e91311;
   font-size: 16px;
-  margin: 2px 0 0 0;
+  margin: 5px 0 0 0;
+  color: #6d6d77;
+  span {
+    color: #e91311;
+  }
 }
 .info .more {
   position: absolute;

+ 24 - 9
src/layout/supermarket/serve.vue

@@ -7,24 +7,24 @@
         </el-col>
         <el-col :span="24" class="list">
           <ul>
-            <li class="schoolList" v-for="(item, index) in serveList" :key="index">
+            <li class="schoolList" v-for="(item, index) in list" :key="index">
               <el-col :span="24" class="image">
-                <el-image style="width:219px;height:170px;" :src="item.url"></el-image>
+                <el-image style="width:219px;height:170px;" :src="url"></el-image>
               </el-col>
               <el-col :span="24" class="title textOver">
                 {{ item.name }}
               </el-col>
-              <el-col :span="12" class="yen textOver"> ¥{{ item.price }}/{{ item.priceunit }}</el-col>
-              <el-col :span="12" class="type"> {{ item.product_type_name }}</el-col>
+              <el-col :span="12" class="yen textOver"> {{ item.messattribute }}</el-col>
+              <el-col :span="12" class="type"> {{ item.type == '0' ? '技术' : item.ype == '1' ? '产品' : '服务' }}</el-col>
             </li>
           </ul>
           <el-col :span="24" class="page">
             <el-pagination
-              @size-change="handleSizeChange"
               @current-change="handleCurrentChange"
               :current-page="currentPage"
               layout="total, prev, pager, next, jumper"
               :total="serveTotal"
+              :page-size="pageSize"
             >
             </el-pagination>
           </el-col>
@@ -35,6 +35,7 @@
 </template>
 
 <script>
+import _ from 'lodash';
 export default {
   name: 'company',
   props: {
@@ -44,15 +45,29 @@ export default {
   components: {},
   data: () => ({
     currentPage: 1,
+    pageSize: 10,
+    origin: [],
+    list: [],
+    url: require('@a/fabu.jpg'),
   }),
   created() {},
   computed: {},
   methods: {
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
+    search(page = 1) {
+      this.$set(this, `list`, this.origin[page - 1]);
     },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
+    handleCurrentChange(currentPage) {
+      this.search(currentPage);
+    },
+  },
+  watch: {
+    serveList: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
+        this.search();
+      },
     },
   },
 };

+ 24 - 8
src/layout/supermarket/technology.vue

@@ -9,22 +9,24 @@
           <ul>
             <li class="schoolList" v-for="(item, index) in serveList" :key="index">
               <el-col :span="24" class="image">
-                <el-image style="width:219px;height:170px;" :src="item.url"></el-image>
+                <el-image style="width:219px;height:170px;" v-if="item.image && item.image.length > 0" :src="item.image[0].url"></el-image>
               </el-col>
               <el-col :span="24" class="title textOver">
                 {{ item.name }}
               </el-col>
-              <el-col :span="12" class="yen textOver"> ¥{{ item.price }}/{{ item.priceunit }}</el-col>
-              <el-col :span="12" class="type"> {{ item.product_type_name }}</el-col>
+              <el-col :span="19" class="yen textOver">
+                所属领域:<span>{{ item.field }}</span>
+              </el-col>
+              <el-col :span="5" class="type">{{ item.type == '0' ? '技术' : item.ype == '1' ? '产品' : '服务' }}</el-col>
             </li>
           </ul>
           <el-col :span="24" class="page">
             <el-pagination
-              @size-change="handleSizeChange"
               @current-change="handleCurrentChange"
               :current-page="currentPage"
               layout="total, prev, pager, next, jumper"
               :total="serveTotal"
+              :page-size="pageSize"
             >
             </el-pagination>
           </el-col>
@@ -35,6 +37,7 @@
 </template>
 
 <script>
+import _ from 'lodash';
 export default {
   name: 'technology',
   props: {
@@ -44,15 +47,28 @@ export default {
   components: {},
   data: () => ({
     currentPage: 1,
+    pageSize: 15,
+    origin: [],
+    list: [],
   }),
   created() {},
   computed: {},
   methods: {
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
+    search(page = 1) {
+      this.$set(this, `list`, this.origin[page - 1]);
+    },
+    handleCurrentChange(currentPage) {
+      this.search(currentPage);
     },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
+  },
+  watch: {
+    serveList: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
+        this.search();
+      },
     },
   },
 };

+ 21 - 1
src/store/marketproduct.js

@@ -10,7 +10,27 @@ const mutations = {};
 
 const actions = {
   async query({ commit }, { skip = 0, limit, ...info } = {}) {
-    const res = await this.$axios.$get(`${api.newsInfo}`, { skip, limit, ...info });
+    const res = await this.$axios.$get(`${api.newsInfo}`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async newquery({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.newsInfo}/newquery`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async newfetch({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.newsInfo}/newfetch`, {
+      skip,
+      limit,
+      ...info,
+    });
     return res;
   },
   async create({ commit }, payload) {

+ 27 - 20
src/views/supermaket/supermarket.vue

@@ -31,6 +31,7 @@ import supermarketDetail from '@/components/supermaket/supermarket.vue';
 import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
 const { mapActions: mapSite } = createNamespacedHelpers('site');
 const { mapActions: user } = createNamespacedHelpers('user');
+const { mapActions: marketproduct } = createNamespacedHelpers('marketproduct');
 // 获取学校
 import { school } from '@/util/school';
 export default {
@@ -59,7 +60,7 @@ export default {
         name: '研发服务',
       },
       {
-        name: '技术成果',
+        name: '科技需求',
       },
       {
         name: '创新产品',
@@ -99,11 +100,11 @@ export default {
     // 技术型
     jishuList: [],
     // 技术型分页
-    jishuTotal: 1,
+    jishuTotal: 0,
     // 产品型
     chanpinList: [],
     // 产品型分页
-    chanpinTotal: 1,
+    chanpinTotal: 0,
     // 服务供求,研发服务
     serviceList: [
       {
@@ -120,21 +121,9 @@ export default {
       },
     ],
     // 服务分页
-    serveTotal: 1,
-    tableData: [
-      {
-        market: '系统管理员',
-        make: '硅藻土联盟',
-        product: '纳米融金',
-        deal: '交易完成',
-      },
-      {
-        market: '四条数据',
-        make: '硅藻土联盟',
-        product: '纳米融金',
-        deal: '交易完成',
-      },
-    ],
+    serveTotal: 0,
+    // 交易展示
+    tableData: [],
     companyTotal: 1,
     // 机构团体
     mechanismList: [
@@ -160,6 +149,7 @@ export default {
   methods: {
     ...mapSite(['showInfo']),
     ...user({ userQuery: 'query' }),
+    ...marketproduct({ productquery: 'query' }),
     // 查询站点信息
     async search() {
       let res = await this.showInfo();
@@ -171,7 +161,24 @@ export default {
     // 查询列表
     async searchList({ ...info }) {
       let res = await this.userQuery({ role: 5, ...info });
-      // console.log(res);
+      // 科技需求
+      res = await this.productquery({ type: 0, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `jishuList`, res.data);
+        this.$set(this, `jishuTotal`, res.total);
+      }
+      // 创新产品
+      res = await this.productquery({ type: 1, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `chanpinList`, res.data);
+        this.$set(this, `chanpinTotal`, res.total);
+      }
+      // 研发服务+咨询服务
+      res = await this.productquery({ type: 2, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `serviceList`, res.data);
+        this.$set(this, `serveTotal`, res.total);
+      }
     },
     // 发布
     fabu() {},
@@ -187,7 +194,7 @@ export default {
         this.display = 'fivth';
       } else if (name === '研发服务') {
         this.display = 'sixth';
-      } else if (name === '技术成果') {
+      } else if (name === '科技需求') {
         this.display = 'seventh';
       } else if (name === '创新产品') {
         this.display = 'eighth';