code review:会员等级

(cherry picked from commit bb0c1cb536)
This commit is contained in:
YunaiV 2023-08-22 21:59:17 +08:00 committed by shizhong
parent edb88f8548
commit 6556feed21
9 changed files with 20 additions and 20 deletions

View File

@ -5,7 +5,7 @@ export interface LevelVO {
name: string
experience: number
value: number
discount: number
discountPercent: number
icon: string
bgUrl: string
status: number

View File

@ -9,25 +9,25 @@ export interface SignInConfigVO {
// 查询积分签到规则列表
export const getSignInConfigList = async () => {
return await request.get({ url: `/member/point/sign-in-config/list` })
return await request.get({ url: `/member/sign-in/config/list` })
}
// 查询积分签到规则详情
export const getSignInConfig = async (id: number) => {
return await request.get({ url: `/member/point/sign-in-config/get?id=` + id })
return await request.get({ url: `/member/sign-in/config/get?id=` + id })
}
// 新增积分签到规则
export const createSignInConfig = async (data: SignInConfigVO) => {
return await request.post({ url: `/member/point/sign-in-config/create`, data })
return await request.post({ url: `/member/sign-in/config/create`, data })
}
// 修改积分签到规则
export const updateSignInConfig = async (data: SignInConfigVO) => {
return await request.put({ url: `/member/point/sign-in-config/update`, data })
return await request.put({ url: `/member/sign-in/config/update`, data })
}
// 删除积分签到规则
export const deleteSignInConfig = async (id: number) => {
return await request.delete({ url: `/member/point/sign-in-config/delete?id=` + id })
return await request.delete({ url: `/member/sign-in/config/delete?id=` + id })
}

View File

@ -18,5 +18,5 @@ export interface SignInRecordQueryVO {
// 查询用户签到积分列表
export const getSignInRecordPage = async (params) => {
return await request.get({ url: `/member/point/sign-in-record/page`, params })
return await request.get({ url: `/member/sign-in/record/page`, params })
}

View File

@ -10,9 +10,6 @@
<el-form-item label="名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入名称" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" type="textarea" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="formData.status">
<el-radio
@ -24,6 +21,9 @@
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" type="textarea" placeholder="请输入备注" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>

View File

@ -8,7 +8,6 @@
/>
</el-select>
</template>
<script lang="ts" setup>
import * as GroupApi from '@/api/member/group'

View File

@ -38,9 +38,9 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="享受折扣(%)" prop="discount">
<el-form-item label="享受折扣(%)" prop="discountPercent">
<el-input-number
v-model="formData.discount"
v-model="formData.discountPercent"
:min="0"
:max="100"
:precision="0"
@ -100,7 +100,7 @@ const formData = ref({
name: undefined,
experience: undefined,
level: undefined,
discount: undefined,
discountPercent: undefined,
icon: undefined,
backgroundUrl: undefined,
status: CommonStatusEnum.ENABLE
@ -109,7 +109,7 @@ const formRules = reactive({
name: [{ required: true, message: '等级名称不能为空', trigger: 'blur' }],
experience: [{ required: true, message: '升级经验不能为空', trigger: 'blur' }],
level: [{ required: true, message: '等级不能为空', trigger: 'blur' }],
discount: [{ required: true, message: '享受折扣不能为空', trigger: 'blur' }],
discountPercent: [{ required: true, message: '享受折扣不能为空', trigger: 'blur' }],
status: [{ required: true, message: '状态不能为空', trigger: 'change' }]
})
const formRef = ref() // Ref
@ -165,7 +165,7 @@ const resetForm = () => {
name: undefined,
experience: undefined,
level: undefined,
discount: undefined,
discountPercent: undefined,
icon: undefined,
backgroundUrl: undefined,
status: CommonStatusEnum.ENABLE

View File

@ -8,7 +8,6 @@
</el-option>
</el-select>
</template>
<script lang="ts" setup>
import * as LevelApi from '@/api/member/level'

View File

@ -62,7 +62,7 @@
<el-table-column label="等级名称" align="center" prop="name" min-width="100" />
<el-table-column label="等级" align="center" prop="level" min-width="60" />
<el-table-column label="升级经验" align="center" prop="experience" min-width="80" />
<el-table-column label="享受折扣(%)" align="center" prop="discount" min-width="110" />
<el-table-column label="享受折扣(%)" align="center" prop="discountPercent" min-width="110" />
<el-table-column label="状态" align="center" prop="status" min-width="70">
<template #default="scope">
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />

View File

@ -84,10 +84,12 @@
:show-overflow-tooltip="false"
>
<template #default="scope">
<el-tag v-for="(tagName, index) in scope.row.tagNames" :key="index">{{ tagName }}</el-tag>
<el-tag v-for="(tagName, index) in scope.row.tagNames" :key="index" class="mr-5px">
{{ tagName }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="积分" align="center" width="100px" />
<el-table-column label="积分" align="center" prop="point" width="100px" />
<el-table-column label="状态" align="center" prop="status" width="100px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />