fix(移动端): DIY 商品列表配色开关修正并对齐后台预览

This commit is contained in:
From-wh 2026-10-27 17:07:57 +08:00 committed by 吴昊天
parent e7ab0004cd
commit aed7dfb6b5
2 changed files with 10 additions and 8 deletions

View File

@ -1141,7 +1141,9 @@ const imgStyle = computed(() => {
/*商品名称样式*/
const productStyle = computed(() => {
return {
color: props.dataConfig.goodsNameColor.color[0].item,
color: props.dataConfig.toneConfig.tabVal
? props.dataConfig.goodsNameColor.color[0].item
: "#333",
fontWeight: props.dataConfig.goodsName.tabVal ? "normal" : "bold",
};
});
@ -1151,7 +1153,7 @@ const checkboxInfo = computed(() => {
});
/* 价格颜色 */
const priceColor = computed(() => {
return props.dataConfig.toneCartConfig.tabVal
return props.dataConfig.toneConfig.tabVal
? props.dataConfig.goodsPriceColor.color[0].item
: "var(--view-theme)";
});
@ -1168,7 +1170,7 @@ const showBtn = computed(() => {
/* 按钮颜色 */
const btnBgColor = computed(() => {
return {
background: props.dataConfig.toneConfig.tabVal
background: props.dataConfig.toneCartConfig.tabVal
? `linear-gradient(90deg,${props.dataConfig.bntBgColor.color[0].item} 0%,${props.dataConfig.bntBgColor.color[1].item} 100%)`
: "linear-gradient(90deg, var(--view-theme) 0%, var(--view-gradient) 100%)",
};

View File

@ -288,8 +288,9 @@ function buildGoodDataConfig() {
checkboxInfo: {
type: [0, 1, 2, 3, 4, 5],
},
// 促销列表的价格/按钮颜色跟随按钮色调开关(与后台 home_product 预览一致)
toneConfig: {
tabVal: 0,
tabVal: props.dataConfig.toneCartConfig.tabVal,
},
toneCartConfig: props.dataConfig.toneCartConfig,
bntBgColor: props.dataConfig.bntBgColor,
@ -303,12 +304,11 @@ function buildGoodDataConfig() {
},
],
},
goodsPriceColor: {
goodsPriceColor: props.dataConfig.goodsPriceColor,
soldNumColor: {
color: [
{
item: props.dataConfig.toneCartConfig.tabVal
? props.dataConfig.goodsPriceColor.color[0].item
: "var(--view-theme)",
item: "#999999",
},
],
},