emis-sapp/components/buns-post-detail-templates/bpd-pic-preview-tmp.vue
2024-06-03 00:38:25 +08:00

78 lines
1.3 KiB
Vue

<template>
<u-row justify="between" align="top">
<view class="font-28 font-weight">
{{label}}
</view>
<view style="width: 120rpx;">
<u-button @click="handleCheckDanJu(dataList)" :plain="true" shape="circle" custom-style="margin: 0 10rpx;height:50rpx;font-size: 28rpx;">
查看
</u-button>
</view>
</u-row>
<view>
<u-row>
<u-image v-for="(item, index) in dataList"
@click="handlePreviewCur(dataList, index)" :src="item" width="100" height="50" mode="aspectFill"
custom-style="margin: 20rpx 20rpx 0 0;"
></u-image>
</u-row>
</view>
</template>
<script>
export default {
computed: {
dataList() {
let list = this.list || []
if(typeof list == 'string') {
list = list.split(",")
}
return list
}
},
props: {
label: {
default () {
return ''
}
},
list: {
default () {
return []
}
},
},
data() {
return {}
},
created() {
},
onHide() {
},
unmounted() {
},
methods: {
handleCheckDanJu(list, type){
let url = ''
if(list.length == 0) {
return this.showToast("暂无数据")
}
this.handlePreviewCur(list, 0)
},
handlePreviewCur(list, index) {
uni.previewImage({
urls: list,
current: index
})
},
}
}
</script>
<style scoped lang="scss">
</style>