<template>
|
<view>
|
<image v-if="mapImg" @tap.stop="viewImg" :src="mapImg" style="width: 100vw;" mode="widthFix" />
|
</view>
|
</template>
|
|
<script setup lang="ts">
|
import { ref } from 'vue'
|
import { onLoad } from '@dcloudio/uni-app'
|
import { getOtherConfig } from '@/pages/contact/service.js'
|
import { formatImageUrl } from '@/utils/utils.js'
|
|
const mapImg = ref('')
|
|
const loadConfig = async () => {
|
const res = await getOtherConfig()
|
if (res && res.data && res.data.mapImg) {
|
mapImg.value = formatImageUrl(res.data.mapImg)
|
}
|
}
|
|
onLoad(() => {
|
loadConfig()
|
})
|
|
const viewImg = () => {
|
if (!mapImg.value) return
|
uni.previewImage({
|
urls: [mapImg.value]
|
})
|
}
|
</script>
|
|
<style>
|
|
</style>
|