Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
boyueCEnd
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
游洁
boyueCEnd
Commits
4787b2fb
Commit
4787b2fb
authored
Nov 25, 2025
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
个人中心
parent
6b11afc0
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
565 additions
and
36 deletions
+565
-36
Headers.vue
src/layouts/components/Headers.vue
+1
-1
index.ts
src/router/index.ts
+25
-0
UserService.ts
src/services/UserService.ts
+20
-0
accountCenter.vue
src/views/personalCenter/accountCenter.vue
+90
-0
commonPassengerInfo.vue
src/views/personalCenter/commonPassengerInfo.vue
+90
-0
LeftView.vue
src/views/personalCenter/components/LeftView.vue
+21
-5
coupon.vue
src/views/personalCenter/coupon.vue
+90
-0
distributionCenter.vue
src/views/personalCenter/distributionCenter.vue
+90
-0
index.vue
src/views/personalCenter/index.vue
+34
-27
myCollection.vue
src/views/personalCenter/myCollection.vue
+90
-0
myOrder.vue
src/views/personalCenter/myOrder.vue
+14
-3
No files found.
src/layouts/components/Headers.vue
View file @
4787b2fb
...
@@ -66,7 +66,7 @@ const { t } = useI18n()
...
@@ -66,7 +66,7 @@ const { t } = useI18n()
const
router
=
useRouter
()
const
router
=
useRouter
()
const
userStore
=
useUserStore
()
const
userStore
=
useUserStore
()
const
systemConfigStore
=
useSystemConfigStore
()
const
systemConfigStore
=
useSystemConfigStore
()
console
.
log
(
userStore
.
userInfo
,
'----------'
)
//
console.log(userStore.userInfo,'----------')
const
goPage
=
(
path
:
string
)
=>
{
const
goPage
=
(
path
:
string
)
=>
{
router
.
push
(
path
)
router
.
push
(
path
)
...
...
src/router/index.ts
View file @
4787b2fb
...
@@ -28,6 +28,31 @@ const router = createRouter({
...
@@ -28,6 +28,31 @@ const router = createRouter({
meta
:
{
title
:
"page.systemMessage"
},
meta
:
{
title
:
"page.systemMessage"
},
component
:
()
=>
import
(
'../views/personalCenter/systemMessage.vue'
)
component
:
()
=>
import
(
'../views/personalCenter/systemMessage.vue'
)
},
},
{
path
:
'/personalCenter/myCollection'
,
meta
:
{
title
:
"page.myCollection"
},
component
:
()
=>
import
(
'../views/personalCenter/myCollection.vue'
)
},
{
path
:
'/personalCenter/coupon'
,
meta
:
{
title
:
"page.coupon"
},
component
:
()
=>
import
(
'../views/personalCenter/coupon.vue'
)
},
{
path
:
'/personalCenter/accountCenter'
,
meta
:
{
title
:
"page.accountCenter"
},
component
:
()
=>
import
(
'../views/personalCenter/accountCenter.vue'
)
},
{
path
:
'/personalCenter/commonPassengerInfo'
,
meta
:
{
title
:
"page.commonPassengerInfo"
},
component
:
()
=>
import
(
'../views/personalCenter/commonPassengerInfo.vue'
)
},
{
path
:
'/personalCenter/distributionCenter'
,
meta
:
{
title
:
"page.distributionCenter"
},
component
:
()
=>
import
(
'../views/personalCenter/distributionCenter.vue'
)
},
]
]
}
}
]
]
...
...
src/services/UserService.ts
View file @
4787b2fb
...
@@ -504,6 +504,26 @@ class UserService {
...
@@ -504,6 +504,26 @@ class UserService {
)
)
return
response
as
unknown
as
ResetPasswordResponseDto
return
response
as
unknown
as
ResetPasswordResponseDto
}
}
/**
* 获取个人中心信息
* @param email 邮箱地址
* @param code 验证码
* @param tenantId 租户ID(可选)
* @returns 验证结果
*/
static
async
memberCenterAsync
(
tenantId
:
string
):
Promise
<
HttpResponse
>
{
const
response
=
await
OtaRequest
.
get
(
'/member-auth/member-center'
,
{},
{
headers
:
tenantId
?
{
'__tenant'
:
tenantId
}
:
{}
}
)
return
response
as
unknown
as
HttpResponse
}
}
}
export
default
UserService
export
default
UserService
src/views/personalCenter/accountCenter.vue
0 → 100644
View file @
4787b2fb
<
template
>
<div
class=
"w-[977px] h-full flex flex-col flex-shrink-0 overflow-hidden"
>
账户中心
</div>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ref
}
from
'vue'
import
{
useI18n
}
from
'vue-i18n'
import
{
useUserStore
}
from
'@/stores/user'
import
{
useSystemConfigStore
}
from
'@/stores/index'
// 引入订单状态枚举
import
OrderStatusEnum
from
'@/utils/orderStautsEnum'
const
{
t
}
=
useI18n
()
const
userStore
=
useUserStore
()
const
systemConfigStore
=
useSystemConfigStore
()
const
orderList
=
ref
<
any
>
([])
const
currentStatus
=
ref
(
0
)
orderList
.
value
.
push
({
value
:
0
,
lable
:
t
(
'personal.orderStatus.ALL'
),
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
UN_PAY
.
value
,
lable
:
OrderStatusEnum
.
UN_PAY
.
desc
,
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
PAYED
.
value
,
lable
:
OrderStatusEnum
.
PAYED
.
desc
,
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
FINISH
.
value
,
lable
:
OrderStatusEnum
.
FINISH
.
desc
,
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
CANCEL
.
value
,
lable
:
OrderStatusEnum
.
CANCEL
.
desc
,
})
const
queryParams
=
ref
<
any
>
({
pageIndex
:
1
,
pageSize
:
10
,
orderStatus
:
currentStatus
.
value
,
})
const
dataList
=
ref
<
any
>
([])
const
loding
=
ref
(
false
)
const
noMoreData
=
ref
(
false
)
const
scrollContainer
=
ref
<
any
>
(
null
)
const
scrollThreshold
=
0
// 阈值,距离底部多少距离时触发加载
const
changeStatus
=
(
key
:
number
)
=>
{
currentStatus
.
value
=
key
}
const
loadData
=
async
()
=>
{
}
// 处理 div 滚动事件(核心修改)
const
handleDivScroll
=
(
e
:
any
)
=>
{
if
(
loding
.
value
||
noMoreData
.
value
)
return
;
const
container
=
e
.
target
;
if
(
!
container
)
return
;
// 计算滚动位置(兼容不同浏览器)
const
scrollTop
=
container
.
scrollTop
;
const
clientHeight
=
container
.
clientHeight
;
const
scrollHeight
=
container
.
scrollHeight
;
// 触底条件:滚动距离 + 可见高度 ≥ 总高度 - 阈值
if
(
scrollTop
+
clientHeight
>=
scrollHeight
-
scrollThreshold
)
{
noMoreData
.
value
=
false
queryParams
.
value
.
pageIndex
++
loadData
();
// 加载下一页
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.myOrderData
{
background
:
#FBFBFA
;
}
.myOrder-text-l
{
color
:
var
(
--
color-neutral-7
);
}
:deep
(
.arco-scrollbar-track-direction-vertical
)
{
display
:
none
;
}
.myOrder-time
{
color
:
var
(
--
color-neutral-6
);
}
</
style
>
\ No newline at end of file
src/views/personalCenter/commonPassengerInfo.vue
0 → 100644
View file @
4787b2fb
<
template
>
<div
class=
"w-[977px] h-full flex flex-col flex-shrink-0 overflow-hidden"
>
常用旅客信息
</div>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ref
}
from
'vue'
import
{
useI18n
}
from
'vue-i18n'
import
{
useUserStore
}
from
'@/stores/user'
import
{
useSystemConfigStore
}
from
'@/stores/index'
// 引入订单状态枚举
import
OrderStatusEnum
from
'@/utils/orderStautsEnum'
const
{
t
}
=
useI18n
()
const
userStore
=
useUserStore
()
const
systemConfigStore
=
useSystemConfigStore
()
const
orderList
=
ref
<
any
>
([])
const
currentStatus
=
ref
(
0
)
orderList
.
value
.
push
({
value
:
0
,
lable
:
t
(
'personal.orderStatus.ALL'
),
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
UN_PAY
.
value
,
lable
:
OrderStatusEnum
.
UN_PAY
.
desc
,
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
PAYED
.
value
,
lable
:
OrderStatusEnum
.
PAYED
.
desc
,
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
FINISH
.
value
,
lable
:
OrderStatusEnum
.
FINISH
.
desc
,
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
CANCEL
.
value
,
lable
:
OrderStatusEnum
.
CANCEL
.
desc
,
})
const
queryParams
=
ref
<
any
>
({
pageIndex
:
1
,
pageSize
:
10
,
orderStatus
:
currentStatus
.
value
,
})
const
dataList
=
ref
<
any
>
([])
const
loding
=
ref
(
false
)
const
noMoreData
=
ref
(
false
)
const
scrollContainer
=
ref
<
any
>
(
null
)
const
scrollThreshold
=
0
// 阈值,距离底部多少距离时触发加载
const
changeStatus
=
(
key
:
number
)
=>
{
currentStatus
.
value
=
key
}
const
loadData
=
async
()
=>
{
}
// 处理 div 滚动事件(核心修改)
const
handleDivScroll
=
(
e
:
any
)
=>
{
if
(
loding
.
value
||
noMoreData
.
value
)
return
;
const
container
=
e
.
target
;
if
(
!
container
)
return
;
// 计算滚动位置(兼容不同浏览器)
const
scrollTop
=
container
.
scrollTop
;
const
clientHeight
=
container
.
clientHeight
;
const
scrollHeight
=
container
.
scrollHeight
;
// 触底条件:滚动距离 + 可见高度 ≥ 总高度 - 阈值
if
(
scrollTop
+
clientHeight
>=
scrollHeight
-
scrollThreshold
)
{
noMoreData
.
value
=
false
queryParams
.
value
.
pageIndex
++
loadData
();
// 加载下一页
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.myOrderData
{
background
:
#FBFBFA
;
}
.myOrder-text-l
{
color
:
var
(
--
color-neutral-7
);
}
:deep
(
.arco-scrollbar-track-direction-vertical
)
{
display
:
none
;
}
.myOrder-time
{
color
:
var
(
--
color-neutral-6
);
}
</
style
>
\ No newline at end of file
src/views/personalCenter/components/LeftView.vue
View file @
4787b2fb
...
@@ -5,13 +5,13 @@
...
@@ -5,13 +5,13 @@
<a-avatar
class=
"LeftViewImg cursor-pointer flex-shrink-0 !w-[80px] !h-[80px]"
>
<a-avatar
class=
"LeftViewImg cursor-pointer flex-shrink-0 !w-[80px] !h-[80px]"
>
<img
class=
"w-full h-full cursor-pointer"
<img
class=
"w-full h-full cursor-pointer"
alt=
"avatar"
alt=
"avatar"
:src=
"user
Store.userInfo.avatar
|| systemConfigStore.config?.logo || 'https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp'"
:src=
"user
Info.photo
|| systemConfigStore.config?.logo || 'https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp'"
/>
/>
</a-avatar>
</a-avatar>
</div>
</div>
<div
class=
"mt-[13px] text-lg font-medium text-center truncate"
>
{{
user
Store
.
userInfo
.
nick
}}
</div>
<div
class=
"mt-[13px] text-lg font-medium text-center truncate"
>
{{
user
Info
.
name
}}
</div>
<div
class=
"flex justify-center items-center mt-[10px] cursor-pointer"
>
<div
class=
"flex justify-center items-center mt-[10px] cursor-pointer"
>
<span
class=
"LeftViewTisp w-[6px] h-[6px] rounded-full"
></span>
<span
v-if=
"userInfo.externalLoginList?.length==0"
class=
"LeftViewTisp w-[6px] h-[6px] rounded-full"
></span>
<span
class=
"LeftViewData ml-[5px] text-sm font-medium text-[#666]"
>
<span
class=
"LeftViewData ml-[5px] text-sm font-medium text-[#666]"
>
{{
t
(
'personal.completeProfile'
)
}}
{{
t
(
'personal.completeProfile'
)
}}
>>
>>
...
@@ -85,12 +85,16 @@
...
@@ -85,12 +85,16 @@
</div>
</div>
</
template
>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
reactive
,
inject
,
watch
}
from
'vue'
import
{
ref
,
reactive
,
inject
,
watch
,
computed
}
from
'vue'
import
{
useI18n
}
from
'vue-i18n'
import
{
useI18n
}
from
'vue-i18n'
import
{
useRouter
}
from
'vue-router'
import
{
useRouter
}
from
'vue-router'
import
{
useUserStore
}
from
'@/stores/user'
import
{
useUserStore
}
from
'@/stores/user'
import
UserService
from
'@/services/UserService'
import
{
useSystemConfigStore
}
from
'@/stores/index'
import
{
useSystemConfigStore
}
from
'@/stores/index'
const
props
=
defineProps
({
const
props
=
defineProps
({
menuList
:
{
menuList
:
{
type
:
Array
,
type
:
Array
,
...
@@ -112,8 +116,14 @@ const { t } = useI18n()
...
@@ -112,8 +116,14 @@ const { t } = useI18n()
const
router
=
useRouter
()
const
router
=
useRouter
()
const
userStore
=
useUserStore
()
const
userStore
=
useUserStore
()
const
systemConfigStore
=
useSystemConfigStore
()
const
systemConfigStore
=
useSystemConfigStore
()
const
activeMenu
=
ref
(
props
.
activeMenu
)
const
tenantId
=
computed
(()
=>
systemConfigStore
.
tenantId
)
const
userData
=
ref
({}
as
any
)
userData
.
value
=
inject
(
'userData'
)
const
userInfo
=
computed
(()
=>
userData
.
value
.
userInfo
)
const
activeMenu
=
ref
(
props
.
activeMenu
)
watch
(()
=>
props
.
activeMenu
,
(
newVal
,
oldVal
)
=>
{
watch
(()
=>
props
.
activeMenu
,
(
newVal
,
oldVal
)
=>
{
activeMenu
.
value
=
newVal
activeMenu
.
value
=
newVal
})
})
...
@@ -121,6 +131,12 @@ watch(() => props.activeMenu, (newVal, oldVal) => {
...
@@ -121,6 +131,12 @@ watch(() => props.activeMenu, (newVal, oldVal) => {
const
goPage
=
(
path
:
string
)
=>
{
const
goPage
=
(
path
:
string
)
=>
{
router
.
push
(
path
)
router
.
push
(
path
)
}
}
const
getPersonalInfor
=
async
()
=>
{
const
response
=
await
UserService
.
memberCenterAsync
(
tenantId
.
value
)
userData
.
value
.
userInfo
=
response
}
getPersonalInfor
()
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.LeftViewImg
{
.LeftViewImg
{
...
...
src/views/personalCenter/coupon.vue
0 → 100644
View file @
4787b2fb
<
template
>
<div
class=
"w-[977px] h-full flex flex-col flex-shrink-0 overflow-hidden"
>
优惠券
</div>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ref
}
from
'vue'
import
{
useI18n
}
from
'vue-i18n'
import
{
useUserStore
}
from
'@/stores/user'
import
{
useSystemConfigStore
}
from
'@/stores/index'
// 引入订单状态枚举
import
OrderStatusEnum
from
'@/utils/orderStautsEnum'
const
{
t
}
=
useI18n
()
const
userStore
=
useUserStore
()
const
systemConfigStore
=
useSystemConfigStore
()
const
orderList
=
ref
<
any
>
([])
const
currentStatus
=
ref
(
0
)
orderList
.
value
.
push
({
value
:
0
,
lable
:
t
(
'personal.orderStatus.ALL'
),
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
UN_PAY
.
value
,
lable
:
OrderStatusEnum
.
UN_PAY
.
desc
,
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
PAYED
.
value
,
lable
:
OrderStatusEnum
.
PAYED
.
desc
,
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
FINISH
.
value
,
lable
:
OrderStatusEnum
.
FINISH
.
desc
,
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
CANCEL
.
value
,
lable
:
OrderStatusEnum
.
CANCEL
.
desc
,
})
const
queryParams
=
ref
<
any
>
({
pageIndex
:
1
,
pageSize
:
10
,
orderStatus
:
currentStatus
.
value
,
})
const
dataList
=
ref
<
any
>
([])
const
loding
=
ref
(
false
)
const
noMoreData
=
ref
(
false
)
const
scrollContainer
=
ref
<
any
>
(
null
)
const
scrollThreshold
=
0
// 阈值,距离底部多少距离时触发加载
const
changeStatus
=
(
key
:
number
)
=>
{
currentStatus
.
value
=
key
}
const
loadData
=
async
()
=>
{
}
// 处理 div 滚动事件(核心修改)
const
handleDivScroll
=
(
e
:
any
)
=>
{
if
(
loding
.
value
||
noMoreData
.
value
)
return
;
const
container
=
e
.
target
;
if
(
!
container
)
return
;
// 计算滚动位置(兼容不同浏览器)
const
scrollTop
=
container
.
scrollTop
;
const
clientHeight
=
container
.
clientHeight
;
const
scrollHeight
=
container
.
scrollHeight
;
// 触底条件:滚动距离 + 可见高度 ≥ 总高度 - 阈值
if
(
scrollTop
+
clientHeight
>=
scrollHeight
-
scrollThreshold
)
{
noMoreData
.
value
=
false
queryParams
.
value
.
pageIndex
++
loadData
();
// 加载下一页
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.myOrderData
{
background
:
#FBFBFA
;
}
.myOrder-text-l
{
color
:
var
(
--
color-neutral-7
);
}
:deep
(
.arco-scrollbar-track-direction-vertical
)
{
display
:
none
;
}
.myOrder-time
{
color
:
var
(
--
color-neutral-6
);
}
</
style
>
\ No newline at end of file
src/views/personalCenter/distributionCenter.vue
0 → 100644
View file @
4787b2fb
<
template
>
<div
class=
"w-[977px] h-full flex flex-col flex-shrink-0 overflow-hidden"
>
分销
</div>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ref
}
from
'vue'
import
{
useI18n
}
from
'vue-i18n'
import
{
useUserStore
}
from
'@/stores/user'
import
{
useSystemConfigStore
}
from
'@/stores/index'
// 引入订单状态枚举
import
OrderStatusEnum
from
'@/utils/orderStautsEnum'
const
{
t
}
=
useI18n
()
const
userStore
=
useUserStore
()
const
systemConfigStore
=
useSystemConfigStore
()
const
orderList
=
ref
<
any
>
([])
const
currentStatus
=
ref
(
0
)
orderList
.
value
.
push
({
value
:
0
,
lable
:
t
(
'personal.orderStatus.ALL'
),
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
UN_PAY
.
value
,
lable
:
OrderStatusEnum
.
UN_PAY
.
desc
,
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
PAYED
.
value
,
lable
:
OrderStatusEnum
.
PAYED
.
desc
,
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
FINISH
.
value
,
lable
:
OrderStatusEnum
.
FINISH
.
desc
,
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
CANCEL
.
value
,
lable
:
OrderStatusEnum
.
CANCEL
.
desc
,
})
const
queryParams
=
ref
<
any
>
({
pageIndex
:
1
,
pageSize
:
10
,
orderStatus
:
currentStatus
.
value
,
})
const
dataList
=
ref
<
any
>
([])
const
loding
=
ref
(
false
)
const
noMoreData
=
ref
(
false
)
const
scrollContainer
=
ref
<
any
>
(
null
)
const
scrollThreshold
=
0
// 阈值,距离底部多少距离时触发加载
const
changeStatus
=
(
key
:
number
)
=>
{
currentStatus
.
value
=
key
}
const
loadData
=
async
()
=>
{
}
// 处理 div 滚动事件(核心修改)
const
handleDivScroll
=
(
e
:
any
)
=>
{
if
(
loding
.
value
||
noMoreData
.
value
)
return
;
const
container
=
e
.
target
;
if
(
!
container
)
return
;
// 计算滚动位置(兼容不同浏览器)
const
scrollTop
=
container
.
scrollTop
;
const
clientHeight
=
container
.
clientHeight
;
const
scrollHeight
=
container
.
scrollHeight
;
// 触底条件:滚动距离 + 可见高度 ≥ 总高度 - 阈值
if
(
scrollTop
+
clientHeight
>=
scrollHeight
-
scrollThreshold
)
{
noMoreData
.
value
=
false
queryParams
.
value
.
pageIndex
++
loadData
();
// 加载下一页
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.myOrderData
{
background
:
#FBFBFA
;
}
.myOrder-text-l
{
color
:
var
(
--
color-neutral-7
);
}
:deep
(
.arco-scrollbar-track-direction-vertical
)
{
display
:
none
;
}
.myOrder-time
{
color
:
var
(
--
color-neutral-6
);
}
</
style
>
\ No newline at end of file
src/views/personalCenter/index.vue
View file @
4787b2fb
<
template
>
<
template
>
<div
class=
"h-screen flex justify-center pt-[25px] pb-[12px]"
>
<div
class=
"h-screen flex justify-center pt-[25px] pb-[12px]"
>
<div
class=
"h-full flex justify-between w-[1200px]"
>
<div
class=
"h-full flex justify-between w-[1200px]"
>
<!-- 左侧导航栏 -->
<LeftView
<LeftView
:menu-list=
"menuList"
:menu-list=
"menuList"
:active-menu=
"activeMenu"
/>
:active-menu=
"activeMenu"
/>
<!-- 右侧页面内容 -->
<main
class=
"h-full flex-1 ml-[24px]"
>
<main
class=
"h-full flex-1 ml-[24px]"
>
<router-view
/>
<router-view
/>
</main>
</main>
...
@@ -11,11 +13,12 @@
...
@@ -11,11 +13,12 @@
</div>
</div>
</
template
>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
computed
,
watch
}
from
'vue'
import
{
ref
,
computed
,
reactive
,
provide
}
from
'vue'
import
{
useRoute
}
from
'vue-router'
import
{
useRoute
}
from
'vue-router'
import
{
useI18n
}
from
'vue-i18n'
import
{
useI18n
}
from
'vue-i18n'
import
LeftView
from
'./components/LeftView.vue'
import
LeftView
from
'./components/LeftView.vue'
const
{
t
}
=
useI18n
()
const
{
t
}
=
useI18n
()
const
route
=
useRoute
()
const
route
=
useRoute
()
...
@@ -39,33 +42,37 @@ const menuList = ref([
...
@@ -39,33 +42,37 @@ const menuList = ref([
path
:
'/personalCenter/systemMessage'
,
path
:
'/personalCenter/systemMessage'
,
key
:
'systemMessage'
,
key
:
'systemMessage'
,
},
},
//
{
{
//
name: t('personal.menu.myCollection'),
name
:
t
(
'personal.menu.myCollection'
),
//
path: '/personalCenter/myCollection',
path
:
'/personalCenter/myCollection'
,
//
key: 'myCollection',
key
:
'myCollection'
,
//
},
},
//
{
{
//
name: t('personal.menu.coupon'),
name
:
t
(
'personal.menu.coupon'
),
//
path: '/personalCenter/coupon',
path
:
'/personalCenter/coupon'
,
//
key: 'coupon',
key
:
'coupon'
,
//
count: 2,
count
:
2
,
//
},
},
//
{
{
//
name: t('personal.menu.accountCenter'),
name
:
t
(
'personal.menu.accountCenter'
),
//
path: '/personalCenter/accountCenter',
path
:
'/personalCenter/accountCenter'
,
//
key: 'accountCenter',
key
:
'accountCenter'
,
//
},
},
//
{
{
//
name: t('personal.menu.commonPassengerInfo'),
name
:
t
(
'personal.menu.commonPassengerInfo'
),
//
path: '/personalCenter/commonPassengerInfo',
path
:
'/personalCenter/commonPassengerInfo'
,
//
key: 'commonPassengerInfo',
key
:
'commonPassengerInfo'
,
//
},
},
//
{
{
//
name: t('personal.menu.distributionCenter'),
name
:
t
(
'personal.menu.distributionCenter'
),
//
path: '/personalCenter/distributionCenter',
path
:
'/personalCenter/distributionCenter'
,
//
key: 'distributionCenter',
key
:
'distributionCenter'
,
//
},
},
])
])
const
userData
=
reactive
({
userInfo
:
{},
})
provide
(
'userData'
,
userData
)
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
...
...
src/views/personalCenter/myCollection.vue
0 → 100644
View file @
4787b2fb
<
template
>
<div
class=
"w-[977px] h-full flex flex-col flex-shrink-0 overflow-hidden"
>
收藏
</div>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ref
}
from
'vue'
import
{
useI18n
}
from
'vue-i18n'
import
{
useUserStore
}
from
'@/stores/user'
import
{
useSystemConfigStore
}
from
'@/stores/index'
// 引入订单状态枚举
import
OrderStatusEnum
from
'@/utils/orderStautsEnum'
const
{
t
}
=
useI18n
()
const
userStore
=
useUserStore
()
const
systemConfigStore
=
useSystemConfigStore
()
const
orderList
=
ref
<
any
>
([])
const
currentStatus
=
ref
(
0
)
orderList
.
value
.
push
({
value
:
0
,
lable
:
t
(
'personal.orderStatus.ALL'
),
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
UN_PAY
.
value
,
lable
:
OrderStatusEnum
.
UN_PAY
.
desc
,
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
PAYED
.
value
,
lable
:
OrderStatusEnum
.
PAYED
.
desc
,
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
FINISH
.
value
,
lable
:
OrderStatusEnum
.
FINISH
.
desc
,
})
orderList
.
value
.
push
({
value
:
OrderStatusEnum
.
CANCEL
.
value
,
lable
:
OrderStatusEnum
.
CANCEL
.
desc
,
})
const
queryParams
=
ref
<
any
>
({
pageIndex
:
1
,
pageSize
:
10
,
orderStatus
:
currentStatus
.
value
,
})
const
dataList
=
ref
<
any
>
([])
const
loding
=
ref
(
false
)
const
noMoreData
=
ref
(
false
)
const
scrollContainer
=
ref
<
any
>
(
null
)
const
scrollThreshold
=
0
// 阈值,距离底部多少距离时触发加载
const
changeStatus
=
(
key
:
number
)
=>
{
currentStatus
.
value
=
key
}
const
loadData
=
async
()
=>
{
}
// 处理 div 滚动事件(核心修改)
const
handleDivScroll
=
(
e
:
any
)
=>
{
if
(
loding
.
value
||
noMoreData
.
value
)
return
;
const
container
=
e
.
target
;
if
(
!
container
)
return
;
// 计算滚动位置(兼容不同浏览器)
const
scrollTop
=
container
.
scrollTop
;
const
clientHeight
=
container
.
clientHeight
;
const
scrollHeight
=
container
.
scrollHeight
;
// 触底条件:滚动距离 + 可见高度 ≥ 总高度 - 阈值
if
(
scrollTop
+
clientHeight
>=
scrollHeight
-
scrollThreshold
)
{
noMoreData
.
value
=
false
queryParams
.
value
.
pageIndex
++
loadData
();
// 加载下一页
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.myOrderData
{
background
:
#FBFBFA
;
}
.myOrder-text-l
{
color
:
var
(
--
color-neutral-7
);
}
:deep
(
.arco-scrollbar-track-direction-vertical
)
{
display
:
none
;
}
.myOrder-time
{
color
:
var
(
--
color-neutral-6
);
}
</
style
>
\ No newline at end of file
src/views/personalCenter/myOrder.vue
View file @
4787b2fb
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
{{
t
(
'personal.bindingEmail'
)
}}
{{
t
(
'personal.bindingEmail'
)
}}
</div>
</div>
<div
class=
"mt-[10px] flex items-center"
>
<div
class=
"mt-[10px] flex items-center"
>
<span
class=
"text-base font-normal"
>
{{
user
Store
.
user
Info
?.
email
||
t
(
'personal.unbound'
)
}}
</span>
<span
class=
"text-base font-normal"
>
{{
userInfo
?.
email
||
t
(
'personal.unbound'
)
}}
</span>
<img
class=
"w-[15px] h-[15px] ml-[10px] cursor-pointer"
src=
"../../assets/images/personal/pen.png"
alt=
""
/>
<img
class=
"w-[15px] h-[15px] ml-[10px] cursor-pointer"
src=
"../../assets/images/personal/pen.png"
alt=
""
/>
</div>
</div>
</div>
</div>
...
@@ -134,7 +134,7 @@
...
@@ -134,7 +134,7 @@
</div>
</div>
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ref
}
from
'vue'
import
{
ref
,
inject
,
computed
,
watch
}
from
'vue'
import
{
useI18n
}
from
'vue-i18n'
import
{
useI18n
}
from
'vue-i18n'
import
{
useUserStore
}
from
'@/stores/user'
import
{
useUserStore
}
from
'@/stores/user'
import
{
useSystemConfigStore
}
from
'@/stores/index'
import
{
useSystemConfigStore
}
from
'@/stores/index'
...
@@ -146,6 +146,11 @@ import ListProductTypeEnum from '@/utils/listProductType'
...
@@ -146,6 +146,11 @@ import ListProductTypeEnum from '@/utils/listProductType'
const
{
t
}
=
useI18n
()
const
{
t
}
=
useI18n
()
const
userStore
=
useUserStore
()
const
userStore
=
useUserStore
()
const
systemConfigStore
=
useSystemConfigStore
()
const
systemConfigStore
=
useSystemConfigStore
()
const
userData
=
ref
({}
as
any
)
userData
.
value
=
inject
(
'userData'
)
const
userInfo
=
ref
({}
as
any
)
const
orderList
=
ref
<
any
>
([])
const
orderList
=
ref
<
any
>
([])
const
currentStatus
=
ref
(
0
)
const
currentStatus
=
ref
(
0
)
const
productTypeList
=
ref
<
any
>
([])
const
productTypeList
=
ref
<
any
>
([])
...
@@ -158,7 +163,7 @@ productTypeList.value.push({
...
@@ -158,7 +163,7 @@ productTypeList.value.push({
value
:
ListProductTypeEnum
.
SCENIC
.
value
,
value
:
ListProductTypeEnum
.
SCENIC
.
value
,
label
:
ListProductTypeEnum
.
SCENIC
.
desc
,
label
:
ListProductTypeEnum
.
SCENIC
.
desc
,
})
})
console
.
log
(
productTypeList
.
value
,
'--------'
)
//
console.log(productTypeList.value,'--------')
orderList
.
value
.
push
({
orderList
.
value
.
push
({
value
:
0
,
value
:
0
,
...
@@ -192,6 +197,12 @@ const noMoreData = ref(false)
...
@@ -192,6 +197,12 @@ const noMoreData = ref(false)
const
scrollContainer
=
ref
<
any
>
(
null
)
const
scrollContainer
=
ref
<
any
>
(
null
)
const
scrollThreshold
=
0
// 阈值,距离底部多少距离时触发加载
const
scrollThreshold
=
0
// 阈值,距离底部多少距离时触发加载
watch
(()
=>
userData
.
value
.
userInfo
,
(
newVal
,
oldVal
)
=>
{
if
(
newVal
!=
oldVal
){
userInfo
.
value
=
userData
.
value
.
userInfo
}
})
const
changeStatus
=
(
key
:
number
)
=>
{
const
changeStatus
=
(
key
:
number
)
=>
{
currentStatus
.
value
=
key
currentStatus
.
value
=
key
}
}
...
...
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