feat:微信认证
This commit is contained in:
1 parent
dc89dd0b59
commit
5daecfe0d9
4 files changed
+327
-1
No files matched your search
@@ -0,0 +1,51 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 用户认证 VO
|
||||
export interface AuthVO {
|
||||
id: number // 认证编号
|
||||
bizType: string // 认证类型
|
||||
bizId: number // 认证类型编号
|
||||
authPic: number // 认证图片或视频
|
||||
authExtraJson: string // 认证额外信息(json)
|
||||
authTime: Date // 认证时间
|
||||
authMemberId: number // 认证人编号(-1为系统认证)
|
||||
authStatus: string // 认证状态
|
||||
}
|
||||
|
||||
// 用户认证 API
|
||||
export const AuthApi = {
|
||||
// 查询用户认证分页
|
||||
getAuthPage: async (params: any) => {
|
||||
return await request.get({ url: `/member/com-auth/page`, params })
|
||||
},
|
||||
|
||||
// 查询用户认证详情
|
||||
getAuth: async (id: number) => {
|
||||
return await request.get({ url: `/member/com-auth/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增用户认证
|
||||
createAuth: async (data: AuthVO) => {
|
||||
return await request.post({ url: `/member/com-auth/create`, data })
|
||||
},
|
||||
|
||||
// 修改用户认证
|
||||
updateAuth: async (data: AuthVO) => {
|
||||
return await request.put({ url: `/member/com-auth/update`, data })
|
||||
},
|
||||
|
||||
// 检查用户认证
|
||||
checkAuth: async (data: AuthVO) => {
|
||||
return await request.post({ url: `/member/com-auth/check`, data })
|
||||
},
|
||||
|
||||
// 删除用户认证
|
||||
deleteAuth: async (id: number) => {
|
||||
return await request.delete({ url: `/member/com-auth/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出用户认证 Excel
|
||||
exportAuth: async (params) => {
|
||||
return await request.download({ url: `/member/com-auth/export-excel`, params })
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -115,7 +115,7 @@ export enum DICT_TYPE {
|
||||
|
||||
// ========== CHAT 模块 ==========
|
||||
// 聊天消息状态
|
||||
CHAT_MSG_STATUS = 'chat_msg_status',
|
||||
CHAT_MSG_STATUS = 'chat_msg_status',
|
||||
|
||||
// ========== SYSTEM 模块 ==========
|
||||
SYSTEM_USER_SEX = 'system_user_sex',
|
||||
@@ -174,6 +174,8 @@ export enum DICT_TYPE {
|
||||
MEMBER_EXPERIENCE_BIZ_TYPE = 'member_experience_biz_type', // 会员经验业务类型
|
||||
MEMBER_OPEN_TYPE_STATUS = 'open_type_status', // 会员开通类型状态
|
||||
MEMBER_RECENT_TAG = 'member_recent_tag', // 会员标签状态
|
||||
MEMBER_COM_AUTH_TYPE = 'member_com_auth_type', // 会员认证类型
|
||||
MEMBER_COM_AUTH_STATUS = 'member_com_auth_status', // 会员认证类型
|
||||
|
||||
// ========== MALL - 商品模块 ==========
|
||||
PRODUCT_SPU_STATUS = 'product_spu_status', //商品状态
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<Dialog v-model="dialogVisible" title="审核" width="600">
|
||||
<el-form ref="formRef" v-loading="formLoading" :model="formData" :rules="formRules" label-width="130px">
|
||||
<!-- 微信认证 -->
|
||||
<div v-if="formData.bizType == 3">
|
||||
<el-form-item label="微信号" prop="id">
|
||||
<el-input v-model="extraJson.wechatNumber" class="!w-240px" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="微信二维码" prop="id">
|
||||
<PreviewImage :src="extraJson.wechatQrcode" class="!w-240px" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!-- 微信认证 -->
|
||||
<el-form-item label="用户编号" prop="id">
|
||||
<el-radio-group v-model="formData.authStatus">
|
||||
<el-radio value="3" size="large" border>通过</el-radio>
|
||||
<el-radio value="4" size="large" border>拒绝</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formData.authStatus == 4" label="拒绝原因" prop="changeBalance">
|
||||
<el-input v-model="formData.failReason" style="width: 240px" :autosize="{ minRows: 2, maxRows: 4 }"
|
||||
type="textarea" placeholder="请输入拒绝原因" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import * as WalletApi from '@/api/pay/wallet/balance'
|
||||
|
||||
import * as MemberAuthApi from '@/api/member/com-auth'
|
||||
|
||||
/** 修改用户宝石表单 */
|
||||
defineOptions({ name: 'ComAuthForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formData = ref<any>({
|
||||
id: undefined,
|
||||
authStatus: "3",
|
||||
})
|
||||
const extraJson = ref<any>({
|
||||
|
||||
})
|
||||
const formRules = reactive({
|
||||
authStatus: [{ required: true, message: '审核状态不能为空', trigger: 'change' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type = 'check', id?: number) => {
|
||||
dialogVisible.value = true
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = await MemberAuthApi.AuthApi.getAuth(id)
|
||||
formData.value = data
|
||||
if (type == 'check') {
|
||||
formData.value.authStatus = '3'
|
||||
}
|
||||
if (data && data.authExtraJson) {
|
||||
extraJson.value = JSON.parse(data.authExtraJson)
|
||||
}
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
if (!formRef) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
await MemberAuthApi.AuthApi.checkAuth({
|
||||
...formData.value
|
||||
})
|
||||
message.success(t('common.updateSuccess'))
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
nickname: undefined,
|
||||
balance: '0',
|
||||
changeBalance: 0,
|
||||
changeType: 1
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1,160 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
|
||||
<el-form-item label="等级名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入等级名称" clearable @keyup.enter="handleQuery"
|
||||
class="!w-240px" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery">
|
||||
<Icon icon="ep:search" class="mr-5px" /> 搜索
|
||||
</el-button>
|
||||
<el-button @click="resetQuery">
|
||||
<Icon icon="ep:refresh" class="mr-5px" /> 重置
|
||||
</el-button>
|
||||
<el-button type="primary" @click="openForm('create')" v-hasPermi="['member:level:create']">
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="编号" align="center" prop="id" min-width="60" />
|
||||
<el-table-column label="用户" align="center" prop="icon" min-width="150">
|
||||
<template #default="{ row }">
|
||||
<div class="flex items-center gap-2">
|
||||
<PreviewImage :src="row.memberUserAvatar" />
|
||||
<div class="flex flex-col items-start">
|
||||
<div class="table-cell">
|
||||
<span>昵称:</span>
|
||||
<span>{{ row.memberUserName }}</span>
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
<span>手机号:</span>
|
||||
<span>{{ row.memberUserPhone }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核类型" align="center" prop="bizType" min-width="200">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :type="DICT_TYPE.MEMBER_COM_AUTH_TYPE" :value="row.bizType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核状态" align="center" prop="authStatus" min-width="100">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :type="DICT_TYPE.MEMBER_COM_AUTH_STATUS" :value="row.authStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="拒绝原因" align="center" prop="failReason" min-width="150" />
|
||||
<el-table-column label="申请时间" align="center" prop="createTime" :formatter="dateFormatter" min-width="170" />
|
||||
<el-table-column label="操作" align="center" min-width="110px" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="row.bizType != 3" link type="primary" @click="openForm('view', row.id)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button v-if="row.bizType == 3 && !['3', '4'].includes(row.authStatus)" link type="primary"
|
||||
@click="openForm('check', row.id)">
|
||||
审核
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<ComAuthForm ref="formRef" @success="getList" />
|
||||
</ContentWrap>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
import * as MemberAuthApi from '@/api/member/com-auth'
|
||||
|
||||
import ComAuthForm from './cmp/com-auth-form.vue'
|
||||
|
||||
const message = useMessage()
|
||||
const { t } = useI18n()
|
||||
|
||||
const queryFormRef = ref()
|
||||
|
||||
const loading = ref(true)
|
||||
const total = ref(0)
|
||||
const list = ref([])
|
||||
const queryParams = reactive({
|
||||
name: null,
|
||||
status: null
|
||||
})
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await MemberAuthApi.AuthApi.getAuthPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await MemberAuthApi.AuthApi.deleteAuth(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch { }
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.table-cell {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
text-align: left;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
span:first-child {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
span:last-child {
|
||||
flex: 1;
|
||||
color: lightblue;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user