guhongwei 4 years ago
parent
commit
c418e60ddf

BIN
public/cclg.pdf


BIN
public/jldx.pdf


+ 1 - 1
src/views/halltwo/liveCenter.vue

@@ -145,7 +145,7 @@ export default {
       }
     },
     getDate(value) {
-      let data = moment().format('HH:mm:ss');
+      let data = moment(value).format('HH:mm:ss');
       if (data) return data;
     },
   },

+ 100 - 0
src/views/halltwo/parts/xmdjachieve.vue

@@ -0,0 +1,100 @@
+<template>
+  <div id="xmdjachieve">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="one">
+          {{ detailInfo.name }}
+        </el-col>
+        <el-col :span="24" class="two">
+          <el-col :span="12" class="twoinfo">技术类型:{{ detailInfo.type == '0' ? '科技需求' : detailInfo == '1' ? '技术成果' : '商务信息' }} </el-col>
+          <el-col :span="12" class="twoinfo">行业分类:{{ detailInfo.field || '暂无' }} </el-col>
+          <el-col :span="12" class="twoinfo">技术成熟度:{{ detailInfo.achievestatus || '暂无' }} </el-col>
+          <el-col :span="12" class="twoinfo">交易方式:{{ detailInfo.cooperation || '暂无' }} </el-col>
+          <el-col :span="12" class="twoinfo">交易价格:{{ detailInfo.intentionprice || '暂无' }} </el-col>
+        </el-col>
+        <el-col :span="24" class="three">
+          <el-col :span="24" class="top">
+            <i class="el-icon-document"></i>
+            <span>项目介绍</span>
+          </el-col>
+          <el-col :span="24" class="down">
+            <el-col :span="24" class="downinfo">
+              <p>{{ detailInfo.achievebrief }}</p>
+            </el-col>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'xmdjachieve',
+  props: {
+    detailInfo: { type: Object },
+  },
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .one {
+    font-size: 24px;
+    text-align: center;
+    border-bottom: 3px solid #2152cb;
+    padding: 20px 0;
+    margin: 0 0 15px 0;
+  }
+  .two {
+    color: #2152cb;
+    font-size: 16px;
+    padding: 0 0 15px 0;
+    border-bottom: 1px dashed #2152cb;
+    .twoinfo {
+      padding: 10px 30px;
+    }
+  }
+  .three {
+    border-bottom: 1px dashed #000;
+    .top {
+      padding: 15px 0;
+      font-size: 20px;
+      color: #2152cb;
+      i {
+        font-size: 40px;
+      }
+      span {
+        position: relative;
+        top: -5px;
+        left: 5px;
+      }
+    }
+    .down {
+      padding: 0 0 15px 0;
+      .downinfo {
+        font-size: 16px;
+        padding: 0px 15px 15px 40px;
+        p:nth-child(1) {
+          font-weight: bold;
+        }
+        p:nth-child(2) {
+          text-indent: 2rem;
+          line-height: 30px;
+        }
+      }
+    }
+  }
+}
+</style>

+ 119 - 0
src/views/halltwo/parts/xmdjaexpert.vue

