Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
ai-astro-app
Project
Project
Details
Activity
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
liubinyu
ai-astro-app
Commits
888fedcc
Commit
888fedcc
authored
Jun 19, 2025
by
liubinyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改生日等信息后重置页面
parent
9a60819e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
8 deletions
+44
-8
chat.vue
pages/chat/chat.vue
+18
-2
setPlace.vue
pages/user/setPlace.vue
+2
-1
user.vue
pages/user/user.vue
+9
-5
const.js
utils/const.js
+15
-0
No files found.
pages/chat/chat.vue
View file @
888fedcc
...
...
@@ -49,8 +49,13 @@
async
init
()
{
this
.
recordList
=
[]
this
.
inputText
=
''
if
(
this
.
x_user
.
birthday
&&
this
.
x_user
.
sex
)
{
this
.
inputText
=
this
.
getQuestion
()
this
.
send
()
}
else
{
await
this
.
getInfo
()
this
.
getZSYC
()
}
},
// 获取星座信息
async
getInfo
()
{
...
...
@@ -81,6 +86,17 @@
const
msg
=
res
?.
data
?.[
0
]?.
message
?.
content
||
this
.
$t
(
'Parsing Failed'
)
this
.
addMsg
(
msg
)
},
// 组装生日信息
getQuestion
()
{
const
{
birthday
,
sex
}
=
this
.
x_user
const
lang
=
this
.
$i18n
.
locale
const
a
=
birthday
.
split
(
/
[
-:
]
/
)
if
(
lang
===
'En'
)
{
return
`
${
this
.
$g
.
monthMap
[
a
[
1
]]}
${
a
[
2
]}
,
${
a
[
0
]}
,
${(
a
[
3
]
%
12
)
||
12
}
:
${
a
[
4
]}
${
a
[
3
]
<
12
?
'AM'
:
'PM'
}
,
${
sex
===
'男'
?
'Male'
:
'Female'
}
`
}
else
{
return
`
${
a
[
0
]}
年
${
a
[
1
]}
月
${
a
[
2
]}
日
${
a
[
3
]}${
lang
===
'Tc'
?
'時'
:
'时'
}${
a
[
4
]}
分
${
sex
}
`
}
},
// 是否显示头像,每个用户连续的记录,只显示第一个的头像
showAvatar
(
item
,
index
)
{
if
(
index
===
0
)
return
true
...
...
pages/user/setPlace.vue
View file @
888fedcc
...
...
@@ -56,7 +56,8 @@
this
.
$util
.
getUserInfo
()
uni
.
showToast
({
title
:
this
.
$t
(
'Save Success'
)
})
setTimeout
(()
=>
{
this
.
back
()
// 重置所有页面
uni
.
reLaunch
({
url
:
'/pages/user/user'
})
},
1000
)
},
back
()
{
...
...
pages/user/user.vue
View file @
888fedcc
...
...
@@ -108,17 +108,21 @@
openSex
()
{
this
.
$refs
.
sex
.
open
()
},
changeSex
(
e
)
{
async
changeSex
(
e
)
{
if
(
e
.
indexs
[
0
]
===
this
.
sexIndex
[
0
])
return
const
val
=
Object
.
values
(
this
.
$g
.
sexMap
)[
e
.
indexs
[
0
]]
this
.
save
(
Object
.
assign
({},
this
.
x_user
,
{
sex
:
val
}))
await
this
.
save
(
Object
.
assign
({},
this
.
x_user
,
{
sex
:
val
}))
// 重置所有页面
uni
.
reLaunch
({
url
:
'/pages/user/user'
})
},
openBirth
()
{
this
.
$refs
.
birth
.
open
()
},
changeBirth
(
e
)
{
async
changeBirth
(
e
)
{
const
val
=
this
.
$util
.
dateFormat
(
e
.
value
,
'YYYY-MM-DD HH:mm'
)
this
.
save
(
Object
.
assign
({},
this
.
x_user
,
{
birthday
:
val
}))
await
this
.
save
(
Object
.
assign
({},
this
.
x_user
,
{
birthday
:
val
}))
// 重置所有页面
uni
.
reLaunch
({
url
:
'/pages/user/user'
})
},
// 获取语言列表
getLocales
()
{
...
...
@@ -143,7 +147,7 @@
async
save
(
user
)
{
const
res
=
await
this
.
$api
.
userEdit
(
user
)
if
(
!
res
)
return
this
.
$util
.
getUserInfo
()
await
this
.
$util
.
getUserInfo
()
},
// 页面跳转
go
(
url
)
{
...
...
utils/const.js
View file @
888fedcc
...
...
@@ -30,4 +30,19 @@ export default {
},
// mapbox的token
mapboxToken
:
'pk.eyJ1IjoiYXJjYmxvY2siLCJhIjoiY2xvd2RkY2RyMGhkZDJxcW1rbW52cDFiaSJ9.Q1toKeWpNlhKQllsscB1Ag'
,
// 英文月份
monthMap
:
{
'01'
:
'January'
,
'02'
:
'February'
,
'03'
:
'March'
,
'04'
:
'April'
,
'05'
:
'May'
,
'06'
:
'June'
,
'07'
:
'July'
,
'08'
:
'August'
,
'09'
:
'September'
,
'10'
:
'October'
,
'11'
:
'November'
,
'12'
:
'December'
,
}
}
\ No newline at end of file
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