[装修] DIY组件样式与配置调整

master
Council 2026-07-06 12:05:45 +08:00
parent 4679c0f49d
commit 6bfe89c3bf
5 changed files with 3486 additions and 10 deletions

3445
App.vue.bak-commit2 Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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;

View File

@ -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">

View File

@ -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 || ''),
});
}
}

View File

@ -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">