[装修] DIY组件样式与配置调整
parent
4679c0f49d
commit
6bfe89c3bf
File diff suppressed because it is too large
Load Diff
|
|
@ -365,7 +365,7 @@ button:before {
|
|||
* 价格
|
||||
*/
|
||||
.sales-price {
|
||||
color: #E22C08;
|
||||
color: #f1a29e;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
|
@ -460,7 +460,7 @@ button:before {
|
|||
border: 2rpx solid #FFF !important;
|
||||
}
|
||||
.br-red {
|
||||
border: 2rpx solid #E22C08 !important;
|
||||
border: 2rpx solid #f1a29e !important;
|
||||
}
|
||||
.br-yellow {
|
||||
border: 2rpx solid #f6c133 !important;
|
||||
|
|
@ -519,7 +519,7 @@ button:before {
|
|||
border-right: dashed 2rpx #EEEEEE !important;
|
||||
}
|
||||
.br-dashed-red {
|
||||
border: dashed 2rpx #E22C08 !important;
|
||||
border: dashed 2rpx #f1a29e !important;
|
||||
}
|
||||
.br-dashed-yellow {
|
||||
border: dashed 2rpx #f6c133 !important;
|
||||
|
|
@ -536,7 +536,7 @@ button:before {
|
|||
* 文本价格色、基础色、白色、黑色、灰色、浅灰色、红色、黄色、绿色、蓝色
|
||||
*/
|
||||
.cr-price {
|
||||
color: #E22C08;
|
||||
color: #f1a29e;
|
||||
}
|
||||
.cr-base {
|
||||
color: #666 !important;
|
||||
|
|
@ -561,7 +561,7 @@ button:before {
|
|||
color: #e7e7e7 !important;
|
||||
}
|
||||
.cr-red {
|
||||
color: #E22C08 !important;
|
||||
color: #f1a29e !important;
|
||||
}
|
||||
.cr-yellow {
|
||||
color: #f6c133 !important;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<image-empty :propImageSrc="item.images" :propStyle="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></image-empty>
|
||||
</view>
|
||||
<!-- 角标 -->
|
||||
<subscriptIndex :propValue="propValue"></subscriptIndex>
|
||||
<subscriptIndex :propValue="propValue" :propItemType="item.item_type"></subscriptIndex>
|
||||
</view>
|
||||
</block>
|
||||
<view v-if="is_show('title') || is_show('simple_desc') || is_show('price') || is_show('original_price') || is_show('sales_count') || is_show('plugins_view_icon') || form.is_shop_show == '1'" class="flex-col flex-1 jc-sb content gap-10" :style="content_style">
|
||||
|
|
@ -126,7 +126,7 @@
|
|||
<image-empty :propImageSrc="item.images" :propStyle="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></image-empty>
|
||||
</view>
|
||||
<!-- 角标 -->
|
||||
<subscriptIndex :propValue="propValue"></subscriptIndex>
|
||||
<subscriptIndex :propValue="propValue" :propItemType="item.item_type"></subscriptIndex>
|
||||
</view>
|
||||
</block>
|
||||
<view v-if="is_show('title') || is_show('simple_desc') || is_show('price') || is_show('plugins_view_icon') || is_show('original_price') || form.is_shop_show == '1'" class="flex-col flex-1 jc-sb content gap-10" :style="content_style">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span class="text-line-1" :style="text_size">{{ form.subscript_text }}</span>
|
||||
<span class="text-line-1" :style="text_size">{{ display_text || form.subscript_text }}</span>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -32,6 +32,11 @@
|
|||
type: String,
|
||||
default: 'outer',
|
||||
},
|
||||
// 商品类型(用于占位符 $good_type 映射):ticket / normal / ...
|
||||
propItemType: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -40,6 +45,15 @@
|
|||
corner_img_marker: '',
|
||||
img_style: '',
|
||||
text_size: '',
|
||||
// 占位符 token -> item_type -> 文案
|
||||
// 运营后续可在此扩展
|
||||
placeholder_map: {
|
||||
'$good_type': {
|
||||
ticket: '演出',
|
||||
normal: '周边',
|
||||
},
|
||||
},
|
||||
display_text: '',
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -47,6 +61,22 @@
|
|||
},
|
||||
methods: {
|
||||
isEmpty,
|
||||
// 占位符替换:text 中所有已知 token -> 根据 propItemType 找文案。
|
||||
// item_type 缺失/未知 → 原样保留(fallback,方便运营发现异常)
|
||||
replace_placeholder(text) {
|
||||
if (isEmpty(text) || typeof text !== 'string') return text || '';
|
||||
const map = this.placeholder_map || {};
|
||||
let out = text;
|
||||
Object.keys(map).forEach((token) => {
|
||||
if (out.indexOf(token) === -1) return;
|
||||
const item_map = map[token] || {};
|
||||
const replaced = item_map[this.propItemType];
|
||||
if (replaced !== undefined && replaced !== null) {
|
||||
out = out.split(token).join(replaced);
|
||||
}
|
||||
});
|
||||
return out;
|
||||
},
|
||||
// 初始化数据
|
||||
init() {
|
||||
if (!isEmpty(this.propValue)) {
|
||||
|
|
@ -61,6 +91,7 @@
|
|||
text_size: `font-size: ${ new_style.subscript_style.text_or_icon_size * 2 }rpx;color: ${ new_style.subscript_style.text_or_icon_color };`,
|
||||
corner_img_marker: common_img_computer(new_style.subscript_style),
|
||||
img_style: `height: ${new_style.subscript_style.img_height * 2}rpx; width: ${new_style.subscript_style.img_width * 2}rpx`,
|
||||
display_text: this.replace_placeholder(new_content.subscript_text || ''),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
<image-empty :propImageSrc="item.images" :propStyle="content_img_radius" propErrorStyle="width:100rpx; height: 100rpx;"></image-empty>
|
||||
</view>
|
||||
<!-- 角标 -->
|
||||
<subscriptIndex :propValue="propValue"></subscriptIndex>
|
||||
<subscriptIndex :propValue="propValue" :propItemType="item.item_type"></subscriptIndex>
|
||||
</view>
|
||||
</template>
|
||||
<view v-if="is_show('title') || is_show('simple_desc') || is_show('price') || is_show('original_price') || form.is_shop_show == '1'" class="flex-col gap-10 wh-auto flex-1 jc-sb oh" :style="content_style">
|
||||
|
|
@ -119,7 +119,7 @@
|
|||
<image-empty :propImageSrc="item.images" :propStyle="content_img_radius" propErrorStyle="width:100rpx; height: 100rpx;"></image-empty>
|
||||
</view>
|
||||
<!-- 角标 -->
|
||||
<subscriptIndex :propValue="propValue"></subscriptIndex>
|
||||
<subscriptIndex :propValue="propValue" :propItemType="item.item_type"></subscriptIndex>
|
||||
</view>
|
||||
</template>
|
||||
<view v-if="is_show('title') || is_show('simple_desc') || is_show('price') || is_show('original_price') || form.is_shop_show == '1'" class="flex-col gap-10 wh-auto flex-1 jc-sb" :style="content_style">
|
||||
|
|
|
|||
Loading…
Reference in New Issue