Files
crmeb-mp/pages/index/components/hotspot.vue
karlcarlo a5c5d753b6 feat: 添加静态资源文件及基础组件
- 新增大量图片资源,包括图标、背景图、海报等,用于页面展示
- 添加字体文件及样式配置,支持自定义字体
- 引入 uni-ui 组件库,包括图标、弹窗、日期选择器等常用组件
- 添加网络状态监听、加密工具等基础工具函数
- 配置 Vuex 状态管理,包括购物车数量、热门搜索词等
- 增加页面组件,如用户协议、分销信息、提现状态等
- 配置项目构建和忽略文件,优化开发体验
2026-02-26 17:59:51 +08:00

70 lines
1.7 KiB
Vue

<template>
<view class="w-full" :style="[hotspotWrapStyle]" v-if="!dataConfig.isHide">
<view class="hotspot">
<image :src="dataConfig.picStyle.url" mode="widthFix" class="image" :style="[imageRadius]"></image>
<view v-for="(item, index) in dataConfig.picStyle.list" :key="item.number" :style="{
top: `${item.starY}rpx`,
left: `${item.starX}rpx`,
width: `${item.areaWidth}rpx`,
height: `${item.areaHeight}rpx`,
}" class="area" @click="goPage(item.link)"></view>
</view>
</view>
</template>
<script>
export default {
props: {
dataConfig: {
type: Object,
default: () => {}
},
isSortType: {
type: String | Number,
default: 0
}
},
data() {
return {}
},
computed: {
imageRadius() {
let borderRadius = `${this.dataConfig.fillet.val * 2}rpx`;
if (this.dataConfig.fillet.type) {
borderRadius =
`${this.dataConfig.fillet.valList[0].val * 2}rpx ${this.dataConfig.fillet.valList[1].val * 2}rpx ${this.dataConfig.fillet.valList[3].val * 2}rpx ${this.dataConfig.fillet.valList[2].val * 2}rpx`;
}
return {
'border-radius': borderRadius,
};
},
hotspotWrapStyle() {
return {
'padding': `${this.dataConfig.topConfig.val * 2}rpx ${this.dataConfig.prConfig.val * 2}rpx ${this.dataConfig.bottomConfig.val * 2}rpx`,
'margin-top': `${this.dataConfig.mbConfig.val * 2}rpx`,
'background': this.dataConfig.bottomBgColor.color[0].item,
};
},
},
methods: {
goPage(link) {
this.$util.JumpPath(link);
},
},
}
</script>
<style lang="scss" scoped>
.hotspot {
position: relative;
width: 100%;
.image {
display: block;
width: 100%;
}
.area {
position: absolute;
}
}
</style>