Explorar el Código

更新我的发布

guhongwei hace 4 años
padre
commit
3bb77330f6

+ 23 - 22
src/views/userCenter/myProduct/detailinfo.vue

@@ -16,6 +16,8 @@
 <script>
 import NavBar from '@/layout/common/topInfo.vue';
 import prodDetails from '@/layout/myProduct/prodDetails.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: mapMarketproduct } = createNamespacedHelpers('marketproduct');
 export default {
   name: 'prodDetail',
   props: {},
@@ -31,29 +33,28 @@ export default {
     // 返回
     navShow: true,
     // 产品名称
-    productInfo: {
-      image: [
-        {
-          url: require('@/assets/test.jpg'),
-        },
-      ],
-      name: '产品名称',
-      totaltype: '0',
-      product_type_name: '科研',
-      phase: '1', //研发阶段
-      business: '0', //交易方式
-      field: '应用领域',
-      scope: '服务范围',
-      price: '100', //单价
-      priceunit: '公斤', //单位
-      contact_user: '联系人',
-      contact_tel: '17319450324',
-      introduction: '产品简介',
-    },
+    productInfo: {},
   }),
-  created() {},
-  computed: {},
-  methods: {},
+  created() {
+    this.searchInfo();
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  methods: {
+    ...mapMarketproduct({ productFetch: 'fetch', productCreate: 'create', productUpdate: 'update', productQuery: 'query' }),
+    async searchInfo() {
+      if (this.id) {
+        let res = await this.productFetch(this.id);
+        if (this.$checkRes(res)) {
+          this.$set(this, `productInfo`, res.data);
+        }
+      }
+    },
+  },
   mounted() {
     this.title = this.$route.meta.title;
     this.isleftarrow = this.$route.meta.isleftarrow;

+ 1 - 1
src/views/userCenter/myProduct/parts/auditList.vue

@@ -5,7 +5,7 @@
         <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
           <el-col :span="19" class="messag">
             <p>
-              <span class="textOver">{{ item.name }}</span>
+              <span class="textOver" @click="$router.push({ path: '/userCenter/myProduct/detailinfo', query: { id: item.id } })">{{ item.name }}</span>
               <span>{{ item.status == '1' ? '审核通过' : '未识别' }}</span>
             </p>
             <p>

+ 1 - 1
src/views/userCenter/myProduct/parts/caogaoList.vue

@@ -5,7 +5,7 @@
         <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
           <el-col :span="19" class="messag">
             <p>
-              <span class="textOver">{{ item.name }}</span>
+              <span class="textOver" @click="$router.push({ path: '/userCenter/myProduct/detailinfo', query: { id: item.id } })">{{ item.name }}</span>
               <span>{{ item.status == '2' ? '审核拒绝' : item.status == '3' ? '草稿' : '未识别' }}</span>
             </p>
             <p>

+ 1 - 1
src/views/userCenter/myProduct/parts/noauditList.vue

@@ -5,7 +5,7 @@
         <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
           <el-col :span="19" class="messag">
             <p>
-              <span class="textOver">{{ item.name }}</span>
+              <span class="textOver" @click="$router.push({ path: '/userCenter/myProduct/detailinfo', query: { id: item.id } })">{{ item.name }}</span>
               <span>{{ item.status == '0' ? '审核中' : '未识别' }}</span>
             </p>
             <p>