78 lines
1.4 KiB
Vue
78 lines
1.4 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 v-if="dataList.length > 0" class="mt-20">
|
|
<u-row custom-style="flex-wrap: wrap;column-gap: 20rpx; row-gap: 20rpx;">
|
|
<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> |