文件消息,地理位置消息
This commit is contained in:
@@ -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;
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user