修改秒杀显示
parent
a3f608f9f3
commit
f3dd79ab4e
|
|
@ -30,35 +30,141 @@
|
|||
<el-icon class="iconfont icon-arrow-right" :color="new_style.head_button_color"></el-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap" :style="`gap: ${ content_outer_spacing }px;`">
|
||||
<div v-for="(item, index) in list" :key="index" :class="layout_type" :style="`${ content_radius }; ${ shop_style_type == '1' ? content_padding : '' }`">
|
||||
<template v-if="!isEmpty(item)">
|
||||
<template v-if="!isEmpty(item.new_cover)">
|
||||
<image-empty v-model="item.new_cover[0]" :class="`flex-img${shop_style_type}`" :style="content_img_radius"></image-empty>
|
||||
</template>
|
||||
<template v-else>
|
||||
<image-empty v-model="item.images" :class="`flex-img${shop_style_type}`" :style="content_img_radius"></image-empty>
|
||||
</template>
|
||||
</template>
|
||||
<div class="flex-col gap-10 w flex-1" :style="content_style">
|
||||
<div >{{ item.title }}</div>
|
||||
<div class="flex-row align-c gap-6">
|
||||
<div class="re flex-1">
|
||||
<div class="slide-bottom" :style="`background: ${ new_style.progress_bg_color }`"></div>
|
||||
<div class="slide-top" :style="` width: 51%; ${ slide_active_color }`"><div class="slide-top-icon round" :style="`background: ${ new_style.progress_button_color }`"><icon name="a-miaosha" :color="new_style.progress_button_icon_color" size="9"></icon></div></div>
|
||||
<template v-if="form.shop_style_type != '3'">
|
||||
<div class="flex flex-wrap" :style="`gap: ${ content_outer_spacing }px;`">
|
||||
<div v-for="(item, index) in list" :key="index" :class="layout_type" :style="`${ content_radius }; ${ shop_style_type == '1' ? content_padding : '' }`">
|
||||
<template v-if="!isEmpty(item)">
|
||||
<div class="oh re">
|
||||
<template v-if="!isEmpty(item.new_cover)">
|
||||
<image-empty v-model="item.new_cover[0]" :class="`flex-img${shop_style_type}`" :style="content_img_radius"></image-empty>
|
||||
</template>
|
||||
<template v-else>
|
||||
<image-empty v-model="item.images" :class="`flex-img${shop_style_type}`" :style="content_img_radius"></image-empty>
|
||||
</template>
|
||||
<div v-if="form.seckill_subscript_show == '1'" class="size-12 nowrap corner-marker" :style="corner_marker"><span class="text-line-1">{{ form.subscript_text }}</span></div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="flex-col gap-10 w flex-1 jc-sb" :style="content_style">
|
||||
<div class="flex-col gap-10 w">
|
||||
<!-- 标题 -->
|
||||
<div :style="trends_config('title')">{{ item.title }}</div>
|
||||
<!-- 进度条 -->
|
||||
<div v-if="form.shop_style_type == '1'" class="flex-row align-c gap-6">
|
||||
<div class="re flex-1">
|
||||
<div class="slide-bottom" :style="`background: ${ new_style.progress_bg_color }`"></div>
|
||||
<div class="slide-top" :style="` width: 51%; ${ slide_active_color }`"><div class="slide-top-icon round" :style="`background: ${ new_style.progress_button_color }`"><icon name="a-miaosha" :color="new_style.progress_button_icon_color" size="9"></icon></div></div>
|
||||
</div>
|
||||
<span class="size-10" :style="`color: ${ new_style.progress_text_color }`">已抢51%</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-row align-e gap-10 jc-sb">
|
||||
<div class="flex-col gap-5">
|
||||
<div v-if="is_show('price')" class="num" :style="`color: ${new_style.shop_price_color}`">
|
||||
<span v-if="form.shop_style_type == '1'" class="size-10 pl-4">秒杀价</span>
|
||||
<span class="identifying">{{ item.show_price_symbol }}</span
|
||||
><span :style="trends_config('price')">{{ item.min_price }}</span>
|
||||
<span v-if="is_show('price_unit')" class="identifying">{{ item.show_price_unit }}</span>
|
||||
</div>
|
||||
<div v-if="is_show('original_price')" class="size-11 flex" :style="`color: ${new_style.original_price_color}`">
|
||||
<span class="original-price text-line-1 flex-1">{{ item.show_original_price_symbol }}{{ item.min_original_price }}
|
||||
<template v-if="is_show('original_price_unit')">
|
||||
{{ item.show_original_price_unit }}
|
||||
</template>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="form.is_shop_show == '1'">
|
||||
<template v-if="form.shop_type == 'text'">
|
||||
<div class="plr-11 ptb-3 round cr-f" :style="trends_config('button', 'gradient') + `color: ${new_style.shop_button_text_color};`">{{ form.shop_button_text }}</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<icon class="round plr-6 ptb-5" :name="!isEmpty(form.shop_button_icon_class) ? form.shop_button_icon_class : 'cart'" :color="new_style.shop_icon_color" :size="new_style.shop_icon_size + ''" :styles="button_gradient()"></icon>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<span class="size-10" :style="`color: ${ new_style.progress_text_color }`">已抢51%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<swiper
|
||||
:key="carouselKey"
|
||||
class="w flex"
|
||||
direction="horizontal"
|
||||
:loop="true"
|
||||
:autoplay="autoplay"
|
||||
:slides-per-view="form.carousel_col"
|
||||
:slides-per-group="slides_per_group"
|
||||
:allow-touch-move="false"
|
||||
:space-between="content_outer_spacing"
|
||||
:pause-on-mouse-enter="true"
|
||||
:modules="modules"
|
||||
>
|
||||
<swiper-slide v-for="(item, index) in list" :key="index" :class="layout_type" :style="`${ content_radius }; ${ shop_style_type == '1' ? content_padding : '' }`">
|
||||
<template v-if="!isEmpty(item)">
|
||||
<div class="oh re">
|
||||
<template v-if="!isEmpty(item.new_cover)">
|
||||
<image-empty v-model="item.new_cover[0]" :class="`flex-img${shop_style_type}`" :style="content_img_radius"></image-empty>
|
||||
</template>
|
||||
<template v-else>
|
||||
<image-empty v-model="item.images" :class="`flex-img${shop_style_type}`" :style="content_img_radius"></image-empty>
|
||||
</template>
|
||||
<div v-if="form.seckill_subscript_show == '1'" class="size-12 nowrap corner-marker" :style="corner_marker"><span class="text-line-1">{{ form.subscript_text }}</span></div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="flex-col gap-10 w flex-1 jc-sb" :style="content_style">
|
||||
<div class="flex-col gap-10 w">
|
||||
<!-- 标题 -->
|
||||
<div :style="trends_config('title')">{{ item.title }}</div>
|
||||
<!-- 进度条 -->
|
||||
<div v-if="form.shop_style_type == '1'" class="flex-row align-c gap-6">
|
||||
<div class="re flex-1">
|
||||
<div class="slide-bottom" :style="`background: ${ new_style.progress_bg_color }`"></div>
|
||||
<div class="slide-top" :style="` width: 51%; ${ slide_active_color }`"><div class="slide-top-icon round" :style="`background: ${ new_style.progress_button_color }`"><icon name="a-miaosha" :color="new_style.progress_button_icon_color" size="9"></icon></div></div>
|
||||
</div>
|
||||
<span class="size-10" :style="`color: ${ new_style.progress_text_color }`">已抢51%</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-row align-e gap-10 jc-sb">
|
||||
<div class="flex-col gap-5">
|
||||
<div v-if="is_show('price')" class="num" :style="`color: ${new_style.shop_price_color}`">
|
||||
<span v-if="form.shop_style_type == '1'" class="size-10 pl-4">秒杀价</span>
|
||||
<span class="identifying">{{ item.show_price_symbol }}</span
|
||||
><span :style="trends_config('price')">{{ item.min_price }}</span>
|
||||
<span v-if="is_show('price_unit')" class="identifying">{{ item.show_price_unit }}</span>
|
||||
</div>
|
||||
<div v-if="is_show('original_price')" class="size-11 flex" :style="`color: ${new_style.original_price_color}`">
|
||||
<span class="original-price text-line-1 flex-1">{{ item.show_original_price_symbol }}{{ item.min_original_price }}
|
||||
<template v-if="is_show('original_price_unit')">
|
||||
{{ item.show_original_price_unit }}
|
||||
</template>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="form.is_shop_show == '1'">
|
||||
<template v-if="form.shop_type == 'text'">
|
||||
<div class="plr-11 ptb-3 round cr-f" :style="trends_config('button', 'gradient') + `color: ${new_style.shop_button_text_color};`">{{ form.shop_button_text }}</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<icon class="round plr-6 ptb-5" :name="!isEmpty(form.shop_button_icon_class) ? form.shop_button_icon_class : 'cart'" :color="new_style.shop_icon_color" :size="new_style.shop_icon_size + ''" :styles="button_gradient()"></icon>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</swiper-slide>
|
||||
</swiper>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { background_computer, common_styles_computer, gradient_computer, gradient_handle, padding_computer, radius_computer } from '@/utils';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { background_computer, common_styles_computer, get_math, gradient_computer, gradient_handle, padding_computer, radius_computer } from '@/utils';
|
||||
import { isEmpty, cloneDeep } from 'lodash';
|
||||
import { online_url } from '@/utils';
|
||||
import { Swiper, SwiperSlide } from 'swiper/vue';
|
||||
import { Autoplay } from 'swiper/modules';
|
||||
import 'swiper/css';
|
||||
const modules = [Autoplay];
|
||||
|
||||
const props = defineProps({
|
||||
value: {
|
||||
|
|
@ -200,7 +306,7 @@ const layout_type = computed(() => {
|
|||
class_type = `flex-col bg-f oh multicolumn-columns`;
|
||||
break;
|
||||
case '3':
|
||||
class_type = `flex-col bg-f oh multicolumn-columns`;
|
||||
class_type = `flex-col bg-f oh roll-columns`;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -227,8 +333,8 @@ const button_gradient = () => {
|
|||
};
|
||||
// 不换行显示
|
||||
const multicolumn_columns_width = computed(() => {
|
||||
const { single_line_number } = toRefs(form.value);
|
||||
let model_number = single_line_number.value;
|
||||
const { carousel_col } = toRefs(form.value);
|
||||
let model_number = carousel_col.value;
|
||||
if (shop_style_type.value == '1') {
|
||||
model_number = 1;
|
||||
} else if (shop_style_type.value == '2') {
|
||||
|
|
@ -238,8 +344,51 @@ const multicolumn_columns_width = computed(() => {
|
|||
let gap = (new_style.value.content_outer_spacing * (model_number - 1)) / model_number;
|
||||
return `calc(${100 / model_number}% - ${gap}px)`;
|
||||
});
|
||||
// 判断是否显示对应的内容
|
||||
const is_show = (index: string) => {
|
||||
return form.value.is_show.includes(index);
|
||||
};
|
||||
// 轮播图key值
|
||||
const carouselKey = ref('0');
|
||||
const autoplay = ref<boolean | object>(false);
|
||||
const slides_per_group = ref(1);
|
||||
// 内容参数的集合
|
||||
watchEffect(() => {
|
||||
// 是否滚动
|
||||
if (new_style.value.is_roll) {
|
||||
autoplay.value = {
|
||||
delay: (new_style.value.interval_time || 2) * 1000,
|
||||
pauseOnMouseEnter: true,
|
||||
};
|
||||
} else {
|
||||
autoplay.value = false;
|
||||
}
|
||||
slides_per_group.value = new_style.value.rolling_fashion == 'translation' ? 1 : form.value.carousel_col;
|
||||
// 更新轮播图的key,确保更换时能重新更新轮播图
|
||||
carouselKey.value = get_math();
|
||||
});
|
||||
|
||||
//容器高度
|
||||
const multicolumn_columns_height = computed(() => new_style.value.content_outer_height + 'px');
|
||||
// 图片圆角设置
|
||||
const content_img_radius = computed(() => radius_computer(new_style.value.shop_img_radius));
|
||||
|
||||
// 左上角,右上角,右下角,左下角
|
||||
const corner_marker = computed(() => {
|
||||
const { seckill_subscript_location, shop_img_radius, seckill_subscript_bg_color, seckill_subscript_text_color } = new_style.value;
|
||||
let location = `background: ${ seckill_subscript_bg_color };color: ${seckill_subscript_text_color};`;
|
||||
// 圆角根据图片的圆角来计算 对角线是同样的圆角
|
||||
if (seckill_subscript_location == 'top-left') {
|
||||
location += `top: 0;left: 0;border-radius: ${ shop_img_radius.radius_top_left }px 0 ${ shop_img_radius.radius_top_left }px 0;`;
|
||||
} else if (seckill_subscript_location == 'top-right') {
|
||||
location += `top: 0;right: 0;border-radius: 0 ${ shop_img_radius.radius_top_right }px 0 ${ shop_img_radius.radius_top_right }px;`;
|
||||
} else if (seckill_subscript_location == 'bottom-left') {
|
||||
location += `bottom: 0;left: 0;border-radius: 0 ${ shop_img_radius.radius_bottom_left }px 0 ${ shop_img_radius.radius_bottom_left }px;`;
|
||||
} else if (seckill_subscript_location == 'bottom-right') {
|
||||
location += `bottom: 0;right: 0;border-radius: ${ shop_img_radius.radius_bottom_right }px 0 ${ shop_img_radius.radius_bottom_right }px 0;`;
|
||||
}
|
||||
return location;
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-image) {
|
||||
|
|
@ -248,6 +397,9 @@ const content_img_radius = computed(() => radius_computer(new_style.value.shop_i
|
|||
height: 5rem;
|
||||
}
|
||||
}
|
||||
.identifying {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.seckill-head {
|
||||
padding: 1.5rem 1.3rem;
|
||||
width: 100%;
|
||||
|
|
@ -272,11 +424,10 @@ const content_img_radius = computed(() => radius_computer(new_style.value.shop_i
|
|||
}
|
||||
.multicolumn-columns {
|
||||
height: 100%;
|
||||
width: v-bind(multicolumn_columns_width);
|
||||
min-width: v-bind(multicolumn_columns_width);
|
||||
width: v-bind(multicolumn_columns_width) !important;
|
||||
min-width: v-bind(multicolumn_columns_width) !important;
|
||||
}
|
||||
.flex-img1 {
|
||||
height: auto;
|
||||
min-height: 11rem;
|
||||
max-height: 12rem;
|
||||
width: 11rem;
|
||||
|
|
@ -286,6 +437,7 @@ const content_img_radius = computed(() => radius_computer(new_style.value.shop_i
|
|||
height: 18rem;
|
||||
}
|
||||
.flex-img3 {
|
||||
background: #f4fcff;
|
||||
width: 100%;
|
||||
min-height: 10.4rem;
|
||||
}
|
||||
|
|
@ -311,4 +463,15 @@ const content_img_radius = computed(() => radius_computer(new_style.value.shop_i
|
|||
justify-content: center;
|
||||
}
|
||||
}
|
||||
.original-price {
|
||||
text-decoration-line: line-through;
|
||||
}
|
||||
.roll-columns {
|
||||
height: v-bind(multicolumn_columns_height);
|
||||
}
|
||||
.corner-marker {
|
||||
position: absolute;
|
||||
padding: 0.1rem 1rem;
|
||||
max-width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -45,12 +45,12 @@
|
|||
<card-container>
|
||||
<div class="mb-12">商品风格</div>
|
||||
<el-form-item label="风格类型">
|
||||
<el-radio-group v-model="form.shop_style_type">
|
||||
<el-radio-group v-model="form.shop_style_type" @change="change_style">
|
||||
<el-radio v-for="item in base_list.shop_style_type_list" :key="item.value" :value="item.value">{{ item.name }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.shop_style_type == '3'" label="单行显示">
|
||||
<el-radio-group v-model="form.single_line_number">
|
||||
<el-radio-group v-model="form.carousel_col">
|
||||
<el-radio :value="1">1个</el-radio>
|
||||
<el-radio :value="2">2个</el-radio>
|
||||
<el-radio :value="3">3个</el-radio>
|
||||
|
|
@ -70,9 +70,20 @@
|
|||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="秒杀按钮">
|
||||
<el-radio-group v-model="form.seckill_button_show">
|
||||
<el-radio v-for="item in base_list.state_list" :key="item.value" :value="item.value">{{ item.name }}</el-radio>
|
||||
</el-radio-group>
|
||||
<div class="flex-col gap-10 w">
|
||||
<el-switch v-model="form.is_shop_show" active-value="1" inactive-value="0"></el-switch>
|
||||
<template v-if="form.is_shop_show == '1'">
|
||||
<el-radio-group v-model="form.shop_type" @change="change_shop_type">
|
||||
<el-radio v-for="item in base_list.shopping_button_list" :key="item.value" :value="item.value">{{ item.name }}</el-radio>
|
||||
</el-radio-group>
|
||||
<template v-if="form.shop_type == 'text'">
|
||||
<el-input v-model="form.shop_button_text" placeholder="请输入按钮文字"></el-input>
|
||||
</template>
|
||||
<template v-else>
|
||||
<upload v-model:icon-value="form.shop_button_icon_class" is-icon type="icon" :limit="1" size="50"></upload>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="秒杀角标">
|
||||
<div class="flex-col gap-10 w">
|
||||
|
|
@ -143,6 +154,42 @@ const base_list = {
|
|||
{ name: '售价单位', value: 'price_unit' },
|
||||
{ name: '原价单位', value: 'original_price_unit' },
|
||||
],
|
||||
shopping_button_list: [
|
||||
{ name: '文字', value: 'text' },
|
||||
{ name: '图标', value: 'icon' },
|
||||
],
|
||||
};
|
||||
const is_revise = ref(false);
|
||||
const change_shop_type = () => {
|
||||
is_revise.value = true;
|
||||
};
|
||||
// 选择某些风格时, 切换到对应的按钮
|
||||
const change_style = (val: any): void => {
|
||||
form.value.theme = val;
|
||||
if (!is_revise.value) {
|
||||
if (['3'].includes(val) && form.value.shop_type == 'text') {
|
||||
form.value.shop_type = 'icon';
|
||||
} else if (['1', '2'].includes(val) && form.value.shop_type == 'icon') {
|
||||
form.value.shop_type = 'text';
|
||||
}
|
||||
}
|
||||
if (['1'].includes(val)) {
|
||||
if (data.value.shop_img_radius.radius == props.defaultConfig.img_radius_0 || (data.value.shop_img_radius.radius_bottom_left == props.defaultConfig.img_radius_1 && data.value.shop_img_radius.radius_bottom_right == props.defaultConfig.img_radius_1 && data.value.shop_img_radius.radius_top_left == props.defaultConfig.img_radius_1 && data.value.shop_img_radius.radius_top_right == props.defaultConfig.img_radius_1)) {
|
||||
data.value.shop_img_radius.radius = props.defaultConfig.img_radius_0;
|
||||
data.value.shop_img_radius.radius_bottom_left = props.defaultConfig.img_radius_0;
|
||||
data.value.shop_img_radius.radius_bottom_right = props.defaultConfig.img_radius_0;
|
||||
data.value.shop_img_radius.radius_top_left = props.defaultConfig.img_radius_0;
|
||||
data.value.shop_img_radius.radius_top_right = props.defaultConfig.img_radius_0;
|
||||
}
|
||||
} else {
|
||||
if (data.value.shop_img_radius.radius == props.defaultConfig.img_radius_0 || (data.value.shop_img_radius.radius_bottom_left == props.defaultConfig.img_radius_1 && data.value.shop_img_radius.radius_bottom_right == props.defaultConfig.img_radius_1 && data.value.shop_img_radius.radius_top_left == props.defaultConfig.img_radius_1 && data.value.shop_img_radius.radius_top_right == props.defaultConfig.img_radius_1)) {
|
||||
data.value.shop_img_radius.radius = props.defaultConfig.img_radius_1;
|
||||
data.value.shop_img_radius.radius_bottom_left = props.defaultConfig.img_radius_1;
|
||||
data.value.shop_img_radius.radius_bottom_right = props.defaultConfig.img_radius_1;
|
||||
data.value.shop_img_radius.radius_top_left = props.defaultConfig.img_radius_1;
|
||||
data.value.shop_img_radius.radius_top_right = props.defaultConfig.img_radius_1;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const emit = defineEmits(['update:change-theme']);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<template>
|
||||
<div class="auxiliary-line-setting">
|
||||
<template v-if="type == '1'">
|
||||
<model-seckill-content :value="form.content" :styles="form.style" @update:change-theme="change_theme"></model-seckill-content>
|
||||
<model-seckill-content :value="form.content" :styles="form.style" :default-config="data_config" @update:change-theme="change_theme"></model-seckill-content>
|
||||
</template>
|
||||
<template v-if="type == '2'">
|
||||
<model-seckill-styles :value="form.style" :content="form.content"></model-seckill-styles>
|
||||
<model-seckill-styles :value="form.style" :content="form.content" :default-config="data_config"></model-seckill-styles>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -22,13 +22,21 @@ const props = defineProps({
|
|||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
//#region 默认数据
|
||||
const data_config = reactive({
|
||||
// 图片不同风格下的圆角
|
||||
img_radius_0: 4,
|
||||
img_radius_1: 0,
|
||||
});
|
||||
const new_url = ref('');
|
||||
// 全部的默认数据
|
||||
let default_data:any = {};
|
||||
// 每个样式下独立的默认数据
|
||||
let default_config:any = {};
|
||||
onBeforeMount(async () => {
|
||||
// 获取图片的链接地址
|
||||
new_url.value = await online_url('/static/plugins/seckill/images/diy/').then(res => res);
|
||||
// 全部的默认数据
|
||||
default_data = {
|
||||
content: {
|
||||
topic_type: 'image',
|
||||
|
|
@ -72,25 +80,43 @@ onBeforeMount(async () => {
|
|||
content_outer_spacing: 10, // 商品间距
|
||||
content_spacing: 10,
|
||||
content_outer_height: 232,
|
||||
shop_title_color: '',
|
||||
shop_title_typeface: '',
|
||||
shop_title_size: 12,
|
||||
price_color: '',
|
||||
original_price_color: '',
|
||||
seckill_subscript_location: '',
|
||||
seckill_subscript_text_color: '',
|
||||
seckill_subscript_bg_color: '',
|
||||
progress_bg_color: '',
|
||||
progress_actived_color_list: [{ color: '', color_percentage: undefined }],
|
||||
shop_title_typeface: '500',
|
||||
shop_title_size: 14,
|
||||
shop_title_color: "#333333",
|
||||
shop_price_typeface: '500',
|
||||
shop_price_size: 18,
|
||||
shop_price_color: "#EA3323;",
|
||||
shop_button_typeface:'400',
|
||||
shop_button_size: 12,
|
||||
shop_button_color: [
|
||||
{
|
||||
color: '#FF3D53',
|
||||
color_percentage: undefined
|
||||
},
|
||||
{
|
||||
color: '#D73A3A',
|
||||
color_percentage: undefined
|
||||
}
|
||||
],
|
||||
shop_button_text_color: '#fff',
|
||||
shop_icon_size: 10,
|
||||
shop_icon_color: "#fff",
|
||||
original_price_color: '#999',
|
||||
seckill_subscript_location: 'top-left',
|
||||
seckill_subscript_text_color: '#fff',
|
||||
seckill_subscript_bg_color: '#FF7607',
|
||||
progress_bg_color: '#FFEDED',
|
||||
progress_actived_color_list: [{ color: '#FF3131', color_percentage: undefined }, { color: '#FF973D', color_percentage: undefined }],
|
||||
progress_actived_direction: '180deg',
|
||||
progress_button_color: '',
|
||||
progress_button_icon_color: '',
|
||||
progress_text_color: '',
|
||||
progress_button_color: '#FFDE81',
|
||||
progress_button_icon_color: '#FF2525',
|
||||
progress_text_color: '#FF3434',
|
||||
is_roll: true,
|
||||
interval_time: 2,
|
||||
rolling_fashion: 'translation',
|
||||
}
|
||||
}
|
||||
// 每个样式下独立的默认数据
|
||||
default_config = {
|
||||
style: {
|
||||
theme_1: {},
|
||||
|
|
@ -147,12 +173,13 @@ onBeforeMount(async () => {
|
|||
},
|
||||
};
|
||||
})
|
||||
//#endregion
|
||||
const form = ref(props.value);
|
||||
// 切换风格的时候会将对应风格的默认数据合并到form中
|
||||
const change_theme = (val: string) => {
|
||||
if (val) {
|
||||
form.value.style = Object.assign({}, form.value.style, cloneDeep(default_data.style), cloneDeep((<arrayIndex>default_config.style)[`theme_${Number(val)}`].style));
|
||||
form.value.content = Object.assign({}, form.value.content, cloneDeep(default_data.content), cloneDeep((<arrayIndex>default_config.style)[`theme_${Number(val)}`].content));
|
||||
console.log(form.value.content);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -84,15 +84,36 @@
|
|||
<el-radio-group v-model="form.seckill_subscript_location">
|
||||
<el-radio v-for="item in base_list.location_list" :key="item.value" :value="item.value">{{ item.name }}</el-radio>
|
||||
</el-radio-group>
|
||||
<el-form-item label="文字" style="color: #333;">
|
||||
<el-form-item label="文字" style="color: #333;" label-width="40">
|
||||
<color-picker v-model="form.seckill_subscript_text_color"></color-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="背景" style="color: #333;">
|
||||
<el-form-item label="背景" style="color: #333;" label-width="40">
|
||||
<color-picker v-model="form.seckill_subscript_bg_color"></color-picker>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</card-container>
|
||||
<!-- 秒杀按钮 -->
|
||||
<template v-if="data.is_shop_show == '1'">
|
||||
<div class="divider-line"></div>
|
||||
<card-container>
|
||||
<div class="mb-12">秒杀按钮</div>
|
||||
<el-form-item label="按钮颜色" class="topic">
|
||||
<flex-gradients-create :color-list="form.shop_button_color" default-color="#FF3D53"></flex-gradients-create>
|
||||
</el-form-item>
|
||||
<template v-if="data.shop_type == 'text'">
|
||||
<el-form-item label="文字设置">
|
||||
<color-text-size-group v-model:color="form.shop_button_text_color" v-model:typeface="form.shop_button_typeface" v-model:size="form.shop_button_size" default-color="#fff"></color-text-size-group>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-form-item label="图标设置">
|
||||
<color-text-size-group v-model:color="form.shop_icon_color" v-model:size="form.shop_icon_size" default-color="#fff" :type-list="['color', 'size']"></color-text-size-group>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</card-container>
|
||||
</template>
|
||||
<!-- 进度条设置 -->
|
||||
<template v-if="data.shop_style_type == '1'">
|
||||
<div class="divider-line"></div>
|
||||
<card-container>
|
||||
|
|
@ -114,6 +135,7 @@
|
|||
</el-form-item>
|
||||
</card-container>
|
||||
</template>
|
||||
<!-- 轮播设置 -->
|
||||
<template v-if="data.shop_style_type == '3'">
|
||||
<div class="divider-line"></div>
|
||||
<card-container>
|
||||
|
|
@ -161,10 +183,10 @@ let clone_form = cloneDeep(props.value);
|
|||
|
||||
const base_list = {
|
||||
location_list: [
|
||||
{ name: '左上', value: 'left-top' },
|
||||
{ name: '右上', value: 'right-top' },
|
||||
{ name: '左下', value: 'left-buttom' },
|
||||
{ name: '右下', value: 'right-buttom' },
|
||||
{ name: '左上', value: 'top-left' },
|
||||
{ name: '右上', value: 'top-right' },
|
||||
{ name: '左下', value: 'bottom-left' },
|
||||
{ name: '右下', value: 'bottom-right' },
|
||||
],
|
||||
rolling_fashion_list: [
|
||||
{ name: '平移', value: 'translation' },
|
||||
|
|
@ -197,4 +219,10 @@ const progress_color_picker_event = (arry: color_list[], type: number) => {
|
|||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
.topic {
|
||||
:deep(.el-form-item__content) {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -11,10 +11,13 @@ interface DefaultSeckill {
|
|||
button_status: string;
|
||||
button_text: string;
|
||||
shop_style_type: string;
|
||||
single_line_number: number;
|
||||
carousel_col: number;
|
||||
shop_number: number,
|
||||
is_show: string[];
|
||||
seckill_button_show: string;
|
||||
shop_type: string;
|
||||
shop_button_text: string;
|
||||
shop_button_icon_class: string;
|
||||
is_shop_show: string;
|
||||
seckill_subscript_show: string;
|
||||
subscript_text: string;
|
||||
};
|
||||
|
|
@ -43,6 +46,12 @@ interface DefaultSeckill {
|
|||
shop_price_typeface: string;
|
||||
shop_price_size: number;
|
||||
shop_price_color: string;
|
||||
shop_button_typeface:string;
|
||||
shop_button_size: number;
|
||||
shop_button_color: color_list[];
|
||||
shop_button_text_color: string,
|
||||
shop_icon_size: number;
|
||||
shop_icon_color: string;
|
||||
original_price_color: string;
|
||||
seckill_subscript_location: string;
|
||||
seckill_subscript_text_color: string;
|
||||
|
|
@ -69,10 +78,13 @@ const defaultSeckill: DefaultSeckill = {
|
|||
button_status: '1',
|
||||
button_text: '更多',
|
||||
shop_style_type: '1',
|
||||
single_line_number: 3,
|
||||
carousel_col: 3,
|
||||
shop_number: 10,
|
||||
is_show: ['title', 'price', 'original_price'],
|
||||
seckill_button_show: '1',
|
||||
is_shop_show: '1',
|
||||
shop_type: 'text',
|
||||
shop_button_text: '去抢购',
|
||||
shop_button_icon_class: '',
|
||||
seckill_subscript_show: '1',
|
||||
subscript_text: '秒杀'
|
||||
},
|
||||
|
|
@ -119,10 +131,25 @@ const defaultSeckill: DefaultSeckill = {
|
|||
shop_price_typeface: '500',
|
||||
shop_price_size: 18,
|
||||
shop_price_color: "#EA3323;",
|
||||
original_price_color: '',
|
||||
seckill_subscript_location: '',
|
||||
seckill_subscript_text_color: '',
|
||||
seckill_subscript_bg_color: '',
|
||||
shop_button_typeface:'400',
|
||||
shop_button_size: 12,
|
||||
shop_button_color: [
|
||||
{
|
||||
color: '#FF3D53',
|
||||
color_percentage: undefined
|
||||
},
|
||||
{
|
||||
color: '#D73A3A',
|
||||
color_percentage: undefined
|
||||
}
|
||||
],
|
||||
shop_button_text_color: '#fff',
|
||||
shop_icon_size: 10,
|
||||
shop_icon_color: "#fff",
|
||||
original_price_color: '#999',
|
||||
seckill_subscript_location: 'top-left',
|
||||
seckill_subscript_text_color: '#fff',
|
||||
seckill_subscript_bg_color: '#FF7607',
|
||||
progress_bg_color: '#FFEDED',
|
||||
progress_actived_color_list: [{ color: '#FF3131', color_percentage: undefined }, { color: '#FF973D', color_percentage: undefined }],
|
||||
progress_actived_direction: '180deg',
|
||||
|
|
|
|||
Loading…
Reference in New Issue