diff --git a/.env.dev b/.env.dev index 232f1c6b..2008a002 100644 --- a/.env.dev +++ b/.env.dev @@ -8,8 +8,6 @@ VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 VITE_UPLOAD_TYPE=server -# 上传路径 -VITE_UPLOAD_URL='http://api-dashboard.yudao.iocoder.cn/admin-api/infra/file/upload' # 接口地址 VITE_API_URL=/admin-api diff --git a/.env.local b/.env.local index 005d2f0d..ad084700 100644 --- a/.env.local +++ b/.env.local @@ -8,8 +8,6 @@ VITE_BASE_URL='http://localhost:48080' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务 VITE_UPLOAD_TYPE=server -# 上传路径 -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' # 接口地址 VITE_API_URL=/admin-api diff --git a/.env.prod b/.env.prod index 842ba616..8b78c415 100644 --- a/.env.prod +++ b/.env.prod @@ -8,8 +8,6 @@ VITE_BASE_URL='http://localhost:48080' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 VITE_UPLOAD_TYPE=server -# 上传路径 -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' # 接口地址 VITE_API_URL=/admin-api diff --git a/.env.stage b/.env.stage index f7c521bd..3d005c7b 100644 --- a/.env.stage +++ b/.env.stage @@ -8,8 +8,6 @@ VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 VITE_UPLOAD_TYPE=server -# 上传路径 -VITE_UPLOAD_URL='http://api-dashboard.yudao.iocoder.cn/admin-api/infra/file/upload' # 接口地址 VITE_API_URL=/admin-api diff --git a/.env.test b/.env.test index 7bf1b417..80f4c660 100644 --- a/.env.test +++ b/.env.test @@ -8,8 +8,6 @@ VITE_BASE_URL='http://localhost:48080' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 VITE_UPLOAD_TYPE=server -# 上传路径 -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' # 接口地址 VITE_API_URL=/admin-api diff --git a/.vscode/settings.json b/.vscode/settings.json index 7d8aed49..f145f386 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -87,7 +87,7 @@ "source.fixAll.stylelint": "explicit" }, "[vue]": { - "editor.defaultFormatter": "rvest.vs-code-prettier-eslint" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "i18n-ally.localesPaths": ["src/locales"], "i18n-ally.keystyle": "nested", diff --git a/src/api/login/index.ts b/src/api/login/index.ts index ef86563b..dec14fb3 100644 --- a/src/api/login/index.ts +++ b/src/api/login/index.ts @@ -1,6 +1,6 @@ import request from '@/config/axios' import { getRefreshToken } from '@/utils/auth' -import type { UserLoginVO } from './types' +import type { RegisterVO, UserLoginVO } from './types' export interface SmsCodeVO { mobile: string @@ -17,6 +17,11 @@ export const login = (data: UserLoginVO) => { return request.post({ url: '/system/auth/login', data }) } +// 注册 +export const register = (data: RegisterVO) => { + return request.post({ url: '/system/auth/register', data }) +} + // 刷新访问令牌 export const refreshToken = () => { return request.post({ url: '/system/auth/refresh-token?refreshToken=' + getRefreshToken() }) diff --git a/src/api/login/types.ts b/src/api/login/types.ts index fff81225..b5790e62 100644 --- a/src/api/login/types.ts +++ b/src/api/login/types.ts @@ -29,3 +29,10 @@ export type UserVO = { loginIp: string loginDate: string } + +export type RegisterVO = { + tenantName: string + username: string + password: string + captchaVerification: string +} diff --git a/src/api/mall/promotion/point/index.ts b/src/api/mall/promotion/point/index.ts new file mode 100644 index 00000000..38254c2d --- /dev/null +++ b/src/api/mall/promotion/point/index.ts @@ -0,0 +1,91 @@ +import request from '@/config/axios' +import { Sku, Spu } from '@/api/mall/product/spu' // 积分商城活动 VO + +// 积分商城活动 VO +export interface PointActivityVO { + id: number // 积分商城活动编号 + spuId: number // 积分商城活动商品 + status: number // 活动状态 + stock: number // 积分商城活动库存 + totalStock: number // 积分商城活动总库存 + remark?: string // 备注 + sort: number // 排序 + createTime: string // 创建时间 + products: PointProductVO[] // 积分商城商品 + + // ========== 商品字段 ========== + spuName: string // 商品名称 + picUrl: string // 商品主图 + marketPrice: number // 商品市场价,单位:分 + + //======================= 显示所需兑换积分最少的 sku 信息 ======================= + point: number // 兑换积分 + price: number // 兑换金额,单位:分 +} + +// 秒杀活动所需属性 +export interface PointProductVO { + id?: number // 积分商城商品编号 + activityId?: number // 积分商城活动 id + spuId?: number // 商品 SPU 编号 + skuId: number // 商品 SKU 编号 + count: number // 可兑换数量 + point: number // 兑换积分 + price: number // 兑换金额,单位:分 + stock: number // 积分商城商品库存 + activityStatus?: number // 积分商城商品状态 +} + +// 扩展 Sku 配置 +export type SkuExtension = Sku & { + productConfig: PointProductVO +} + +export interface SpuExtension extends Spu { + skus: SkuExtension[] // 重写类型 +} + +export interface SpuExtension0 extends Spu { + pointStock: number // 积分商城活动库存 + pointTotalStock: number // 积分商城活动总库存 + point: number // 兑换积分 + pointPrice: number // 兑换金额,单位:分 +} + +// 积分商城活动 API +export const PointActivityApi = { + // 查询积分商城活动分页 + getPointActivityPage: async (params: any) => { + return await request.get({ url: `/promotion/point-activity/page`, params }) + }, + + // 查询积分商城活动详情 + getPointActivity: async (id: number) => { + return await request.get({ url: `/promotion/point-activity/get?id=` + id }) + }, + + // 查询积分商城活动列表,基于活动编号数组 + getPointActivityListByIds: async (ids: number[]) => { + return request.get({ url: `/promotion/point-activity/list-by-ids?ids=${ids}` }) + }, + + // 新增积分商城活动 + createPointActivity: async (data: PointActivityVO) => { + return await request.post({ url: `/promotion/point-activity/create`, data }) + }, + + // 修改积分商城活动 + updatePointActivity: async (data: PointActivityVO) => { + return await request.put({ url: `/promotion/point-activity/update`, data }) + }, + + // 删除积分商城活动 + deletePointActivity: async (id: number) => { + return await request.delete({ url: `/promotion/point-activity/delete?id=` + id }) + }, + + // 关闭秒杀活动 + closePointActivity: async (id: number) => { + return await request.put({ url: '/promotion/point-activity/close?id=' + id }) + } +} diff --git a/src/api/mall/promotion/reward/rewardActivity.ts b/src/api/mall/promotion/reward/rewardActivity.ts index 09f32ac5..e9f95ed8 100644 --- a/src/api/mall/promotion/reward/rewardActivity.ts +++ b/src/api/mall/promotion/reward/rewardActivity.ts @@ -47,7 +47,12 @@ export const getReward = async (id: number) => { return await request.get({ url: '/promotion/reward-activity/get?id=' + id }) } -// 删除限时折扣活动 +// 删除满减送活动 export const deleteRewardActivity = async (id: number) => { return await request.delete({ url: '/promotion/reward-activity/delete?id=' + id }) } + +// 关闭满减送活动 +export const closeRewardActivity = async (id: number) => { + return await request.put({ url: '/promotion/reward-activity/close?id=' + id }) +} diff --git a/src/api/pay/order/index.ts b/src/api/pay/order/index.ts index 71960a8a..6460c4d1 100644 --- a/src/api/pay/order/index.ts +++ b/src/api/pay/order/index.ts @@ -84,8 +84,14 @@ export const getOrderPage = async (params: OrderPageReqVO) => { } // 查询详情支付订单 -export const getOrder = async (id: number) => { - return await request.get({ url: '/pay/order/get?id=' + id }) +export const getOrder = async (id: number, sync?: boolean) => { + return await request.get({ + url: '/pay/order/get', + params: { + id, + sync + } + }) } // 获得支付订单的明细 diff --git a/src/components/AppLinkInput/data.ts b/src/components/AppLinkInput/data.ts index 1916e083..c9e3678a 100644 --- a/src/components/AppLinkInput/data.ts +++ b/src/components/AppLinkInput/data.ts @@ -5,6 +5,7 @@ export interface AppLinkGroup { // 链接列表 links: AppLink[] } + // APP 链接 export interface AppLink { // 链接名称 @@ -21,6 +22,8 @@ export const enum APP_LINK_TYPE_ENUM { ACTIVITY_COMBINATION, // 秒杀活动 ACTIVITY_SECKILL, + // 积分商城活动 + ACTIVITY_POINT, // 文章详情 ARTICLE_DETAIL, // 优惠券详情 @@ -130,6 +133,11 @@ export const APP_LINK_GROUP_LIST = [ path: '/pages/activity/seckill/list', type: APP_LINK_TYPE_ENUM.ACTIVITY_SECKILL }, + { + name: '积分商城活动', + path: '/pages/activity/point/list', + type: APP_LINK_TYPE_ENUM.ACTIVITY_POINT + }, { name: '签到中心', path: '/pages/app/sign' diff --git a/src/components/DiyEditor/components/mobile/ProductCard/index.vue b/src/components/DiyEditor/components/mobile/ProductCard/index.vue index 78ad84f3..25f8cb87 100644 --- a/src/components/DiyEditor/components/mobile/ProductCard/index.vue +++ b/src/components/DiyEditor/components/mobile/ProductCard/index.vue @@ -67,7 +67,7 @@ class="text-16px" :style="{ color: property.fields.price.color }" > - ¥{{ fenToYuan(spu.price) }} + ¥{{ fenToYuan(spu.price as any) }} diff --git a/src/components/DiyEditor/components/mobile/PromotionPoint/index.vue b/src/components/DiyEditor/components/mobile/PromotionPoint/index.vue new file mode 100644 index 00000000..4acd93fc --- /dev/null +++ b/src/components/DiyEditor/components/mobile/PromotionPoint/index.vue @@ -0,0 +1,202 @@ + + + + diff --git a/src/components/DiyEditor/components/mobile/PromotionPoint/property.vue b/src/components/DiyEditor/components/mobile/PromotionPoint/property.vue new file mode 100644 index 00000000..84a429b6 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/PromotionPoint/property.vue @@ -0,0 +1,154 @@ + + + + + diff --git a/src/components/Editor/src/Editor.vue b/src/components/Editor/src/Editor.vue index 8dd06456..e16776c7 100644 --- a/src/components/Editor/src/Editor.vue +++ b/src/components/Editor/src/Editor.vue @@ -7,6 +7,7 @@ import { isNumber } from '@/utils/is' import { ElMessage } from 'element-plus' import { useLocaleStore } from '@/store/modules/locale' import { getAccessToken, getTenantId } from '@/utils/auth' +import { getUploadUrl } from '@/components/UploadFile/src/useUpload' defineOptions({ name: 'Editor' }) @@ -88,7 +89,7 @@ const editorConfig = computed((): IEditorConfig => { scroll: true, MENU_CONF: { ['uploadImage']: { - server: import.meta.env.VITE_UPLOAD_URL, + server: getUploadUrl(), // 单个文件的最大体积限制,默认为 2M maxFileSize: 5 * 1024 * 1024, // 最多可上传几个文件,默认为 100 @@ -136,7 +137,7 @@ const editorConfig = computed((): IEditorConfig => { } }, ['uploadVideo']: { - server: import.meta.env.VITE_UPLOAD_URL, + server: getUploadUrl(), // 单个文件的最大体积限制,默认为 10M maxFileSize: 10 * 1024 * 1024, // 最多可上传几个文件,默认为 100 diff --git a/src/components/UploadFile/src/UploadImgs.vue b/src/components/UploadFile/src/UploadImgs.vue index 85da64c0..59857a98 100644 --- a/src/components/UploadFile/src/UploadImgs.vue +++ b/src/components/UploadFile/src/UploadImgs.vue @@ -25,7 +25,7 @@ diff --git a/src/views/knowledge/dataset-form/form-step1.vue b/src/views/knowledge/dataset-form/form-step1.vue new file mode 100644 index 00000000..ef3579eb --- /dev/null +++ b/src/views/knowledge/dataset-form/form-step1.vue @@ -0,0 +1,151 @@ + + + + + diff --git a/src/views/knowledge/dataset-form/form-step2.vue b/src/views/knowledge/dataset-form/form-step2.vue new file mode 100644 index 00000000..f8ca5718 --- /dev/null +++ b/src/views/knowledge/dataset-form/form-step2.vue @@ -0,0 +1,168 @@ + + + + + diff --git a/src/views/knowledge/dataset.vue b/src/views/knowledge/dataset.vue new file mode 100644 index 00000000..4636a912 --- /dev/null +++ b/src/views/knowledge/dataset.vue @@ -0,0 +1,152 @@ + + + + + diff --git a/src/views/mall/product/property/value/index.vue b/src/views/mall/product/property/value/index.vue index d708172c..f0a6ef48 100644 --- a/src/views/mall/product/property/value/index.vue +++ b/src/views/mall/product/property/value/index.vue @@ -105,7 +105,7 @@ const list = ref([]) // 列表的数据 const queryParams = reactive({ pageNo: 1, pageSize: 10, - propertyId: Number(params.propertyId), + propertyId: params.propertyId, name: undefined }) const queryFormRef = ref() // 搜索的表单 diff --git a/src/views/mall/product/spu/components/SkuList.vue b/src/views/mall/product/spu/components/SkuList.vue index 25475cf8..2ffb37d0 100644 --- a/src/views/mall/product/spu/components/SkuList.vue +++ b/src/views/mall/product/spu/components/SkuList.vue @@ -180,17 +180,17 @@ @@ -211,12 +211,12 @@ diff --git a/src/views/mall/product/spu/form/InfoForm.vue b/src/views/mall/product/spu/form/InfoForm.vue index 76a09706..28bd309b 100644 --- a/src/views/mall/product/spu/form/InfoForm.vue +++ b/src/views/mall/product/spu/form/InfoForm.vue @@ -45,7 +45,7 @@ :show-word-limit="true" class="w-80!" maxlength="128" - placeholder="请输入商品名称" + placeholder="请输入商品简介" type="textarea" /> diff --git a/src/views/mall/promotion/combination/activity/index.vue b/src/views/mall/promotion/combination/activity/index.vue index 02c7de22..a40044df 100644 --- a/src/views/mall/promotion/combination/activity/index.vue +++ b/src/views/mall/promotion/combination/activity/index.vue @@ -4,27 +4,27 @@ - 搜索 - 重置 + + + 搜索 + + + + 重置 + - 新增 + + 新增 @@ -51,77 +58,77 @@ - - - + + + - + - + - + - - - - + + + + - + - diff --git a/src/views/mall/promotion/point/activity/index.vue b/src/views/mall/promotion/point/activity/index.vue new file mode 100644 index 00000000..ceceb7b5 --- /dev/null +++ b/src/views/mall/promotion/point/activity/index.vue @@ -0,0 +1,219 @@ + + + diff --git a/src/views/mall/promotion/point/activity/pointActivity.data.ts b/src/views/mall/promotion/point/activity/pointActivity.data.ts new file mode 100644 index 00000000..a3334eac --- /dev/null +++ b/src/views/mall/promotion/point/activity/pointActivity.data.ts @@ -0,0 +1,55 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' + +// 表单校验 +export const rules = reactive({ + spuId: [required], + sort: [required] +}) + +// CrudSchema https://doc.iocoder.cn/vue3/crud-schema/ +const crudSchemas = reactive([ + { + label: '排序', + field: 'sort', + form: { + component: 'InputNumber', + value: 0 + }, + table: { + width: 80 + } + }, + { + label: '积分商城活动商品', + field: 'spuId', + isTable: true, + isSearch: false, + form: { + colProps: { + span: 24 + } + }, + table: { + width: 300 + } + }, + { + label: '备注', + field: 'remark', + isSearch: false, + form: { + component: 'Input', + componentProps: { + type: 'textarea', + rows: 4 + }, + colProps: { + span: 24 + } + }, + table: { + width: 300 + } + } +]) +export const { allSchemas } = useCrudSchemas(crudSchemas) diff --git a/src/views/mall/promotion/point/components/PointShowcase.vue b/src/views/mall/promotion/point/components/PointShowcase.vue new file mode 100644 index 00000000..82e490c5 --- /dev/null +++ b/src/views/mall/promotion/point/components/PointShowcase.vue @@ -0,0 +1,154 @@ + + + + diff --git a/src/views/mall/promotion/point/components/PointTableSelect.vue b/src/views/mall/promotion/point/components/PointTableSelect.vue new file mode 100644 index 00000000..d68b5f15 --- /dev/null +++ b/src/views/mall/promotion/point/components/PointTableSelect.vue @@ -0,0 +1,300 @@ + + + diff --git a/src/views/mall/promotion/rewardActivity/RewardForm.vue b/src/views/mall/promotion/rewardActivity/RewardForm.vue index fc1d5dfc..64a2dd4a 100644 --- a/src/views/mall/promotion/rewardActivity/RewardForm.vue +++ b/src/views/mall/promotion/rewardActivity/RewardForm.vue @@ -56,7 +56,7 @@ label="分类" prop="productCategoryIds" > - + @@ -119,6 +119,9 @@ const open = async (type: string, id?: number) => { // 规则分转元 data.rules?.forEach((item: any) => { item.discountPrice = fenToYuan(item.discountPrice || 0) + if (data.conditionType === PromotionConditionTypeEnum.PRICE.type) { + item.limit = fenToYuan(item.limit || 0) + } }) formData.value = data // 获得商品范围 @@ -151,6 +154,9 @@ const submitForm = async () => { // 规则元转分 data.rules.forEach((item) => { item.discountPrice = yuanToFen(item.discountPrice || 0) + if (data.conditionType === PromotionConditionTypeEnum.PRICE.type) { + item.limit = yuanToFen(item.limit || 0) + } }) // 设置商品范围 setProductScopeValues(data) @@ -188,7 +194,7 @@ const getProductScope = async () => { case PromotionProductScopeEnum.CATEGORY.scope: await nextTick() let productCategoryIds = formData.value.productScopeValues as any - if (Array.isArray(productCategoryIds) && productCategoryIds.length > 0) { + if (Array.isArray(productCategoryIds) && productCategoryIds.length === 1) { // 单选时使用数组不能反显 productCategoryIds = productCategoryIds[0] } diff --git a/src/views/mall/promotion/rewardActivity/components/RewardRule.vue b/src/views/mall/promotion/rewardActivity/components/RewardRule.vue index 8dc37b32..2c63a427 100644 --- a/src/views/mall/promotion/rewardActivity/components/RewardRule.vue +++ b/src/views/mall/promotion/rewardActivity/components/RewardRule.vue @@ -10,14 +10,25 @@ 满 + - {{ PromotionConditionTypeEnum.PRICE.type === formData.conditionType ? '元' : '件' }} diff --git a/src/views/mall/promotion/rewardActivity/index.vue b/src/views/mall/promotion/rewardActivity/index.vue index 55f30358..544420e1 100644 --- a/src/views/mall/promotion/rewardActivity/index.vue +++ b/src/views/mall/promotion/rewardActivity/index.vue @@ -27,7 +27,7 @@ placeholder="请选择活动状态" > + + +