From 3198688eb53ae39f76472643c8ee80db903e7ab2 Mon Sep 17 00:00:00 2001 From: owen Date: Sun, 19 Nov 2023 18:27:25 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E8=90=A5=E9=94=80=EF=BC=9A=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=95=86=E5=9F=8E=E8=A3=85=E4=BF=AE=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E3=80=90=E5=95=86=E5=93=81=E6=A0=8F=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/mobile/ProductList/config.ts | 64 +++++++++ .../components/mobile/ProductList/index.vue | 128 ++++++++++++++++++ .../mobile/ProductList/property.vue | 99 ++++++++++++++ src/components/DiyEditor/util.ts | 2 +- .../product/spu/components/SpuShowcase.vue | 1 - 5 files changed, 292 insertions(+), 2 deletions(-) create mode 100644 src/components/DiyEditor/components/mobile/ProductList/config.ts create mode 100644 src/components/DiyEditor/components/mobile/ProductList/index.vue create mode 100644 src/components/DiyEditor/components/mobile/ProductList/property.vue diff --git a/src/components/DiyEditor/components/mobile/ProductList/config.ts b/src/components/DiyEditor/components/mobile/ProductList/config.ts new file mode 100644 index 00000000..019be74e --- /dev/null +++ b/src/components/DiyEditor/components/mobile/ProductList/config.ts @@ -0,0 +1,64 @@ +import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' + +/** 商品卡片属性 */ +export interface ProductListProperty { + // 布局类型:双列 | 三列 | 水平滑动 + layoutType: 'twoCol' | 'threeCol' | 'horizSwiper' + // 商品字段 + fields: { + // 商品名称 + name: ProductListFieldProperty + // 商品价格 + price: ProductListFieldProperty + } + // 角标 + badge: { + // 是否显示 + show: boolean + // 角标图片 + imgUrl: string + } + // 上圆角 + borderRadiusTop: number + // 下圆角 + borderRadiusBottom: number + // 间距 + space: number + // 商品编号列表 + spuIds: number[] + // 组件样式 + style: ComponentStyle +} +// 商品字段 +export interface ProductListFieldProperty { + // 是否显示 + show: boolean + // 颜色 + color: string +} + +// 定义组件 +export const component = { + id: 'ProductList', + name: '商品栏', + icon: 'system-uicons:carousel', + property: { + layoutType: 'twoCol', + fields: { + name: { show: true, color: '#000' }, + price: { show: true, color: '#ff3000' } + }, + badge: { show: false, imgUrl: '' }, + borderRadiusTop: 8, + borderRadiusBottom: 8, + space: 8, + spuIds: [], + style: { + bgType: 'color', + bgColor: '', + marginLeft: 8, + marginRight: 8, + marginBottom: 8 + } as ComponentStyle + } +} as DiyComponent diff --git a/src/components/DiyEditor/components/mobile/ProductList/index.vue b/src/components/DiyEditor/components/mobile/ProductList/index.vue new file mode 100644 index 00000000..cf644ea1 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/ProductList/index.vue @@ -0,0 +1,128 @@ + + + + diff --git a/src/components/DiyEditor/components/mobile/ProductList/property.vue b/src/components/DiyEditor/components/mobile/ProductList/property.vue new file mode 100644 index 00000000..872affc3 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/ProductList/property.vue @@ -0,0 +1,99 @@ + + + + + diff --git a/src/components/DiyEditor/util.ts b/src/components/DiyEditor/util.ts index 8f8c2c0c..5dfcea9e 100644 --- a/src/components/DiyEditor/util.ts +++ b/src/components/DiyEditor/util.ts @@ -107,7 +107,7 @@ export const PAGE_LIBS = [ extended: true, components: ['ImageBar', 'Carousel', 'TitleBar', 'VideoPlayer', 'Divider', 'MagicCube'] }, - { name: '商品组件', extended: true, components: ['ProductCard'] }, + { name: '商品组件', extended: true, components: ['ProductCard', 'ProductList'] }, { name: '会员组件', extended: true, diff --git a/src/views/mall/product/spu/components/SpuShowcase.vue b/src/views/mall/product/spu/components/SpuShowcase.vue index a3f16fba..3d2caf9a 100644 --- a/src/views/mall/product/spu/components/SpuShowcase.vue +++ b/src/views/mall/product/spu/components/SpuShowcase.vue @@ -59,7 +59,6 @@ watch( productSpus.value.length === 0 || productSpus.value.some((spu) => !props.modelValue.includes(spu.id)) ) { - debugger productSpus.value = await ProductSpuApi.getSpuDetailList(props.modelValue) } }, From e0a731dd86f76292a4b6a7aef3cad1f188c1ff0c Mon Sep 17 00:00:00 2001 From: owen Date: Mon, 20 Nov 2023 10:53:02 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=95=86=E5=93=81=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E3=80=81=E4=BC=98=E6=83=A0=E5=88=B8=E6=A8=A1=E6=9D=BF=E5=A4=8D?= =?UTF-8?q?=E7=94=A8=E7=BB=84=E4=BB=B6=E3=80=90=E5=95=86=E5=93=81=E6=A9=B1?= =?UTF-8?q?=E7=AA=97=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/product/comment/CommentForm.vue | 31 ++-------- src/views/mall/product/comment/index.vue | 2 +- .../product/spu/components/SpuShowcase.vue | 51 ++++++++++------ .../coupon/template/CouponTemplateForm.vue | 58 +------------------ 4 files changed, 41 insertions(+), 101 deletions(-) diff --git a/src/views/mall/product/comment/CommentForm.vue b/src/views/mall/product/comment/CommentForm.vue index 284e9a61..e9913ade 100644 --- a/src/views/mall/product/comment/CommentForm.vue +++ b/src/views/mall/product/comment/CommentForm.vue @@ -8,14 +8,7 @@ v-loading="formLoading" > -
-
- -
-
- -
-
+
@@ -51,12 +44,11 @@ 取 消 - - + diff --git a/src/views/mall/promotion/coupon/template/CouponTemplateForm.vue b/src/views/mall/promotion/coupon/template/CouponTemplateForm.vue index ddf44eb3..fcb18337 100644 --- a/src/views/mall/promotion/coupon/template/CouponTemplateForm.vue +++ b/src/views/mall/promotion/coupon/template/CouponTemplateForm.vue @@ -26,15 +26,7 @@ label="商品" prop="productSpuIds" > -
-
- - -
-
- -
-
+ 取 消 - From 1bb9df7b3c6b7fd8b91195664a36afe151141f4c Mon Sep 17 00:00:00 2001 From: owen Date: Tue, 21 Nov 2023 10:27:29 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=95=86=E5=93=81=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=95=86=E5=93=81=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=AF=B9=E8=AF=9D=E6=A1=86=EF=BC=8C=E5=9C=A8?= =?UTF-8?q?=E5=A4=9A=E9=80=89=E6=97=B6=E8=A1=A8=E5=A4=B4=E5=86=85=E7=9A=84?= =?UTF-8?q?=E5=A4=9A=E9=80=89=E6=A1=86=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E6=95=88=E6=9E=9C=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/spu/components/SpuShowcase.vue | 6 +- .../product/spu/components/SpuTableSelect.vue | 200 +++++++++++------- 2 files changed, 130 insertions(+), 76 deletions(-) diff --git a/src/views/mall/product/spu/components/SpuShowcase.vue b/src/views/mall/product/spu/components/SpuShowcase.vue index a56a3ef0..5d35238e 100644 --- a/src/views/mall/product/spu/components/SpuShowcase.vue +++ b/src/views/mall/product/spu/components/SpuShowcase.vue @@ -20,7 +20,7 @@
- + + diff --git a/src/components/DiyEditor/components/mobile/CouponCard/property.vue b/src/components/DiyEditor/components/mobile/CouponCard/property.vue new file mode 100644 index 00000000..4f32c21e --- /dev/null +++ b/src/components/DiyEditor/components/mobile/CouponCard/property.vue @@ -0,0 +1,104 @@ + + + + + diff --git a/src/components/DiyEditor/components/mobile/ProductCard/config.ts b/src/components/DiyEditor/components/mobile/ProductCard/config.ts index 49dd30d0..735b6ba0 100644 --- a/src/components/DiyEditor/components/mobile/ProductCard/config.ts +++ b/src/components/DiyEditor/components/mobile/ProductCard/config.ts @@ -62,7 +62,7 @@ export interface ProductCardFieldProperty { export const component = { id: 'ProductCard', name: '商品卡片', - icon: 'system-uicons:carousel', + icon: 'fluent:text-column-two-left-24-filled', property: { layoutType: 'oneColBigImg', fields: { diff --git a/src/components/DiyEditor/components/mobile/ProductList/config.ts b/src/components/DiyEditor/components/mobile/ProductList/config.ts index 019be74e..436de405 100644 --- a/src/components/DiyEditor/components/mobile/ProductList/config.ts +++ b/src/components/DiyEditor/components/mobile/ProductList/config.ts @@ -41,7 +41,7 @@ export interface ProductListFieldProperty { export const component = { id: 'ProductList', name: '商品栏', - icon: 'system-uicons:carousel', + icon: 'fluent:text-column-two-24-filled', property: { layoutType: 'twoCol', fields: { diff --git a/src/components/DiyEditor/components/mobile/ProductList/index.vue b/src/components/DiyEditor/components/mobile/ProductList/index.vue index cf644ea1..8a35628e 100644 --- a/src/components/DiyEditor/components/mobile/ProductList/index.vue +++ b/src/components/DiyEditor/components/mobile/ProductList/index.vue @@ -1,13 +1,13 @@ diff --git a/src/components/DiyEditor/util.ts b/src/components/DiyEditor/util.ts index 5dfcea9e..a8d0e095 100644 --- a/src/components/DiyEditor/util.ts +++ b/src/components/DiyEditor/util.ts @@ -111,7 +111,11 @@ export const PAGE_LIBS = [ { name: '会员组件', extended: true, - components: ['UserCard', 'OrderCard', 'WalletCard', 'CouponCard'] + components: ['UserCard', 'UserOrder', 'UserWallet', 'UserCoupon'] }, - { name: '营销组件', extended: true, components: ['Combination', 'Seckill', 'Point', 'Coupon'] } + { + name: '营销组件', + extended: true, + components: ['CombinationCard', 'SeckillCard', 'PointCard', 'CouponCard'] + } ] as DiyComponentLibrary[] diff --git a/src/views/mall/product/comment/CommentForm.vue b/src/views/mall/product/comment/CommentForm.vue index e9913ade..df6756a0 100644 --- a/src/views/mall/product/comment/CommentForm.vue +++ b/src/views/mall/product/comment/CommentForm.vue @@ -48,7 +48,7 @@ - + From c3cad3f3ee4f23e5caabea83d08d42eaf955cc1d Mon Sep 17 00:00:00 2001 From: owen Date: Fri, 24 Nov 2023 20:54:47 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=95=86=E5=9F=8E=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=BC=9A=E5=91=98=E7=BB=9F=E8=AE=A1=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E9=80=89=E6=8B=A9=E6=98=A8=E5=A4=A9=E6=97=B6?= =?UTF-8?q?,=20=E4=BC=9A=E5=BC=BA=E5=88=B6=E6=9F=A5=E8=AF=A2=E4=B8=A4?= =?UTF-8?q?=E5=A4=A9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ShortcutDateRangePicker/index.vue | 5 ----- src/utils/formatTime.ts | 5 ++++- src/views/mall/statistics/trade/index.vue | 9 +++++++++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/components/ShortcutDateRangePicker/index.vue b/src/components/ShortcutDateRangePicker/index.vue index 9f268a3f..117c079a 100644 --- a/src/components/ShortcutDateRangePicker/index.vue +++ b/src/components/ShortcutDateRangePicker/index.vue @@ -74,11 +74,6 @@ const emits = defineEmits<{ }>() /** 触发时间范围选中事件 */ const emitDateRangePicker = async () => { - // 开始与截止在同一天的, 折线图出不来, 需要延长一天 - if (DateUtil.isSameDay(times.value[0], times.value[1])) { - // 前天 - times.value[0] = DateUtil.formatDate(dayjs(times.value[0]).subtract(1, 'd')) - } emits('change', times.value) } diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts index e2ffcadd..466f1e1f 100644 --- a/src/utils/formatTime.ts +++ b/src/utils/formatTime.ts @@ -335,5 +335,8 @@ export function getDateRange( beginDate: dayjs.ConfigType, endDate: dayjs.ConfigType ): [string, string] { - return [dayjs(beginDate).startOf('d').toString(), dayjs(endDate).endOf('d').toString()] + return [ + dayjs(beginDate).startOf('d').format('YYYY-MM-DD HH:mm:ss'), + dayjs(endDate).endOf('d').format('YYYY-MM-DD HH:mm:ss') + ] } diff --git a/src/views/mall/statistics/trade/index.vue b/src/views/mall/statistics/trade/index.vue index e89f0cc3..86deaa87 100644 --- a/src/views/mall/statistics/trade/index.vue +++ b/src/views/mall/statistics/trade/index.vue @@ -219,6 +219,8 @@ import { TradeSummaryRespVO, TradeTrendSummaryRespVO } from '@/api/mall/statisti import { calculateRelativeRate, fenToYuan } from '@/utils' import download from '@/utils/download' import { CardTitle } from '@/components/Card' +import * as DateUtil from '@/utils/formatTime' +import dayjs from 'dayjs' /** 交易统计 */ defineOptions({ name: 'TradeStatistics' }) @@ -289,6 +291,13 @@ const lineChartOptions = reactive({ /** 处理交易状况查询 */ const getTradeTrendData = async () => { trendLoading.value = true + // 1. 处理时间: 开始与截止在同一天的, 折线图出不来, 需要延长一天 + const times = shortcutDateRangePicker.value.times + if (DateUtil.isSameDay(times[0], times[1])) { + // 前天 + times[0] = DateUtil.formatDate(dayjs(times[0]).subtract(1, 'd')) + } + // 查询数据 await Promise.all([getTradeTrendSummary(), getTradeStatisticsList()]) trendLoading.value = false }