新增预售页面

This commit is contained in:
于肖磊
2026-04-10 18:07:57 +08:00
parent 7f2a5fda0a
commit d543ea2a90
7 changed files with 1558 additions and 0 deletions

1
.gitignore vendored
View File

@ -31,3 +31,4 @@ coverage
*.sw?
pnpm-lock.yaml
.trae

14
src/api/presale.ts Normal file
View File

@ -0,0 +1,14 @@
import api_request from '@/utils/api-request';
class PresaleAPI {
/** 预售商品查询接口*/
static getPresaleList(data: any) {
return api_request({
url: `plugins/index/pluginsname/presale/pluginscontrol/diyapi/pluginsaction/presaledata`,
method: 'post',
data,
});
}
}
export default PresaleAPI;

View File

@ -0,0 +1,552 @@
<template>
<div :style="style">
<div :style="style_img_container">
<div class="flex-col gap-10">
<div v-if="form.head_state == '1'" class="oh" :style="presale_head_style">
<div class="presale-head flex-row align-c jc-sb oh" :style="presale_head_img_style">
<div :class="['flex-1 flex-row align-c', { 'gap-10': form.theme != '1', 'jc-sb w': form.theme == '2' }]">
<div class="presale-title">
<image-empty v-if="form.title_type == 'image'" v-model="form.title_src[0]" error-img-style="width:2.1rem; height: 1rem;"></image-empty>
<span v-else :style="`color: ${new_style.title_color};font-size: ${new_style.title_size}px;line-height:21px;font-weight:600;`">{{ form.title_text }}</span>
</div>
</div>
<div v-if="form.button_status == '1'" class="flex-row align-c" :style="`color: ${new_style.head_button_color}`">
<span :style="`font-size: ${new_style.head_button_size}px;`">{{ form.button_text }}</span>
<el-icon class="iconfont icon-arrow-right" :color="new_style.head_button_color"></el-icon>
</div>
</div>
</div>
<div class="oh" :style="shop_container">
<div class="oh" :style="shop_img_container">
<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="layout_style">
<div :class="['oh w h', ['1'].includes(shop_style_type) ? 'flex-row' : 'flex-col' ]" :style="layout_img_style">
<template v-if="!isEmpty(item)">
<div class="oh re" :class="`flex-img${shop_style_type}`">
<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>
<!-- 角标 -->
<subscript-index :value="props.value"></subscript-index>
</div>
</template>
<div 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 w flex-1 jc-sb oh" :style="content_style">
<div class="flex-col gap-10 w">
<!-- 标题 -->
<div v-if="is_show('title') || is_show('simple_desc')" class="flex-col" :style="`gap: ${ new_style.title_simple_desc_spacing }px;`">
<div v-if="is_show('title')" :style="trends_config('title', 'title')" class="text-line-2">{{ item.title }}</div>
<div v-if="is_show('simple_desc')" class="text-line-1" :style="trends_config('simple_desc', 'desc')">{{ item.simple_desc }}</div>
</div>
</div>
<div class="flex-row align-e gap-10 jc-sb">
<div class="flex-col gap-5">
<div v-if="is_show('price') && (!isEmpty(item.min_price) || typeof item.min_price == 'number')" class="num" :style="`color: ${new_style.shop_price_color}`">
<span v-if="form.shop_style_type == '1'" class="size-10 pr-4">{{ form.presale_pirce_title }}</span>
<span :style="trends_config('price_symbol')">{{ item.show_price_symbol }}</span
><span :style="trends_config('price')">{{ item.min_price }}</span>
<span v-if="is_show('price_unit')" :style="trends_config('price_unit')">{{ item.show_price_unit }}</span>
</div>
<div v-if="is_show('original_price') && (!isEmpty(item.min_original_price) || typeof item.min_original_price == 'number')" class="size-11 flex" :style="trends_config('original_price')">
<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>
</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">
<div :class="layout_type" :style="layout_style">
<div :class="['oh w h', ['1'].includes(shop_style_type) ? 'flex-row' : 'flex-col' ]" :style="layout_img_style">
<template v-if="!isEmpty(item)">
<div class="oh re w h">
<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>
<!-- 角标 -->
<subscript-index :value="props.value"></subscript-index>
</div>
</template>
<div 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 w flex-1 jc-sb" :style="content_style">
<div class="flex-col gap-10 w">
<!-- 标题 -->
<div v-if="is_show('title') || is_show('simple_desc')" class="flex-col" :style="`gap: ${ new_style.title_simple_desc_spacing }px;`">
<div v-if="is_show('title')" :style="trends_config('title', 'title')" class="text-line-2">{{ item.title }}</div>
<div v-if="is_show('simple_desc')" class="text-line-1" :style="trends_config('simple_desc', 'desc')">{{ item.simple_desc }}</div>
</div>
</div>
<div class="flex-row align-e gap-10 jc-sb">
<div class="flex-col gap-5">
<div v-if="is_show('price') && (!isEmpty(item.min_price) || typeof item.min_price == 'number')" class="num" :style="trends_config('original_price')">
<span v-if="form.shop_style_type == '1'" class="size-10 pr-4">{{ form.presale_pirce_title }}</span>
<span :style="trends_config('price_symbol')">{{ item.show_price_symbol }}</span
><span :style="trends_config('price')">{{ item.min_price }}</span>
<span v-if="is_show('price_unit')" :style="trends_config('price_unit')">{{ item.show_price_unit }}</span>
</div>
<div v-if="is_show('original_price') && (!isEmpty(item.min_original_price) || typeof item.min_original_price == 'number')" 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>
</div>
</div>
</swiper-slide>
</swiper>
</template>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { background_computer, common_styles_computer, get_math, gradient_computer, gradient_handle, padding_computer, radius_computer, common_img_computer, margin_computer, box_shadow_computer, border_computer } from '@/utils';
import { old_margin, old_border_and_box_shadow, old_radius, old_padding } from '@/utils/common'
import { isEmpty, throttle } from 'lodash';
import PresaleAPI from '@/api/presale';
import { Swiper, SwiperSlide } from 'swiper/vue';
import { Autoplay } from 'swiper/modules';
const modules = [Autoplay];
const props = defineProps({
value: {
type: Object,
default: () => {
return {};
},
},
});
const form = computed(() => props.value?.content || {});
const new_style = computed(() => props.value?.style || {});
//#region 预售头部控制
const time_bg = computed(() => {
const { countdown_bg_color_list, countdown_direction } = new_style.value;
// 渐变
const gradient = { color_list: countdown_bg_color_list, direction: countdown_direction };
return gradient_computer(gradient);
});
// icon的渐变色处理
const icon_time_check = () => {
return `${time_bg.value};line-height: 1;background-clip: text;-webkit-background-clip: text;-webkit-text-fill-color: transparent;`;
};
const slide_active_color = computed(() => {
const { progress_actived_color_list, progress_actived_direction } = new_style.value;
// 渐变
const gradient = { color_list: progress_actived_color_list, direction: progress_actived_direction };
return gradient_computer(gradient);
});
const presale_head_style = computed(() => {
let style = ``;
const { header_background_color_list, header_background_direction, presale_head_radius, presale_head_margin = old_margin, presale_head_style = old_border_and_box_shadow } = new_style.value;
// 渐变
const gradient = { color_list: header_background_color_list, direction: header_background_direction };
style += gradient_computer(gradient) + radius_computer(presale_head_radius) + margin_computer(presale_head_margin) + box_shadow_computer(presale_head_style) + border_computer(presale_head_style);
return style;
});
const presale_head_img_style = computed(() => {
let style = ``;
const { header_background_img, header_background_img_style, presale_head_padding } = new_style.value;
// 背景图
const back = { background_img: header_background_img, background_img_style: header_background_img_style };
// 预售头部内间距设置, 没有的时候默认15px
const padding = !isEmpty(presale_head_padding) ? presale_head_padding : { padding: 0, padding_top: 15, padding_bottom: 15, padding_left: 13, padding_right: 13};
style += background_computer(back) + padding_computer(padding);
return style;
});
// 商品内容区域显示
const shop_container = computed(() => {
const { shop_content_color_list = [], shop_content_direction = '', shop_content_radius = old_radius, shop_content_margin = old_margin, shop_content = old_border_and_box_shadow } = new_style.value;
// 渐变
const gradient = { color_list: shop_content_color_list, direction: shop_content_direction };
return gradient_computer(gradient) + radius_computer(shop_content_radius) + margin_computer(shop_content_margin) + border_computer(shop_content) + box_shadow_computer(shop_content);
});
const shop_img_container = computed(() => {
const { shop_content_background_img_style = '2', shop_content_background_img = [], shop_content_padding = old_padding } = new_style.value;
// 背景图
const back = { background_img: shop_content_background_img, background_img_style: shop_content_background_img_style };
return padding_computer(shop_content_padding) + background_computer(back);
});
//#endregion
const style = computed(() => common_styles_computer(props.value.style.common_style));
const style_img_container = computed(() => common_img_computer(props.value.style.common_style));
//#region 预售默认数据
interface plugins_icon_data {
name: string;
bg_color: string;
br_color: string;
color: string;
url: string;
}
interface data_list {
title: string;
images: string;
new_cover: string[];
min_original_price: string;
show_original_price_symbol: string;
show_original_price_unit: string;
simple_desc: string;
min_price: string;
show_price_symbol: string;
show_price_unit: string;
sales_count: string;
plugins_view_icon_data: plugins_icon_data[];
}
const default_list = {
title: '测试商品标题',
min_original_price: '41.2',
show_original_price_symbol: '¥',
show_original_price_unit: '/ 台',
min_price: '51',
show_price_symbol: '¥',
show_price_unit: '/ 台',
sales_count: '1000',
images: '',
new_cover: [],
plugins_view_icon_data: [
{
name: '满减活动',
bg_color: '#EA3323',
br_color: '',
color: '#fff',
url: '',
},
{
name: '包邮',
bg_color: '',
br_color: '#EA3323',
color: '#EA3323',
url: '',
},
{
name: '领劵',
bg_color: '',
br_color: '#EA9223',
color: '#EA9223',
url: '',
},
],
};
//#endregion
//#region 倒计时和商品数据获取
// 显示时间
const time_config = reactive([
{ key: 'hour', value: '00' },
{ key: 'minute', value: '00' },
{ key: 'second', value: '00' },
]);
// 定时任务器
const intervalId = ref<any>(undefined);
// 数据存放,用于倒计时
const presale_time = ref({
endTime: '2024-09-04 18:51:00',
startTime: '2024-09-04 18:51:00',
status: 0,
time_first_text: '距结束',
});
const list = ref<data_list[]>([]);
// 更新倒计时函数
onBeforeMount(() => {
if (form.value.is_left == '1') {
PresaleAPI.getPresaleList({}).then((res: any) => {
const data = res.data;
init(data);
});
} else {
init(form.value.data);
}
});
const init = (data: any) => {
if (!isEmpty(data)) {
list.value = data;
} else {
list.value = Array(4).fill(default_list);
}
}
// 组件销毁时,清除定时器
onUnmounted(() => {
clearInterval(intervalId.value);
})
//#endregion
//#region 商品样式
// 商品间距
const content_outer_spacing = computed(() => new_style.value.content_outer_spacing);
// 圆角设置
const content_radius = computed(() => radius_computer(new_style.value.shop_radius));
// 选择的风格
const shop_style_type = computed(() => form.value.shop_style_type);
// 内边距设置
const content_padding = computed(() => padding_computer(new_style.value.shop_padding));
// 内容区域的样式
const content_style = computed(() => {
const spacing_value = new_style.value.content_spacing;
let spacing = '';
if (shop_style_type.value == '1') {
spacing = `margin-left: ${spacing_value}px;`;
} else {
spacing = content_padding.value;
}
return `${spacing}`;
});
// 不同风格下的样式
const layout_type = computed(() => {
let class_type = '';
switch (shop_style_type.value) {
case '1':
class_type = `oh multicolumn-columns`;
break;
case '2':
class_type = `multicolumn-columns`;
break;
case '3':
class_type = `roll-columns`;
break;
default:
break;
}
return class_type;
});
// 容器样式
const layout_style = computed(() => {
const radius = content_radius.value;
const { shop_style = old_border_and_box_shadow, shop_color_list = [], shop_direction = '', shop_margin = old_margin } = new_style.value;
const style = gradient_handle(shop_color_list, shop_direction) + margin_computer(shop_margin) + border_computer(shop_style) + box_shadow_computer(shop_style);
return `${radius} ${ style }`;
});
// 容器图片样式
const layout_img_style = computed(() => {
const padding = ['1'].includes(shop_style_type.value) ? content_padding.value : '';
const data = {
background_img_style: new_style.value.shop_background_img_style,
background_img: new_style.value.shop_background_img,
}
return padding + background_computer(data);
});
//#endregion
//#region 图片大小控制
const shop_style_type_list= [
{ name: '单列', value: '1', width: 110, height: 120 },
{ name: '双列', value: '2', width: 180, height: 180 },
{ name: '横向滑动', value: '3', width: 0, height: 0 },
];
// 宽度和高度为空的时候,修改默认值
const goods_img_width = computed(() => {
if (typeof new_style.value.content_img_width == 'number') {
return new_style.value.content_img_width + 'px';
} else {
const list = shop_style_type_list.filter(item => item.value == form.value.theme);
if (list.length > 0) {
return list[0].width + 'px';
} else {
return 'auto';
}
}
});
// 宽度和高度为空的时候,修改默认值
const goods_img_height = computed(() => {
if (typeof new_style.value.content_img_height == 'number') {
return new_style.value.content_img_height + 'px';
} else {
const list = shop_style_type_list.filter(item => item.value == form.value.theme);
if (list.length > 0) {
return list[0].height + 'px';
} else {
return 'auto';
}
}
});
//#endregion
//#region 通用处理方式,处理文字大小和颜色等
// 根据传递的参数,从对象中取值
const trends_config = (key: string, type?: string) => {
return style_config(new_style.value[`shop_${key}_typeface`], new_style.value[`shop_${key}_size`], new_style.value[`shop_${key}_color`], type);
};
// 根据传递的值,显示不同的内容
const style_config = (typeface: string, size: number, color: string | object, type?: string) => {
let style = `font-weight:${typeface}; font-size: ${size}px;`;
if (type == 'gradient') {
style += button_gradient();
} else if (type == 'title') {
style += `line-height: ${size > 0 ? size + 3 : 0}px;height: ${size > 0 ? (size + 3) * 2 : 0}px;color: ${color};`;
} else if (type == 'desc') {
style += `line-height: ${size}px;height: ${size}px;color: ${color};`;
} else {
style += `color: ${color};`;
}
return style;
};
// 按钮渐变色处理
const button_gradient = () => {
return gradient_handle(new_style.value.shop_button_color, '180deg');
};
//#endregion
const shop_left_right_width_margin = computed(() => {
const { shop_margin = old_margin } = new_style.value;
return shop_margin.margin_left + shop_margin.margin_right;
});
// 不换行显示
const multicolumn_columns_width = computed(() => {
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') {
model_number = 2;
}
// 计算间隔的空间。(gap * gap数量) / 模块数量
let gap = ((new_style.value.content_outer_spacing * (model_number - 1)) + (shop_left_right_width_margin.value * model_number) / model_number);
return `calc(${100 / model_number}% - ${gap}px)`;
});
// 判断是否显示对应的内容
const is_show = (index: string) => {
return form.value.is_show.includes(index);
};
//#region 轮播图
// 轮播图key值
const carouselKey = ref('0');
const autoplay = ref<boolean | object>(false);
const slides_per_group = ref(1);
// 内容参数的集合
watchEffect(() => {
// 是否滚动
if (new_style.value.is_roll == '1') {
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));
//#endregion
</script>
<style lang="scss" scoped>
:deep(.el-image) {
.image-slot img {
width: 5rem;
height: 5rem;
}
}
.identifying {
font-size: 0.9rem;
}
.presale-head {
// padding: 1.5rem 1.3rem;
width: 100%;
height: 5.1rem;
border-radius: 0.8rem 0.8rem 0 0;
.presale-title {
height: 2.1rem;
}
.time-config {
padding: 0.1rem 0.5rem;
line-height: 1.7rem;
border-radius: 0.4rem;
}
}
.presale-head-icon {
width: 1.6rem;
height: 1.6rem;
}
.colon {
position: relative;
top: -0.1rem;
}
.multicolumn-columns {
height: 100%;
width: v-bind(multicolumn_columns_width) !important;
min-width: v-bind(multicolumn_columns_width) !important;
}
.flex-img1 {
width: v-bind(goods_img_width);
height: v-bind(goods_img_height);
}
.flex-img2 {
width: 100%;
height: v-bind(goods_img_height);
}
.flex-img3 {
height: 100%;
width: 100%;
}
.slide-bottom {
height: 1rem;
border-radius: 0.5rem;
background: red;
}
.slide-top {
position: absolute;
height: 1rem;
top: 0;
left: 0;
border-radius: 0.5rem;
.slide-top-icon {
position: absolute;
top: -0.3rem;
right: 0;
width: 1.6rem;
height: 1.6rem;
display: flex;
align-items: center;
justify-content: center;
}
}
.original-price {
text-decoration-line: line-through;
}
.roll-columns {
height: v-bind(multicolumn_columns_height);
}
</style>

View File

@ -0,0 +1,202 @@
<template>
<div class="content">
<el-form :model="form" label-width="70" class="m-h">
<common-content-top :value="form.content_top"></common-content-top>
<div class="divider-line"></div>
<card-container>
<div class="mb-12">头部设置</div>
<el-form-item label="头部状态">
<el-switch v-model="form.head_state" active-value="1" inactive-value="0"></el-switch>
</el-form-item>
<template v-if="form.head_state == '1'">
<el-form-item label="选择风格">
<theme-select v-model="form.theme" :data="base_list.themeList" @update:model-value="themeChange"></theme-select>
</el-form-item>
<el-form-item label="主题类型">
<el-radio-group v-model="form.title_type">
<el-radio value="text">文字</el-radio>
<el-radio value="image">图片</el-radio>
</el-radio-group>
</el-form-item>
<template v-if="form.title_type == 'image'">
<el-form-item label="标题图片">
<upload v-model="form.title_src" :limit="1" size="50"></upload>
</el-form-item>
</template>
<template v-else>
<el-form-item label="标题文字">
<el-input v-model="form.title_text" placeholder="请输入标题文字" clearable></el-input>
</el-form-item>
</template>
<el-form-item label="按钮状态">
<el-switch v-model="form.button_status" active-value="1" inactive-value="0"></el-switch>
</el-form-item>
<el-form-item v-if="form.button_status == '1'" label="按钮文字">
<el-input v-model="form.button_text" placeholder="请输入按钮文字" clearable></el-input>
</el-form-item>
</template>
</card-container>
<div class="divider-line"></div>
<card-container>
<div class="mb-12">商品风格</div>
<el-form-item label="风格类型">
<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.carousel_col">
<el-radio :value="1">单列展示</el-radio>
<el-radio :value="2">两列展示</el-radio>
<el-radio :value="3">三列展示</el-radio>
<el-radio :value="4">四列展示</el-radio>
</el-radio-group>
</el-form-item>
</card-container>
<div class="divider-line"></div>
<card-container>
<div class="mb-12">商品设置</div>
<el-form-item label="展示信息">
<el-checkbox-group v-model="form.is_show">
<el-checkbox v-for="item in base_list.list_show_list" :key="item.value" :value="item.value">{{ item.name }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<template v-if="form.shop_style_type == '1'">
<el-form-item label="预售名称">
<el-input v-model="form.presale_pirce_title" placeholder="请输入预售名称"></el-input>
</el-form-item>
</template>
<el-form-item label="预售按钮">
<el-row class="w">
<el-col :span="24"><el-switch v-model="form.is_shop_show" active-value="1" inactive-value="0"></el-switch></el-col>
</el-row>
<el-row v-if="form.is_shop_show == '1'" class="mt-10 w">
<el-col :span="24">
<el-radio-group v-model="form.shop_type" class="mb-10" @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>
</el-col>
</el-row>
</el-form-item>
<!-- 角标设置 -->
<subscript-content :value="form"></subscript-content>
</card-container>
</el-form>
</div>
</template>
<script setup lang="ts">
import { commonStore } from '@/store';
const common_store = commonStore();
const props = defineProps({
value: {
type: Object,
default: () => ({}),
},
styles: {
type: Object,
default: () => ({}),
},
defaultConfig: {
type: Object,
default: () => ({
// 图片不同风格下的圆角
img_radius_0: 4,
img_radius_1: 0,
}),
},
});
const form = ref(props.value);
const data = ref(props.styles);
onBeforeMount(() => {
init();
});
const init = () => {
// 如果历史数据没有操作,则修改默认值
const { content_img_width = '', content_img_height = '' } = data.value;
// 宽度和高度为空的时候,并且不是无图模式和左右滑动模式的时候,修改默认值
if ((typeof content_img_width != 'number' || typeof content_img_height != 'number') && !['3'].includes(form.value.shop_style_type)) {
const list = base_list.shop_style_type_list.filter(item => item.value == form.value.shop_style_type);
if (list.length > 0) {
emit('shop_style_change', list[0].width, list[0].height);
}
}
};
const emit = defineEmits(['update:change-theme', 'shop_style_change']);
const base_list = {
themeList: [
{ id: '1', name: '风格1', url: common_store.common.config.attachment_host + `/static/diy/images/components/model-presale/theme-1.png` },
{ id: '2', name: '风格2', url: common_store.common.config.attachment_host + `/static/diy/images/components/model-presale/theme-2.png` },
{ id: '3', name: '风格3', url: common_store.common.config.attachment_host + `/static/diy/images/components/model-presale/theme-3.png` },
],
shop_style_type_list: [
{ name: '单列', value: '1', width: 110, height: 120 },
{ name: '双列', value: '2', width: 180, height: 180 },
{ name: '横向滑动', value: '3', width: 0, height: 0 },
],
list_show_list: [
{ name: '商品名称', value: 'title' },
{ name: '商品简述', value: 'simple_desc' },
{ name: '商品售价', value: 'price' },
{ name: '商品原价', value: 'original_price' },
{ 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.shop_style_type = 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 list = base_list.shop_style_type_list.filter(item => item.value == form.value.shop_style_type);
if (list.length > 0) {
emit('shop_style_change', list[0].width, list[0].height);
}
};
const themeChange = (val: string) => {
emit('update:change-theme', val);
};
watchEffect(() => {
form.value = props.value;
init();
});
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,181 @@
<template>
<div class="auxiliary-line-setting">
<template v-if="type == '1'">
<model-presale-content :value="form.content" :styles="form.style" :default-config="data_config" @update:change-theme="change_theme" @shop_style_change="shop_style_change"></model-presale-content>
</template>
<template v-if="type == '2'">
<model-presale-styles :value="form.style" :content="form.content" :default-config="data_config"></model-presale-styles>
</template>
</div>
</template>
<script setup lang="ts">
import { cloneDeep } from 'lodash';
import { online_url } from '@/utils';
const props = defineProps({
type: {
type: String,
default: '1',
},
value: {
type: Object,
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/presale/images/diy/').then(res => res);
// 全部的默认数据
default_data = {
content: {
title_type: 'image',
title_src: [{ id: 1, url: new_url.value + 'header-title.png', original: '标题', title: '标题', ext: '.png', type: 'img' }],
title_text: '限时预售',
},
style: {
title_color: '#fff',
title_size: 18,
head_button_color: '#fff',
head_button_size: 12,
end_text_color: '#fff',
countdown_bg_color_list: [{ color: '#fff', color_percentage: undefined }],
countdown_direction: '180deg',
countdown_color: '#FF1818',
header_background_color_list: [{ color: '', color_percentage: undefined }],
header_background_direction: '180deg',
header_background_img_style: '2',
header_background_img: [{ id: 1, url: new_url.value + 'header-bg.png', original: '背景', title: '背景1', ext: '.png', type: 'img' }],
shop_direction: '90deg',
shop_color_list: [{ color: '#fff', color_percentage: undefined }],
shop_background_img_style: '0',
shop_background_img: [],
shop_radius: {
radius: 8,
radius_top_left: 8,
radius_top_right: 8,
radius_bottom_left: 8,
radius_bottom_right: 8,
} ,
shop_img_radius: {
radius: 4,
radius_top_left: 4,
radius_top_right: 4,
radius_bottom_left: 4,
radius_bottom_right: 4,
},
shop_padding: {
padding: 10,
padding_top: 10,
padding_bottom: 10,
padding_left: 10,
padding_right: 10,
},
content_outer_spacing: 10, // 商品间距
content_spacing: 10,
content_outer_height: 232,
shop_title_typeface: 'bold',
shop_title_size: 14,
shop_title_color: "#333333",
shop_price_typeface: 'bold',
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',
presale_subscript_location: 'top-left',
presale_subscript_text_color: '#fff',
presale_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: '#FFDE81',
progress_button_icon_color: '#FF2525',
progress_text_color: '#FF3434',
is_roll: '1',
interval_time: 3,
rolling_fashion: 'translation',
}
}
// 每个样式下独立的默认数据
default_config = {
style: {
theme_1: {},
theme_2: {
content: {
title_type: 'image',
title_src: [{ id: 1, url: new_url.value + 'header-title-2.png', original: '标题2', title: '标题2', ext: '.png', type: 'img' }],
button_status: '0',
},
style: {
title_color: '#000',
end_text_color: '#666',
header_background_color_list: [{ color: '#F0E0FF', color_percentage: undefined },{ color: '#F9EFFF', color_percentage: 50 }, { color: '#FFFFFF', color_percentage: undefined }],
header_background_img: [],
countdown_bg_color_list: [{ color: '#FF4909', color_percentage: undefined }, { color: '#FF8E4D', color_percentage: undefined }],
countdown_direction: '180deg',
countdown_color: '#fff',
}
},
theme_3: {
content: {
title_type: 'text',
title_src: [],
button_status: '1',
},
style: {
title_color: '#000',
head_button_color: '#000',
end_text_color: '#666',
header_background_color_list: [{ color: '#fff', color_percentage: undefined }],
header_background_img: [],
countdown_bg_color_list: [{ color: '#000', color_percentage: undefined }],
countdown_direction: '180deg',
countdown_color: '#fff',
}
}
},
};
})
//#endregion
const form = ref(props.value);
// 切换风格的时候会将对应风格的默认数据合并到form中
const change_theme = (val: string) => {
if (val) {
// 将默认数据样式合并到form中
form.value.style = Object.assign({}, form.value.style, cloneDeep(default_data.style), cloneDeep((<arrayIndex>default_config.style)[`theme_${Number(val)}`].style));
// 将默认数据样式合并到form中
form.value.content = Object.assign({}, form.value.content, cloneDeep(default_data.content), cloneDeep((<arrayIndex>default_config.style)[`theme_${Number(val)}`].content));
}
};
const shop_style_change = (width: number, height: number) => {
form.value.style.content_img_width = width;
form.value.style.content_img_height = height;
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,247 @@
<template>
<div class="w">
<el-form :model="form" label-width="70">
<template v-if="data.head_state == '1'">
<card-container>
<div class="mb-12">头部样式</div>
<el-form-item v-if="data.title_type == 'text'" label="标题设置">
<color-text-size-group v-model:color="form.title_color" v-model:size="form.title_size" :default-color="clone_form.title_color" :type-list="['color', 'size']"></color-text-size-group>
</el-form-item>
<el-form-item label="预售提示">
<color-picker v-model="form.end_text_color" :default-color="clone_form.end_text_color"></color-picker>
</el-form-item>
<el-form-item label="时间背景">
<mult-color-picker :value="form.countdown_bg_color_list" :type="form.countdown_direction" @update:value="countdown_color_picker_event"></mult-color-picker>
</el-form-item>
<el-form-item label="时间颜色">
<color-picker v-model="form.countdown_color" :default-color="clone_form.countdown_color"></color-picker>
</el-form-item>
<el-form-item v-if="data.button_status == '1'" label="按钮设置">
<color-text-size-group v-model:color="form.head_button_color" v-model:size="form.head_button_size" :default-color="clone_form.head_button_color" :type-list="['color', 'size']"></color-text-size-group>
</el-form-item>
<el-form-item label="头部背景">
<background-common v-model:color_list="form.header_background_color_list" v-model:direction="form.header_background_direction" v-model:img_style="form.header_background_img_style" v-model:img="form.header_background_img" @mult_color_picker_event="mult_color_picker_event" />
</el-form-item>
<el-form-item label="圆角">
<radius :value="form.presale_head_radius"></radius>
</el-form-item>
<el-form-item label="外间距">
<margin :value="form.presale_head_margin"></margin>
</el-form-item>
<el-form-item label="内间距">
<padding :value="form.presale_head_padding"></padding>
</el-form-item>
<!-- 边框处理 -->
<border-config v-model:show="form.presale_head_style.border_is_show" v-model:color="form.presale_head_style.border_color" v-model:style="form.presale_head_style.border_style" v-model:size="form.presale_head_style.border_size"></border-config>
<!-- 阴影配置 -->
<shadow-config v-model="form.presale_head_style"></shadow-config>
</card-container>
<div class="divider-line"></div>
</template>
<card-container>
<div class="mb-12">内容样式</div>
<el-form-item label="内容背景">
<background-common v-model:color_list="form.shop_content_color_list" v-model:direction="form.shop_content_direction" v-model:img_style="form.shop_content_background_img_style" v-model:img="form.shop_content_background_img" @mult_color_picker_event="shop_content_mult_color_picker_event" />
</el-form-item>
<el-form-item label="圆角">
<radius :value="form.shop_content_radius"></radius>
</el-form-item>
<el-form-item label="外间距">
<margin :value="form.shop_content_margin"></margin>
</el-form-item>
<el-form-item label="内间距">
<padding :value="form.shop_content_padding"></padding>
</el-form-item>
<!-- 边框处理 -->
<border-config v-model:show="form.shop_content.border_is_show" v-model:color="form.shop_content.border_color" v-model:style="form.shop_content.border_style" v-model:size="form.shop_content.border_size"></border-config>
<!-- 阴影配置 -->
<shadow-config v-model="form.shop_content"></shadow-config>
</card-container>
<div class="divider-line"></div>
<card-container>
<div class="mb-12">商品样式</div>
<el-form-item label="商品背景">
<background-common v-model:color_list="form.shop_color_list" v-model:direction="form.shop_direction" v-model:img_style="form.shop_background_img_style" v-model:img="form.shop_background_img" @mult_color_picker_event="shop_mult_color_picker_event" />
</el-form-item>
<template v-if="data.is_show.includes('title')">
<el-form-item label="商品名称">
<color-text-size-group v-model:color="form.shop_title_color" v-model:typeface="form.shop_title_typeface" v-model:size="form.shop_title_size" default-color="#000000"></color-text-size-group>
</el-form-item>
</template>
<template v-if="data.is_show.includes('simple_desc')">
<el-form-item label="商品简述">
<color-text-size-group v-model:color="form.shop_simple_desc_color" v-model:size="form.shop_simple_desc_size" default-color="#999" :type-list="['color', 'size']">
<el-form-item label="间距" label-width="40" class="mb-0 w form-item-child-label">
<slider v-model="form.title_simple_desc_spacing" :max="100"></slider>
</el-form-item>
</color-text-size-group>
</el-form-item>
</template>
<template v-if="data.is_show.includes('price')">
<el-form-item label="商品价格">
<color-text-size-group v-model:color="form.shop_price_color" v-model:typeface="form.shop_price_typeface" v-model:size="form.shop_price_size" default-color="#000000"></color-text-size-group>
</el-form-item>
<el-form-item label="售价符号">
<color-text-size-group v-model:color="form.shop_price_symbol_color" v-model:size="form.shop_price_symbol_size" default-color="#EA3323" :type-list="['color', 'size']"></color-text-size-group>
</el-form-item>
<template v-if="data.is_show.includes('price_unit')">
<el-form-item label="售价单位">
<color-text-size-group v-model:color="form.shop_price_unit_color" v-model:size="form.shop_price_unit_size" default-color="#EA3323" :type-list="['color', 'size']"></color-text-size-group>
</el-form-item>
</template>
</template>
<template v-if="data.is_show.includes('original_price')">
<el-form-item label="原价价格">
<color-text-size-group v-model:color="form.shop_original_price_color" v-model:size="form.shop_original_price_size" default-color="#999" :type-list="['color', 'size']"></color-text-size-group>
</el-form-item>
</template>
<el-form-item label="内容圆角">
<radius :value="form.shop_radius"></radius>
</el-form-item>
<template v-if="data.shop_style_type == '3'">
<el-form-item label="内容高度">
<slider v-model="form.content_outer_height" :max="1000"></slider>
</el-form-item>
</template>
<el-form-item label="外间距">
<margin :value="form.shop_margin"></margin>
</el-form-item>
<el-form-item label="内间距">
<padding :value="form.shop_padding"></padding>
</el-form-item>
<el-form-item v-if="data.shop_style_type == '1'" label="内容间距">
<slider v-model="form.content_spacing" :max="100"></slider>
</el-form-item>
<el-form-item label="商品间距">
<slider v-model="form.content_outer_spacing" :max="100"></slider>
</el-form-item>
<el-form-item label="图片圆角">
<radius :value="form.shop_img_radius"></radius>
</el-form-item>
<!-- 边框处理 -->
<border-config v-model:show="form.shop_style.border_is_show" v-model:color="form.shop_style.border_color" v-model:style="form.shop_style.border_style" v-model:size="form.shop_style.border_size"></border-config>
<!-- 阴影配置 -->
<shadow-config v-model="form.shop_style"></shadow-config>
<template v-if="data.shop_style_type !== '3'">
<el-form-item v-if="data.shop_style_type == '1'" label="图片宽度">
<slider v-model="form.content_img_width" :max="1000"></slider>
</el-form-item>
<el-form-item label="图片高度">
<slider v-model="form.content_img_height" :max="1000"></slider>
</el-form-item>
</template>
</card-container>
<!-- 预售角标 -->
<template v-if="data.presale_subscript_show == '1'">
<div class="divider-line"></div>
<subscript-styles :value="form.subscript_style" :data="data"></subscript-styles>
</template>
<!-- 预售按钮 -->
<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" slider-name="大小" 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 == '3'">
<div class="divider-line"></div>
<card-container>
<div class="mb-12">轮播设置</div>
<el-form-item label="自动轮播">
<el-switch v-model="form.is_roll" active-value="1" inactive-value="0" />
</el-form-item>
<el-form-item label="间隔时间">
<slider v-model="form.interval_time" :min="1" :max="100"></slider>
</el-form-item>
<el-form-item label="滚动方式">
<el-radio-group v-model="form.rolling_fashion">
<el-radio v-for="item in base_list.rolling_fashion_list" :key="item.value" :value="item.value">{{ item.name }}</el-radio>
</el-radio-group>
</el-form-item>
</card-container>
</template>
</el-form>
<div class="divider-line"></div>
<common-styles :value="form.common_style" @update:value="common_style_update" />
</div>
</template>
<script setup lang="ts">
import { cloneDeep, isEmpty } from 'lodash';
const props = defineProps({
value: {
type: Object,
default: () => ({}),
},
content: {
type: Object,
default: () => ({}),
},
});
// 默认值
const state = reactive({
form: props.value,
data: props.content,
});
// 如果需要解构确保使用toRefs
const { form, data } = toRefs(state);
let clone_form = cloneDeep(props.value);
const base_list = {
location_list: [
{ name: '左上', value: 'top-left' },
{ name: '右上', value: 'top-right' },
{ name: '左下', value: 'bottom-left' },
{ name: '右下', value: 'bottom-right' },
],
rolling_fashion_list: [
{ name: '平移', value: 'translation' },
{ name: '切屏', value: 'cut-screen' },
],
};
const common_style_update = (value: any) => {
form.value.common_style = value;
};
// 顶部背景设置
const mult_color_picker_event = (arry: color_list[], type: number) => {
form.value.header_background_color_list = arry;
form.value.header_background_direction = type.toString();
};
// 倒计时背景设置
const countdown_color_picker_event = (arry: color_list[], type: number) => {
form.value.countdown_bg_color_list = arry;
form.value.countdown_direction = type.toString();
};
const shop_content_mult_color_picker_event = (arry: color_list[], type: number) => {
form.value.shop_content_color_list = arry;
form.value.shop_content_direction = type.toString();
};
// 商品背景渐变设置
const shop_mult_color_picker_event = (arry: color_list[], type: number) => {
form.value.shop_color_list = arry;
form.value.shop_direction = type.toString();
};
</script>
<style lang="scss" scoped>
.topic {
:deep(.el-form-item__content) {
align-items: flex-start;
flex-direction: column;
}
}
</style>

361
src/config/const/presale.ts Normal file
View File

@ -0,0 +1,361 @@
import defaultCommon from './index';
import subscriptStyle from './subscript-style';
import commonTop from './common-top';
import { online_url } from '@/utils';
const new_url = await online_url('/static/plugins/presale/images/diy/').then((res) => res);
interface DefaultPresale {
content: {
content_top: object;
head_state: string;
is_left: string;
data: string[],
theme: string;
title_type: string;
title_src: uploadList[];
title_text: string;
theme_4_static_img: uploadList[];
button_status: string;
button_text: string;
shop_style_type: string;
presale_pirce_title: string;
carousel_col: number;
shop_number: number;
is_show: string[];
shop_type: string;
shop_button_text: string;
shop_button_icon_class: string;
is_shop_show: string;
seckill_subscript_show: string;
subscript_type: string;
subscript_img_src: uploadList[];
subscript_icon_class: string;
subscript_text: string;
};
style: {
title_color: string;
title_size: number;
head_button_color: string;
head_button_size: number;
end_text_color: string;
countdown_bg_color_list: color_list[];
countdown_direction: string;
countdown_color: string;
header_background_color_list: color_list[];
header_background_direction: string;
header_background_img_style: string;
header_background_img: uploadList[];
presale_head_radius: radiusStyle;
presale_head_margin: marginStyle;
presale_head_padding: paddingStyle;
presale_head_style: object;
shop_direction: string,
shop_color_list: color_list[],
shop_background_img_style: string,
shop_background_img: uploadList[],
shop_radius: radiusStyle;
shop_img_radius: radiusStyle;
shop_margin: marginStyle;
shop_padding: paddingStyle;
shop_style: object;
content_outer_spacing: number;
content_spacing: number;
content_outer_height: number;
content_img_width: number | undefined;
content_img_height: number | undefined;
shop_content_direction: string;
shop_content_color_list: color_list[];
shop_content_background_img_style: string;
shop_content_background_img: string[];
shop_content_radius: radiusStyle;
shop_content_margin: marginStyle;
shop_content_padding: paddingStyle;
shop_content_spacing: number;
shop_content: object;
shop_title_color: string;
shop_title_typeface: string;
shop_title_size: number;
shop_simple_desc_typeface: string;
shop_simple_desc_size: number;
shop_simple_desc_color: string;
title_simple_desc_spacing: 4,
shop_price_typeface: string;
shop_price_size: number;
shop_price_color: string;
shop_price_symbol_color: string;
shop_price_symbol_size: number;
shop_price_unit_color: string;
shop_price_unit_size: number;
shop_original_price_color: string;
shop_original_price_size: number;
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;
subscript_style: object,
progress_bg_color: string;
progress_actived_color_list: color_list[];
progress_actived_direction: string;
progress_button_color: string;
progress_button_icon_color: string;
progress_text_color: string;
is_roll: string;
interval_time: number;
rolling_fashion: string;
common_style: object;
};
}
const defaultPresale: DefaultPresale = {
content: {
content_top: {
...commonTop,
},
// 头部状态
head_state: '1',
is_left: '1',
data: [],
// 主题风格配置
theme: '1',
title_type: 'image',
title_src: [{ id: 1, url: new_url + 'header-title.png', original: '标题', title: '标题', ext: '.png', type: 'img' }],
theme_4_static_img: [{ id: 2, url: new_url + 'time.png', original: '时钟', title: '时钟', ext: '.png', type: 'img' }],
title_text: '限时预售',
// 右侧按钮处理
button_status: '1',
button_text: '更多',
// 风格类型
shop_style_type: '1',
presale_pirce_title: '预售',
// 轮播数量
carousel_col: 3,
shop_number: 10,
// 商品显示信息
is_show: ['title', 'price', 'original_price'],
// 商品按钮显示
is_shop_show: '1',
shop_type: 'text',
shop_button_text: '去预定',
shop_button_icon_class: 'cart',
// 预售角标配置
seckill_subscript_show: '1',
subscript_type: 'text',
subscript_img_src: [],
subscript_icon_class: '',
subscript_text: '角标',
},
style: {
// 文字颜色
title_color: '#fff',
title_size: 18,
// 按钮设置
head_button_color: '#fff',
head_button_size: 12,
end_text_color: '#fff',
countdown_bg_color_list: [{ color: '#fff', color_percentage: undefined }],
countdown_direction: '180deg',
countdown_color: '#FF1818',
// 头部背景设置
header_background_color_list: [{ color: '', color_percentage: undefined }],
header_background_direction: '180deg',
header_background_img_style: '2',
header_background_img: [{ id: 1, url: new_url + 'header-bg.png', original: '背景', title: '背景1', ext: '.png', type: 'img' }],
presale_head_radius: {
radius: 0,
radius_top_left: 0,
radius_top_right: 0,
radius_bottom_left: 0,
radius_bottom_right: 0,
},
presale_head_margin: {
margin: 0,
margin_top: 0,
margin_bottom: 0,
margin_left: 0,
margin_right: 0,
},
// 头部内边距
presale_head_padding: {
padding: 0,
padding_top: 15,
padding_bottom: 15,
padding_left: 13,
padding_right: 13,
},
presale_head_style: {
// 边框样式
border_is_show: '0',
border_color: '#FF3F3F',
border_style: 'solid',
border_size: {
padding: 1,
padding_top: 1,
padding_right: 1,
padding_bottom: 1,
padding_left: 1,
},
// 阴影
box_shadow_color: '',
box_shadow_x: 0,
box_shadow_y: 0,
box_shadow_blur: 0,
box_shadow_spread: 0,
},
shop_direction: '90deg',
shop_color_list: [{ color: '#fff', color_percentage: undefined }],
shop_background_img_style: '0',
shop_background_img: [],
// 商品内容圆角
shop_radius: {
radius: 8,
radius_top_left: 8,
radius_top_right: 8,
radius_bottom_left: 8,
radius_bottom_right: 8,
},
// 商品图片圆角
shop_img_radius: {
radius: 4,
radius_top_left: 4,
radius_top_right: 4,
radius_bottom_left: 4,
radius_bottom_right: 4,
},
shop_margin: {
margin: 0,
margin_top: 0,
margin_bottom: 0,
margin_left: 0,
margin_right: 0,
},
// 商品间距
shop_padding: {
padding: 10,
padding_top: 10,
padding_bottom: 10,
padding_left: 10,
padding_right: 10,
},
shop_style: {
// 边框样式
border_is_show: '0',
border_color: '#FF3F3F',
border_style: 'solid',
border_size: {
padding: 1,
padding_top: 1,
padding_right: 1,
padding_bottom: 1,
padding_left: 1,
},
// 阴影
box_shadow_color: '',
box_shadow_x: 0,
box_shadow_y: 0,
box_shadow_blur: 0,
box_shadow_spread: 0,
},
content_outer_spacing: 10, // 商品外间距
// 商品内间距
content_spacing: 10,
// 商品高度
content_outer_height: 232,
content_img_width: undefined,
content_img_height: undefined,
// 商品内容设置
shop_content_direction: '90deg',
shop_content_color_list: [{ color: '', color_percentage: undefined }],
shop_content_background_img_style: '2',
shop_content_background_img: [],
shop_content_radius: {
radius: 0,
radius_top_left: 0,
radius_top_right: 0,
radius_bottom_left: 0,
radius_bottom_right: 0,
},
shop_content_margin: {
margin: 0,
margin_top: 0,
margin_bottom: 0,
margin_left: 0,
margin_right: 0,
},
shop_content_padding: {
padding: 0,
padding_top: 0,
padding_bottom: 0,
padding_left: 0,
padding_right: 0,
},
shop_content_spacing: 0,
shop_content: {
// 边框样式
border_is_show: '0',
border_color: '#FF3F3F',
border_style: 'solid',
border_size: {
padding: 1,
padding_top: 1,
padding_right: 1,
padding_bottom: 1,
padding_left: 1,
},
// 阴影
box_shadow_color: '',
box_shadow_x: 0,
box_shadow_y: 0,
box_shadow_blur: 0,
box_shadow_spread: 0,
},
shop_title_typeface: 'bold',
shop_title_size: 14,
shop_title_color: '#333333',
shop_simple_desc_typeface: '400',
shop_simple_desc_size: 12,
shop_simple_desc_color: "#999",
title_simple_desc_spacing: 4,
shop_price_typeface: 'bold',
shop_price_size: 18,
shop_price_color: '#EA3323;',
shop_price_symbol_color: '#EA3323',
shop_price_symbol_size: 9,
shop_price_unit_color: '#EA3323',
shop_price_unit_size: 9,
shop_original_price_color: '#999',
shop_original_price_size: 12,
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',
subscript_style: subscriptStyle,
// 进度条设置,暂时隐藏
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: '#FFDE81',
progress_button_icon_color: '#FF2525',
progress_text_color: '#FF3434',
// 轮播设置
is_roll: '1',
interval_time: 3,
rolling_fashion: 'translation', // 滚动方式 translation 平移 cut-screen 切屏
common_style: { ...defaultCommon, padding: 0, padding_top: 2, padding_bottom: 10, padding_left: 10, padding_right: 10 },
},
};
export default defaultPresale;