Эх сурвалжийг харах

fix: 1.群聊的清空聊天记录 的提示

suwenjiang 1 сар өмнө
parent
commit
b6708a1a0a

+ 0 - 2
src/components/Chat/Image.vue

@@ -52,8 +52,6 @@ function doTouchstart() {
 }
 
 function select(action, index) {
-  console.log(action, index)
-
   if (action.text == '复制') {
     copy(itemData.text)
     showToast('已复制')

+ 0 - 2
src/components/Chat/Search.vue

@@ -36,8 +36,6 @@ defineProps({
 const emit = defineEmits(['search'])
 
 function handleKeyDown(event) {
-  console.log(!isThrottled.value)
-
   if (event.key === 'Enter' && !isThrottled.value) {
     emit('search')
 

+ 0 - 2
src/components/Chat/Text.vue

@@ -50,8 +50,6 @@ function doTouchstart() {
 }
 
 function select(action, index) {
-  console.log(action, index)
-
   if (action.text == '复制') {
     copy(itemData.text)
     showToast('已复制')

+ 1 - 6
src/components/Profile/News/ChatInput.vue

@@ -189,7 +189,6 @@ const uploadPictures = () => {
 
 onChange(async (files) => {
   if (!files.length) return
-  console.log(files[0])
   const formData = new FormData()
   formData.append('uploadFile', files[0])
   formData.append('asImage', true)
@@ -225,16 +224,12 @@ onChange(async (files) => {
       // })
       closeToast()
       showToast('图片上传失败')
-
-      console.log('图片上传失败')
     }
   }
 })
 
 // 分享群聊
-const shareGroupChat = () => {
-  console.log('分享群聊')
-}
+const shareGroupChat = () => {}
 
 // 按住说话 松开结束
 const changeShowVoiceing = () => {}

+ 3 - 12
src/pages/chat/components/chat-input/index.vue

@@ -99,7 +99,7 @@ const handleOperate = (operate) => {
         open()
         break
       case 'shareGroupChat':
-        console.log('分享群聊')
+        // console.log('分享群聊')
         showToast('研发中,敬请期待~')
         break
     }
@@ -109,7 +109,7 @@ const handleOperate = (operate) => {
 uploadImage(async (files) => {
   if (!files.length) return
 
-  console.log(files[0], 'files[0]files[0]')
+  // console.log(files[0], 'files[0]files[0]')
   const { type, size } = files[0]
   if (!['image/jpeg', 'image/png', 'image/gif'].includes(type)) {
     showToast('请上传图片')
@@ -119,15 +119,6 @@ uploadImage(async (files) => {
     showToast('图片大小不能超过20MB')
     return
   }
-  /*  const formData = new FormData()
-    formData.append('uploadFile', files[0])
-    formData.append('asImage', true)
-    formData.append('fieldName', 'messageContent')
-    const {data} = await request('/website/tourMessage/upload', {
-      method: 'post',
-      body: formData
-    })*/
-  // closeToast()
   emit('send', {
     type: 'image',
     messageContent: files[0]
@@ -182,7 +173,7 @@ const getInputPosition = () => {
     if (!el) return inputValue.value.length - 1
     return el.selectionStart
   } catch (e) {
-    console.log(e, '??')
+    // console.log(e, '??')
   }
 }
 

+ 1 - 1
src/pages/chat/examine.vue

@@ -113,7 +113,7 @@ const toggle = (id) => {
   } else {
     checkedId.value.push(id)
   }
-  console.log(checkedId.value, 'checkedId.value')
+
   checkboxRefs.value[id].toggle()
 }
 

+ 4 - 5
src/pages/chat/group-chat.vue

@@ -189,7 +189,6 @@ const getLastMessageId = () => {
 // 发送文本消息
 const sendTextMessage = async (text) => {
   try {
-    console.log(text, 'sendTextMessage')
     if (!text) return
     let msg = {
       groupId: groupId.value,
@@ -211,9 +210,9 @@ const sendTextMessage = async (text) => {
     currConversationChatList.value.push(msg)
     await scrollToBottom()
     const res = await chatsStore.sendSocketMessage(msg)
-    console.log('luck:', res)
+    // console.log('luck:', res)
   } catch (e) {
-    console.log(e, '2')
+    // console.log(e, '2')
   } finally {
   }
 }
@@ -287,7 +286,7 @@ const scrollToBottom = async () => {
       const scrollContainer = listElement
 
       scrollContainer.scrollTop = scrollContainer.scrollHeight
-      console.log(scrollContainer.scrollTop, '6666')
+      // console.log(scrollContainer.scrollTop, '6666')
     }
   }, 200)
 }
@@ -334,7 +333,7 @@ onMounted(() => {
   initGroupId()
   try {
     XYWebSocket.SocketEventsBus.on('chat-event', async (chat) => {
-      console.log('订阅群聊消息', chat)
+      // console.log('订阅群聊消息', chat)
       const isCurrGroupId = chat.groupId && chat.groupId === groupId.value
       const isOtherUserMessage = chat.sendUserId && chatsStore.isRealMessage(chat.sendUserId)
       if (isCurrGroupId) {

+ 1 - 8
src/pages/chat/group-member.vue

@@ -142,20 +142,13 @@ const search = () => {
 }
 
 const toggle = (item) => {
-  // let index2 = checked.value.findIndex((el) => el?.id == item.id)
   let index = checkedList.value.findIndex((el) => el?.userId == item?.userId)
-
-  // if (index2 != -1) {
-  //   checkedId.value.splice(index2, 1)
-  // } else {
-  //   checkedId.value.push(id)
-  // }
   if (index != -1) {
     checkedList.value.splice(index, 1)
   } else {
     checkedList.value.push(item)
   }
-  console.log(checked.value, 'checkedId.value')
+
   checkboxRefs.value[item.userId].toggle()
 }
 

+ 0 - 2
src/pages/chat/group-square.vue

@@ -144,8 +144,6 @@ const queryParams = reactive({
 // 获取切换的数据
 const onClickTab = ({ title }) => {
   queryParams.groupTypeId = squareTabList.value.find((item) => item.typeName == title).id
-
-  console.log(queryParams.groupTypeId, ' queryParams.groupTypeId')
 }
 
 // 加入群聊

+ 0 - 2
src/pages/chat/set-single.vue

@@ -215,8 +215,6 @@ const changeGroupName = async (body) => {
 
 // 查找聊天记录
 const findChatHistory = () => {
-  console.log(itemData.value?.groupId, '555')
-
   navigateTo({
     path: '/chat/set-sub',
     query: {

+ 3 - 3
src/pages/chat/single-chat.vue

@@ -186,7 +186,7 @@ const sendTextMessage = async (text) => {
     await scrollToBottom()
     await chatsStore.sendSocketMessage(msg)
   } catch (e) {
-    console.log(e, '2')
+    // console.log(e, '2')
   } finally {
   }
 }
@@ -292,7 +292,7 @@ const loadMore = async () => {
       await getChatList('init')
     }
   } catch (e) {
-    console.log(e, 'error')
+    // console.log(e, 'error')
   } finally {
     moreLoading.value = false
   }
@@ -317,7 +317,7 @@ function getLocalId() {
 onMounted(() => {
   initGroupId()
   XYWebSocket.SocketEventsBus.on('chat-event', async (chat) => {
-    console.log('单聊页面消息订阅', chat)
+    // console.log('单聊页面消息订阅', chat)
     const isCurrGroupId = chat.groupId && chat.groupId === groupId.value
     const isOtherUserMessage = chat.sendUserId && chatsStore.isRealMessage(chat.sendUserId)
     if (isCurrGroupId) {

+ 1 - 4
src/pages/chat/sweep.vue

@@ -106,11 +106,8 @@ const handleQrcode = () => {
 
               scanQRCode()
             } else {
-              // show.value = false
             }
             stopScan()
-            // scanQRCode()
-            console.log(results.value)
           }
           // (errorMessage) => {
           //   // 错误回调
@@ -129,7 +126,7 @@ const stopScan = () => {
   state.html5QrCode
     .stop()
     .then((a) => {
-      console.log('已停止扫码', a)
+      // console.log('已停止扫码', a)
     })
     .catch((err) => {
       console.log(err)

+ 89 - 69
src/pages/house/index.vue

@@ -1,66 +1,87 @@
 <template>
-    <div class="bg-[#F8F8F8] pt-15" style="min-height: calc(100vh - 70px);">
-        
-        <div class="sticky top-50 z-50 flex items-center justify-between text-[12px] px-[15px]">
-            <NuxtLink to="/house/newHouse" class="w-[80px] h-[42px] flex items-center justify-center bg-[#fff] rounded">
-                <img class="w-[30px] h-[30px]" :src="newHouseIcon" alt="">
-                <span class="text-[#707070] font-bold ">新房</span>
-            </NuxtLink>
-            <NuxtLink to="/house/oldHouse" class="w-[80px] h-[42px] flex items-center justify-center bg-[#fff] rounded">
-                <img class="w-[30px] h-[30px]" :src="oldHouseIcon" alt="">
-                <span class="text-[#707070] font-bold ">二手房</span>
-            </NuxtLink>
-            <div @click="showModal=true" class="w-[80px] h-[42px] flex items-center justify-center bg-[#fff] rounded">
-                <img class="w-[30px] h-[30px]" :src="saleHouseIcon" alt="">
-                <span class="text-[#707070] font-bold ">卖房</span>
-            </div>
-            <NuxtLink to="/house/rentHouse" class="w-[80px] h-[42px] flex items-center justify-center bg-[#fff] rounded">
-                <img class="w-[30px] h-[30px]" :src="rentHouseIcon" alt="">
-                <span class="text-[#707070] font-bold ">租房</span>
-            </NuxtLink>
+  <div class="bg-[#F8F8F8] pt-15" style="min-height: calc(100vh - 70px)">
+    <div class="sticky top-50 z-50 flex items-center justify-between text-[12px] px-[15px]">
+      <NuxtLink
+        to="/house/newHouse"
+        class="w-[80px] h-[42px] flex items-center justify-center bg-[#fff] rounded"
+      >
+        <img class="w-[30px] h-[30px]" :src="newHouseIcon" alt="" />
+        <span class="text-[#707070] font-bold">新房</span>
+      </NuxtLink>
+      <NuxtLink
+        to="/house/oldHouse"
+        class="w-[80px] h-[42px] flex items-center justify-center bg-[#fff] rounded"
+      >
+        <img class="w-[30px] h-[30px]" :src="oldHouseIcon" alt="" />
+        <span class="text-[#707070] font-bold">二手房</span>
+      </NuxtLink>
+      <div
+        @click="showModal = true"
+        class="w-[80px] h-[42px] flex items-center justify-center bg-[#fff] rounded"
+      >
+        <img class="w-[30px] h-[30px]" :src="saleHouseIcon" alt="" />
+        <span class="text-[#707070] font-bold">卖房</span>
+      </div>
+      <NuxtLink
+        to="/house/rentHouse"
+        class="w-[80px] h-[42px] flex items-center justify-center bg-[#fff] rounded"
+      >
+        <img class="w-[30px] h-[30px]" :src="rentHouseIcon" alt="" />
+        <span class="text-[#707070] font-bold">租房</span>
+      </NuxtLink>
+    </div>
+    <div class="text-[#292929] p-15 text-[16px]">新开楼盘</div>
+    <div class="px-15 flex flex-wrap justify-between justify-bewtween">
+      <NuxtLink
+        :to="`/house/newHouse/${item.id}`"
+        v-for="item in dataList"
+        :key="item.id"
+        class="w-[48%] mb-15"
+      >
+        <div class="w-full aspect-[1/1] rounded overflow-hidden bg-[#f5f5f5]">
+          <img :src="item.coverUrl" class="w-full h-full object-cover" alt="" />
         </div>
-        <div class="text-[#292929] p-15 text-[16px]">
-            新开楼盘
+        <div class="w-full truncate text-[#444] font-bold text-[14px] mt-[12px]">
+          {{ item.houseTitle }}
         </div>
-        <div class="px-15 flex flex-wrap justify-between justify-bewtween">
-            <NuxtLink :to="`/house/newHouse/${item.id}`" v-for="item in dataList" :key="item.id" class="w-[48%] mb-15">
-                <div class="w-full aspect-[1/1] rounded overflow-hidden bg-[#f5f5f5]">
-                    <img :src="item.coverUrl" class="w-full h-full object-cover" alt="" />
-                </div>
-                <div class="w-full truncate text-[#444] font-bold text-[14px] mt-[12px]">
-                    {{ item.houseTitle }}
-                </div>
-                <div class="flex items-center font-bold">
-                    <span class="text-[#FF1A1A] text-[14px]">{{item.currency}}{{ item.averagePrice }}</span>
-                    <span class="text-[#666] text-[12px]">/m²</span>
-                </div>
-            </NuxtLink>
+        <div class="flex items-center font-bold">
+          <span class="text-[#FF1A1A] text-[14px]">{{ item.currency }}{{ item.averagePrice }}</span>
+          <span class="text-[#666] text-[12px]">/m²</span>
         </div>
-        <div v-if="showModal"  class="fixed top-0 left-0 w-full h-full flex items-center justify-center " style="background:rgba(0,0,0,0.5);z-index:1000">
-            <div class="animation-in">
-                <div class="w-[246px] h-[246px] rounded-[10px] flex flex-col items-center justify-center" :style="{background:`url(${modalBgIcon})`,backgroundSize:'100% 100%'}">
-                    <div class="w-[157px] h-[157px] bg-[#fff]">
-
-                    </div>
-                    <div class="text-[#242424] text-[12px] font-bold mt-15">
-                        扫码联系我们专业卖房顾问!!!
-                    </div>
-                </div>
-                <div class="w-[50px] h-[50px] rounded-full overflow-hidden flex items-center justify-center" style="background:rgba(0,0,0,0.6);margin:0 auto;margin-top:30px;">
-                    <van-icon @click="showModal=false" name="cross" color="#fff" size="30" />
-                </div>
-            </div>
+      </NuxtLink>
+    </div>
+    <div
+      v-if="showModal"
+      class="fixed top-0 left-0 w-full h-full flex items-center justify-center"
+      style="background: rgba(0, 0, 0, 0.5); z-index: 1000"
+    >
+      <div class="animation-in">
+        <div
+          class="w-[246px] h-[246px] rounded-[10px] flex flex-col items-center justify-center"
+          :style="{ background: `url(${modalBgIcon})`, backgroundSize: '100% 100%' }"
+        >
+          <div class="w-[157px] h-[157px] bg-[#fff]"></div>
+          <div class="text-[#242424] text-[12px] font-bold mt-15">
+            扫码联系我们专业卖房顾问!!!
+          </div>
         </div>
+        <div
+          class="w-[50px] h-[50px] rounded-full overflow-hidden flex items-center justify-center"
+          style="background: rgba(0, 0, 0, 0.6); margin: 0 auto; margin-top: 30px"
+        >
+          <van-icon @click="showModal = false" name="cross" color="#fff" size="30" />
+        </div>
+      </div>
     </div>
+  </div>
 </template>
 
 <script setup>
-import newHouseIcon from '~/assets/img/house/newHouse.png';
-import oldHouseIcon from '~/assets/img/house/oldHouse.png';
-import saleHouseIcon from '~/assets/img/house/saleHouse.png';
-import rentHouseIcon from '~/assets/img/house/rentHouse.png';
-import modalBgIcon from '~/assets/img/house/modalBg.png';
-
+import newHouseIcon from '~/assets/img/house/newHouse.png'
+import oldHouseIcon from '~/assets/img/house/oldHouse.png'
+import saleHouseIcon from '~/assets/img/house/saleHouse.png'
+import rentHouseIcon from '~/assets/img/house/rentHouse.png'
+import modalBgIcon from '~/assets/img/house/modalBg.png'
 
 const { data: dataList, status } = useMyFetch(`/website/house/sale/viewNewHouseList`)
 
@@ -69,25 +90,24 @@ const pageNum = ref(1)
 const pageSize = ref(10)
 const params = ref('')
 
-async function getList(){
-    const p= `?pageNum=${pageNum.value}&pageSize=${pageSize.value}${params.value}`
-    
+async function getList() {
+  const p = `?pageNum=${pageNum.value}&pageSize=${pageSize.value}${params.value}`
 }
-function filterChange(param){
-    console.log('filter change:',param)
+function filterChange(param) {
+  console.log('filter change:', param)
 }
 </script>
 
 <style scoped>
-.animation-in{
-    animation: show .5s ease-in-out;
+.animation-in {
+  animation: show 0.5s ease-in-out;
 }
-@keyframes show{
-    0%{
-        transform: scale(0.5);
-    }
-    100%{
-        transform: scale(1);
-    }
+@keyframes show {
+  0% {
+    transform: scale(0.5);
+  }
+  100% {
+    transform: scale(1);
+  }
 }
-</style>
+</style>

+ 1 - 1
src/pages/profile/system-message/index.vue

@@ -122,7 +122,7 @@ function messageShowName(messageContent) {
       return ''
     }
   } catch (error) {
-    console.log(error)
+    // console.log(error)
   }
 }
 

+ 18 - 21
src/pages/test/index.vue

@@ -8,14 +8,15 @@
 
     <div class="flex mt-auto py-20 flex-col bg-[#999]">
       <van-uploader
-          :preview-image="false"
-          :after-read="upLoadImg"
-          accept="image/*"
-          :multiple="false"
-          :max-count="1"
-      ><img src="~/assets/img/scan/pic.png" height="32" width="32" alt=""/>
+        :preview-image="false"
+        :after-read="upLoadImg"
+        accept="image/*"
+        :multiple="false"
+        :max-count="1"
+      >
+        <img src="~/assets/img/scan/pic.png" height="32" width="32" alt="" />
       </van-uploader>
-<!--      <template v-if="inRecording">
+      <!--      <template v-if="inRecording">
         <div class="flex flex-row px-20 justify-around">
           <van-button @click="cancelRecording">取消</van-button>
           <van-button @click="handleStopRecording" type="warning">完成并发送</van-button>
@@ -33,7 +34,7 @@
 </template>
 <script setup>
 import ChatMessage from '../chat/components/chat-message'
-import {useRecording} from "~/pages/test/useRecording";
+import { useRecording } from '~/pages/test/useRecording'
 // import VConsole from 'vconsole';
 // new VConsole({ theme: 'dark' });
 
@@ -55,12 +56,14 @@ let messageList = ref([
   },
   {
     type: 'text',
-    messageContent: '发送文字消息发送文字消息发送文字消息发送文字消息发送文字消息发送文字消息发送文字消息',
+    messageContent:
+      '发送文字消息发送文字消息发送文字消息发送文字消息发送文字消息发送文字消息发送文字消息',
     viewType: 0
   },
   {
     type: 'text',
-    messageContent: '发送文字消息发送文字消息发送文字消息发送文字消息发送文字消息发送文字消息发送文字消息',
+    messageContent:
+      '发送文字消息发送文字消息发送文字消息发送文字消息发送文字消息发送文字消息发送文字消息',
     viewType: 1
   },
   {
@@ -80,22 +83,20 @@ let messageList = ref([
   }
 ])
 
-const {inRecording, startRecording, stopRecording, cancelRecording} = useRecording()
+const { inRecording, startRecording, stopRecording, cancelRecording } = useRecording()
 const handleTouchstart = async () => {
   try {
     await startRecording()
   } catch (e) {
-
   } finally {
-
   }
 }
 
 const handleStopRecording = async () => {
   try {
-    const {success, errorMessage, audio} = await stopRecording()
+    const { success, errorMessage, audio } = await stopRecording()
     if (!success) {
-      showToast(errorMessage);
+      showToast(errorMessage)
       return
     }
     console.log(audio, '---audio---')
@@ -108,11 +109,9 @@ const handleStopRecording = async () => {
       body: formData
     })
     console.log(res, 'resresres')
-
   } catch (e) {
     console.log(e, 'handleStopRecording')
   } finally {
-
   }
 }
 
@@ -124,9 +123,7 @@ const upLoadImg = async (e, b) => {
       messageContent: e.file,
       viewType: 0
     })
-  } catch (e) {
-
-  }
+  } catch (e) {}
 }
 onMounted(() => {
   /*  document.addEventListener('contextmenu', function(e) {
@@ -145,4 +142,4 @@ onMounted(() => {
   padding: 20px;
   box-sizing: border-box;
 }
-</style>
+</style>

+ 2 - 2
src/stores/chat.js

@@ -40,8 +40,8 @@ export const useChatStore = defineStore('chat', () => {
         reqChatList()
         try {
           const messageBody = JSON.parse(e.data)
-          console.log('messageBody:', messageBody)
-          console.log('curConversiton:', curConversiton)
+          // console.log('messageBody:', messageBody)
+          // console.log('curConversiton:', curConversiton)
           // 判断该条消息是否属于当前会话
           if (messageBody.groupId == curConversiton.value.groupId) {
             let isReceive = true // 判断该条消息是收到的还是发出的