Browse Source

fix: 同时上传文件失败的bug

master
xsx 5 months ago
parent
commit
0457e706ee
  1. 13
      im-uniapp/pages/chat/chat-box.vue
  2. 13
      im-web/src/components/chat/ChatBox.vue

13
im-uniapp/pages/chat/chat-box.vue

@ -152,7 +152,8 @@ export default {
isInBottom: true, //
newMessageSize: 0, //
scrollTop: 0, // ios h5
scrollViewHeight: 0 //
scrollViewHeight: 0, //
maxTmpId: 0 // id
}
},
methods: {
@ -983,7 +984,13 @@ export default {
},
generateId() {
// id
return String(new Date().getTime()) + String(Math.floor(Math.random() * 1000));
const id = String(new Date().getTime()) + String(Math.floor(Math.random() * 1000));
// id
if (this.maxTmpId > id) {
return this.generateId();
}
this.maxTmpId = id;
return id;
}
},
computed: {
@ -1108,6 +1115,8 @@ export default {
//
this.isInBottom = true;
this.newMessageSize = 0;
// id
this.maxTmpId = 0;
//
this.listenKeyBoard();
//

13
im-web/src/components/chat/ChatBox.vue

@ -132,7 +132,8 @@ export default {
reqQueue: [], //
isSending: false, //
isInBottom: false, //
newMessageSize: 0 //
newMessageSize: 0, //
maxTmpId: 0 // ID
}
},
methods: {
@ -742,7 +743,13 @@ export default {
},
generateId() {
// id
return String(new Date().getTime()) + String(Math.floor(Math.random() * 1000));
const id = String(new Date().getTime()) + String(Math.floor(Math.random() * 1000));
// id
if (this.maxTmpId > id) {
return this.generateId();
}
this.maxTmpId = id;
return id;
}
},
computed: {
@ -822,6 +829,8 @@ export default {
this.resetEditor();
//
this.isReceipt = false;
// id
this.maxTmpId = 0;
// placeholder
this.refreshPlaceHolder();
}

Loading…
Cancel
Save