Преглед изворни кода

Merge branch 'master' of http://git.cc-lotus.info/service-platform/mobile-official

guhongwei пре 4 година
родитељ
комит
ac75b44334

+ 2 - 2
src/views/user/parts/clickBtn.vue

@@ -4,8 +4,8 @@
       <el-col :span="24" class="style">
         <span v-if="user.role == '4' || user.role == '5' || user.role == '6'">
           <van-cell is-link title="基本信息" @click="$router.push({ path: '/userCenter/user/index' })" />
-          <!-- <van-cell is-link title="我的发布" @click="$router.push({ path: '/userCenter/myProduct/index' })" />
-          <van-cell is-link title="事项管理" @click="$router.push({ path: '/userCenter/matter/index' })" />
+          <van-cell is-link title="我的发布" @click="$router.push({ path: '/userCenter/myProduct/index' })" />
+          <!--<van-cell is-link title="事项管理" @click="$router.push({ path: '/userCenter/matter/index' })" />
           <van-cell is-link title="展会管理" @click="$router.push({ path: '/userCenter/dock/index' })" />
           <van-cell is-link title="退出登录" @click="$router.push({ path: '/userCenter/out/index' })" /> -->
         </span>

+ 40 - 34
src/views/userCenter/myProduct/index.vue

@@ -6,34 +6,22 @@
           <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
         </el-col>
         <el-col :span="24" class="main">
+          <el-col :span="24" class="two">
+            <van-button type="primary" @click="$router.push({ path: '/userCenter/myProduct/detail' })">发布产品</van-button>
+          </el-col>
           <el-col :span="24" class="one">
-            <van-tabs v-model="active" animated>
-              <van-tab>
-                <template #title>
-                  <van-icon name="todo-list" />
-                  <p>待发布</p>
-                </template>
-                <caogaoList></caogaoList>
+            <van-tabs v-model="active">
+              <van-tab title="待发布">
+                <productList :list="nextList" @detailBtn="detailBtn"></productList>
               </van-tab>
-              <van-tab>
-                <template #title>
-                  <van-icon name="column" />
-                  <p>审核中</p>
-                </template>
-                <noauditList></noauditList>
+              <van-tab title="审核中">
+                <productList :list="nowList" @detailBtn="detailBtn"></productList>
               </van-tab>
-              <van-tab>
-                <template #title>
-                  <van-icon name="label" />
-                  <p>已发布</p>
-                </template>
-                <auditList></auditList>
+              <van-tab title="已发布">
+                <productList :list="pastList" @detailBtn="detailBtn"></productList>
               </van-tab>
             </van-tabs>
           </el-col>
-          <el-col :span="24" class="two">
-            <van-button type="primary" @click="$router.push({ path: '/userCenter/myProduct/detail' })">发布产品</van-button>
-          </el-col>
         </el-col>
       </el-col>
     </el-row>
@@ -43,18 +31,24 @@
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
 import NavBar from '@/layout/common/topInfo.vue';
