潘超林 1 giorno fa
parent
commit
6c3a918de6

+ 3 - 0
TUIKit-House/components/TUIChat/index.vue

@@ -133,9 +133,12 @@ onMounted(() => {
     currentConversation: onCurrentConversationUpdate,
   });
   initData();
+  
 });
 
+
 const initData = () => {
+ 
   let data = {
     shopUserId: getParamValue("shopUserId"),
     userId: getParamValue("recruitUserId") || getParamValue("userId"),

+ 12 - 1
TUIKit-House/components/TUIChat/message-input-toolbar/house/index.vue

@@ -24,10 +24,21 @@ interface IProps {
   infoData: Object;
 }
 const props = withDefaults(defineProps<IProps>(), {});
+function getParamValue(paramName) {
+  const regExp = new RegExp("[?&]" + paramName + "=([^&#]*)");
+  const results = regExp.exec(window.location.href);
+  if (results) {
+    return decodeURIComponent(results[1]);
+  } else {
+    return null;
+  }
+}
 
 const onIconClick = () => {
   webUni.webView.navigateTo({
-    url: "/packageHouse/home/house/my-house?userId=" + props.infoData.shopUserId,
+    url:
+      "/packageHouse/home/house/my-house?userId=" +
+      getParamValue("recruitUserId"),
   });
 };
 </script>

+ 16 - 7
TUIKit-House/components/TUIChat/message-list/index.vue

@@ -30,7 +30,10 @@
             <!-- 对方为用户显示预约看房按钮 -->
             <div
               @tap="sendMsgHandle('预约看房')"
-              v-if="(!infoData.flag && (userType === 0 || loginType == 1)) || (infoData.flag  && infoData.isShowSeeHouseBtn == 'true')"
+              v-if="
+                (!infoData.flag && (userType === 0 || loginType == 1)) ||
+                (infoData.flag && infoData.isShowSeeHouseBtn == 'true')
+              "
             >
               <!-- 电话沟通按钮状态根据是否聊过天判断 -->
               <template v-if="messageList && messageList.length > 0">
@@ -343,7 +346,7 @@ import { isPC, isH5, isMobile } from "../../../utils/env";
 import { IAudioContext } from "../../../interface";
 import config from "@/request/config";
 import value from "../../../../uni_modules/uview-ui/components/u-text/value";
-
+import { onLoad } from "@dcloudio/uni-app"; // 该方法只能用在父组件内,子组件内不生效
 interface IEmits {
   (e: "closeInputToolBar"): void;
   (e: "handleEditor", message: IMessageModel, type: string): void;
@@ -392,7 +395,6 @@ const scrollButtonInstanceRef = ref<InstanceType<typeof ScrollButton>>();
 const historyFirstMessageID = ref<string>("");
 let selfAddValue = 0;
 const userType = Number(uni.getStorageSync("userType"));
-console.log("userType:" + userType)
 
 // audio control
 const broadcastNewAudioSrc = ref<string>("");
@@ -415,7 +417,6 @@ const scrollToBottom = () => {
     clearTimeout(timer);
   }, 300);
 };
-
 // 监听回调函数
 const onCurrentConversationIDUpdated = (conversationID: string) => {
   currentConversationID.value = conversationID;
@@ -431,7 +432,7 @@ const ShowDialogClose = () => {
   showDialog.value = false;
 };
 const loginType = ref(uni.getStorageSync("loginType"));
-console.log("loginType:" + loginType)
+console.log("loginType:" + loginType);
 onMounted(() => {
   // 消息列表监听
   TUIStore.watch(StoreName.CHAT, {
@@ -471,6 +472,15 @@ const handelScrollListScroll = throttle(
   500,
   { leading: true }
 );
+function getParamValue(paramName) {
+  const regExp = new RegExp("[?&]" + paramName + "=([^&#]*)");
+  const results = regExp.exec(window.location.href);
+  if (results) {
+    return decodeURIComponent(results[1]);
+  } else {
+    return null;
+  }
+}
 
 // 各种消息处理
 const sendMsgHandle = (title) => {
@@ -490,7 +500,7 @@ const sendMsgHandle = (title) => {
     webUni.webView.navigateTo({
       url:
         "/packageHouse/user/house-manage/subscribe-house?inviteeId=" +
-        props.infoData.shopUserId,
+        getParamValue("recruitUserId"),
     });
   }
 };
@@ -528,7 +538,6 @@ function getGlobalAudioContext(
 
 async function onMessageListUpdated(list: IMessageModel[]) {
   observer?.disconnect();
-  console.log(1111123123213);
   messageList.value = list
     .filter((message) => !message.isDeleted)
     .map((message) => {