Merge remote-tracking branch 'origin/dev-yxl' into dev-sws
commit
715c3992ec
|
|
@ -0,0 +1,14 @@
|
|||
import request from '@/utils/request';
|
||||
|
||||
class ShopAPI {
|
||||
/** 分类品牌查询接口*/
|
||||
static getSeckillList(data: any) {
|
||||
return request({
|
||||
url: `plugins/index/pluginsname/seckill/pluginscontrol/diyapi/pluginsaction/goods`,
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default ShopAPI;
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-image :src="is_obj(image) ? image?.url || '' : image" class="flex align-c jc-c w h radius-sm" fit="cover" @load="on_load">
|
||||
<el-image :src="is_obj(image) ? image?.url || '' : image" class="flex align-c jc-c w h radius-sm" :fit="fit" @load="on_load">
|
||||
<template #error>
|
||||
<div class="image-slot" :style="errorStyle">
|
||||
<img :src="error_image" :style="errorImgStyle" />
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
import { is_obj } from '@/utils';
|
||||
import type { ImageProps } from 'element-plus';
|
||||
const props = defineProps({
|
||||
errorImgStyle: {
|
||||
type: String,
|
||||
|
|
@ -18,6 +19,10 @@ const props = defineProps({
|
|||
type: String,
|
||||
default: () => '',
|
||||
},
|
||||
fit: {
|
||||
type: String as PropType<ImageProps['fit']>,
|
||||
default: () => 'cover',
|
||||
},
|
||||
});
|
||||
const image = defineModel({ type: [Object, String], default: () => {} });
|
||||
const error_image = ref(new URL(`../../../assets/images/empty.png`, import.meta.url).href);
|
||||
|
|
|
|||
|
|
@ -25,12 +25,12 @@
|
|||
>
|
||||
<swiper-slide v-for="(item, index) in form.carousel_list" :key="index">
|
||||
<div class="item-image flex jc-c align-c w h" :style="img_style">
|
||||
<image-empty v-model="item.carousel_img[0]" :style="img_style" error-style="width:5rem;height:5rem"></image-empty>
|
||||
<image-empty v-model="item.carousel_img[0]" :style="img_style" :fit="img_fit" error-style="width:5rem;height:5rem"></image-empty>
|
||||
</div>
|
||||
</swiper-slide>
|
||||
<swiper-slide v-for="(item, index1) in seat_list" :key="index1">
|
||||
<div class="item-image flex jc-c align-c w h" :style="img_style">
|
||||
<image-empty v-model="item.carousel_img[0]" :style="img_style" error-style="width:5rem;height:5rem"></image-empty>
|
||||
<image-empty v-model="item.carousel_img[0]" :style="img_style" :fit="img_fit" error-style="width:5rem;height:5rem"></image-empty>
|
||||
</div>
|
||||
</swiper-slide>
|
||||
<div v-if="new_style.is_show" :class="{'dot-center': new_style.indicator_location == 'center', 'dot-right': new_style.indicator_location == 'flex-end' }" class="dot flex abs">
|
||||
|
|
@ -221,9 +221,6 @@ const slideChange = (swiper: { realIndex: number }) => {
|
|||
.item-image {
|
||||
background: #F8FDFF;
|
||||
height: v-bind(newHeight);
|
||||
:deep(.el-image__inner) {
|
||||
object-fit: v-bind(img_fit);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
<template v-else>
|
||||
<div class="flex-col gap-20 align-c w h">
|
||||
<template v-if="props.flex === 'row'">
|
||||
<div v-for="(item, index) in split_list" :key="index" class="flex-row gap-10 align-c w h">
|
||||
<div v-for="(item, index) in split_list" :key="index" class="flex-row gap-10 align-c w h shop-max-height">
|
||||
<template v-if="!isEmpty(item.new_cover)">
|
||||
<image-empty v-model="item.new_cover[0]" :style="contentImgRadius"></image-empty>
|
||||
</template>
|
||||
|
|
@ -142,6 +142,9 @@ watchEffect(() => {
|
|||
bottom: 0.4rem;
|
||||
border-radius: 0.8rem;
|
||||
}
|
||||
.shop-max-height{
|
||||
max-height: 33%;
|
||||
}
|
||||
.half-width {
|
||||
width: 50%;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,6 +174,42 @@ const background_style = (item: any) => {
|
|||
const style_actived_color = (item: any, index: number) => {
|
||||
return item.actived_index == index ? `background: ${ item.data_style.actived_color };` : ''
|
||||
}
|
||||
// 设置默认值
|
||||
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: '',
|
||||
},
|
||||
],
|
||||
};
|
||||
/*
|
||||
** 组装产品的数据
|
||||
** @param {Array} list 商品列表
|
||||
|
|
@ -197,7 +233,7 @@ const commodity_list = (list: any[], num: number) => {
|
|||
}
|
||||
return nav_list;
|
||||
} else {
|
||||
return [];
|
||||
return [{ split_list: Array(num).fill(default_list)}];
|
||||
}
|
||||
}
|
||||
const old_list = ref<any>({});
|
||||
|
|
|
|||
|
|
@ -30,35 +30,143 @@
|
|||
<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" :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>
|
||||
<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 pr-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 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>
|
||||
<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 pr-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, throttle } from 'lodash';
|
||||
import SeckillAPI from '@/api/seckill';
|
||||
import { online_url } from '@/utils';
|
||||
import { Swiper, SwiperSlide } from 'swiper/vue';
|
||||
import { Autoplay } from 'swiper/modules';
|
||||
import 'swiper/css';
|
||||
import { da } from 'element-plus/es/locale';
|
||||
const modules = [Autoplay];
|
||||
|
||||
const props = defineProps({
|
||||
value: {
|
||||
|
|
@ -168,7 +276,15 @@ const default_list = {
|
|||
};
|
||||
const list = ref<data_list[]>([]);
|
||||
onBeforeMount(() => {
|
||||
list.value = Array(4).fill(default_list);
|
||||
SeckillAPI.getSeckillList((res: any) => {
|
||||
const data = res.data;
|
||||
console.log(data);
|
||||
if (!isEmpty(data.current)) {
|
||||
list.value = data.current.goods;
|
||||
} else {
|
||||
list.value = Array(4).fill(default_list);
|
||||
}
|
||||
});
|
||||
})
|
||||
// 商品间距
|
||||
const content_outer_spacing = computed(() => new_style.value.content_outer_spacing);
|
||||
|
|
@ -200,7 +316,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 +343,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 +354,52 @@ 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 +408,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 +435,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,8 +448,8 @@ const content_img_radius = computed(() => radius_computer(new_style.value.shop_i
|
|||
height: 18rem;
|
||||
}
|
||||
.flex-img3 {
|
||||
background: #f4fcff;
|
||||
width: 100%;
|
||||
min-height: 10.4rem;
|
||||
}
|
||||
.slide-bottom {
|
||||
height: 1rem;
|
||||
|
|
@ -311,4 +473,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>
|
||||
|
|
@ -61,18 +61,29 @@
|
|||
<div class="divider-line"></div>
|
||||
<card-container>
|
||||
<div class="mb-12">商品设置</div>
|
||||
<el-form-item label="商品数量">
|
||||
<!-- <el-form-item label="商品数量">
|
||||
<slider v-model="form.shop_number" :max="50"></slider>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<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>
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@
|
|||
<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>
|
||||
<el-form-item label="销售价格">
|
||||
<color-picker v-model="form.price_color"></color-picker>
|
||||
<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-picker v-model="form.original_price_color"></color-picker>
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<img class="img" :style="`Filter: brightness(${ new_style.function_buttons_type == 'black' ? 0 : 100 })`" src="@/assets/images/layout/main/main-top.png" />
|
||||
</div>
|
||||
<div class="model-head tc re mlr-12 mt-6">
|
||||
<div v-if="['1', '2', '3'].includes(form.theme)" class="flex align-c jc-c h gap-16" :style="[{ 'justify-content': form?.indicator_location || 'center', 'padding-right': form?.indicator_location == 'flex-end' ? '90px' : '0'}, text_style]">
|
||||
<div v-if="['1', '2', '3'].includes(form.theme)" class="flex align-c jc-c h gap-16" :style="[{ 'justify-content': form?.indicator_location || 'center', 'padding-right': form.indicator_location == 'flex-end' || form.theme == 3 ? '95px' : '0'}, text_style]">
|
||||
<template v-if="['2', '3'].includes(form.theme)">
|
||||
<div class="logo-outer-style"><image-empty v-model="form.logo[0]" class="logo-style" error-img-style="width:2rem;height:2rem;"></image-empty></div>
|
||||
</template>
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
<div v-else-if="['4', '5'].includes(form.theme)" class="flex align-c h gap-10">
|
||||
<div class="flex-row gap-2"><icon name="position" size="12" color="0"></icon><span class="size-14 cr-3 text-line-1">{{ form.positioning_name }}</span><icon v-if="form.is_arrows_show" name="arrow-right" size="12" color="0"></icon></div>
|
||||
<template v-if="['5'].includes(form.theme)">
|
||||
<div class="flex-1" style="padding-right:90px">
|
||||
<div class="flex-1" style="padding-right:95px">
|
||||
<model-search :value="pageData.com_data" :is-page-settings="true"></model-search>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
<el-radio value="white">白色</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="沉浸样式">
|
||||
<el-form-item v-if="form.header_background_type == 'transparent'" label="沉浸样式">
|
||||
<el-radio-group v-model="form.immersive_style">
|
||||
<el-radio :value="true">开启</el-radio>
|
||||
<el-radio :value="false">关闭</el-radio>
|
||||
|
|
|
|||
|
|
@ -18,10 +18,13 @@ interface DefaultSeckill {
|
|||
button_status: string;
|
||||
button_text: string;
|
||||
shop_style_type: string;
|
||||
single_line_number: number;
|
||||
shop_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;
|
||||
};
|
||||
|
|
@ -50,6 +53,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;
|
||||
|
|
@ -76,10 +85,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: '秒杀',
|
||||
},
|
||||
|
|
@ -125,11 +137,26 @@ const defaultSeckill: DefaultSeckill = {
|
|||
shop_title_color: '#333333',
|
||||
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_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 },
|
||||
|
|
|
|||
Loading…
Reference in New Issue