index.vue
1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<template>
<view class="booth-map-gallery-page">
<view class="booth-map-gallery-grid">
<view
v-for="(item, index) in imageList"
:key="item.id"
class="booth-map-gallery-item"
@click="previewImage(index)"
>
<image class="booth-map-gallery-image" :src="item.url" :mode="item.mode || 'widthFix'" />
</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import Taro from '@tarojs/taro'
import './index.less'
const imageList = ref([
{
id: 'booth-01',
url: 'https://cdn.ipadbiz.cn/lls_prog/images/check_detail_img.png?imageMogr2/strip/quality/60',
mode: 'widthFix',
},
{
id: 'booth-02',
url: 'https://cdn.ipadbiz.cn/lls_prog/images/welcome_8.jpg?imageMogr2/strip/quality/60',
mode: 'widthFix',
},
{
id: 'booth-03',
url: 'https://cdn.ipadbiz.cn/lls_prog/images/check_detail_img.png?imageMogr2/strip/quality/60',
mode: 'widthFix',
},
])
const previewImage = index => {
Taro.previewImage({
current: imageList.value[index].url,
urls: imageList.value.map(item => item.url),
})
}
</script>
<script>
export default {
name: 'BoothMapGallery',
}
</script>