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