guhongwei 4 years ago
parent
commit
30c74b30a0
4 changed files with 82 additions and 19 deletions
  1. 2 0
      src/store/index.js
  2. 42 0
      src/store/live/flower.js
  3. 25 19
      src/views/halltwo/directTwo.vue
  4. 13 0
      src/views/halltwo/parts/dockchat.vue

+ 2 - 0
src/store/index.js

@@ -26,6 +26,7 @@ import apply from './live/apply';
 import market from './market/market';
 import channel from './live/channel';
 import channelVideo from './live/channelVideo';
+import flower from './live/flower';
 // 专家
 import expertsuser from './market/exportuser';
 // 产品
@@ -78,6 +79,7 @@ export default new Vuex.Store({
     market,
     channel,
     channelVideo,
+    flower,
     // 专家
     expertsuser,
     // 产品

+ 42 - 0
src/store/live/flower.js

@@ -0,0 +1,42 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  flowerInfo: `/api/live/flower`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.flowerInfo}`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.flowerInfo}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.flowerInfo}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.flowerInfo}/update/${id}`, data);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.flowerInfo}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 25 - 19
src/views/halltwo/directTwo.vue

@@ -42,51 +42,53 @@
             <el-col :span="24" class="twodown">
               <el-col :span="5" class="txt">
                 <span>已经到场</span>
-                <span>{{ statNum.tszx }}</span
+                <span>{{ statNum.tszx || 0 }}</span
                 >人
               </el-col>
               <el-col :span="5" class="txt">
                 <span>实现对接</span>
-                <span>{{ statNum.jywc }}</span
+                <span>{{ statNum.jywc || 0 }}</span
                 >次
               </el-col>
               <el-col :span="5" class="txt">
                 <span>产生意向</span>
-                <span>{{ statNum.qthz }}</span
+                <span>{{ statNum.qthz || 0 }}</span
                 >次
               </el-col>
               <el-col :span="5" class="txt">
                 <span>项目数</span>
-                <span>{{ statNum.czxm }}</span
+                <span>{{ statNum.czxm || 0 }}</span
                 >项
               </el-col>
               <el-col :span="5" class="txt">
                 <span>贺信</span>
-                <span>0</span>封
+                <span>{{ statNum.zhhx || 0 }}</span
+                >封
               </el-col>
               <el-col :span="5" class="txt">
                 <span>同时在线</span>
-                <span>{{ statNum.tszx }}</span
+                <span>{{ statNum.tszx || 0 }}</span
                 >人
               </el-col>
               <el-col :span="5" class="txt">
                 <span>正在对接</span>
-                <span>{{ statNum.qthz }}</span
+                <span>{{ statNum.qthz || 0 }}</span
                 >人
               </el-col>
               <el-col :span="5" class="txt">
                 <span>达成意向</span>
-                <span>{{ statNum.dcyx }}</span
+                <span>{{ statNum.dcyx || 0 }}</span
                 >次
               </el-col>
               <el-col :span="5" class="txt">
                 <span>需求数</span>
-                <span>{{ statNum.czxq }}</span
+                <span>{{ statNum.czxq || 0 }}</span
                 >项
               </el-col>
               <el-col :span="5" class="txt">
                 <span>鲜花</span>
-                <span>0</span>束
+                <span>{{ statNum.zhxh || 0 }}</span
+                >束
               </el-col>
             </el-col>
           </div>
@@ -265,6 +267,7 @@ const { mapActions: dock } = createNamespacedHelpers('dock');
 const { mapActions: expertsuser } = createNamespacedHelpers('expertsuser');
 const { mapActions: transaction } = createNamespacedHelpers('transaction');
 const { mapActions: market } = createNamespacedHelpers('market');
+const { mapActions: flower } = createNamespacedHelpers('flower');
 var moment = require('moment');
 export default {
   metaInfo() {
@@ -333,15 +336,7 @@ export default {
       zdcom: require('@a/zh_17.png'),
       jscom: require('@a/zh_18.png'),
       // 项目数
-      statNum: {
-        tszx: 0,
-        tyjb: 0,
-        qthz: 0,
-        dcyx: 0,
-        jywc: 0,
-        czxm: 0,
-        czxq: 0,
-      },
+      statNum: {},
       // 倒计时
       djs: '',
     };
@@ -354,6 +349,7 @@ export default {
     ...expertsuser({ expertQuery: 'query' }),
     ...transaction({ tquery: 'query' }),
     ...market({ marketFetch: 'fetch', operaFetch: 'operaFetch', sendMsg: 'operationCreate', operaQuery: 'operaQuery' }),
+    ...flower({ flowerquery: 'query' }),
     async searchInfo() {
       // 查询展会详情
       if (this.id) {
@@ -436,6 +432,16 @@ export default {
       if (tszx) {
         this.$set(this.statNum, `tszx`, tszx.total);
       }
+      // 查询贺信
+      let zhhx = await this.flowerquery({ type: 'flower', dock_id: this.id });
+      if (this.$checkRes(zhhx)) {
+        this.$set(this.statNum, `zhhx`, zhhx.total);
+      }
+      // 花
+      let zhxh = await this.flowerquery({ type: 'hand', dock_id: this.id });
+      if (this.$checkRes(zhxh)) {
+        this.$set(this.statNum, `zhxh`, zhxh.total);
+      }
     },
     // 倒计时
     setTime(end) {

+ 13 - 0
src/views/halltwo/parts/dockchat.vue

@@ -39,6 +39,7 @@
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: chat } = createNamespacedHelpers('chat');
+const { mapActions: flower } = createNamespacedHelpers('flower');
 import _ from 'lodash';
 var moment = require('moment');
 export default {
@@ -65,6 +66,7 @@ export default {
   },
   methods: {
     ...chat(['query', 'create']),
+    ...flower({ flowercreate: 'create' }),
     // 查询列表
     async search() {
       const res = await this.query({ skip: 0, limit: 10, dock_id: this.dock_id });
@@ -102,6 +104,17 @@ export default {
         let res = await this.create(object);
         this.$checkRes(res, null, res.errmsg || '发言失败');
       }
+      // 创建花,贺信
+      let data = {
+        type: type,
+        dock_id: this.dock_id,
+      };
+      if (type == 'flower') {
+        data.name = '贺信';
+      } else {
+        data.name = '束花';
+      }
+      let res = await this.flowercreate(data);
     },
     // 切换图片
     isEmotion(word) {