-import caogaoList from './parts/caogaoList.vue';
-import noauditList from './parts/noauditList.vue';
-import auditList from './parts/auditList.vue';
+import productList from './parts/productList.vue';
+const { mapActions: product } = createNamespacedHelpers('product');
+// import caogaoList from './parts/caogaoList.vue';
+// import noauditList from './parts/noauditList.vue';
+// import auditList from './parts/auditList.vue';
 
 export default {
   name: 'index',
   props: {},
   components: {
     NavBar,
-    caogaoList,
-    noauditList,
-    auditList,
+    //待发布
+    // caogaoList,
+    //审核中
+    // noauditList,
+    //已发布
+    // auditList,
+    productList,
   },
   data: function() {
     return {
@@ -66,10 +60,23 @@ export default {
       navShow: true,
       // 标签
       active: '1',
+      //待发布
+      nextList: [],
+      //审核中
+      nowList: [],
+      //已发布
+      pastList: [],
     };
   },
-  created() {},
-  methods: {},
+  created() {
+    this.search();
+  },
+  methods: {
+    ...product({ productList: 'query', columnInfo: 'fetch', marketcerate: 'create', productdeltet: 'delete', upup: 'update' }),
+    async search() {
+      console.log(this.user.id);
+    },
+  },
   computed: {
     ...mapState(['user']),
   },
@@ -96,10 +103,9 @@ export default {
 .main {
   min-height: 570px;
   .two {
-    position: fixed;
-    top: 80%;
-    left: 10px;
-    z-index: 999;
+    text-align: center;
+    margin: 5px 0px;
+    border-radius: 10px;
   }
 }
 /deep/.van-tab {

+ 145 - 31
src/views/userCenter/myProduct/parts/caogaoList.vue

@@ -2,7 +2,7 @@
   <div id="technologyList">
     <el-row>
       <el-col :span="24" class="info">
-        <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
+        <!-- <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
           <el-col :span="19" class="messag">
             <p>
               <span class="textOver" @click="$router.push({ path: '/userCenter/myProduct/detailinfo', query: { id: item.id } })">{{ item.name }}</span>
@@ -25,6 +25,60 @@
             <el-button type="success" size="mini" v-if="item.status == '3'" @click="releaseBtn(item)">发布</el-button>
             <el-button type="danger" size="mini" @click="deleteBtn(item.id)">删除</el-button>
           </el-col>
+        </el-col> -->
+        <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
+          <el-col :span="24" class="top">
+            <span class="textOver">{{ item.name }}</span>
+            <span>{{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}</span>
+          </el-col>
+          <el-col :span="24" class="down">
+            <el-col :span="3" class="image">
+              <span v-if="item.image.length > 0">
+                <el-col :span="24" v-for="(acm, index) in item.image" :key="index">
+                  <template v-if="index === 0">
+                    <vant-image style="width:100%;height:100px" :src="acm.url"></vant-image>
+                  </template>
+                </el-col>
+              </span>
+              <span v-else>
+                <el-col :span="24" style="width: 100%;height: 100px;text-align: center;line-height: 100px;font-size: 20px;">
+                  <span>暂无图片</span>
+                </el-col>
+              </span>
+            </el-col>
+            <el-col :span="6" class="product">
+              <p>类型:{{ item.type === '0' ? '技术' : item.type === '1' ? '产品' : item.type === '2' ? '服务' : 'underdind' }}</p>
+              <span v-if="item.type === '0' || item.type === '1'">
+                <p>所属领域:{{ item.field }}</p>
+                <p>合作方式:{{ item.cooperation }}</p>
+              </span>
+              <span v-else>
+                <p>信息属性:{{ item.messattribute }}</p>
+                <p>需求程度:{{ item.demand }}</p>
+              </span>
+            </el-col>
+            <el-col :span="9" class="intro">
+              <span v-if="item.type == '0'">
+                <p>技术难题&需求说明:</p>
+                <p>{{ item.requirementdesc }}</p>
+              </span>
+              <span v-else-if="item.type == '1'">
+                <p>产品简介:</p>
+                <p>{{ item.achievebrief }}</p>
+              </span>
+              <span v-else>
+                <p>信息描述:</p>
+                <p>{{ item.informationdesc }}</p>
+              </span>
+            </el-col>
+            <el-col :span="6" class="status">
+              <p>状态:{{ item.status === '2' ? '审核拒绝' : item.status === '3' ? '草稿' : '未识别' }}</p>
+              <van-button type="primary" size="mini" @click="previewBtn(item)" v-if="item.status == '3'">预览</van-button>
+              <van-button type="info" size="mini" @click="editBtn(item)" v-if="item.status == '3'">编辑</van-button>
+              <van-button type="success" size="mini" @click="releaseBtn(item)" v-if="item.status == '3'">发布</van-button>
+              <van-button type="danger" size="mini" @click="deleteBtn(item.id)">删除</van-button>
+            </el-col>
+          </el-col>
         </el-col>
       </el-col>
     </el-row>
@@ -33,7 +87,7 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: mapMarketproduct } = createNamespacedHelpers('marketproduct');
+const { mapActions: product } = createNamespacedHelpers('product');
 export default {
   name: 'technologyList',
   props: {},
@@ -47,37 +101,97 @@ export default {
     this.searchInfo();
   },
   methods: {
-    ...mapMarketproduct({ productList: 'query', columnInfo: 'fetch', marketcerate: 'create', productdeltet: 'delete', upup: 'update' }),
-    async searchInfo({ skip = 0, limit = 1000, ...info } = {}) {
+    // ...mapMarketproduct({ productList: 'query', columnInfo: 'fetch', marketcerate: 'create', productdeltet: 'delete', upup: 'update' }),
+    // async searchInfo({ skip = 0, limit = 1000, ...info } = {}) {
+    //   let userid = this.user.uid;
+    //   const res = await this.productList({ skip, limit, status: 2, userid, ...info });
+    //   const resTwo = await this.productList({ skip, limit, status: 3, userid, ...info });
+    //   var newData = res.data.concat(resTwo.data);
+    //   if (newData.length != 0) {
+    //     this.$set(this, `list`, newData);
+    //   }
+    // },
+    // async releaseBtn(data) {
+    //   data.status = 0;
+    //   const res = await this.upup(data);
+    //   if (this.$checkRes(res)) {
+    //     this.$message({
+    //       message: '信息发布成功',
+    //       type: 'success',
+    //     });
+    //     this.searchInfo();
+    //   }
+    // },
+    // async deleteBtn(id) {
+    //   const res = await this.productdeltet(id);
+    //   if (this.$checkRes(res)) {
+    //     this.$message({
+    //       message: '删除信息成功',
+    //       type: 'success',
+    //     });
+    //     this.searchInfo();
+    //   }
+    // },
+    ...product({ productList: 'query', columnInfo: 'fetch', marketcerate: 'create', productdeltet: 'delete', upup: 'update' }),
+    // 查询列表
+    async searchInfo({ skip = 0, limit = 6, ...info } = {}) {
+      skip = this.skip;
       let userid = this.user.uid;
-      const res = await this.productList({ skip, limit, status: 2, userid, ...info });
-      const resTwo = await this.productList({ skip, limit, status: 3, userid, ...info });
-      var newData = res.data.concat(resTwo.data);
-      if (newData.length != 0) {
-        this.$set(this, `list`, newData);
-      }
-    },
-    async releaseBtn(data) {
-      data.status = 0;
-      const res = await this.upup(data);
-      if (this.$checkRes(res)) {
-        this.$message({
-          message: '信息发布成功',
-          type: 'success',
-        });
-        this.searchInfo();
-      }
-    },
-    async deleteBtn(id) {
-      const res = await this.productdeltet(id);
-      if (this.$checkRes(res)) {
-        this.$message({
-          message: '删除信息成功',
-          type: 'success',
-        });
-        this.searchInfo();
-      }
+      const res = await this.productList({ skip, status: 2, userid, ...info });
+      // console.log(res);
+      const resTwo = await this.productList({ skip, status: 3, userid, ...info });
+      //   var newData = res.data.concat(resTwo.data);
+      //   if (newData.length != 0) {
+      //     this.$set(this, `newDataList`, newData);
+      //     this.$set(this, `total`, newData.length);
+      //   }
     },
+    // // 预览
+    // previewBtn(item) {
+    //   this.$set(this, `type`, item.type);
+    //   this.dialogVisible = true;
+    //   this.$set(this, `detailInfo`, item);
+    // },
+    // handleClose() {
+    //   this.dialogVisible = false;
+    // },
+    // // 修改
+    // editBtn(item) {
+    //   this.$emit('editBtn', item);
+    // },
+    // // 信息发布
+    // async releaseBtn(data) {
+    //   data.status = '0';
+    //   let res = await this.upup(data);
+    //   if (this.$checkRes(res)) {
+    //     this.$message({
+    //       message: '信息发布成功',
+    //       type: 'success',
+    //     });
+    //     this.searchInfo();
+    //   } else {
+    //     this.$message.error('信息发布失败');
+    //   }
+    // },
+    // // 删除信息
+    // async deleteBtn(id) {
+    //   let res = await this.productdeltet(id);
+    //   if (this.$checkRes(res)) {
+    //     this.$message({
+    //       message: '信息删除成功',
+    //       type: 'success',
+    //     });
+    //     this.searchInfo();
+    //   } else {
+    //     this.$message.error('信息删除失败');
+    //   }
+    // },
+    // search(page = 1) {
+    //   this.$set(this, `list`, this.origin[page - 1]);
+    // },
+    // handleCurrentChange(currentPage) {
+    //   this.search(currentPage);
+    // },
   },
   computed: {
     ...mapState(['user']),

+ 31 - 0
src/views/userCenter/myProduct/parts/productList.vue

@@ -0,0 +1,31 @@
+<template>
+  <div id="productList">
+    <el-row>
+      <el-col :span="24">
+        <p>productList</p>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  name: 'productList',
+  props: {},
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+};
+</script>
+
+<style lang="less" scoped></style>