|
@@ -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;
|