|
@@ -45,7 +45,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { wxUploadFile, wxMakePhoneCall } from '@/utils/wxRequest.js'
|
|
import { wxUploadFile, wxMakePhoneCall } from '@/utils/wxRequest.js'
|
|
-import { sendMsg, getOrderConversationInfo, getListConversationInfo, setRead } from '@/api/conversation.js';
|
|
|
|
|
|
+import { sendMsg, getOrderConversationInfo, getListConversationInfo, setRead,getHistoryMsg } from '@/api/conversation.js';
|
|
import { onMounted } from "vue";
|
|
import { onMounted } from "vue";
|
|
import store from "@/store"
|
|
import store from "@/store"
|
|
export default {
|
|
export default {
|
|
@@ -131,9 +131,25 @@ export default {
|
|
console.log("TCL: 下拉刷新 -> e", e)
|
|
console.log("TCL: 下拉刷新 -> e", e)
|
|
this.scrollView.refresherTriggered = true;
|
|
this.scrollView.refresherTriggered = true;
|
|
// this.getMessage();
|
|
// this.getMessage();
|
|
- setTimeout(()=>{
|
|
|
|
- this.scrollView.refresherTriggered = false;
|
|
|
|
- },500)
|
|
|
|
|
|
+ const conversationMsgRecordId = this.talkList[this.talkList.length-1].conversationMsgRecordId;
|
|
|
|
+ console.log("TCL: refresherrefresh -> conversationMsgRecordId", conversationMsgRecordId,this.talkList[this.talkList.length-1])
|
|
|
|
+ const msgSendTime = this.talkList[this.talkList.length-1].msgSendTime
|
|
|
|
+ getHistoryMsg({conversationMsgRecordId,conversationRecordId:this.conversationRecordId}).then(res => {
|
|
|
|
+ console.log("TCL: refresherrefresh -> res", res)
|
|
|
|
+ if(res.code === 200){
|
|
|
|
+ if(res.data.length === 0) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '没有更多消息了',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ this.scrollView.refresherTriggered = false;
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.talkList = [...this.talkList,...res.data];
|
|
|
|
+ this.scrollView.refresherTriggered = false;
|
|
|
|
+ this.scrollView.intoView = `msg-${msgSendTime}`;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
listsMessage(){
|
|
listsMessage(){
|
|
console.log('-----listsMessage---->', this.storeUser,this.storeUser.wsManager);
|
|
console.log('-----listsMessage---->', this.storeUser,this.storeUser.wsManager);
|
|
@@ -190,7 +206,7 @@ export default {
|
|
// title: userType === 1? res.data. : // 根据业务逻辑调整
|
|
// title: userType === 1? res.data. : // 根据业务逻辑调整
|
|
// });
|
|
// });
|
|
// 将获取到的消息数据合并到消息数组中
|
|
// 将获取到的消息数据合并到消息数组中
|
|
- this.talkList = [...this.talkList, ...data];
|
|
|
|
|
|
+ this.talkList = data;
|
|
console.log("TCL: getOrder -> talkList", this.talkList)
|
|
console.log("TCL: getOrder -> talkList", this.talkList)
|
|
this.orderInfo = res.data;
|
|
this.orderInfo = res.data;
|
|
|
|
|