diff --git a/package.json b/package.json index 1fb585f311db6aa21b2c401f5457d3a03e1ae89a..e81fe5509bac1c5d740fd080764bc3578b6a2f3b 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "pinia": "^2.1.7", "qrcode": "^1.5.3", "qs": "^6.11.2", + "sortablejs": "^1.15.0", "steady-xml": "^0.1.0", "url": "^0.11.3", "video.js": "^7.21.5", @@ -82,6 +83,7 @@ "@types/nprogress": "^0.2.1", "@types/qrcode": "^1.5.2", "@types/qs": "^6.9.8", + "@types/sortablejs": "^1.15.4", "@typescript-eslint/eslint-plugin": "^6.7.5", "@typescript-eslint/parser": "^6.7.5", "@unocss/transformer-variant-group": "^0.56.5", diff --git a/src/api/mall/market/banner/index.ts b/src/api/mall/market/banner/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..ee65024cb5260c62ea1a7e53c139eee45c45d729 --- /dev/null +++ b/src/api/mall/market/banner/index.ts @@ -0,0 +1,37 @@ +import request from '@/config/axios' + +export interface BannerVO { + id: number + title: string + picUrl: string + status: number + url: string + position: number + sort: number + memo: string +} + +// 查询Banner管理列表 +export const getBannerPage = async (params) => { + return await request.get({ url: `/promotion/banner/page`, params }) +} + +// 查询Banner管理详情 +export const getBanner = async (id: number) => { + return await request.get({ url: `/promotion/banner/get?id=` + id }) +} + +// 新增Banner管理 +export const createBanner = async (data: BannerVO) => { + return await request.post({ url: `/promotion/banner/create`, data }) +} + +// 修改Banner管理 +export const updateBanner = async (data: BannerVO) => { + return await request.put({ url: `/promotion/banner/update`, data }) +} + +// 删除Banner管理 +export const deleteBanner = async (id: number) => { + return await request.delete({ url: `/promotion/banner/delete?id=` + id }) +} diff --git a/src/api/mall/product/spu.ts b/src/api/mall/product/spu.ts index 5cc4d8fef639b39dfeacd7c1610342b39f8cc4a3..8ccd02a5c72bda50e0f9e22c1130927a37b583a6 100644 --- a/src/api/mall/product/spu.ts +++ b/src/api/mall/product/spu.ts @@ -25,17 +25,22 @@ export interface Sku { salesCount?: number // 商品销量 } +export interface GiveCouponTemplate { + id?: number + name?: string // 优惠券名称 +} + export interface Spu { id?: number name?: string // 商品名称 - categoryId?: number | null // 商品分类 + categoryId?: number | undefined // 商品分类 keyword?: string // 关键字 - unit?: number | null // 单位 + unit?: number | undefined // 单位 picUrl?: string // 商品封面图 sliderPicUrls?: string[] // 商品轮播图 introduction?: string // 商品简介 - deliveryTemplateId?: number | null // 运费模版 - brandId?: number | null // 商品品牌编号 + deliveryTemplateId?: number | undefined // 运费模版 + brandId?: number | undefined // 商品品牌编号 specType?: boolean // 商品规格 subCommissionType?: boolean // 分销类型 skus?: Sku[] // sku数组 @@ -55,6 +60,7 @@ export interface Spu { stock?: number // 商品库存 createTime?: Date // 商品创建时间 status?: number // 商品状态 + activityOrders: number[] // 活动排序 } // 获得 Spu 列表 diff --git a/src/api/mall/trade/delivery/pickUpStore/index.ts b/src/api/mall/trade/delivery/pickUpStore/index.ts index 82ba66c4f1ccde49935d780b480100268addcb53..c3175021834d9ee3532827a44d874b99c9f2fc9a 100644 --- a/src/api/mall/trade/delivery/pickUpStore/index.ts +++ b/src/api/mall/trade/delivery/pickUpStore/index.ts @@ -26,7 +26,7 @@ export const getDeliveryPickUpStore = async (id: number) => { } // 查询自提门店精简列表 -export const getListAllSimple = async () => { +export const getListAllSimple = async (): Promise => { return await request.get({ url: '/trade/delivery/pick-up-store/list-all-simple' }) } diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 448a03dd7f3151d05a492a4b666337a9582ac2cf..7534fb492ccaa617e9654ca8d207cb04d2553d75 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -155,6 +155,7 @@ export enum DICT_TYPE { // ========== MALL - 商品模块 ========== PRODUCT_UNIT = 'product_unit', // 商品单位 PRODUCT_SPU_STATUS = 'product_spu_status', //商品状态 + PROMOTION_TYPE_ENUM = 'promotion_type_enum', // 营销类型枚举 // ========== MALL - 交易模块 ========== EXPRESS_CHARGE_MODE = 'trade_delivery_express_charge_mode', //快递的计费方式 @@ -183,6 +184,7 @@ export enum DICT_TYPE { PROMOTION_CONDITION_TYPE = 'promotion_condition_type', // 营销的条件类型枚举 PROMOTION_BARGAIN_RECORD_STATUS = 'promotion_bargain_record_status', // 砍价记录的状态 PROMOTION_COMBINATION_RECORD_STATUS = 'promotion_combination_record_status', // 拼团记录的状态 + BANNER_POSITION = 'banner_position', // banner 定位 // ========== CRM - 客户管理模块 ========== CRM_RECEIVABLE_CHECK_STATUS = 'crm_receivable_check_status', diff --git a/src/views/mall/product/spu/form/ActivityOrdersSort.vue b/src/views/mall/product/spu/form/ActivityOrdersSort.vue new file mode 100644 index 0000000000000000000000000000000000000000..3a41b3c5c209463f4a50e3f81805a735f9033839 --- /dev/null +++ b/src/views/mall/product/spu/form/ActivityOrdersSort.vue @@ -0,0 +1,66 @@ + + diff --git a/src/views/mall/product/spu/form/OtherSettingsForm.vue b/src/views/mall/product/spu/form/OtherSettingsForm.vue index a2f2afc6bb765e56e9991624fb65439244b7941c..d574ae78a6a94a22b2a6eb2bab354a56591a976c 100644 --- a/src/views/mall/product/spu/form/OtherSettingsForm.vue +++ b/src/views/mall/product/spu/form/OtherSettingsForm.vue @@ -41,18 +41,11 @@ - - 默认 - 秒杀 - 砍价 - 拼团 - - - - - - 选择优惠券 + @@ -61,25 +54,29 @@ - @@ -89,6 +86,8 @@ import { PropType } from 'vue' import { propTypes } from '@/utils/propTypes' import { copyValueToTarget } from '@/utils' import { otherSettingsSchema } from './spu.data' +import { DICT_TYPE, DictDataType } from '@/utils/dict' +import ActivityOrdersSort from './ActivityOrdersSort.vue' defineOptions({ name: 'OtherSettingsForm' }) @@ -105,6 +104,67 @@ const props = defineProps({ isDetail: propTypes.bool.def(false) // 是否作为详情组件 }) +// TODO @puhui999:这个目前先写死;主要是,这个优惠类型不好用 promotion_type_enum;因为优惠劵、会员折扣都算 +// 活动优先级处理 +const promotionTypes = ref([ + { + dictType: 'promotionTypes', + label: '秒杀活动', + value: 1, + colorType: 'warning', + cssClass: '' + }, + { + dictType: 'promotionTypes', + label: '砍价活动', + value: 2, + colorType: 'warning', + cssClass: '' + }, + { + dictType: 'promotionTypes', + label: '拼团活动', + value: 3, + colorType: 'warning', + cssClass: '' + }, + { + dictType: 'promotionTypes', + label: '限时折扣', + value: 4, + colorType: 'warning', + cssClass: '' + }, + { + dictType: 'promotionTypes', + label: '满减送', + value: 5, + colorType: 'warning', + cssClass: '' + }, + { + dictType: 'promotionTypes', + label: '会员折扣', + value: 6, + colorType: 'warning', + cssClass: '' + }, + { + dictType: 'promotionTypes', + label: '优惠劵', + value: 7, + colorType: 'warning', + cssClass: '' + }, + { + dictType: 'promotionTypes', + label: '积分', + value: 8, + colorType: 'warning', + cssClass: '' + } +]) + const otherSettingsFormRef = ref() // 表单Ref // 表单数据 const formData = ref({ @@ -115,7 +175,8 @@ const formData = ref({ recommendBenefit: false, // 是否优惠 recommendBest: false, // 是否精品 recommendNew: false, // 是否新品 - recommendGood: false // 是否优品 + recommendGood: false, // 是否优品 + activityOrders: [] // 活动排序 }) // 表单规则 const rules = reactive({ diff --git a/src/views/mall/product/spu/form/index.vue b/src/views/mall/product/spu/form/index.vue index c10c6b83cb9eda0dc5574c1f8b88554c6d49462a..9d69923a0dbf05b307582032aa69343e475d81d1 100644 --- a/src/views/mall/product/spu/form/index.vue +++ b/src/views/mall/product/spu/form/index.vue @@ -62,14 +62,14 @@ const otherSettingsRef = ref() // 其他设置Ref // spu 表单数据 const formData = ref({ name: '', // 商品名称 - categoryId: null, // 商品分类 + categoryId: undefined, // 商品分类 keyword: '', // 关键字 - unit: null, // 单位 + unit: undefined, // 单位 picUrl: '', // 商品封面图 sliderPicUrls: [], // 商品轮播图 introduction: '', // 商品简介 - deliveryTemplateId: null, // 运费模版 - brandId: null, // 商品品牌 + deliveryTemplateId: undefined, // 运费模版 + brandId: undefined, // 商品品牌 specType: false, // 商品规格 subCommissionType: false, // 分销类型 skus: [ @@ -94,7 +94,8 @@ const formData = ref({ recommendBenefit: false, // 是否优惠 recommendBest: false, // 是否精品 recommendNew: false, // 是否新品 - recommendGood: false // 是否优品 + recommendGood: false, // 是否优品 + activityOrders: [] // 活动排序 }) /** 获得详情 */ @@ -108,7 +109,7 @@ const getDetail = async () => { try { const res = (await ProductSpuApi.getSpu(id)) as ProductSpuApi.Spu res.skus?.forEach((item) => { - if (isDetail.value === true) { + if (isDetail.value) { item.price = floatToFixed2(item.price) item.marketPrice = floatToFixed2(item.marketPrice) item.costPrice = floatToFixed2(item.costPrice) diff --git a/src/views/mall/product/spu/form/spu.data.ts b/src/views/mall/product/spu/form/spu.data.ts index 41c43df90c1e860b182cb17d992c1ae133284882..9d88f4335e2f060719c0a999c5d64733a7c40fc9 100644 --- a/src/views/mall/product/spu/form/spu.data.ts +++ b/src/views/mall/product/spu/form/spu.data.ts @@ -94,10 +94,6 @@ export const otherSettingsSchema = reactive([ label: '是否优品推荐', field: 'recommendGood' }, - { - label: '赠送的优惠劵', - field: 'giveCouponTemplateIds' - }, { label: '活动显示排序', field: 'activityOrders' diff --git a/src/views/mall/product/spu/index.vue b/src/views/mall/product/spu/index.vue index 6fc14ca30ea4afa5d2fb262a2f5dca76504ea096..27a4bd2d87494fa2234853c98ed32b8f0ea69a13 100644 --- a/src/views/mall/product/spu/index.vue +++ b/src/views/mall/product/spu/index.vue @@ -24,8 +24,8 @@ :props="defaultProps" class="w-1/1" clearable - placeholder="请选择商品分类" filterable + placeholder="请选择商品分类" /> @@ -48,7 +48,12 @@ 重置 - + 新增 @@ -278,8 +283,8 @@ const queryParams = ref({ pageSize: 10, tabType: 0, name: '', - categoryId: null, - createTime: [] + categoryId: undefined, + createTime: undefined }) // 查询参数 const queryFormRef = ref() // 搜索的表单Ref diff --git a/src/views/mall/promotion/article/ArticleForm.vue b/src/views/mall/promotion/article/ArticleForm.vue index 92976931dce2dc6cea8769023c3b466777860cb7..1e44fad65b77fa20f33bce599a713f3106b2dbe7 100644 --- a/src/views/mall/promotion/article/ArticleForm.vue +++ b/src/views/mall/promotion/article/ArticleForm.vue @@ -40,17 +40,6 @@ - - - - - - @@ -69,19 +58,6 @@ - - - - - - - - @@ -108,6 +84,14 @@ + + + + {{ spuList.find((item) => item.id === formData.spuId)?.name }} + + 选择商品 + + @@ -120,12 +104,14 @@ 取 消 + diff --git a/src/views/mall/promotion/banner/index.vue b/src/views/mall/promotion/banner/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..bcf6d80da864a79598563cbd4c6f41ab9b04aa08 --- /dev/null +++ b/src/views/mall/promotion/banner/index.vue @@ -0,0 +1,204 @@ + + + diff --git a/src/views/mall/promotion/coupon/components/CouponSelect.vue b/src/views/mall/promotion/coupon/components/CouponSelect.vue new file mode 100644 index 0000000000000000000000000000000000000000..67e057b10f30727bd99d886b3f090dc3b2b82fa4 --- /dev/null +++ b/src/views/mall/promotion/coupon/components/CouponSelect.vue @@ -0,0 +1,223 @@ + + diff --git a/src/views/mall/promotion/coupon/components/index.ts b/src/views/mall/promotion/coupon/components/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..6a0e56facfc377321590f01d16a8a41a07022dec --- /dev/null +++ b/src/views/mall/promotion/coupon/components/index.ts @@ -0,0 +1,4 @@ +import CouponSendForm from './CouponSendForm.vue' +import CouponSelect from './CouponSelect.vue' + +export { CouponSendForm, CouponSelect } diff --git a/src/views/mall/promotion/coupon/template/CouponTemplateForm.vue b/src/views/mall/promotion/coupon/template/CouponTemplateForm.vue index ad335fb52a62cf288e60c873ae85723f0ad4013f..ddf44eb3d5d732ef95a392acb239dbf5427fcff2 100644 --- a/src/views/mall/promotion/coupon/template/CouponTemplateForm.vue +++ b/src/views/mall/promotion/coupon/template/CouponTemplateForm.vue @@ -22,14 +22,14 @@
-
+
- +
@@ -37,8 +37,8 @@
@@ -61,10 +61,10 @@ > @@ -75,11 +75,11 @@ > 折 @@ -90,20 +90,20 @@ > @@ -116,20 +116,20 @@ @@ -151,10 +151,10 @@ > 天有效 @@ -199,6 +199,7 @@ import { } from '@/utils/constants' import SpuTableSelect from '@/views/mall/product/spu/components/SpuTableSelect.vue' import ProductCategorySelect from '@/views/mall/product/category/components/ProductCategorySelect.vue' +import { convertToInteger, formatToFraction } from '@/utils' defineOptions({ name: 'CouponTemplateForm' }) @@ -265,12 +266,11 @@ const open = async (type: string, id?: number) => { const data = await CouponTemplateApi.getCouponTemplate(id) formData.value = { ...data, - discountPrice: data.discountPrice !== undefined ? data.discountPrice / 100.0 : undefined, + discountPrice: formatToFraction(data.discountPrice), discountPercent: data.discountPercent !== undefined ? data.discountPercent / 10.0 : undefined, - discountLimitPrice: - data.discountLimitPrice !== undefined ? data.discountLimitPrice / 100.0 : undefined, - usePrice: data.usePrice !== undefined ? data.usePrice / 100.0 : undefined, + discountLimitPrice: formatToFraction(data.discountLimitPrice), + usePrice: formatToFraction(data.usePrice), validTimes: [data.validStartTime, data.validEndTime] } // 获得商品范围 @@ -294,17 +294,13 @@ const submitForm = async () => { try { const data = { ...formData.value, - discountPrice: - formData.value.discountPrice !== undefined ? formData.value.discountPrice * 100 : undefined, + discountPrice: convertToInteger(formData.value.discountPrice), discountPercent: formData.value.discountPercent !== undefined ? formData.value.discountPercent * 10 : undefined, - discountLimitPrice: - formData.value.discountLimitPrice !== undefined - ? formData.value.discountLimitPrice * 100 - : undefined, - usePrice: formData.value.usePrice !== undefined ? formData.value.usePrice * 100 : undefined, + discountLimitPrice: convertToInteger(formData.value.discountLimitPrice), + usePrice: convertToInteger(formData.value.usePrice), validStartTime: formData.value.validTimes && formData.value.validTimes.length === 2 ? formData.value.validTimes[0] @@ -385,6 +381,7 @@ const getProductScope = async () => { break } } + /** 设置商品范围 */ function setProductScopeValues(data: CouponTemplateApi.CouponTemplateVO) { switch (formData.value.productScope) { @@ -420,7 +417,7 @@ const handleRemoveSpu = (index: number) => { } - diff --git a/src/views/mall/trade/order/components/index.ts b/src/views/mall/trade/order/components/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..9cce9fac4fe120171e7e54d107a4ecf17089bac0 --- /dev/null +++ b/src/views/mall/trade/order/components/index.ts @@ -0,0 +1,3 @@ +import OrderTableColumn from './OrderTableColumn.vue' + +export { OrderTableColumn } diff --git a/src/views/mall/trade/order/index.vue b/src/views/mall/trade/order/index.vue index 4a85a30ef0272a575123c564ce0c7f97ec5c6fb5..e08715df581bbdb81412bd10de0badaeaea2c8f5 100644 --- a/src/views/mall/trade/order/index.vue +++ b/src/views/mall/trade/order/index.vue @@ -164,177 +164,42 @@ - - -