feat:【ele】【member 会员】优化会员详情
This commit is contained in:
@@ -19,12 +19,12 @@ withDefaults(
|
||||
},
|
||||
);
|
||||
|
||||
const [Description] = useDescription({
|
||||
const [Descriptions] = useDescription({
|
||||
componentProps: {
|
||||
border: false,
|
||||
column: 2,
|
||||
direction: 'horizontal',
|
||||
labelWidth: 100,
|
||||
labelWidth: 140,
|
||||
title: '',
|
||||
extra: '',
|
||||
},
|
||||
@@ -32,7 +32,7 @@ const [Description] = useDescription({
|
||||
{
|
||||
field: 'levelName',
|
||||
label: '等级',
|
||||
content: (data) => data.levelName || '无',
|
||||
content: (data) => data.levelName || '-',
|
||||
},
|
||||
{
|
||||
field: 'experience',
|
||||
@@ -76,7 +76,7 @@ const [Description] = useDescription({
|
||||
<template #extra>
|
||||
<slot name="extra"></slot>
|
||||
</template>
|
||||
<Description
|
||||
<Descriptions
|
||||
:column="mode === 'member' ? 2 : 1"
|
||||
:data="{
|
||||
...user,
|
||||
@@ -15,31 +15,33 @@ const [Grid] = useVbenVxeGrid({
|
||||
{
|
||||
field: 'id',
|
||||
title: '编号',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
field: 'title',
|
||||
title: '关联业务标题',
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
field: 'price',
|
||||
title: '交易金额',
|
||||
formatter: 'formatAmount2',
|
||||
minWidth: 120,
|
||||
formatter: 'formatFenToYuanAmount',
|
||||
},
|
||||
{
|
||||
field: 'balance',
|
||||
title: '钱包余额',
|
||||
formatter: 'formatAmount2',
|
||||
minWidth: 120,
|
||||
formatter: 'formatFenToYuanAmount',
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '交易时间',
|
||||
minWidth: 180,
|
||||
formatter: 'formatDateTime',
|
||||
},
|
||||
],
|
||||
keepSource: true,
|
||||
pagerConfig: {
|
||||
pageSize: 10,
|
||||
},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
@@ -54,6 +56,7 @@ const [Grid] = useVbenVxeGrid({
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
isHover: true,
|
||||
},
|
||||
toolbarConfig: {
|
||||
refresh: true,
|
||||
@@ -18,12 +18,12 @@ withDefaults(
|
||||
},
|
||||
);
|
||||
|
||||
const [Description] = useDescription({
|
||||
const [Descriptions] = useDescription({
|
||||
componentProps: {
|
||||
border: false,
|
||||
column: 2,
|
||||
direction: 'horizontal',
|
||||
labelWidth: 100,
|
||||
labelWidth: 140,
|
||||
title: '',
|
||||
extra: '',
|
||||
},
|
||||
@@ -60,17 +60,17 @@ const [Description] = useDescription({
|
||||
{
|
||||
field: 'birthday',
|
||||
label: '生日',
|
||||
content: (data) => formatDate(data.birthday)?.toString() || '空',
|
||||
content: (data) => formatDate(data.birthday)?.toString() || '-',
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
label: '注册时间',
|
||||
content: (data) => formatDate(data.createTime)?.toString() || '空',
|
||||
content: (data) => formatDate(data.createTime)?.toString() || '-',
|
||||
},
|
||||
{
|
||||
field: 'loginDate',
|
||||
label: '最后登录时间',
|
||||
content: (data) => formatDate(data.loginDate)?.toString() || '空',
|
||||
content: (data) => formatDate(data.loginDate)?.toString() || '-',
|
||||
},
|
||||
],
|
||||
});
|
||||
@@ -85,16 +85,16 @@ const [Description] = useDescription({
|
||||
<slot name="extra"></slot>
|
||||
</template>
|
||||
<ElRow v-if="mode === 'member'" :gutter="24">
|
||||
<ElCol :span="4">
|
||||
<ElAvatar :size="140" shape="square" :src="user.avatar" />
|
||||
<ElCol :span="6">
|
||||
<ElAvatar :size="180" shape="square" :src="user.avatar" />
|
||||
</ElCol>
|
||||
<ElCol :span="20">
|
||||
<Description :column="2" :data="user" />
|
||||
<ElCol :span="18">
|
||||
<Descriptions :column="2" :data="user" />
|
||||
</ElCol>
|
||||
</ElRow>
|
||||
<template v-else-if="mode === 'kefu'">
|
||||
<ElAvatar :size="140" shape="square" :src="user.avatar" />
|
||||
<Description :column="1" :data="user" />
|
||||
<Descriptions :column="1" :data="user" />
|
||||
</template>
|
||||
</ElCard>
|
||||
</template>
|
||||
@@ -4,13 +4,13 @@ import type { MemberExperienceRecordApi } from '#/api/member/experience-record';
|
||||
|
||||
import { h } from 'vue';
|
||||
|
||||
import { DICT_TYPE } from '@vben/constants';
|
||||
import { getDictOptions } from '@vben/hooks';
|
||||
|
||||
import { ElTag } from 'element-plus';
|
||||
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { getExperienceRecordPage } from '#/api/member/experience-record';
|
||||
import { DICT_TYPE } from '@vben/constants';
|
||||
import { getDictOptions } from '@vben/hooks';
|
||||
|
||||
import { getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -25,17 +25,22 @@ const [Grid] = useVbenVxeGrid({
|
||||
label: '业务类型',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
clearable: true,
|
||||
options: getDictOptions(
|
||||
DICT_TYPE.MEMBER_EXPERIENCE_BIZ_TYPE,
|
||||
'number',
|
||||
),
|
||||
placeholder: '请选择业务类型',
|
||||
clearable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'title',
|
||||
label: '标题',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入标题',
|
||||
clearable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'createDate',
|
||||
@@ -53,22 +58,24 @@ const [Grid] = useVbenVxeGrid({
|
||||
{
|
||||
field: 'id',
|
||||
title: '编号',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '获得时间',
|
||||
minWidth: 180,
|
||||
formatter: 'formatDateTime',
|
||||
},
|
||||
{
|
||||
field: 'experience',
|
||||
title: '经验',
|
||||
minWidth: 100,
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return h(
|
||||
ElTag,
|
||||
{
|
||||
class: 'mr-1',
|
||||
color: row.experience > 0 ? 'blue' : 'red',
|
||||
type: row.point > 0 ? 'primary' : 'danger',
|
||||
},
|
||||
() =>
|
||||
row.experience > 0 ? `+${row.experience}` : row.experience,
|
||||
@@ -79,22 +86,27 @@ const [Grid] = useVbenVxeGrid({
|
||||
{
|
||||
field: 'totalExperience',
|
||||
title: '总经验',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
field: 'title',
|
||||
title: '标题',
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
field: 'description',
|
||||
title: '描述',
|
||||
minWidth: 250,
|
||||
},
|
||||
{
|
||||
field: 'bizId',
|
||||
title: '业务编号',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'bizType',
|
||||
title: '业务类型',
|
||||
minWidth: 120,
|
||||
cellRender: {
|
||||
name: 'CellDict',
|
||||
props: { type: DICT_TYPE.MEMBER_EXPERIENCE_BIZ_TYPE },
|
||||
@@ -102,9 +114,6 @@ const [Grid] = useVbenVxeGrid({
|
||||
},
|
||||
],
|
||||
keepSource: true,
|
||||
pagerConfig: {
|
||||
pageSize: 10,
|
||||
},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
@@ -119,6 +128,7 @@ const [Grid] = useVbenVxeGrid({
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
isHover: true,
|
||||
},
|
||||
toolbarConfig: {
|
||||
refresh: true,
|
||||
@@ -23,6 +23,7 @@ const [Grid] = useVbenVxeGrid({
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
clearable: true,
|
||||
placeholder: '请选择业务类型',
|
||||
options: getDictOptions(DICT_TYPE.MEMBER_POINT_BIZ_TYPE, 'number'),
|
||||
},
|
||||
},
|
||||
@@ -18,6 +18,10 @@ const [Grid] = useVbenVxeGrid({
|
||||
fieldName: 'day',
|
||||
label: '签到天数',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入签到天数',
|
||||
clearable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'createTime',
|
||||
@@ -33,9 +37,6 @@ const [Grid] = useVbenVxeGrid({
|
||||
gridOptions: {
|
||||
columns: useGridColumns(),
|
||||
keepSource: true,
|
||||
pagerConfig: {
|
||||
pageSize: 10,
|
||||
},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
@@ -50,6 +51,7 @@ const [Grid] = useVbenVxeGrid({
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
isHover: true,
|
||||
},
|
||||
toolbarConfig: {
|
||||
refresh: true,
|
||||
@@ -19,33 +19,39 @@ const [Grid] = useVbenVxeGrid({
|
||||
{
|
||||
field: 'id',
|
||||
title: '地址编号',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
title: '收件人名称',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'mobile',
|
||||
title: '手机号',
|
||||
minWidth: 130,
|
||||
},
|
||||
{
|
||||
field: 'areaId',
|
||||
title: '地区编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'detailAddress',
|
||||
title: '收件详细地址',
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
field: 'defaultStatus',
|
||||
title: '是否默认',
|
||||
minWidth: 100,
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return h(
|
||||
ElTag,
|
||||
{
|
||||
class: 'mr-1',
|
||||
color: row.defaultStatus ? 'blue' : 'red',
|
||||
type: row.defaultStatus ? 'primary' : 'danger',
|
||||
},
|
||||
() => (row.defaultStatus ? '是' : '否'),
|
||||
);
|
||||
@@ -56,6 +62,7 @@ const [Grid] = useVbenVxeGrid({
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
formatter: 'formatDateTime',
|
||||
minWidth: 160,
|
||||
},
|
||||
],
|
||||
keepSource: true,
|
||||
|
||||
@@ -4,6 +4,9 @@ import type { MallCouponApi } from '#/api/mall/promotion/coupon/coupon';
|
||||
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
import { DICT_TYPE } from '@vben/constants';
|
||||
import { getDictOptions } from '@vben/hooks';
|
||||
|
||||
import { ElLoading, ElMessage, ElTabPane, ElTabs } from 'element-plus';
|
||||
|
||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
@@ -11,9 +14,6 @@ import {
|
||||
deleteCoupon,
|
||||
getCouponPage,
|
||||
} from '#/api/mall/promotion/coupon/coupon';
|
||||
import { DICT_TYPE } from '@vben/constants';
|
||||
import { getDictOptions } from '@vben/hooks';
|
||||
|
||||
import { getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
const props = defineProps<{
|
||||
|
||||
Reference in New Issue
Block a user