图片预览
This commit is contained in:
@@ -35,7 +35,7 @@ export default {
|
||||
onShow() {
|
||||
this.$refs?.TabPage?.show()
|
||||
this.$nextTick(() => {
|
||||
this.injectJWeixin(['getLocation', 'sendChatMessage', 'shareAppMessage', 'shareWechatMessage'])
|
||||
this.injectJWeixin(['getLocation', 'previewImage'])
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="photo" v-if="pageShow" @click="isShow = !isShow">
|
||||
<div class="photo-wrapper">
|
||||
<image mode="widthFix" :src="img" />
|
||||
<image mode="widthFix" :src="img" @click="preview(img)" />
|
||||
</div>
|
||||
<div class="photo-bottom" :class="[isShow ? 'active' : '']">
|
||||
<div class="top">
|
||||
@@ -83,9 +83,15 @@
|
||||
},
|
||||
|
||||
preview (url) {
|
||||
uni.previewImage({
|
||||
urls: [url],
|
||||
current: url
|
||||
// uni.previewImage({
|
||||
// urls: [url],
|
||||
// current: url
|
||||
// })
|
||||
if (!this.isShow) return
|
||||
|
||||
wx.previewImage({
|
||||
current: url, // 第一张显示的图片链接
|
||||
urls: [url] // 需要预加载的图片http链接列表,预加载后,可以滑动浏览这些图片
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user