Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
b0b66912
authored
Nov 18, 2023
by
芋道源码
Committed by
Gitee
Nov 18, 2023
Browse files
Options
Browse Files
Download
Plain Diff
!314 会员中心商品收藏
Merge pull request !314 from niou233/featrue/mall_org
parents
4423e9b8
af5d1cf2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
1 deletions
+112
-1
src/api/mall/product/favorite.ts
+12
-0
src/views/member/user/detail/UserFavoriteList.vue
+96
-0
src/views/member/user/detail/index.vue
+4
-1
No files found.
src/api/mall/product/favorite.ts
0 → 100644
View file @
b0b66912
import
request
from
'@/config/axios'
export
interface
Favorite
{
id
?:
number
userId
?:
string
// 用户编号
spuId
?:
number
|
null
// 商品 SPU 编号
}
// 获得 ProductFavorite 列表
export
const
getFavoritePage
=
(
params
:
PageParam
)
=>
{
return
request
.
get
({
url
:
'/product/favorite/page'
,
params
})
}
src/views/member/user/detail/UserFavoriteList.vue
0 → 100644
View file @
b0b66912
<
template
>
<!-- 列表 -->
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
key=
"id"
align=
"center"
label=
"商品编号"
width=
"180"
prop=
"id"
/>
<el-table-column
label=
"商品图"
min-width=
"80"
>
<template
#
default=
"
{ row }">
<el-image
:src=
"row.picUrl"
class=
"h-30px w-30px"
@
click=
"imagePreview(row.picUrl)"
/>
</
template
>
</el-table-column>
<el-table-column
:show-overflow-tooltip=
"true"
label=
"商品名称"
min-width=
"300"
prop=
"name"
/>
<el-table-column
align=
"center"
label=
"商品售价"
min-width=
"90"
prop=
"price"
>
<
template
#
default=
"{ row }"
>
{{
floatToFixed2
(
row
.
price
)
}}
元
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"销量"
min-width=
"90"
prop=
"salesCount"
/>
<el-table-column
:formatter=
"dateFormatter"
align=
"center"
label=
"收藏时间"
prop=
"createTime"
width=
"180"
/>
<el-table-column
align=
"center"
label=
"状态"
min-width=
"80"
>
<
template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.PRODUCT_SPU_STATUS"
:value=
"scope.row.status"
/>
</
template
>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total=
"total"
v-model:page=
"queryParams.pageNo"
v-model:limit=
"queryParams.pageSize"
@
pagination=
"getList"
/>
</ContentWrap>
</template>
<
script
lang=
"ts"
setup
>
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
*
as
FavoriteApi
from
'@/api/mall/product/favorite'
import
{
floatToFixed2
}
from
'@/utils'
const
message
=
useMessage
()
// 消息弹窗
const
{
t
}
=
useI18n
()
// 国际化
const
loading
=
ref
(
true
)
// 列表的加载中
const
total
=
ref
(
0
)
// 列表的总页数
const
list
=
ref
([])
// 列表的数据
const
queryParams
=
reactive
({
pageNo
:
1
,
pageSize
:
10
,
name
:
null
,
createTime
:
[],
userId
:
NaN
})
const
queryFormRef
=
ref
()
// 搜索的表单
/** 查询列表 */
const
getList
=
async
()
=>
{
loading
.
value
=
true
try
{
const
data
=
await
FavoriteApi
.
getFavoritePage
(
queryParams
)
list
.
value
=
data
.
list
total
.
value
=
data
.
total
}
finally
{
loading
.
value
=
false
}
}
/** 搜索按钮操作 */
const
handleQuery
=
()
=>
{
queryParams
.
pageNo
=
1
getList
()
}
/** 重置按钮操作 */
const
resetQuery
=
()
=>
{
queryFormRef
.
value
.
resetFields
()
handleQuery
()
}
const
{
userId
}
=
defineProps
({
userId
:
{
type
:
Number
,
required
:
true
}
})
/** 初始化 **/
onMounted
(()
=>
{
queryParams
.
userId
=
userId
getList
()
})
</
script
>
src/views/member/user/detail/index.vue
View file @
b0b66912
...
...
@@ -48,7 +48,9 @@
<UserOrderList
:user-id=
"id"
/>
</el-tab-pane>
<el-tab-pane
label=
"售后管理"
lazy
>
售后管理(WIP)
</el-tab-pane>
<el-tab-pane
label=
"收藏记录"
lazy
>
收藏记录(WIP)
</el-tab-pane>
<el-tab-pane
label=
"收藏记录"
lazy
>
<UserFavoriteList
:user-id=
"id"
/>
</el-tab-pane>
<el-tab-pane
label=
"优惠劵"
lazy
>
<UserCouponList
:user-id=
"id"
/>
</el-tab-pane>
...
...
@@ -76,6 +78,7 @@ import UserExperienceRecordList from './UserExperienceRecordList.vue'
import
UserOrderList
from
'./UserOrderList.vue'
import
UserPointList
from
'./UserPointList.vue'
import
UserSignList
from
'./UserSignList.vue'
import
UserFavoriteList
from
'./UserFavoriteList.vue'
import
{
CardTitle
}
from
'@/components/Card/index'
import
{
ElMessage
}
from
'element-plus'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment