diff --git a/src/api/point/config/index.ts b/src/api/point/config/index.ts index 00adc3f1..9a3c4c48 100644 --- a/src/api/point/config/index.ts +++ b/src/api/point/config/index.ts @@ -10,10 +10,10 @@ export interface ConfigVO { // 查询积分设置详情 export const getConfig = async () => { - return await request.get({ url: `/point/config/get` }) + return await request.get({ url: `/member/point/config/get` }) } // 新增修改积分设置 export const saveConfig = async (data: ConfigVO) => { - return await request.put({ url: `/point/config/save`, data }) + return await request.put({ url: `/member/point/config/save`, data }) } diff --git a/src/api/point/record/index.ts b/src/api/point/record/index.ts index 15eaff35..1c60f754 100644 --- a/src/api/point/record/index.ts +++ b/src/api/point/record/index.ts @@ -4,7 +4,6 @@ export interface RecordVO { id: number bizId: string bizType: string - type: string title: string description: string point: number @@ -18,30 +17,5 @@ export interface RecordVO { // 查询用户积分记录列表 export const getRecordPage = async (params) => { - return await request.get({ url: `/point/record/page`, params }) -} - -// 查询用户积分记录详情 -export const getRecord = async (id: number) => { - return await request.get({ url: `/point/record/get?id=` + id }) -} - -// 新增用户积分记录 -export const createRecord = async (data: RecordVO) => { - return await request.post({ url: `/point/record/create`, data }) -} - -// 修改用户积分记录 -export const updateRecord = async (data: RecordVO) => { - return await request.put({ url: `/point/record/update`, data }) -} - -// 删除用户积分记录 -export const deleteRecord = async (id: number) => { - return await request.delete({ url: `/point/record/delete?id=` + id }) -} - -// 导出用户积分记录 Excel -export const exportRecord = async (params) => { - return await request.download({ url: `/point/record/export-excel`, params }) + return await request.get({ url: `/member/point/record/page`, params }) } diff --git a/src/api/point/signInConfig/index.ts b/src/api/point/signInConfig/index.ts index 3786c06e..246270ec 100644 --- a/src/api/point/signInConfig/index.ts +++ b/src/api/point/signInConfig/index.ts @@ -2,36 +2,32 @@ import request from '@/config/axios' export interface SignInConfigVO { id: number - day: number - point: number + day: number | null + point: number | null + enable: boolean | null } // 查询积分签到规则列表 -export const getSignInConfigPage = async (params) => { - return await request.get({ url: `/point/sign-in-config/page`, params }) +export const getSignInConfigPage = async () => { + return await request.get({ url: `/member/point/sign-in-config/list` }) } // 查询积分签到规则详情 export const getSignInConfig = async (id: number) => { - return await request.get({ url: `/point/sign-in-config/get?id=` + id }) + return await request.get({ url: `/member/point/sign-in-config/get?id=` + id }) } // 新增积分签到规则 export const createSignInConfig = async (data: SignInConfigVO) => { - return await request.post({ url: `/point/sign-in-config/create`, data }) + return await request.post({ url: `/member/point/sign-in-config/create`, data }) } // 修改积分签到规则 export const updateSignInConfig = async (data: SignInConfigVO) => { - return await request.put({ url: `/point/sign-in-config/update`, data }) + return await request.put({ url: `/member/point/sign-in-config/update`, data }) } // 删除积分签到规则 export const deleteSignInConfig = async (id: number) => { - return await request.delete({ url: `/point/sign-in-config/delete?id=` + id }) -} - -// 导出积分签到规则 Excel -export const exportSignInConfig = async (params) => { - return await request.download({ url: `/point/sign-in-config/export-excel`, params }) + return await request.delete({ url: `/member/point/sign-in-config/delete?id=` + id }) } diff --git a/src/api/point/signInRecord/index.ts b/src/api/point/signInRecord/index.ts index 0f9b9f64..909449f6 100644 --- a/src/api/point/signInRecord/index.ts +++ b/src/api/point/signInRecord/index.ts @@ -9,30 +9,10 @@ export interface SignInRecordVO { // 查询用户签到积分列表 export const getSignInRecordPage = async (params) => { - return await request.get({ url: `/point/sign-in-record/page`, params }) -} - -// 查询用户签到积分详情 -export const getSignInRecord = async (id: number) => { - return await request.get({ url: `/point/sign-in-record/get?id=` + id }) -} - -// 新增用户签到积分 -export const createSignInRecord = async (data: SignInRecordVO) => { - return await request.post({ url: `/point/sign-in-record/create`, data }) -} - -// 修改用户签到积分 -export const updateSignInRecord = async (data: SignInRecordVO) => { - return await request.put({ url: `/point/sign-in-record/update`, data }) -} - -// 删除用户签到积分 -export const deleteSignInRecord = async (id: number) => { - return await request.delete({ url: `/point/sign-in-record/delete?id=` + id }) + return await request.get({ url: `/member/point/sign-in-record/page`, params }) } // 导出用户签到积分 Excel export const exportSignInRecord = async (params) => { - return await request.download({ url: `/point/sign-in-record/export-excel`, params }) + return await request.download({ url: `/member/point/sign-in-record/export-excel`, params }) } diff --git a/src/views/member/point/config/index.vue b/src/views/member/point/config/index.vue index 0fd1484f..c69013eb 100644 --- a/src/views/member/point/config/index.vue +++ b/src/views/member/point/config/index.vue @@ -10,26 +10,36 @@ - - - + + - - + + 下单积分是否抵用订单金额 + + - + + 积分抵用比例(1积分抵多少金额)单位:元 + + + - + + 单次下单积分使用上限,0不限制 + + - 提交 + 下单支付金额按比例赠送积分(实际支付1元赠送多少积分) + + + 保存 @@ -52,11 +67,19 @@ const dialogVisible = ref(false) // 弹窗的是否展示 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 const formData = ref({ id: undefined, - tradeDeductEnable: undefined, - tradeDeductUnitPrice: undefined, - tradeDeductMaxPrice: undefined, - tradeGivePoint: undefined + tradeDeductEnable: true, + tradeDeductUnitPrice: 0, + tradeDeductMaxPrice: 0, + tradeGivePoint: 0 }) +// 创建一个计算属性,用于将 tradeDeductUnitPrice 显示为带两位小数的形式 +const computedTradeDeductUnitPrice = computed({ + get: () => (formData.value.tradeDeductUnitPrice / 100).toFixed(2), + set: (newValue) => { + formData.value.tradeDeductUnitPrice = Math.round(newValue * 100) + } +}) + const formRules = reactive({}) const formRef = ref() // 表单 Ref @@ -82,6 +105,7 @@ const onSubmit = async () => { const getConfig = async () => { try { const data = await ConfigApi.getConfig() + if (data === null) return formData.value = data } finally { } @@ -91,3 +115,9 @@ onMounted(() => { getConfig() }) + + diff --git a/src/views/member/point/record/RecordForm.vue b/src/views/member/point/record/RecordForm.vue deleted file mode 100644 index a75eb9a5..00000000 --- a/src/views/member/point/record/RecordForm.vue +++ /dev/null @@ -1,180 +0,0 @@ - - diff --git a/src/views/member/point/record/index.vue b/src/views/member/point/record/index.vue index 517410f7..f1e74bfa 100644 --- a/src/views/member/point/record/index.vue +++ b/src/views/member/point/record/index.vue @@ -8,10 +8,10 @@ :inline="true" label-width="68px" > - + - - - - - - - 搜索 - 重置 + + + 搜索 + + + + 重置 + @@ -79,28 +79,23 @@ - - + - - - + + + @@ -143,7 +138,6 @@ import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict' import { dateFormatter } from '@/utils/formatTime' import * as RecordApi from '@/api/point/record' -import RecordForm from './RecordForm.vue' defineOptions({ name: 'PointRecord' }) @@ -153,7 +147,7 @@ const list = ref([]) // 列表的数据 const queryParams = reactive({ pageNo: 1, pageSize: 10, - bizId: null, + nickname: null, bizType: null, type: null, title: null, diff --git a/src/views/member/signin/config/SignInConfigForm.vue b/src/views/member/signin/config/SignInConfigForm.vue index 52263c94..3c272c80 100644 --- a/src/views/member/signin/config/SignInConfigForm.vue +++ b/src/views/member/signin/config/SignInConfigForm.vue @@ -71,6 +71,8 @@ const submitForm = async () => { try { const data = formData.value as unknown as SignInConfigApi.SignInConfigVO if (formType.value === 'create') { + //默认新创建的自动启动 + data.enable = true await SignInConfigApi.createSignInConfig(data) message.success(t('common.createSuccess')) } else { diff --git a/src/views/member/signin/config/index.vue b/src/views/member/signin/config/index.vue index ca4db158..99e22589 100644 --- a/src/views/member/signin/config/index.vue +++ b/src/views/member/signin/config/index.vue @@ -1,55 +1,39 @@