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
f14ce197
Commit
f14ce197
authored
Dec 02, 2025
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
邮寄地址
parent
49fb06e4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
588 additions
and
58 deletions
+588
-58
zh-CN.ts
src/i18n/locales/zh-CN.ts
+12
-0
UserService.ts
src/services/UserService.ts
+50
-1
accountCenter.vue
src/views/personalCenter/accountCenter.vue
+9
-3
mailingAddressList.vue
...nalCenter/components/accountCenter/mailingAddressList.vue
+455
-0
passengerList.vue
...personalCenter/components/accountCenter/passengerList.vue
+62
-54
No files found.
src/i18n/locales/zh-CN.ts
View file @
f14ce197
...
...
@@ -222,6 +222,18 @@ export default {
USED
:
'已使用'
,
EXPIRED
:
'已过期'
,
},
postAddress
:
'邮寄地址'
,
addPostAddress
:
'新增邮寄地址'
,
editPostAddress
:
'修改邮寄地址'
,
defaultAddress
:
'默认地址'
,
recipient
:
'收件人'
,
placeholderRecipient
:
'请输入收件人'
,
postalCode
:
'邮政编码'
,
placeholderPostalCode
:
'请输入邮政编码'
,
address
:
'详细地址'
,
placeholderAddress
:
'请输入详细地址'
,
city
:
'城市'
,
placeholderCity
:
'请输入城市'
,
},
// HTTP 错误状态码
httpError
:
{
...
...
src/services/UserService.ts
View file @
f14ce197
...
...
@@ -706,7 +706,7 @@ class UserService {
return
response
as
unknown
as
HttpResponse
}
/**
* 旅客列表
* 旅客
分页
列表
* @param tenantId 租户ID(可选)
*/
static
async
memberGuest
(
tenantId
:
string
,
data
:
any
):
Promise
<
HttpResponse
>
{
...
...
@@ -753,6 +753,55 @@ class UserService {
)
return
response
as
unknown
as
HttpResponse
}
/**
* 邮寄地址分页列表
* @param tenantId 租户ID(可选)
*/
static
async
memberMailingAddress
(
tenantId
:
string
,
data
:
any
):
Promise
<
HttpResponse
>
{
const
response
=
await
OtaRequest
.
get
(
'/member-mailing-address/paged'
,
data
,
{
headers
:
tenantId
?
{
'__tenant'
:
tenantId
}
:
{}
}
)
return
response
as
unknown
as
HttpResponse
}
/**
* 新增修改邮寄地址
* @param tenantId 租户ID(可选)
*/
static
async
updateMemberMailingAddress
(
tenantId
:
string
,
data
:
any
):
Promise
<
HttpResponse
>
{
const
response
=
await
OtaRequest
.
post
(
'/member-mailing-address/or-update'
,
data
,
{
headers
:
tenantId
?
{
'__tenant'
:
tenantId
}
:
{}
}
)
return
response
as
unknown
as
HttpResponse
}
/**
* 删除旅客
* @param tenantId 租户ID(可选)
*/
static
async
deleteMemberMailingAddress
(
tenantId
:
string
,
id
:
any
):
Promise
<
HttpResponse
>
{
const
response
=
await
OtaRequest
.
delete
(
`/member-mailing-address/
${
id
}
`
,
{
headers
:
tenantId
?
{
'__tenant'
:
tenantId
}
:
{}
}
)
return
response
as
unknown
as
HttpResponse
}
}
export
default
UserService
src/views/personalCenter/accountCenter.vue
View file @
f14ce197
<
template
>
<div
class=
"w-[977px] h-full flex flex-col flex-shrink-0"
:class=
"[current
!=
3?'overflow-hidden':'']"
>
:class=
"[current
<
3
?'
overflow-hidden
'
:
'']"
>
<a-spin
:loading=
"loading"
>
<div
class=
"flex pl-[13px]"
>
<div
v-for=
"(item,index) in TitleBars"
...
...
@@ -13,13 +13,14 @@
</div>
</div>
<a-divider
class=
"!m-[0]"
/>
<a-scrollbar
v-if=
"current
!=
3"
class=
"max-h-[735px] mt-[20px] overflow-auto"
<a-scrollbar
v-if=
"current
<
3
"
class=
"max-h-[735px] mt-[20px] overflow-auto"
ref=
"scrollContainer"
>
<basicInfor
v-if=
"current==1"
></basicInfor>
<account
v-if=
"current==2"
></account>
</a-scrollbar>
<div
v-else
class=
"max-h-[735px] mt-[20px]"
>
<passengerList></passengerList>
<passengerList
v-if=
"current==3"
></passengerList>
<mailingAddressList
v-if=
"current==4"
></mailingAddressList>
</div>
</a-spin>
</div>
...
...
@@ -31,6 +32,7 @@ import { useRouter } from 'vue-router'
import
account
from
"./components/accountCenter/account.vue"
import
basicInfor
from
"./components/accountCenter/basicInfor.vue"
import
passengerList
from
"./components/accountCenter/passengerList.vue"
import
mailingAddressList
from
"./components/accountCenter/mailingAddressList.vue"
const
{
t
}
=
useI18n
();
const
router
=
useRouter
()
...
...
@@ -54,6 +56,10 @@ const TitleBars = [
{
label
:
t
(
'personal.commonPassenger'
),
value
:
3
},
{
label
:
t
(
'personal.postAddress'
),
value
:
4
}
]
...
...
src/views/personalCenter/components/accountCenter/mailingAddressList.vue
0 → 100644
View file @
f14ce197
This diff is collapsed.
Click to expand it.
src/views/personalCenter/components/accountCenter/passengerList.vue
View file @
f14ce197
<
template
>
<a-spin
:loading=
"loading"
class=
"w-full"
>
<div
v-if=
"!showType"
>
<a-scrollbar
class=
"max-h-[692px] overflow-auto"
>
<div
v-show=
"!showType"
>
<a-scrollbar
class=
"max-h-[692px] overflow-auto"
@
scroll=
"handleDivScroll"
ref=
"scrollContainer"
>
<div
class=
"accountCenter rounded-[14px]
border-[1px] mb-[18px] flex items-center
justify-between py-[15px] pl-[36px] pr-[22px]"
...
...
@@ -22,7 +24,7 @@
{{
item
.
phoneCode
}}{{
item
.
phone
}}
</div>
<div
class=
"flex items-center justify-between"
>
<div
class=
"w-[16px] h-[16px] editIcon cursor-pointer"
@
click=
"clickItem(item,
2
)"
>
</div>
<div
class=
"w-[16px] h-[16px] editIcon cursor-pointer"
@
click=
"clickItem(item,
1
)"
>
</div>
<div
class=
"w-[14px] h-[16px] deleteIcon ml-[17px] cursor-pointer"
@
click=
"clickItem(item)"
>
</div>
</div>
</div>
...
...
@@ -111,7 +113,7 @@
:placeholder=
"t('personal.placeholder')"
>
<a-option
v-for=
"item of AreaCodeList"
:value=
"item.phoneCode"
:label=
"item.phoneCode"
>
<span>
{{ item.name }}
</span>
<span>
{{ item.phoneCode }}
</span>
<span>
({{ item.phoneCode }})
</span>
</a-option>
</a-select>
</a-form-item>
...
...
@@ -170,15 +172,13 @@
</a-spin>
</template>
<
script
setup
lang=
"ts"
>
import
{
ref
,
reactive
,
onMounted
,
watch
,
computed
}
from
'vue'
import
{
ref
,
reactive
,
computed
}
from
'vue'
import
{
useI18n
}
from
'vue-i18n'
import
{
useUserStore
}
from
'@/stores/user'
import
{
useSystemConfigStore
}
from
'@/stores/index'
import
{
Message
}
from
'@arco-design/web-vue'
import
{
query
}
from
'@/utils/common'
import
{
useRouter
}
from
'vue-router'
import
UserService
from
'@/services/UserService'
import
providerTypeEnum
from
'@/utils/providerTypeEnum'
import
CountryService
from
'@/services/CountryService'
const
{
t
}
=
useI18n
();
...
...
@@ -189,20 +189,8 @@ const systemConfig = reactive({
tenantId
:
systemConfigStore
.
tenantId
||
null
,
distributorId
:
systemConfigStore
.
distributorId
as
any
,
})
const
loginType
=
ref
(
userStore
.
loginType
)
const
userInfor
=
ref
<
any
>
(
userStore
.
personalInfor
)
const
loading
=
ref
(
true
)
// 绑定Google账号
const
googleButtonContainer
=
ref
(
null
);
// 绑定账号信息
const
WeChatInfor
=
ref
(
null
as
any
)
const
GoogleInfor
=
ref
(
null
as
any
)
const
LnlineInfor
=
ref
(
null
as
any
)
// 打开微信绑定账号弹窗信息
const
openInfo
=
ref
({}
as
any
)
const
genderOptions
=
ref
([
{
label
:
t
(
'ORDER.GENDER_MALE'
),
...
...
@@ -214,13 +202,12 @@ const genderOptions = ref([
},
])
const
formData
=
reactive
({
id
:
0
,
//旅客ID
id
:
null
as
any
,
//旅客ID
name
:
''
,
//名
surName
:
''
,
//姓氏
birthday
:
null
as
any
,
//出生日期
phone
:
null
as
any
,
//手机号
phoneCode
:
null
as
any
,
//手机号国家码
photo
:
null
as
any
,
//头像
countryId
:
null
as
any
,
//国籍
sex
:
null
as
any
,
//性别 1男 2女
idCard
:
null
as
any
,
//身份证号
...
...
@@ -243,16 +230,38 @@ const rules = computed(() => ({
},
],
}))
const
AreaCodeList
=
ref
([]
as
any
[])
const
p
arams
=
reactive
({
SkipCount
:
0
,
//跳过的记录数
MaxResultCount
:
1
,
//最大结果数
const
AreaCodeList
=
ref
([]
as
any
[])
//手机号国家码列表
const
queryP
arams
=
reactive
({
SkipCount
:
1
,
//跳过的记录数
MaxResultCount
:
1
5
,
//最大结果数
Name
:
''
,
})
const
noMoreData
=
ref
(
true
)
const
scrollContainer
=
ref
<
any
>
(
null
)
const
scrollThreshold
=
0
// 阈值,距离底部多少距离时触发加载
const
totalCount
=
ref
(
100
)
//总记录数
const
pageCount
=
ref
(
10
)
//总页数
const
showType
=
ref
(
null
)
const
showType
=
ref
(
null
)
//null列表 1新增 2编辑
const
dataList
=
ref
([])
// 处理 div 滚动事件(核心修改)
const
handleDivScroll
=
(
e
:
any
)
=>
{
if
(
loading
.
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
&&
queryParams
.
SkipCount
<
pageCount
.
value
)
{
noMoreData
.
value
=
false
queryParams
.
SkipCount
++
loadData
();
// 加载下一页
}
}
const
initPullDown
=
()
=>
{
loadData
()
getSimples
()
...
...
@@ -268,12 +277,25 @@ const getSimples = async () => {
}
}
const
resetQuery
=
()
=>
{
queryParams
.
SkipCount
=
1
queryParams
.
Name
=
''
dataList
.
value
=
[]
noMoreData
.
value
=
true
loadData
()
}
const
loadData
=
async
()
=>
{
loading
.
value
=
true
try
{
const
response
=
await
UserService
.
memberGuest
(
systemConfig
.
tenantId
,
p
arams
)
const
response
=
await
UserService
.
memberGuest
(
systemConfig
.
tenantId
,
queryP
arams
)
if
(
response
){
dataList
.
value
=
response
.
items
||
[]
dataList
.
value
=
[...
dataList
.
value
,...(
response
.
items
||
[])]
if
(
queryParams
.
SkipCount
==
1
){
totalCount
.
value
=
response
.
totalCount
||
0
pageCount
.
value
=
Math
.
ceil
(
totalCount
.
value
/
queryParams
.
MaxResultCount
)
||
0
}
noMoreData
.
value
=
pageCount
.
value
>=
queryParams
.
SkipCount
}
}
catch
(
error
:
any
)
{
console
.
error
(
'加载失败:'
,
error
)
...
...
@@ -284,6 +306,7 @@ const loadData = async () => {
}
// 点击列表项
const
clickItem
=
(
item
:
any
,
type
:
number
=
1
)
=>
{
if
(
type
==
1
){
showType
.
value
=
2
...
...
@@ -293,7 +316,6 @@ const clickItem = (item: any,type: number = 1) => {
formData
.
birthday
=
item
.
birthday
||
null
formData
.
phone
=
item
.
phone
||
null
formData
.
phoneCode
=
item
.
phoneCode
||
null
formData
.
photo
=
item
.
photo
||
null
formData
.
countryId
=
item
.
countryId
||
null
formData
.
sex
=
item
.
sex
||
null
formData
.
idCard
=
item
.
idCard
||
null
...
...
@@ -308,7 +330,7 @@ const deleteItem = async (item: any) => {
const
response
=
await
UserService
.
deleteMemberGuest
(
systemConfig
.
tenantId
||
'default'
,
item
.
id
)
if
(
response
)
{
Message
.
success
(
t
(
'personal.deleteSuccess'
))
loadData
()
resetQuery
()
}
}
catch
(
error
:
any
)
{
console
.
error
(
'删除失败:'
,
error
)
...
...
@@ -318,29 +340,27 @@ const deleteItem = async (item: any) => {
}
}
// 取消
const
cancel
=
()
=>
{
showType
.
value
=
null
formData
.
id
=
''
formData
.
id
=
null
formData
.
name
=
''
formData
.
surName
=
''
formData
.
birthday
=
null
formData
.
isReceivePush
=
null
formData
.
lineId
=
null
formData
.
phone
=
null
formData
.
phoneCode
=
null
formData
.
photo
=
null
formData
.
countryId
=
null
formData
.
sex
=
null
formData
.
wechatId
=
null
formData
.
idCard
=
null
formData
.
email
=
null
}
const
verification
=
()
=>
{
let
msg
=
''
// 简单验证必填字段
if
(
msg
==
''
&&
(
formData
.
name
==
''
||!
formData
.
name
||
userInfor
.
value
.
surName
==
''
||!
formData
.
surName
||
formData
.
countryId
==
''
||!
formData
.
countryId
||
formData
.
idCard
==
''
||!
formData
.
idCard
||
formData
.
surName
==
''
||!
formData
.
surName
||
formData
.
countryId
==
''
||!
formData
.
countryId
||
formData
.
idCard
==
''
||!
formData
.
idCard
))
{
msg
=
t
(
'login.pleaseComplete'
)
}
...
...
@@ -356,12 +376,9 @@ const handleSubmit = async () => {
loading
.
value
=
true
try
{
const
registerData
=
formData
const
response
=
await
UserService
.
updateMemberGuest
(
formData
.
tenantId
||
'default'
,
registerData
)
console
.
log
(
response
,
'========------'
)
if
(
response
)
{
showType
.
value
=
null
loadData
()
}
const
response
=
await
UserService
.
updateMemberGuest
(
systemConfig
.
tenantId
||
'default'
,
registerData
)
showType
.
value
=
null
resetQuery
()
}
catch
(
error
:
any
)
{
console
.
error
(
'提交失败:'
,
error
)
Message
.
error
(
error
.
message
)
...
...
@@ -370,15 +387,6 @@ const handleSubmit = async () => {
}
}
onMounted
(
async
()
=>
{
try
{
}
catch
(
error
)
{
console
.
error
(
'SDK 初始化失败:'
,
error
);
}
});
initPullDown
()
</
script
>
...
...
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