mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-11-13 04:18:53 +08:00
feat(uniapp): 热区组件应用样式字段
外层背景/边距/页面间距/背景圆角,图片与热区容器内容圆角;缺字段兜底为现状,老页面零视觉变化
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="layout">
|
<view class="layout" :style="wrapperStyle">
|
||||||
<view class="flex-one">
|
<view class="flex-one" :style="contentStyle">
|
||||||
<u-image
|
<u-image
|
||||||
v-if="!hasHotZone"
|
v-if="!hasHotZone"
|
||||||
@click="modelNavigateTo(res.list[0])"
|
@click="modelNavigateTo(res.list[0])"
|
||||||
@@ -25,6 +25,18 @@ const hasHotZone = computed(() => {
|
|||||||
const zoneInfo = props.res?.list?.[0]?.zoneInfo;
|
const zoneInfo = props.res?.list?.[0]?.zoneInfo;
|
||||||
return Array.isArray(zoneInfo) ? zoneInfo.length > 0 : !!zoneInfo;
|
return Array.isArray(zoneInfo) ? zoneInfo.length > 0 : !!zoneInfo;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const wrapperStyle = computed(() => ({
|
||||||
|
background: props.res?.bgColor ?? "transparent",
|
||||||
|
padding: `${props.res?.paddingTop ?? 0}rpx ${props.res?.paddingX ?? 0}rpx ${props.res?.paddingBottom ?? 0}rpx`,
|
||||||
|
marginBottom: `${props.res?.pageGap ?? 0}rpx`,
|
||||||
|
borderRadius: `${props.res?.borderRadius ?? 0}rpx`,
|
||||||
|
overflow: (props.res?.borderRadius ?? 0) > 0 ? "hidden" : "visible",
|
||||||
|
}));
|
||||||
|
|
||||||
|
const contentStyle = computed(() => ({
|
||||||
|
borderRadius: `${props.res?.imgRadius ?? 0}rpx`,
|
||||||
|
}));
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "./tpl.scss";
|
@import "./tpl.scss";
|
||||||
|
|||||||
Reference in New Issue
Block a user