|
@@ -17,6 +17,9 @@
|
|
|
<el-col :span="24">
|
|
|
<el-button type="danger" icon="el-icon-phone-outline" @click="btnPhone">对接</el-button>
|
|
|
</el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-button type="success" icon="el-icon-check" @click="btnTrade">申请交易</el-button>
|
|
|
+ </el-col>
|
|
|
</el-col>
|
|
|
<el-col :span="18" class="mainInfo">
|
|
|
<el-col :span="24" v-if="display === '1'">
|
|
@@ -63,6 +66,7 @@ import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
import chat from './parts/chat.vue';
|
|
|
const { mapActions: mapProduct } = createNamespacedHelpers('marketproduct');
|
|
|
const { mapActions: personalRoom } = createNamespacedHelpers('personalroom');
|
|
|
+const { mapActions: transaction } = createNamespacedHelpers('transaction');
|
|
|
export default {
|
|
|
name: 'dockDetail',
|
|
|
props: {},
|
|
@@ -81,6 +85,7 @@ export default {
|
|
|
methods: {
|
|
|
...mapProduct(['fetch']),
|
|
|
...personalRoom(['create']),
|
|
|
+ ...transaction({ buyProduct: 'create' }),
|
|
|
async searchInfo() {
|
|
|
let res = await this.fetch(this.$route.query.id);
|
|
|
if (res.errcode === 0) {
|
|
@@ -118,6 +123,18 @@ export default {
|
|
|
}
|
|
|
this.display = '2';
|
|
|
},
|
|
|
+ async btnTrade() {
|
|
|
+ let form = {};
|
|
|
+ form.userid = this.user.uid;
|
|
|
+ form.username = this.user.name;
|
|
|
+ form.product_id = this.productInfo.id;
|
|
|
+ form.product_name = this.productInfo.name;
|
|
|
+ form.market_userid = this.productInfo.userid;
|
|
|
+ form.market_username = this.productInfo.contact_user;
|
|
|
+ form.status = '0';
|
|
|
+ let res = await this.buyProduct(form);
|
|
|
+ this.$checkRes(res, '购买申请成功', res.errmsg || '购买申请失败');
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|