66 行
1.0 KiB
Vue
66 行
1.0 KiB
Vue
<template>
|
|
<view class="pic-box">
|
|
<image class="pic-img" :src="$IMG_URL + image" mode="widthFix"></image>
|
|
<view
|
|
@click="jump(item.path)"
|
|
v-if="list.length"
|
|
v-for="(item, index) of list" :key="index"
|
|
class="hotspot"
|
|
:style="{width: `${item.width}rpx`, height: `${item.height}rpx`, left: `${item.left}rpx`, top: `${item.top}rpx`}"
|
|
>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
|
|
/**
|
|
* shPicAds图文广告
|
|
* @property {Array} list 热点数据列表,
|
|
* @property {String} image 广告图片
|
|
*/
|
|
export default {
|
|
components: {},
|
|
data() {
|
|
return {};
|
|
},
|
|
props: {
|
|
// 热点列表
|
|
list: {
|
|
type: Array,
|
|
default: () => {
|
|
return [];
|
|
}
|
|
},
|
|
// 图片
|
|
image: {
|
|
type: String,
|
|
default: ''
|
|
}
|
|
},
|
|
computed: {},
|
|
methods: {
|
|
jump(path) {
|
|
this.$tools.routerTo(path);
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.pic-box {
|
|
width: 100%;
|
|
position: relative;
|
|
|
|
.pic-img {
|
|
width: 100%;
|
|
height: auto;
|
|
display: block;
|
|
}
|
|
|
|
.hotspot {
|
|
position: absolute;
|
|
}
|
|
}
|
|
</style>
|