@@ -0,0 +1,119 @@
+<template>
+  <div id="xmdjachieve">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="one">
+          {{ detailInfo.name }}
+        </el-col>
+        <el-col :span="24" class="two">
+          <el-col :span="24" class="twoinfo">工作单位:{{ detailInfo.company || '暂无' }} </el-col>
+
+          <el-col :span="12" class="twoinfo">毕业院校:{{ detailInfo.school || '暂无' }} </el-col>
+          <el-col :span="12" class="twoinfo">最高学历:{{ detailInfo.education || '暂无' }} </el-col>
+          <el-col :span="12" class="twoinfo">职务职称:{{ detailInfo.zwzc || '暂无' }} </el-col>
+          <el-col :span="12" class="twoinfo">电子邮箱:{{ detailInfo.email || '暂无' }} </el-col>
+          <el-col :span="24" class="twoinfo">擅长领域:{{ detailInfo.expertise || '暂无' }} </el-col>
+        </el-col>
+        <el-col :span="24" class="three">
+          <el-col :span="24" class="top">
+            <i class="el-icon-document"></i>
+            <span>个人经历</span>
+          </el-col>
+          <el-col :span="24" class="down">
+            <el-col :span="24" class="downinfo">
+              <p>工作经历:</p>
+              <p>{{ detailInfo.workexperience || '暂无' }}</p>
+            </el-col>
+            <el-col :span="24" class="downinfo">
+              <p>科研综述:</p>
+              <p>{{ detailInfo.scientific || '暂无' }}</p>
+            </el-col>
+            <el-col :span="24" class="downinfo">
+              <p>承担项目:</p>
+              <p>{{ detailInfo.undertakingproject || '暂无' }}</p>
+            </el-col>
+            <el-col :span="24" class="downinfo">
+              <p>科技奖励:</p>
+              <p>{{ detailInfo.scienceaward || '暂无' }}</p>
+            </el-col>
+            <el-col :span="24" class="downinfo">
+              <p>社会任职:</p>
+              <p>{{ detailInfo.social || '暂无' }}</p>
+            </el-col>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'xmdjachieve',
+  props: {
+    detailInfo: { type: Object },
+  },
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .one {
+    font-size: 24px;
+    text-align: center;
+    border-bottom: 3px solid #2152cb;
+    padding: 20px 0;
+    margin: 0 0 15px 0;
+  }
+  .two {
+    color: #2152cb;
+    font-size: 16px;
+    padding: 0 0 15px 0;
+    border-bottom: 1px dashed #2152cb;
+    .twoinfo {
+      padding: 10px 30px;
+    }
+  }
+  .three {
+    border-bottom: 1px dashed #000;
+    .top {
+      padding: 15px 0;
+      font-size: 20px;
+      color: #2152cb;
+      i {
+        font-size: 40px;
+      }
+      span {
+        position: relative;
+        top: -5px;
+        left: 5px;
+      }
+    }
+    .down {
+      padding: 0 0 15px 0;
+      .downinfo {
+        font-size: 16px;
+        padding: 0px 15px 15px 40px;
+        p:nth-child(1) {
+          font-weight: bold;
+        }
+        p:nth-child(2) {
+          text-indent: 2rem;
+          line-height: 30px;
+        }
+      }
+    }
+  }
+}
+</style>

+ 165 - 0
src/views/halltwo/parts/xmdjchat.vue

