guhongwei пре 3 година
родитељ
комит
3eaa5e3caa

+ 26 - 25
src/components/detail-model/achieveInfo.vue

@@ -181,7 +181,7 @@ import chat from '@c/chat.vue';
 import _ from 'lodash';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: personRoom } = createNamespacedHelpers('personRoom');
-const { mapActions: transaction } = createNamespacedHelpers('transaction');
+const { mapActions: dockTranscation } = createNamespacedHelpers('dockTranscation');
 export default {
   name: 'achieveInfo',
   props: {
@@ -199,7 +199,7 @@ export default {
   created() {},
   methods: {
     ...personRoom(['create']),
-    ...transaction({ getTran: 'query', createTran: 'create' }),
+    ...dockTranscation({ tranCreate: 'create' }),
     async btnPhone() {
       if (!this.room.id) {
         //TODO 请求房间号
@@ -232,29 +232,30 @@ export default {
     },
     //供求对接
     async onSubmit() {
-      const data = _.cloneDeep(this.form);
-      const obj = {
-        dock_id: this.dock_id,
-        supplier: _.get(data, 'user_id'),
-        s_name: _.get(data, 'contacts'),
-        s_phone: _.get(data, 'phone'),
-        product_id: _.get(data, 'id'),
-        product: _.get(data, 'name'),
-        demander: _.get(this.user, 'id'),
-        d_name: _.get(this.user, 'name'),
-        d_phone: _.get(this.user, 'phone'),
-      };
-      if (obj.demander === obj.supplier) {
-        this.$message.error('您不能对自己的成果进行对接!');
-        return;
-      }
-      const list = await this.getTran({ product_id: obj.product_id, demander: obj.demander, dock_id: this.dock_id });
-      if (list.total > 0) {
-        this.$message.warning('您已申请供求对接,无需再次申请!');
-        return;
-      }
-      const res = await this.createTran(obj);
-      this.$checkRes(res, '对接成功', res.errmsg || '对接失败');
+      console.log(this.user);
+      // const data = _.cloneDeep(this.form);
+      // const obj = {
+      //   dock_id: this.dock_id,
+      //   supplier: _.get(data, 'user_id'),
+      //   s_name: _.get(data, 'contacts'),
+      //   s_phone: _.get(data, 'phone'),
+      //   product_id: _.get(data, 'id'),
+      //   product: _.get(data, 'name'),
+      //   demander: _.get(this.user, 'id'),
+      //   d_name: _.get(this.user, 'name'),
+      //   d_phone: _.get(this.user, 'phone'),
+      // };
+      // if (obj.demander === obj.supplier) {
+      //   this.$message.error('您不能对自己的成果进行对接!');
+      //   return;
+      // }
+      // const list = await this.getTran({ product_id: obj.product_id, demander: obj.demander, dock_id: this.dock_id });
+      // if (list.total > 0) {
+      //   this.$message.warning('您已申请供求对接,无需再次申请!');
+      //   return;
+      // }
+      // const res = await this.tranCreate(obj);
+      // this.$checkRes(res, '对接成功', res.errmsg || '对接失败');
     },
   },
   computed: {

+ 21 - 19
src/components/detail-model/expertInfo.vue

@@ -130,7 +130,7 @@ import chat from '@c/chat.vue';
 const _ = require('lodash');
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: personRoom } = createNamespacedHelpers('personRoom');
-const { mapActions: transaction } = createNamespacedHelpers('transaction');
+const { mapActions: dockTranscation } = createNamespacedHelpers('dockTranscation');
 export default {
   name: 'expertInfo',
   props: {
@@ -148,7 +148,7 @@ export default {
   created() {},
   methods: {
     ...personRoom(['create']),
-    ...transaction({ getTran: 'query', createTran: 'create' }),
+    ...dockTranscation({ tranCreate: 'create' }),
     async btnPhone() {
       if (!this.room.id) {
         //TODO 请求房间号
@@ -180,32 +180,34 @@ export default {
       this.dialogTableVisible = true;
     },
     //供求对接
-    async onSubmit(data) {
-      const obj = {
-        supplier: _.get(data, 'id'),
-        s_name: _.get(data, 'name'),
-        s_phone: _.get(data, 'phone'),
-        product_id: _.get(data, 'id'),
-        product: _.get(data, 'name'),
-        demander: _.get(this.user, 'id'),
-        d_name: _.get(this.user, 'name'),
-        d_phone: _.get(this.user, 'phone'),
-      };
-      if (obj.demander === obj.supplier) {
-        this.$message.error('您不能对自己进行对接!');
+    async onSubmit() {
+      let data = { dock_id: this.dock_id, product_id: this.form.user_id, s_id: this.form.user_id, s_name: this.form.name, s_phone: this.form.phone };
+      if (!_.get(this.user, 'id')) {
+        this.$message({
+          dangerouslyUseHTMLString: true,
+          message: '<strong><a href="http://broadcast.waityou24.cn/live/login" style="color:red;">游客身份无法与专家进行对接,请先注册</a></strong>',
+          type: 'error',
+        });
         return;
+      } else {
+        // 需求者信息
+        data.d_id = this.user.id;
+        data.d_name = this.user.name;
+        data.d_phone = this.user.phone;
       }
-      const list = await this.getTran({ product_id: obj.product_id, demander: obj.demander });
-      if (list.total > 0) {
-        this.$message.warning('您已申请供求对接,无需再次申请!');
+      if (data.d_id === data.s_id) {
+        this.$message.error('您不能对自己进行对接!');
         return;
       }
-      const res = await this.createTran(obj);
+      const res = await this.tranCreate(data);
       this.$checkRes(res, '对接成功', res.errmsg || '对接失败');
     },
   },
   computed: {
     ...mapState(['user']),
+    dock_id() {
+      return this.$route.query.dock_id;
+    },
   },
   watch: {},
 };

+ 6 - 0
src/router/index.js

@@ -108,6 +108,12 @@ const live = [
     meta: { title: '直播大厅-数据列表', subSite: true },
     component: () => import('../views/achieveLive/model/data-index.vue'),
   },
+  {
+    path: '/achieveLive/model/dataDetail',
+    name: 'personalLive_model_dataDetail',
+    meta: { title: '直播大厅-数据详情', subSite: true },
+    component: () => import('../views/achieveLive/model/data-detail.vue'),
+  },
 
   // {
   //   path: '/achieveLive/expert/index',

+ 0 - 2
src/store/index.js

@@ -26,8 +26,6 @@ import dockTranscation from '@common/src/store/dock/dockTranscation';
 // 培训问诊
 import trainLive from '@common/src/store/trainLive';
 import trainchat from '@common/src/store/trainchat';
-// // 交易备案
-// import transaction from '@common/src/store/transaction';
 // 科技频道
 import channel from '@common/src/store/channel';
 import channelVideo from '@common/src/store/channelVideo';

+ 3 - 1
src/views/achieveLive/detail/expertData.vue

@@ -78,7 +78,9 @@ export default {
       this.dialog = false;
     },
     // 对接
-    trans(data) {},
+    trans(data) {
+      this.$router.push({ path: '/achieveLive/model/dataDetail', query: { dock_id: this.dock_id, id: data.user_id, viewType: 'expert' } });
+    },
     // 查看更多项目
     moreBtn() {
       this.$router.push({ path: '/achieveLive/model/dataIndex', query: { dock_id: this.dock_id, viewType: 'expert' } });

+ 3 - 1
src/views/achieveLive/detail/productData.vue

@@ -99,7 +99,9 @@ export default {
       this.dialog = false;
     },
     // 对接
-    trans(data, type) {},
+    trans(data, type) {
+      this.$router.push({ path: '/achieveLive/model/dataDetail', query: { dock_id: this.dock_id, id: data._id, type: type, viewType: 'product' } });
+    },
     // 查看更多项目
     moreBtn(type) {
       this.$router.push({ path: '/achieveLive/model/dataIndex', query: { dock_id: this.dock_id, type: type, viewType: 'product' } });

+ 86 - 0
src/views/achieveLive/expert/detail.vue

@@ -0,0 +1,86 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="one">
+          <el-col :span="24" class="right">
+            <el-button type="primary" size="mini" @click="back">返回活动首页</el-button>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="two">
+          <expertInfo :form="info"></expertInfo>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import expertInfo from '@c/detail-model/expertInfo.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: expert } = createNamespacedHelpers('expert');
+export default {
+  name: 'detail',
+  props: {},
+  components: {
+    expertInfo,
+  },
+  data: function() {
+    return {
+      info: {},
+    };
+  },
+  created() {
+    if (this.id) this.search();
+  },
+  methods: {
+    ...expert(['fetch']),
+    async search() {
+      let res = await this.fetch(this.id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `info`, res.data);
+      }
+    },
+    back() {
+      this.$router.push({ path: '/achieveLive/detail', query: { dock_id: this.dock_id } });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    dock_id() {
+      return this.$route.query.dock_id;
+    },
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  min-height: 505px;
+  box-shadow: 0 0 5px #ccc;
+  background-color: #fff;
+  padding: 20px;
+  .one {
+    margin: 0 0 10px 0;
+    height: 40px;
+    overflow: hidden;
+    border-bottom: 2px solid #666;
+    .right {
+      text-align: right;
+    }
+  }
+}
+</style>

+ 3 - 1
src/views/achieveLive/expert/index.vue

@@ -55,7 +55,9 @@ export default {
       }
     },
     // 对接
-    toCheck({ data }) {},
+    toCheck({ data }) {
+      this.$router.push({ path: '/achieveLive/model/dataDetail', query: { dock_id: this.dock_id, id: data.user_id, viewType: 'expert' } });
+    },
     back() {
       this.$router.push({ path: '/achieveLive/detail', query: { dock_id: this.dock_id } });
     },

+ 44 - 0
src/views/achieveLive/model/data-detail.vue

@@ -0,0 +1,44 @@
+<template>
+  <div id="data-detail">
+    <data-slot>
+      <component :is="model"></component>
+    </data-slot>
+  </div>
+</template>
+
+<script>
+import dataSlot from './data-slot.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'data-detail',
+  props: {},
+  components: {
+    dataSlot,
+    modelexpert: () => import('../expert/detail.vue'),
+    modelproduct: () => import('../product/detail.vue'),
+  },
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+    model() {
+      return `model${this.$route.query.viewType}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 1 - 3
src/views/achieveLive/model/data-index.vue

@@ -21,9 +21,7 @@ export default {
   data: function() {
     return {};
   },
-  created() {
-    console.log(this.viewType);
-  },
+  created() {},
   methods: {},
   computed: {
     ...mapState(['user']),

+ 38 - 0
src/views/achieveLive/product/detail.vue

@@ -0,0 +1,38 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="main">
+        产品对接
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'detail',
+  props: {},
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>