文件消息,地理位置消息

This commit is contained in:
2022-02-28 16:28:14 +08:00
parent 39b8f158c0
commit bce7822e51
11 changed files with 505 additions and 223 deletions

View File

@@ -25,7 +25,7 @@
<text class="text">文件</text>
</view>
<tki-file-manager ref="filemanager" @result="resultPath"></tki-file-manager>
<tki-file-manager ref="filemanager" @result="sendFileMessage"></tki-file-manager>
<u-action-sheet :actions="callActions" cancelText="取消" @close="callShow = false" @select="singleCall"
:show="callShow">
@@ -42,9 +42,9 @@
mixins: [
imBase
],
components: [
components: {
tkiFileManager
],
},
data() {
return {
callActions: [{
@@ -74,10 +74,22 @@
}
},
methods: {
resultPath(path) {
im.sentFile(this.conversationType, this.targetId, path).then(res => {
console.log('发送文件', res);
})
sendFileMessage(path) {
if (path) {
im.sentFile(this.conversationType, this.targetId, path).then(res => {
this.success()
}).catch(err => {
uni.showToast({
icon: 'none',
title: '发送文件失败' + err
})
})
} else {
uni.showToast({
icon: 'none',
title: '选择文件失败'
})
}
},
singleCall(e) {
uni.navigateTo({
@@ -120,8 +132,10 @@
break;
case 'location':
uni.chooseLocation({
success: (c) => {
console.log(c);
success: (location) => {
im.sentLocation(this.conversationType, this.targetId, location).then(() => {
this.success()
})
}
})
break;
@@ -133,11 +147,6 @@
break;
case 'file':
this.$refs.filemanager._openFile()
// uni.showToast({
// icon: 'none',
// title: '功能正在开发中'
// })
break;
}
},