chenjj 2 days ago
parent
commit
b8858defa1
5 changed files with 37 additions and 8 deletions
  1. 8 0
      api/conversation.js
  2. 2 2
      config.js
  3. 7 1
      pages/chat.vue
  4. 10 1
      pages/mine/index.vue
  5. 10 4
      pages_orderuser/pages/talk/pages/index/index.vue

+ 8 - 0
api/conversation.js

@@ -40,6 +40,14 @@ export function getListConversationInfo(params) {
     })
 }
 
+//帮助与客服,获取与客服会话记录和详细信息
+export function getHelpConversation(data) {
+    return request({
+        url: `/core/conversation/getHelpConversation`,
+        method: 'post',
+        data
+    })
+}
 
 
 

+ 2 - 2
config.js

@@ -2,8 +2,8 @@
 const config = {
   // baseUrl: 'https://vue.ruoyi.vip/prod-api',
   //cloud后台网关地址
-  baseUrl: 'http://192.168.100.139:9527', //嵘哥
-  // baseUrl: 'http://192.168.100.127:9527',//龙哥
+  // baseUrl: 'http://192.168.100.139:9527', //嵘哥
+  baseUrl: 'http://192.168.100.128:9527',//龙哥
   // baseUrl: 'http://192.168.100.122:9527',
   // baseUrl: 'https://goldshulin.com/prod-api',
   mapKey: 'KFEBZ-P2GKZ-A5PX4-7Q6Y7-KXOBF-XCB4C',

+ 7 - 1
pages/chat.vue

@@ -1,7 +1,7 @@
 <template>
     <view class="chat-container">
         <view class="container-banner" :style="{ height: globalData.navBarHeight + 'px' }">
-            <view class="container-banner-box" :style="{ height: globalData.statusBarHeight + 'px' }">
+            <view class="container-banner-box" :style="{ height: globalData.statusBarHeight + 'px' }" @click="onKf">
                 <img src="/static/serverImg/chat/msg.png" alt="" style="width: 34rpx;height: 34rpx;">
                 <view class="container-banner-btn">咨询客服</view>
             </view>
@@ -127,6 +127,12 @@ const goSys =()=>{
     }
 }
 
+const onKf = () => {
+    uni.navigateTo({
+                url: `/pages_orderuser/pages/talk/pages/index/index?customerService=true`
+    })
+}
+
 const loadmoreInfo = ref({
     status: 'loadmore',
     loadingText: '努力加载中...',

+ 10 - 1
pages/mine/index.vue

@@ -199,7 +199,11 @@ const adminList = [
         img: '/static/serverImg/mine/kf.png',
         key: 'map',
         text: '',
-        page: '/pages_mine/pages/selectAddress/index',
+        operate: () => {
+            uni.navigateTo({
+                url: `/pages_orderuser/pages/talk/pages/index/index?customerService=true`
+            })
+      },
     },
     {
         name: '我的评论',
@@ -238,6 +242,11 @@ const userList = [
         img: '/static/serverImg/mine/kf.png',
         key: 'map',
         text: '',
+        operate: () => {
+            uni.navigateTo({
+                url: `/pages_orderuser/pages/talk/pages/index/index?customerService=true`
+            })
+      },
     },
     {
         name: '邀请二维码',

+ 10 - 4
pages_orderuser/pages/talk/pages/index/index.vue

@@ -50,7 +50,7 @@
 
 <script>
 import { wxUploadFile, wxMakePhoneCall } from '@/utils/wxRequest.js'
-import { sendMsg, getOrderConversationInfo, getListConversationInfo, setRead, getHistoryMsg } from '@/api/conversation.js';
+import { sendMsg, getOrderConversationInfo, getListConversationInfo, setRead, getHistoryMsg,getHelpConversation } from '@/api/conversation.js';
 import { onMounted } from "vue";
 import dayjs from 'dayjs/esm/index'
 import store from "@/store";
@@ -82,6 +82,7 @@ export default {
 			conversationRecordId: null,//会话id
 			storeUser: store.state.user,
 			store: store,
+			isKg:false
 		}
 	},
 	computed: {
@@ -107,6 +108,11 @@ export default {
 		}
 		//1用户2志愿者3后台
 		this.system = this.userType === 1 ? '1' : '2';
+		//客服
+		if(options.customerService){
+			this.system = 3;
+		}
+		
 		// #ifdef H5
 		this.scrollView.safeAreaHeight = uni.getSystemInfoSync().safeArea.height;
 		// #endif
@@ -192,7 +198,7 @@ export default {
 				const parmas = {
 					system: this.system
 				}
-				const apiFun = this.orderId ? getOrderConversationInfo : getListConversationInfo
+				const apiFun = this.orderId ? getOrderConversationInfo : (this.system === 3?getHelpConversation:getListConversationInfo)
 				if (this.orderId) {
 					parmas.mainOrderId = this.orderId
 				}
@@ -200,11 +206,11 @@ export default {
 					parmas.conversationRecordId = this.conversationRecordId
 				}
 
-				await setRead(parmas); //设置已读
+				
 
 				const res = await apiFun(parmas);
 				console.log("TCL: getOrder -> res", res)
-
+				await setRead({...parmas,conversationRecordId: res.data.conversationRecordId}); //设置已读
 				if (res.code === 200) {
 					const data = res.data.vos;
 					// 获取待滚动元素选择器,解决插入数据后,滚动条定位时使用。取当前消息数据的第一条信息元素