Skip to content

Commit 57f6367

Browse files
committed
Merge remote-tracking branch 'origin/dev' into dev
2 parents 6fc232b + c3f06f5 commit 57f6367

File tree

9 files changed

+293
-39
lines changed

9 files changed

+293
-39
lines changed

src/api/pay/wallet/index.ts renamed to src/api/pay/wallet/balance/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,8 @@ export interface WalletVO {
2020
export const getWallet = async (params: PayWalletUserReqVO) => {
2121
return await request.get<WalletVO>({ url: `/pay/wallet/get`, params })
2222
}
23+
24+
// 查询会员钱包列表
25+
export const getWalletPage = async (params) => {
26+
return await request.get({ url: `/pay/wallet/page`, params })
27+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import request from '@/config/axios'
2+
3+
export interface WalletTransactionVO {
4+
id: number
5+
walletId: number
6+
title: string
7+
price: number
8+
balance: number
9+
}
10+
11+
// 查询会员钱包流水列表
12+
export const getWalletTransactionPage = async (params) => {
13+
return await request.get({ url: `/pay/wallet-transaction/page`, params })
14+
}

src/views/mall/promotion/article/ArticleForm.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
label-width="110px"
99
>
1010
<el-row>
11+
<el-col :span="12">
12+
<el-form-item label="文章标题" prop="title">
13+
<el-input v-model="formData.title" placeholder="请输入文章标题" />
14+
</el-form-item>
15+
</el-col>
1116
<el-col :span="12">
1217
<el-form-item label="文章分类" prop="categoryId">
1318
<el-select v-model="formData.categoryId" placeholder="请选择">
@@ -20,11 +25,6 @@
2025
</el-select>
2126
</el-form-item>
2227
</el-col>
23-
<el-col :span="12">
24-
<el-form-item label="文章标题" prop="title">
25-
<el-input v-model="formData.title" placeholder="请输入文章标题" />
26-
</el-form-item>
27-
</el-col>
2828
<el-col :span="12">
2929
<el-form-item label="文章作者" prop="author">
3030
<el-input v-model="formData.author" placeholder="请输入文章作者" />
@@ -40,6 +40,7 @@
4040
<UploadImg v-model="formData.picUrl" height="80px" />
4141
</el-form-item>
4242
</el-col>
43+
<!-- TODO @puhui999:浏览次数,不能修改 -->
4344
<el-col :span="12">
4445
<el-form-item label="浏览次数" prop="browseCount">
4546
<el-input-number
@@ -68,6 +69,7 @@
6869
</el-radio-group>
6970
</el-form-item>
7071
</el-col>
72+
<!-- TODO @puhui999:可以使用 SpuTableSelect -->
7173
<el-col :span="12">
7274
<el-form-item label="商品关联" prop="spuId">
7375
<el-select v-model="formData.spuId" placeholder="请选择">

src/views/mall/promotion/article/index.vue

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -78,51 +78,31 @@
7878
<!-- 列表 -->
7979
<ContentWrap>
8080
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
81-
<el-table-column align="center" label="文章分类" prop="categoryId">
82-
<template #default="scope">
83-
{{ categoryList.find((item) => item.id === scope.row.categoryId)?.name }}
84-
</template>
85-
</el-table-column>
86-
<el-table-column align="center" label="关联商品" prop="spuId" width="300">
87-
<template #default="scope">
88-
<el-image
89-
:preview-src-list="[spuList.find((item) => item.id === scope.row.spuId)?.picUrl]"
90-
:src="spuList.find((item) => item.id === scope.row.spuId)?.picUrl"
91-
class="mr-[10px] h-40px w-40px v-middle"
92-
preview-teleported
93-
/>
94-
{{ spuList.find((item) => item.id === scope.row.spuId)?.name }}
95-
</template>
96-
</el-table-column>
97-
<el-table-column align="center" label="文章标题" prop="title" />
98-
<el-table-column align="center" label="文章作者" prop="author" />
99-
<el-table-column align="center" label="文章封面" prop="picUrl">
81+
<el-table-column align="center" label="编号" prop="id" min-width="60" />
82+
<el-table-column align="center" label="封面" prop="picUrl" min-width="80">
10083
<template #default="{ row }">
10184
<el-image :src="row.picUrl" class="h-30px w-30px" @click="imagePreview(row.picUrl)" />
10285
</template>
10386
</el-table-column>
104-
<el-table-column align="center" label="文章简介" prop="introduction" />
105-
<el-table-column align="center" label="浏览次数" prop="browseCount" />
106-
<el-table-column align="center" label="排序" prop="sort" />
107-
<el-table-column align="center" label="状态" prop="status">
87+
<el-table-column align="center" label="标题" prop="title" min-width="180" />
88+
<el-table-column align="center" label="分类" prop="categoryId" min-width="180">
10889
<template #default="scope">
109-
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
110-
</template>
111-
</el-table-column>
112-
<el-table-column align="center" label="热门" prop="recommendHot">
113-
<template #default="scope">
114-
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.recommendHot" />
90+
{{ categoryList.find((item) => item.id === scope.row.categoryId)?.name }}
11591
</template>
11692
</el-table-column>
117-
<el-table-column align="center" label="轮播图" prop="recommendBanner">
93+
<el-table-column align="center" label="浏览量" prop="browseCount" min-width="180" />
94+
<el-table-column align="center" label="作者" prop="author" min-width="180" />
95+
<el-table-column align="center" label="文章简介" prop="introduction" min-width="250" />
96+
<el-table-column align="center" label="排序" prop="sort" min-width="60" />
97+
<el-table-column align="center" label="状态" prop="status" min-width="60">
11898
<template #default="scope">
119-
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.recommendBanner" />
99+
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
120100
</template>
121101
</el-table-column>
122102
<el-table-column
123103
:formatter="dateFormatter"
124104
align="center"
125-
label="创建时间"
105+
label="发布时间"
126106
prop="createTime"
127107
width="180px"
128108
/>

src/views/member/user/detail/UserAccountInfo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<script setup lang="ts">
4848
import { DescriptionsItemLabel } from '@/components/Descriptions'
4949
import * as UserApi from '@/api/member/user'
50-
import * as WalletApi from '@/api/pay/wallet'
50+
import * as WalletApi from '@/api/pay/wallet/balance'
5151
import { UserTypeEnum } from '@/utils/constants'
5252
import { fenToYuan } from '@/utils'
5353
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<template>
2+
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800">
3+
<WalletTransactionList :wallet-id="walletId" />
4+
<template #footer>
5+
<el-button @click="dialogVisible = false">取 消</el-button>
6+
</template>
7+
</Dialog>
8+
</template>
9+
<script setup lang="ts">
10+
import WalletTransactionList from '../transaction/WalletTransactionList.vue'
11+
const dialogVisible = ref(false) // 弹窗的是否展示
12+
const dialogTitle = ref('') // 弹窗的标题
13+
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
14+
const walletId = ref(0)
15+
/** 打开弹窗 */
16+
const open = async (theWalletId: number) => {
17+
dialogVisible.value = true
18+
dialogTitle.value = '钱包余额明细'
19+
walletId.value = theWalletId
20+
}
21+
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
22+
</script>
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
<template>
2+
<ContentWrap>
3+
<!-- 搜索工作栏 -->
4+
<el-form
5+
class="-mb-15px"
6+
:model="queryParams"
7+
ref="queryFormRef"
8+
:inline="true"
9+
label-width="68px"
10+
>
11+
<el-form-item label="用户编号" prop="userId">
12+
<el-input
13+
v-model="queryParams.userId"
14+
placeholder="请输入用户编号"
15+
clearable
16+
@keyup.enter="handleQuery"
17+
class="!w-240px"
18+
/>
19+
</el-form-item>
20+
<el-form-item label="用户类型" prop="userType">
21+
<el-select
22+
v-model="queryParams.userType"
23+
placeholder="请选择用户类型"
24+
clearable
25+
class="!w-240px"
26+
>
27+
<el-option
28+
v-for="dict in getIntDictOptions(DICT_TYPE.USER_TYPE)"
29+
:key="dict.value"
30+
:label="dict.label"
31+
:value="dict.value"
32+
/>
33+
</el-select>
34+
</el-form-item>
35+
<el-form-item label="创建时间" prop="createTime">
36+
<el-date-picker
37+
v-model="queryParams.createTime"
38+
value-format="YYYY-MM-DD HH:mm:ss"
39+
type="daterange"
40+
start-placeholder="开始日期"
41+
end-placeholder="结束日期"
42+
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
43+
class="!w-240px"
44+
/>
45+
</el-form-item>
46+
<el-form-item>
47+
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
48+
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
49+
</el-form-item>
50+
</el-form>
51+
</ContentWrap>
52+
53+
<!-- 列表 -->
54+
<ContentWrap>
55+
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
56+
<el-table-column label="编号" align="center" prop="id" />
57+
<el-table-column label="用户编号" align="center" prop="userId" />
58+
<el-table-column label="用户类型" align="center" prop="userType">
59+
<template #default="scope">
60+
<dict-tag :type="DICT_TYPE.USER_TYPE" :value="scope.row.userType" />
61+
</template>
62+
</el-table-column>
63+
<el-table-column label="余额" align="center" prop="balance">
64+
<template #default="{ row }"> {{ fenToYuan(row.balance) }} 元</template>
65+
</el-table-column>
66+
<el-table-column label="累计支出" align="center" prop="totalExpense">
67+
<template #default="{ row }"> {{ fenToYuan(row.totalExpense) }} 元</template>
68+
</el-table-column>
69+
<el-table-column label="累计充值" align="center" prop="totalRecharge">
70+
<template #default="{ row }"> {{ fenToYuan(row.totalRecharge) }} 元</template>
71+
</el-table-column>
72+
<el-table-column label="冻结金额" align="center" prop="freezePrice">
73+
<template #default="{ row }"> {{ fenToYuan(row.freezePrice) }} 元</template>
74+
</el-table-column>
75+
<el-table-column
76+
label="创建时间"
77+
align="center"
78+
prop="createTime"
79+
:formatter="dateFormatter"
80+
width="180px"
81+
/>
82+
<el-table-column label="操作" align="center">
83+
<template #default="scope">
84+
<el-button link type="primary" @click="openForm(scope.row.id)">详情</el-button>
85+
</template>
86+
</el-table-column>
87+
</el-table>
88+
<!-- 分页 -->
89+
<Pagination
90+
:total="total"
91+
v-model:page="queryParams.pageNo"
92+
v-model:limit="queryParams.pageSize"
93+
@pagination="getList"
94+
/>
95+
</ContentWrap>
96+
97+
<!-- 弹窗 -->
98+
<WalletForm ref="formRef" />
99+
</template>
100+
101+
<script setup lang="ts">
102+
import { dateFormatter } from '@/utils/formatTime'
103+
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
104+
import { fenToYuan } from '@/utils'
105+
import * as WalletApi from '@/api/pay/wallet/balance'
106+
import WalletForm from './WalletForm.vue'
107+
108+
defineOptions({ name: 'WalletBalance' })
109+
110+
const message = useMessage() // 消息弹窗
111+
const { t } = useI18n() // 国际化
112+
113+
const loading = ref(true) // 列表的加载中
114+
const total = ref(0) // 列表的总页数
115+
const list = ref([]) // 列表的数据
116+
const queryParams = reactive({
117+
pageNo: 1,
118+
pageSize: 10,
119+
userId: null,
120+
userType: null,
121+
balance: null,
122+
totalExpense: null,
123+
totalRecharge: null,
124+
freezePrice: null,
125+
createTime: []
126+
})
127+
const queryFormRef = ref() // 搜索的表单
128+
const exportLoading = ref(false) // 导出的加载中
129+
130+
/** 查询列表 */
131+
const getList = async () => {
132+
loading.value = true
133+
try {
134+
const data = await WalletApi.getWalletPage(queryParams)
135+
list.value = data.list
136+
total.value = data.total
137+
} finally {
138+
loading.value = false
139+
}
140+
}
141+
142+
/** 搜索按钮操作 */
143+
const handleQuery = () => {
144+
queryParams.pageNo = 1
145+
getList()
146+
}
147+
148+
/** 重置按钮操作 */
149+
const resetQuery = () => {
150+
queryFormRef.value.resetFields()
151+
handleQuery()
152+
}
153+
154+
/** 添加/修改操作 */
155+
const formRef = ref()
156+
const openForm = (id?: number) => {
157+
formRef.value.open(id)
158+
}
159+
160+
/** 初始化 **/
161+
onMounted(() => {
162+
getList()
163+
})
164+
</script>

src/views/pay/wallet/rechargePackage/index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ const queryParams = reactive({
135135
createTime: []
136136
})
137137
const queryFormRef = ref() // 搜索的表单
138-
const exportLoading = ref(false) // 导出的加载中
139138
140139
/** 查询列表 */
141140
const getList = async () => {

0 commit comments

Comments
 (0)