图片预览优化
This commit is contained in:
@@ -45,27 +45,27 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showImage(path) {
|
showImage(path) {
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
urls: [
|
urls: [
|
||||||
path
|
path
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
previewImage() {
|
previewImage() {
|
||||||
if (this.content.local && this.content.local.indexOf('///data/user/') < 0) {
|
if (this.content.local && this.content.local.indexOf('///data/user/') < 0) {
|
||||||
this.showImage(this.content.local)
|
this.showImage(this.content.local)
|
||||||
} else {
|
} else {
|
||||||
|
this.showImage(this.content.remote)
|
||||||
RongIMLib.downloadMediaMessage(this.message.messageId, {
|
RongIMLib.downloadMediaMessage(this.message.messageId, {
|
||||||
success: (path) => {
|
success: (path) => {
|
||||||
this.content.local = path
|
this.content.local = path
|
||||||
this.showImage(path)
|
|
||||||
},
|
},
|
||||||
error: (errorCode, messageId) => {
|
error: (errorCode, messageId) => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: errorCode
|
title: errorCode
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user