https://ext.dcloud.net.cn/plugin?id=123
安装此插件,只是加载过程比较慢,可以满足需求,页面引入使用
previewImg(logourl) {
let that = this;
uni.showLoading({
title:"图片处理中..."
})
base64ToPath(logourl) //logoul为base64为图片流
.then(path => {
let imgsArray = [];
uni.hideLoading()
imgsArray[0] = path;
uni.previewImage({
current: 0,
urls: imgsArray
});
})
.catch(error => {
that.$refs.uToast.show({
title: '图片加载失败',
type: 'warning'
})
uni.hideLoading()
})
}