浏览代码

回话消息

chenjj 3 天之前
父节点
当前提交
37336dc088
共有 6 个文件被更改,包括 49 次插入51 次删除
  1. 2 2
      pages/chat.vue
  2. 1 1
      pages/classify.vue
  3. 1 1
      pages/common/orderList/userItem.vue
  4. 17 25
      pages/index.vue
  5. 20 20
      pages/mine/index.vue
  6. 8 2
      pages_orderuser/pages/talk/pages/index/index.vue

+ 2 - 2
pages/chat.vue

@@ -129,7 +129,7 @@ const goSys =()=>{
 
 const onKf = () => {
     uni.navigateTo({
-                url: `/pages_orderuser/pages/talk/pages/index/index?customerService=true`
+                url: `/pages_orderuser/pages/talk/pages/index/index?customerService=true&conversationType=3`
     })
 }
 
@@ -164,7 +164,7 @@ const handlerData = (dates) => {
 
 const onClick = (record) => {
     uni.navigateTo({
-        url: `/pages_orderuser/pages/talk/pages/index/index?conversationRecordId=${record.conversationRecordId}`
+        url: `/pages_orderuser/pages/talk/pages/index/index?conversationRecordId=${record.conversationRecordId}&conversationType=${record.conversationType}`
     });
 }
 const scrolltolower = () => {

+ 1 - 1
pages/classify.vue

@@ -177,7 +177,7 @@ function btnClick(row, type) {
 
   //前往沟通
   uni.navigateTo({
-    url: `/pages_orderuser/pages/talk/pages/index/index?orderId=${row.mainOrderId}`
+    url: `/pages_orderuser/pages/talk/pages/index/index?orderId=${row.mainOrderId}&conversationType=2`
   });
 }
 provide('onClick', btnClick)

+ 1 - 1
pages/common/orderList/userItem.vue

@@ -65,7 +65,7 @@ const btns = [
     onClick: (e) => {
       console.log("TCL: e", e)
       uni.navigateTo({
-        url: `/pages_orderuser/pages/talk/pages/index/index?orderId=${e.mainOrderId}`
+        url: `/pages_orderuser/pages/talk/pages/index/index?orderId=${e.mainOrderId}&conversationType=2`
       });
     },
     type: 'primary'

+ 17 - 25
pages/index.vue

@@ -81,7 +81,6 @@ const data = reactive({
   address: store.state.user.addressInfo,
   queryValue: '',
 })
-console.log('--------index--------',data.address);
 
 // 分页
 const pages = ref({
@@ -98,11 +97,11 @@ const cityClick = async () => {
     { latitude, longitude },
     addresstree.value
   )
-  console.log('TCL: cityClick -> address', address)
   data.address = { ...data.address, ...address }
-  store.dispatch('handlerAddress',data.address)
-  settingAddress();
-  console.log('address', address)
+  console.log("TCL: settingAddress1 -> data", data)
+  store.dispatch('handlerAddress', data.address)
+  const token = getToken();
+  token ? settingAddress():getList();
 }
 
 const loadmoreInfo = ref({
@@ -153,17 +152,13 @@ const getList = async () => {
       latitude,
       longitude,
     }
-    console.log('volunteerinfolist ==>',params);
-    
+
     const res = await volunteerinfolist(params)
 
     if (!res || !res.rows) {
       return
     }
-    console.log(
-      '判断是否已经到了最后一页',
-      pages.value.current >= Math.ceil(res.total / pages.value.pageSize)
-    )
+
 
     // 如果是第一页,先清空
     if (pages.value.current === 1) {
@@ -175,7 +170,6 @@ const getList = async () => {
     res.rows.forEach((item, index) => {
       index % 2 !== 0 ? rightList.value.push(item) : leftList.value.push(item)
     })
-    console.log('home', leftList.value, rightList.value);
 
     pages.value.total = res.total
     if (pages.value.current >= Math.ceil(res.total / pages.value.pageSize)) {
@@ -229,9 +223,9 @@ const getBanners = async () => {
 
 const settingAddress = async () => {
   try {
-    console.log('data', data)
 
     const { address } = data
+
     const { cityCode, latitude, longitude } = address
     const parmas = {
       provinceName: cityCode.data[0], // 省
@@ -247,7 +241,6 @@ const settingAddress = async () => {
       latitude,
       longitude,
     }
-    console.log("TCL: settingAddress -> parmas", parmas);
     const res = await settingHomeAddress(parmas)
     leftList.value = [];
     rightList.value = [];
@@ -271,8 +264,7 @@ onShow(() => {
       globalData.value = { statusBarHeight, navBarHeight }
     },
   })
-  console.log('=========>!userType',!userType);
-  
+
 })
 
 const addresstree = ref([])
@@ -288,14 +280,15 @@ onPageScroll(e => {
 onMounted(async () => {
   getNotice()
   const token = getToken();
-  // console.log("TCL: token", token || 'null')
+
+  const res_dara = await regionAddresstree()
+  addresstree.value = res_dara.data
+
   if (token) {
-    const res_dara = await regionAddresstree()
-    addresstree.value = res_dara.data
     locateTheCurrentAddress(res_dara.data)
       .then((res) => {
-        console.log('locateTheCurrentAddress', res)
         data.address = res
+        console.log("TCL: settingAddress0 -> data", data)
         settingAddress()
       })
       .catch((error) => {
@@ -303,8 +296,6 @@ onMounted(async () => {
         getList()
       })
   } else {
-    
-    
     getList();
   }
 })
@@ -375,7 +366,8 @@ onUnload(() => { })
   height: 180rpx;
   border-radius: 16rpx;
   background: linear-gradient(180deg, #FEF9ED 0%, #FFF9F3 100%);
-  .notice-bar{
+
+  .notice-bar {
     margin-top: 10rpx;
   }
 }
@@ -386,14 +378,14 @@ onUnload(() => { })
   margin-left: 11rpx;
   margin-right: 17rpx;
   margin-bottom: 120rpx;
-  
+
   &.no-margin {
     margin-top: 0;
   }
 }
 
 // 轮播图下的圆角样式
-.home-Wrapper{
+.home-Wrapper {
   position: absolute;
   top: 542rpx;
   width: 100%;

+ 20 - 20
pages/mine/index.vue

@@ -205,7 +205,7 @@ const adminList = [
         text: '',
         operate: () => {
             uni.navigateTo({
-                url: `/pages_orderuser/pages/talk/pages/index/index?customerService=true`
+                url: `/pages_orderuser/pages/talk/pages/index/index?customerService=true&conversationType=3`
             })
         },
     },
@@ -217,15 +217,15 @@ const adminList = [
         switchPage: '/pages/classify',
         value: 3,
     },
-    {
-        name: '修改个人信息',
-        img: '/static/serverImg/mine/xg.png',
-        key: 'map',
-        text: '去认证资质',
-        operate: () => {
-            handLsetTing();
-        },
-    },
+    // {
+    //     name: '修改个人信息',
+    //     img: '/static/serverImg/mine/xg.png',
+    //     key: 'map',
+    //     text: '去认证资质',
+    //     operate: () => {
+    //         handLsetTing();
+    //     },
+    // },
     {
         name: '成为用户',
         img: '/static/serverImg/mine/sf.png',
@@ -252,7 +252,7 @@ const userList = [
         text: '',
         operate: () => {
             uni.navigateTo({
-                url: `/pages_orderuser/pages/talk/pages/index/index?customerService=true`
+                url: `/pages_orderuser/pages/talk/pages/index/index?customerService=true&conversationType=3`
             })
         },
     },
@@ -265,15 +265,15 @@ const userList = [
             show.value = true
         },
     },
-    {
-        name: '修改个人信息',
-        img: '/static/serverImg/mine/xg.png',
-        key: 'map',
-        text: '去实名认证',
-        operate: () => {
-            handLsetTing();
-        },
-    },
+    // {
+    //     name: '修改个人信息',
+    //     img: '/static/serverImg/mine/xg.png',
+    //     key: 'map',
+    //     text: '去实名认证',
+    //     operate: () => {
+    //         handLsetTing();
+    //     },
+    // },
     {
         name: '成为志愿者',
         img: '/static/serverImg/mine/sf.png',

+ 8 - 2
pages_orderuser/pages/talk/pages/index/index.vue

@@ -82,7 +82,8 @@ export default {
 			conversationRecordId: null,//会话id
 			storeUser: store.state.user,
 			store: store,
-			isKg:false
+			isKg:false,
+			conversationType:'2'
 		}
 	},
 	computed: {
@@ -99,6 +100,7 @@ export default {
 	},
 	onLoad(options) {
 		console.log("TCL: onLoad -> options", options)
+		this.conversationType = options.conversationType;
 		if (options.orderId) {
 			this.orderId = options.orderId;
 
@@ -106,6 +108,7 @@ export default {
 		if (options.conversationRecordId) {
 			this.conversationRecordId = options.conversationRecordId;
 		}
+	
 		//1用户2志愿者3后台
 		this.system = this.userType === 1 ? '1' : '2';
 		//客服
@@ -270,11 +273,14 @@ export default {
 				senderId: this.userId,
 				msgType: contentType == 'text' ? '1' : '2',//消息类型 1文字消息 2图片消息
 			}
+			console.log('发送消息',this.conversationType);
+			
 			const res = await sendMsg({
 				...this.orderInfo,
 				msgContent: content,
 				system: this.system,
-				msgType: data.msgType
+				msgType: data.msgType,
+				conversationType: this.conversationType
 			});
 			this.talkList.unshift({ ...data, code: res.code });
 			this.scrollView.intoView = `msg-${data.msgSendTime}`;