From d543ea2a900c1b76f2bd86d42aa78ce5c5c33ff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Fri, 10 Apr 2026 18:07:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A2=84=E5=94=AE=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + src/api/presale.ts | 14 + src/components/model-presale/index.vue | 552 ++++++++++++++++++ .../model-presale/model-presale-content.vue | 202 +++++++ .../model-presale/model-presale-setting.vue | 181 ++++++ .../model-presale/model-presale-styles.vue | 247 ++++++++ src/config/const/presale.ts | 361 ++++++++++++ 7 files changed, 1558 insertions(+) create mode 100644 src/api/presale.ts create mode 100644 src/components/model-presale/index.vue create mode 100644 src/components/model-presale/model-presale-content.vue create mode 100644 src/components/model-presale/model-presale-setting.vue create mode 100644 src/components/model-presale/model-presale-styles.vue create mode 100644 src/config/const/presale.ts diff --git a/.gitignore b/.gitignore index 2c5373d9..f9c1aeb3 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ coverage *.sw? pnpm-lock.yaml +.trae diff --git a/src/api/presale.ts b/src/api/presale.ts new file mode 100644 index 00000000..11fabbd5 --- /dev/null +++ b/src/api/presale.ts @@ -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; diff --git a/src/components/model-presale/index.vue b/src/components/model-presale/index.vue new file mode 100644 index 00000000..9270b6c9 --- /dev/null +++ b/src/components/model-presale/index.vue @@ -0,0 +1,552 @@ + + + + + + + + + + {{ form.title_text }} + + + + {{ form.button_text }} + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ item.title }} + {{ item.simple_desc }} + + + + + + {{ form.presale_pirce_title }} + {{ item.show_price_symbol }}{{ item.min_price }} + {{ item.show_price_unit }} + + + {{ item.show_original_price_symbol }}{{ item.min_original_price }} + + {{ item.show_original_price_unit }} + + + + + + + {{ form.shop_button_text }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ item.title }} + {{ item.simple_desc }} + + + + + + {{ form.presale_pirce_title }} + {{ item.show_price_symbol }}{{ item.min_price }} + {{ item.show_price_unit }} + + + {{ item.show_original_price_symbol }}{{ item.min_original_price }} + + {{ item.show_original_price_unit }} + + + + + + + {{ form.shop_button_text }} + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/model-presale/model-presale-content.vue b/src/components/model-presale/model-presale-content.vue new file mode 100644 index 00000000..7db130c6 --- /dev/null +++ b/src/components/model-presale/model-presale-content.vue @@ -0,0 +1,202 @@ + + + + + + + 头部设置 + + + + + + + + + + 文字 + 图片 + + + + + + + + + + + + + + + + + + + + + + + 商品风格 + + + {{ item.name }} + + + + + 单列展示 + 两列展示 + 三列展示 + 四列展示 + + + + + + 商品设置 + + + {{ item.name }} + + + + + + + + + + + + + + + {{ item.name }} + + + + + + + + + + + + + + + + + + diff --git a/src/components/model-presale/model-presale-setting.vue b/src/components/model-presale/model-presale-setting.vue new file mode 100644 index 00000000..7f36c9fd --- /dev/null +++ b/src/components/model-presale/model-presale-setting.vue @@ -0,0 +1,181 @@ + + + + + + + + + + + + diff --git a/src/components/model-presale/model-presale-styles.vue b/src/components/model-presale/model-presale-styles.vue new file mode 100644 index 00000000..92c4647e --- /dev/null +++ b/src/components/model-presale/model-presale-styles.vue @@ -0,0 +1,247 @@ + + + + + + 头部样式 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 内容样式 + + + + + + + + + + + + + + + + + + + + 商品样式 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 预售按钮 + + + + + + + + + + + + + + + + + + + + 轮播设置 + + + + + + + + + {{ item.name }} + + + + + + + + + + + diff --git a/src/config/const/presale.ts b/src/config/const/presale.ts new file mode 100644 index 00000000..7e15cccd --- /dev/null +++ b/src/config/const/presale.ts @@ -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;