@@ -0,0 +1,165 @@
+<template>
+  <div id="xmdjchat">
+    <el-row>
+      <el-col :span="24" class="info chat_frame" id="chat">
+        <template v-for="(i, index) in talk">
+          <template v-if="isSender(i, index)">
+            <el-col :span="24" class="senderTime" :key="`div${i.id}${index}`">
+              <span :key="`senderTime${i.id}${index}`">[{{ i.send_time }}] {{ i.sender_name }}</span>
+              <span v-html="i.content" :key="`senderContent${i.id}${index}`"></span>
+            </el-col>
+          </template>
+          <template v-else>
+            <el-col :span="24" class="receverTime" :key="`div${i.id}${index}`">
+              <span :key="`receverTime${i.id}${index}`"> {{ i.sender_name }} [{{ i.send_time }}]</span>
+              <span v-html="i.content" :key="`receverContent${i.id}${index}`"></span>
+            </el-col>
+          </template>
+        </template>
+      </el-col>
+      <el-col :span="24" style="text-align:center">
+        <!-- <wang-editor v-model="content" ref="editor"></wang-editor> -->
+        <el-input v-model="content" type="textarea"></el-input>
+        <el-button type="primary" size="mini" @click="sendMessage" style="margin-top:10px">提交发言</el-button>
+        <el-button type="primary" size="mini" @click="onSubmit" style="margin-top:10px">项目对接</el-button>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import wangEditor from '@/components/wang-editor.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: personalChat } = createNamespacedHelpers('personalchat');
+export default {
+  name: 'xmdjchat',
+  props: {
+    room: { type: Object },
+  },
+  components: {},
+  data: () => {
+    return {
+      content: '',
+      talk: [],
+    };
+  },
+  created() {},
+  mounted() {
+    this.channel();
+  },
+  methods: {
+    ...personalChat(['create', 'query']),
+    async search() {
+      console.log(this.room.id);
+      let res = await this.query({ personroom_id: this.room.id });
+      if (this.$checkRes(res)) {
+        this.$set(this, `talk`, res.data);
+        this.turnBottom();
+      }
+    },
+    async sendMessage() {
+      if (this.content != '') {
+        let obj = { personroom_id: this.room.id, content: this.content, sender_id: this.user.uid, sender_name: this.user.name, send_time: '13:00' };
+        let keys = Object.keys(this.room);
+        let fres = keys.find(f => this.room[f] == this.user.uid);
+        obj.receiver_id = fres === 'buyer_id' ? this.room['seller_id'] : this.room['buyer_id'];
+        obj.receiver_name = fres === 'buyer_id' ? this.room['seller_name'] : this.room['buyer_name'];
+        let res = await this.create(obj);
+        // this.$refs.editor.setContent();
+        this.$set(this, `content`, '');
+        this.$forceUpdate();
+        if (this.$checkRes(res, null, res.errmsg || '发言失败')) {
+          this.talk.push(res.data);
+          this.turnBottom();
+        }
+      } else this.$message.error('请输入信息后发送');
+    },
+    channel() {
+      console.log(this.room);
+      //TODO 修改订阅地址
+      if (!this.room.id) {
+        console.warn('未获取到房间id,无法进行订阅');
+        return;
+      }
+      this.$stomp({
+        [`/exchange/person_chat/${this.room.id}_${this.user.uid}`]: this.onMessage,
+      });
+    },
+    onMessage(message) {
+      let body = _.get(message, 'body');
+      if (body) {
+        body = JSON.parse(body);
+        this.talk.push(body);
+        this.turnBottom();
+      }
+    },
+    turnBottom() {
+      this.$nextTick(() => {
+        document.getElementById('chat').scrollTop = document.getElementById('chat').scrollHeight;
+      });
+    },
+    isSender(data) {
+      return this.user.uid == data.sender_id;
+    },
+    // 项目对接
+    onSubmit() {
+      this.$emit('onSubmit');
+    },
+  },
+  watch: {
+    room: {
+      handler(val) {
+        if (val.id) this.search();
+      },
+      immediate: true,
+      deep: true,
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.chat_frame {
+  height: 350px;
+  border: 1px solid #ccc;
+  margin-bottom: 10px;
+  overflow-y: auto;
+}
+.info {
+  float: left;
+  width: 100%;
+  padding: 15px;
+}
+/deep/.info p {
+  margin: 0 !important;
+  padding: 0 !important;
+}
+.senderTime {
+  float: left;
+  width: 100%;
+  text-align: left;
+}
+.receverTime {
+  float: right;
+  width: 100%;
+}
+.receverTime span:first-child {
+  float: right;
+  width: 100%;
+  text-align: right;
+}
+.receverTime span:last-child {
+  float: right;
+  width: 100%;
+  text-align: right;
+}
+</style>

+ 3 - 5
src/views/halltwo/shoolDetail.vue

@@ -47,11 +47,9 @@
               <p class="title">高校院所</p>
               <el-col :span="24" class="detail">
                 <p>{{ schoolList.content }}</p>
-                <el-link v-if="schoolList.name == '吉林大学'" href="">
-                  吉林大学
-                </el-link>
-                <el-link v-else-if="schoolList.name == '长春理工大学'">
-                  长春理工大学
+                <el-link v-if="schoolList.name == '吉林大学'" href="/jldx.pdf"> 附件3:吉林大学科技成果汇编(2018).pdf</el-link>
+                <el-link v-else-if="schoolList.name == '长春理工大学'" href="/cclg.pdf">
+                  长春理工大学科技成果简介.pdf
                 </el-link>
               </el-col>
             </el-col>

+ 56 - 20
src/views/halltwo/xmdj.vue

@@ -63,22 +63,22 @@
                     <xmdjtechol :detailInfo="detailInfo"></xmdjtechol>
                   </span>
                   <span v-else-if="type == '1'">
-                    成果
+                    <xmdjachieve :detailInfo="detailInfo"></xmdjachieve>
                   </span>
                   <span v-else-if="type == '2'">
-                    商务
+                    商务信息
                   </span>
                   <span v-else>
-                    专家
+                    <xmdjaexpert :detailInfo="detailInfo"></xmdjaexpert>
                   </span>
                 </span>
                 <span v-else-if="menuIndex == '1'">
-                  <el-col :span="12" class="productImage" v-for="(item, index) in image" :key="index">
+                  <el-col :span="12" class="productImage" v-for="(item, index) in detailInfo.image" :key="index">
                     <el-image :src="item.url"></el-image>
                   </el-col>
                 </span>
                 <span v-else>
-                  对接
+                  <xmdjchat v-if="room.id" :room="room" @onSubmit="onSubmit"></xmdjchat>
                 </span>
               </el-col>
             </el-col>
@@ -101,10 +101,14 @@
 import ywlx from './parts/ywlx.vue';
 import liveFoot from '@/layout/live/foot.vue';
 import xmdjtechol from './parts/xmdjtechol.vue';
+import xmdjachieve from './parts/xmdjachieve.vue';
+import xmdjaexpert from './parts/xmdjaexpert.vue';
+import xmdjchat from './parts/xmdjchat.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: dock } = createNamespacedHelpers('dock');
 const { mapActions: transaction } = createNamespacedHelpers('transaction');
 const { mapActions: expertsuser } = createNamespacedHelpers('expertsuser');
+const { mapActions: personalRoom } = createNamespacedHelpers('personalroom');
 var moment = require('moment');
 export default {
   metaInfo() {
@@ -117,6 +121,12 @@ export default {
     ywlx,
     // 技术对接
     xmdjtechol,
+    // 成果对接
+    xmdjachieve,
+    // 对接聊天,
+    xmdjchat,
+    // 专家对接
+    xmdjaexpert,
   },
   data: function() {
     return {
@@ -150,17 +160,8 @@ export default {
         },
       ],
       menuIndex: '0',
-      image: [
-        {
-          url: require('@a/7.jpg'),
-        },
-        {
-          url: require('@a/7.jpg'),
-        },
-        {
-          url: require('@a/7.jpg'),
-        },
-      ],
+      // 对接聊天
+      room: {},
     };
   },
   async created() {
@@ -170,6 +171,7 @@ export default {
     ...dock({ dockQuery: 'query', dockFetch: 'fetch', goodsquery: 'goodsquery' }),
     ...transaction({ buyProduct: 'create' }),
     ...expertsuser(['fetch']),
+    ...personalRoom(['create', 'countDelete']),
     async searchInfo() {
       // 查询展会详情
       if (this.dock_id) {
@@ -225,6 +227,44 @@ export default {
         this.$set(this, `detailInfo`, res.data);
       }
     },
+    // 选择菜单
+    changeMenu(name, index) {
+      this.menuIndex = index;
+      if (name == '项目对接') {
+        this.btnPhone();
+      }
+    },
+    // 聊天
+    async btnPhone() {
+      if (!this.room.id) {
+        //TODO 请求房间号
+        let obj = {};
+        if (!this.user.uid) {
+          // this.$message.error('游客身份无法与卖家对话,请先注册');
+          this.$message({
+            dangerouslyUseHTMLString: true,
+            message: '<strong><a href="http://free.liaoningdoupo.com/platlive/webLogin" style="color:red;">游客身份无法与卖家对话,请先注册</a></strong>',
+            type: 'error',
+          });
+          return;
+        } else {
+          obj.buyer_id = this.user.uid;
+          obj.buyer_name = this.user.name;
+        }
+        if (!this.detailInfo.userid) {
+          this.$message.error('缺少卖家信息,请联系卖家或管理员');
+          return;
+        } else {
+          obj.seller_id = this.detailInfo.userid;
+          obj.seller_name = this.detailInfo.contacts || this.detailInfo.name;
+        }
+        console.log(obj);
+        let res = await this.create(obj);
+        if (this.$checkRes(res)) {
+          this.$set(this, `room`, res.data);
+        }
+      }
+    },
     // 洽谈
     async onSubmit() {
       let data = this.detailInfo;
@@ -265,10 +305,6 @@ export default {
         this.$checkRes(res, '购买申请成功', res.errmsg || '购买申请失败');
       }
     },
-    // 选择菜单
-    changeMenu(name, index) {
-      this.menuIndex = index;
-    },
   },
   computed: {
     ...mapState(['user']),

+ 1 - 0
src/views/market/detail/achiDetail.vue

@@ -243,6 +243,7 @@ export default {
           obj.seller_id = this.detailInfo.userid;
           obj.seller_name = this.detailInfo.contacts;
         }
+        console.log(obj);
         let res = await this.create(obj);
         if (this.$checkRes(res)) {
           this.$set(this, `room`, res.data);