YY vor 2 Jahren
Ursprung
Commit
4e9ad64902

+ 7 - 7
src/layout/header/notice.vue

@@ -51,13 +51,13 @@ export default {
       body = JSON.parse(body);
       const type = body.type;
       if (type === 'shopMsg') {
-        this.$notify({
-          title: '新消息',
-          message: '您有新的消息,请注意及时处理!',
-          position: 'top-right',
-          type: 'warning',
-        });
-        this.getNotRead();
+        // this.$notify({
+        //   title: '新消息',
+        //   message: '您有新的消息,请注意及时处理!',
+        //   position: 'top-right',
+        //   type: 'warning',
+        // });
+        // this.getNotRead();
       } else if (type === 'chat') {
         this.$notify({
           title: '新消息',

+ 1 - 1
src/store/module/message/chatRecord.js

@@ -3,7 +3,7 @@ import Vuex from 'vuex';
 const _ = require('lodash');
 Vue.use(Vuex);
 const api = {
-  url: '/point/v1/api/chatRecord',
+  url: "/point/chat/v1/api/chatRecord",
 };
 
 const state = () => ({});

+ 1 - 1
src/store/module/message/room.js

@@ -3,7 +3,7 @@ import Vuex from 'vuex';
 const _ = require('lodash');
 Vue.use(Vuex);
 const api = {
-  url: '/point/v1/api/room',
+  url: '/point/chat/v1/api/room',
 };
 
 const state = () => ({});

Datei-Diff unterdrückt, da er zu groß ist
+ 187 - 48
src/views/selfShop/message/index.vue


+ 10 - 7
src/views/selfShop/message/parts/left-1.vue

@@ -8,20 +8,20 @@
           </el-input>
         </el-col>
         <el-col :span="24" class="left_two">
-          <el-col :span="24" v-for="item in list" :key="item._id" @click.native="toView(item)">
+          <el-col :span="24" v-for="item in roomList" :key="item._id" @click.native="toView(item)" style="cursor: pointer">
             <el-col :span="24" class="left_two_1">
               <el-col :span="4" class="left_image">
-                <el-image :src="item.speaker.icon[0].url" class="left_icon"> </el-image>
+                <el-image :src="item.customer.icon[0].url" class="left_icon"> </el-image>
               </el-col>
               <el-col :span="20">
                 <el-col :span="24" class="left_time">
-                  <el-col :span="12" style="text-align: left">{{ item.speaker.name }}</el-col>
-                  <el-col :span="12" style="text-align: right">{{ item.time }}</el-col>
+                  <el-col :span="12" style="text-align: left">{{ item.customer.name }}</el-col>
+                  <el-col :span="12" style="text-align: right">{{ item.last_time }}</el-col>
                 </el-col>
                 <el-col :span="20" class="left_content">
-                  <p class="left_content_test">{{ item.content }}</p>
+                  <p class="left_content_test">{{ item.last_chat }}</p>
                 </el-col>
-                <el-col :span="4" class="left_badge"> <el-badge :value="200" :max="99" class="left_item"> </el-badge></el-col>
+                <el-col :span="4" class="left_badge"> <el-badge :value="3" :max="99" class="left_item"> </el-badge></el-col>
               </el-col>
             </el-col>
           </el-col>
@@ -36,7 +36,7 @@ import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'left-1',
   props: {
-    list: { type: Array },
+    roomList: { type: Array },
     searchName: { type: String },
   },
   components: {},
@@ -86,6 +86,9 @@ export default {
         height: 60px;
       }
     }
+    .left_content {
+      margin: 4px 0 0 0;
+    }
     .left_content_test {
       margin: 4px 0;
       overflow: hidden;

+ 22 - 10
src/views/selfShop/message/parts/right-1.vue

@@ -9,7 +9,7 @@
           </p>
         </el-col>
         <el-col :span="24" class="right_two">
-          <el-col :span="24" v-for="item in list" :key="item._id">
+          <el-col :span="24" v-for="item in chatRecordList" :key="item._id">
             <el-col :span="24" class="right_time">{{ item.time }}</el-col>
             <el-col :span="24" class="right_left" v-if="item.speaker._id != user._id">
               <el-col :span="24">
@@ -17,14 +17,18 @@
                   <el-image :src="item.speaker.icon[0].url" class="right_icon"> </el-image>
                 </el-col>
                 <el-col :span="20" class="right_left_cont">
-                  <p class="test">{{ item.content }}</p>
+                  <span class="test" v-if="item.msg_type == '0' && item.content.length < 50">{{ item.content }}</span>
+                  <div class="test" v-if="item.msg_type == '0' && item.content.length > 50">{{ item.content }}</div>
+                  <el-image v-else-if="item.msg_type == '1'" :src="item.content" :preview-src-list="srcList" style="width: 300px" mode="widthFix"> </el-image>
                 </el-col>
               </el-col>
             </el-col>
             <el-col :span="24" class="right_right" v-else-if="item.speaker._id == user._id">
               <el-col :span="24">
                 <el-col :span="20" class="right_right_cont">
-                  <p class="test">{{ item.content }}</p>
+                  <span class="test" v-if="item.msg_type == '0' && item.content.length < 50">111{{ item.content }}</span>
+                  <div class="test" v-if="item.msg_type == '0' && item.content.length > 50">{{ item.content }}</div>
+                  <el-image v-if="item.msg_type == '1'" :src="item.content" :preview-src-list="srcList" style="width: 300px" mode="widthFix"> </el-image>
                 </el-col>
                 <el-col :span="2" class="right_image">
                   <el-image :src="item.speaker.icon[0].url" class="right_icon"> </el-image>
@@ -35,9 +39,8 @@
         </el-col>
         <el-col :span="24" class="right_thr">
           <el-col :span="20" class="right_thr_1">
-            <!-- <el-input v-model="message" :autosize="{ minRows: 5, maxRows: 7 }" maxlength="-1" placeholder="消息" type="textarea" size="small"></el-input> -->
             <el-form ref="form" :model="form" label-width="80px">
-              <el-input v-model="form.message" :autosize="{ minRows: 5, maxRows: 7 }" maxlength="-1" placeholder="消息" type="textarea" size="small"></el-input>
+              <el-input v-model="form.content" :autosize="{ minRows: 5, maxRows: 7 }" maxlength="-1" placeholder="消息" type="textarea" size="small"></el-input>
             </el-form>
           </el-col>
           <el-col :span="4" class="right_thr_2">
@@ -57,10 +60,11 @@ import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'right-1',
   props: {
-    list: { type: Array },
+    chatRecordList: { type: Array },
     address: { type: Object },
     customer: { type: Object },
     form: { type: Object },
+    srcList: { type: Array },
   },
   components: {},
   data: function () {
@@ -74,6 +78,9 @@ export default {
     onSubmit(data) {
       this.$emit('onSubmit', data);
     },
+    toaaa(val) {
+      console.log(val.length);
+    },
   },
   computed: {
     ...mapState(['user']),
@@ -132,17 +139,20 @@ export default {
     }
 
     .right_left_cont {
-      padding: 10px 10px;
+      padding: 20px 10px 10px 10px;
+      span {
+        margin: 20px 0 0 0;
+      }
       .test {
         border-radius: 8px;
         border: 1px #ccc solid;
         background: rgb(235, 249, 162);
         padding: 10px;
+        word-wrap: break-word;
       }
     }
   }
   .right_right {
-    text-align: right;
     padding: 0 30px;
     .right_image {
       padding: 10px 15px;
@@ -152,13 +162,15 @@ export default {
     }
     .right_right_cont {
       margin: 0 0 0 8.3%;
-      padding: 10px 10px;
-      text-align: left;
+      padding: 20px 10px 10px 10px;
+      display: flex;
+      flex-direction: row-reverse;
       .test {
         border-radius: 8px;
         border: 1px #ccc solid;
         background: rgb(174, 254, 149);
         padding: 10px;
+        word-break: break-all; // 强制内容换行
       }
     }
   }

+ 9 - 2
src/views/selfShop/sales/index.vue

@@ -14,7 +14,8 @@
             <search-1 :form="searchForm" :statusList="statusList" :typeList="typeList" @onSubmit="toSearch" @toReset="toClose"> </search-1>
           </el-col>
           <el-col :span="24" class="four">
-            <data-table ref="dataTable" :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @exam="toExam"> </data-table>
+            <data-table ref="dataTable" :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @exam="toExam" @message="toMessage">
+            </data-table>
           </el-col>
         </span>
         <detail v-if="view === 'order'" :id="id" @toBack="toBack"></detail>
@@ -43,7 +44,10 @@ export default {
       searchForm: {},
       list: [],
       total: 0,
-      opera: [{ label: '审核', method: 'exam' }],
+      opera: [
+        { label: '审核', method: 'exam' },
+        { label: '联系', method: 'message', type: 'warning' },
+      ],
       fields: [
         { label: '顾客', model: 'customer.name', showTip: false },
         { label: '订单号', model: 'order_detail.no', showTip: false },
@@ -111,6 +115,9 @@ export default {
       this.$set(this, `id`, data.id);
       this.$set(this, `view`, 'order');
     },
+    toMessage({ data }) {
+      this.$router.push({ path: `/selfShop/message`, query: { customer_id: data.customer._id, address_id: data.address._id } });
+    },
     toBack() {
       this.view = 'list';
       this.loadings = true;

+ 13 - 0
vue.config.js

@@ -34,6 +34,7 @@ module.exports = {
         changeOrigin: true,
         ws: false,
       },
+      // 团购
       '/point/group/v1/api': {
         target: 'https://broadcast.waityou24.cn', // 127.0.0.1:13003
         changeOrigin: true,
@@ -44,6 +45,18 @@ module.exports = {
         changeOrigin: true,
         ws: false,
       },
+      // 聊天
+      '/point/chat/v1/api': {
+        target: 'https://broadcast.waityou24.cn', // 127.0.0.1:13003
+        changeOrigin: true,
+        ws: false,
+      },
+      '/dev/point/chat/v1/api': {
+        target: 'https://broadcast.waityou24.cn', // 127.0.0.1:13003
+        changeOrigin: true,
+        ws: false,
+      },
+      // 尊荣
       '/dev/point/zr/v1/api': {
         target: 'https://broadcast.waityou24.cn', // 127.0.0.1:13003
         changeOrigin: true,