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
e137e193
Commit
e137e193
authored
Jun 06, 2025
by
liubinyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
星座接口
parent
2936e8a4
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
140 additions
and
58 deletions
+140
-58
index.js
api/index.js
+8
-2
tabbar.vue
components/tabbar/tabbar.vue
+3
-1
xzzp.vue
components/xzzp/xzzp.vue
+2
-2
chat.vue
pages/chat/chat.vue
+50
-9
home.vue
pages/home/home.vue
+44
-20
user.vue
pages/user/user.vue
+9
-5
icon-dui.svg
static/icon-dui.svg
+1
-0
index.js
store/index.js
+1
-1
mixin.js
store/mixin.js
+1
-4
const.js
utils/const.js
+21
-14
No files found.
api/index.js
View file @
e137e193
import
http
from
'./interceptor.js'
export
function
list
(
data
)
{
return
http
.
request
({
url
:
'/system/astrologyForecastDaily/list'
,
method
:
'get'
,
data
})
// 游客选择星座字体查看今日所属星座运势
export
function
findConstellation
(
data
)
{
return
http
.
request
({
url
:
'/system/chatCompletionsExample/findConstellation'
,
method
:
'get'
,
data
})
}
// 专属运程(免费)
export
function
exclusiveItineraryFree
(
data
)
{
return
http
.
request
({
url
:
'/system/chatCompletionsExample/exclusiveItineraryFree'
,
method
:
'get'
,
data
})
}
/**
...
...
components/tabbar/tabbar.vue
View file @
e137e193
...
...
@@ -32,9 +32,11 @@
this
.
page
=
pages
[
pages
.
length
-
1
].
route
;
},
methods
:
{
// 页面跳转
go
(
url
)
{
if
(
url
.
indexOf
(
this
.
page
)
>
-
1
)
return
;
uni
.
switchTab
({
url
})
// 用switchTab是为了切换时不刷新页面
uni
.
switchTab
({
url
});
},
},
}
...
...
components/xzzp/xzzp.vue
View file @
e137e193
...
...
@@ -41,8 +41,8 @@
this
.
currentWebview
=
page
.
$getAppWebview
();
this
.
currentWebviewRefresh
=
!!
this
.
currentWebview
.
getStyle
().
pullToRefresh
// #endif
//
移动到第一个
this
.
rotate
.
containerA
=
this
.
$g
.
ConstellationList
[
0
].
angle
//
初始移动
this
.
rotate
.
containerA
=
this
.
x_xz
?.
angle
||
this
.
$g
.
ConstellationList
[
0
].
angle
this
.
moveToXZ
()
},
methods
:
{
...
...
pages/chat/chat.vue
View file @
e137e193
<
template
>
<view
class=
"page bg2"
>
<view
class=
"box"
>
<scroll-view
scroll-y
class=
"content"
scroll-into-view=
"last
"
>
<scroll-view
scroll-y
class=
"content"
:scroll-into-view=
"lastId
"
>
<view
class=
"tips"
>
<view
class=
"line"
>
——
</view>
AI
{{
$t
(
'Stargazer'
)
}}
-
{{
$t
(
'XiaoXi'
)
}}
{{
$t
(
'The astrological'
)
}}
...
...
@@ -9,7 +9,7 @@
</view>
<view
class=
"msg"
>
<view
v-for=
"(item,index) in recordList"
:key=
"index"
class=
"msg-item"
:class=
"item.user ? 'right' : ''"
>
<template
v-if=
"
item.showAvatar
"
>
<template
v-if=
"
showAvatar(item, index)
"
>
<view
v-if=
"item.user"
class=
"avatar"
>
<image
class=
"avatar"
src=
"@/static/avatar-user.png"
></image>
<view
class=
"txt"
>
{{
$t
(
'User'
)
}}
</view>
...
...
@@ -34,18 +34,59 @@
export
default
{
data
()
{
return
{
recordList
:
[
{
content
:
'2025年2月28日 星期五
\
n★★★☆☆
\
n稳健发展 财运平稳 健康良好
\
n今日金牛座整体运势平稳,财务方面可能有小收获。'
,
showAvatar
:
true
},
{
content
:
'如果你想窥探详细的星座运程,你可以告诉我你的生日。'
},
{
content
:
'我的生日是2000年2月24日。'
,
user
:
true
,
showAvatar
:
true
},
{
content
:
'2000年2月24日是双鱼座.....'
,
showAvatar
:
true
},
],
lastId
:
''
,
recordList
:
[],
// 聊天记录列表
inputText
:
''
,
};
},
onLoad
()
{
// this.init()
},
methods
:
{
// 初始化
async
init
()
{
this
.
recordList
=
[]
this
.
inputText
=
''
await
this
.
getInfo
()
this
.
getZSYC
()
},
// 获取星座信息
async
getInfo
()
{
const
res
=
await
this
.
$api
.
findConstellation
({
constellation
:
this
.
x_xz
.
constellation
,
language
:
this
.
$g
.
languageMap
[
this
.
$i18n
.
locale
]
})
if
(
!
res
?.
data
)
return
this
.
addMsg
(
res
.
data
.
content
)
},
// 专属运程消息
async
getZSYC
()
{
const
res
=
await
this
.
$api
.
exclusiveItineraryFree
({
language
:
this
.
$g
.
languageMap
[
this
.
$i18n
.
locale
]
})
if
(
!
res
?.
data
)
return
this
.
addMsg
(
res
.
data
)
},
// 是否显示头像,每个用户连续的记录,只显示第一个的头像
showAvatar
(
item
,
index
)
{
if
(
index
===
0
)
return
true
else
return
!!
item
.
user
!==
!!
this
.
recordList
[
index
-
1
].
user
},
confirm
()
{
console
.
log
(
123
,
this
.
inputText
);
this
.
addMsg
(
this
.
inputText
,
true
)
this
.
inputText
=
''
},
// 新增记录
addMsg
(
content
,
user
)
{
this
.
recordList
.
push
({
content
,
user
})
this
.
scrollToLast
()
},
// 滚动到底部
scrollToLast
()
{
this
.
lastId
=
''
setTimeout
(()
=>
{
this
.
lastId
=
'last'
},
10
)
},
}
}
...
...
pages/home/home.vue
View file @
e137e193
...
...
@@ -3,19 +3,26 @@
<view
class=
"card"
:class=
"
{ back: isBack }"
:style="{ transitionDuration: `${duration}s`, transform: `scaleX(${scale})` }" @click="start">
<template
v-if=
"!isBack && info"
>
<view
class=
"title"
>
{{
$t
(
x_xz
.
key
)
}}
</view>
<view
class=
"date"
>
{{
today
}}
</view>
<view
class=
"title"
>
{{
info
.
constellation
}}
</view>
<view
class=
"date"
>
{{
info
.
date
}}
</view>
<view
class=
"star-list"
>
<image
v-for=
"i in Number(info.
luckyStar
)"
class=
"star"
src=
"@/static/star.png"
/>
<template
v-if=
"Number(info.
luckyStar
)
<
=
5
"
>
<image
v-for=
"i in 5 - Number(info.
luckyStar
)"
class=
"star"
src=
"@/static/star1.png"
/>
<image
v-for=
"i in Number(info.
numberStars
)"
class=
"star"
src=
"@/static/star.png"
/>
<template
v-if=
"Number(info.
numberStars
)
<
=
5
"
>
<image
v-for=
"i in 5 - Number(info.
numberStars
)"
class=
"star"
src=
"@/static/star1.png"
/>
</
template
>
</view>
<view
class=
"word-list"
>
<view
v-for=
"word in
getWordList(info[`keyWord${$i18n.locale}`])
"
class=
"word"
>
{{ word }}
</view>
<view
v-for=
"word in
info.keywords
"
class=
"word"
>
{{ word }}
</view>
</view>
<scroll-view
scroll-y
class=
"scroll-wrap"
>
<view
class=
"desc"
>
{{ info[`fortune${$i18n.locale}`] }}
</view>
<view
class=
"desc"
>
{{ info.summaryFortune }}
</view>
<view
class=
"suggest"
>
<view
class=
"tips"
>
{{ $t('Today Advice') }}
</view>
<view
v-for=
"(item, index) in info.toDaySuggestion"
:key=
"index"
class=
"item"
>
<image
class=
"icon"
src=
"/static/icon-dui.svg"
/>
<text
class=
"txt"
>
{{ item }}
</text>
</view>
</view>
</scroll-view>
</template>
</view>
...
...
@@ -41,11 +48,11 @@
isBack
:
true
,
// 是否是背面,也就是无信息的那面
scale
:
1
,
// 收缩状态
duration
:
0.3
,
// 动画时间(s)
today
:
''
,
info
:
undefined
,
info
:
undefined
,
// 星座信息
};
},
onLoad
()
{
// 如果没选择星座,则跳转星座选择页面
if
(
!
this
.
x_xz
)
{
uni
.
reLaunch
({
url
:
'/pages/index/index'
...
...
@@ -53,6 +60,7 @@
}
},
methods
:
{
// 开启
start
()
{
if
(
!
this
.
isBack
)
return
;
this
.
getInfo
()
...
...
@@ -62,18 +70,13 @@
this
.
scale
=
1
},
this
.
duration
*
1000
)
},
// 获取星座信息
async
getInfo
()
{
const
now
=
new
Date
()
const
res
=
await
this
.
$api
.
list
({
zodiacSignId
:
this
.
x_xz
.
zodiacSignId
,
fortuneDate
:
dateFormat
(
now
),
pageSize
:
20
,
});
this
.
info
=
res
?.
rows
?.[
0
]
this
.
today
=
dateFormat
(
now
,
this
.
$i18n
.
locale
===
'En'
?
`
${
now
.
toDateString
()}
e`
:
'YYYY年MM月DD日 z'
)
},
getWordList
(
word
)
{
return
word
?.
split
(
/
[
,、
]
/
).
filter
(
i
=>
!!
i
).
map
(
i
=>
i
.
trim
())
||
[]
const
res
=
await
this
.
$api
.
findConstellation
({
constellation
:
this
.
x_xz
.
constellation
,
language
:
this
.
$g
.
languageMap
[
this
.
$i18n
.
locale
]
})
this
.
info
=
res
?.
data
},
},
}
...
...
@@ -143,6 +146,27 @@
line-height
:
40rpx
;
white-space
:
pre-wrap
;
}
.suggest
{
width
:
fit-content
;
margin
:
80rpx
auto
0
;
line-height
:
50rpx
;
.tips
{}
.item
{
.icon
{
width
:
24rpx
;
height
:
24rpx
;
margin-right
:
10rpx
;
}
.txt
{
font-size
:
30rpx
;
color
:
#666
;
}
}
}
}
.card.back
{
...
...
pages/user/user.vue
View file @
e137e193
...
...
@@ -20,8 +20,8 @@
export
default
{
data
()
{
return
{
locales
:
[],
localeIndex
:
0
,
locales
:
[],
// 语言列表
localeIndex
:
0
,
// 当前语言索引
}
},
computed
:
{
...
...
@@ -33,18 +33,22 @@
this
.
getLocales
()
},
methods
:
{
// 获取语言列表
getLocales
()
{
this
.
locales
=
this
.
$i18n
.
availableLocales
.
map
((
i
,
index
)
=>
{
this
.
locales
=
Object
.
keys
(
this
.
$g
.
languageMap
)
.
map
((
i
,
index
)
=>
{
if
(
i
===
this
.
lang
)
this
.
localeIndex
=
index
;
return
this
.
$t
(
i
)
})
},
// 更改语言
changeLang
(
e
)
{
const
val
=
this
.
$i18n
.
availableLocales
[
e
.
detail
.
value
]
const
val
=
Object
.
keys
(
this
.
$g
.
languageMap
)
[
e
.
detail
.
value
]
this
.
$i18n
.
locale
=
val
uni
.
setStorageSync
(
'locale'
,
val
)
this
.
getLocales
()
// 重置所有页面
uni
.
reLaunch
({
url
:
'/pages/user/user'
})
},
// 页面跳转
go
(
url
)
{
uni
.
navigateTo
({
url
})
},
...
...
static/icon-dui.svg
0 → 100644
View file @
e137e193
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1749175382298"
class=
"icon"
viewBox=
"0 0 1035 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"4431"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"64.6875"
height=
"64"
><path
d=
"M517.613889 1010.377409c-66.653788 0-131.336031-13.065657-192.264544-38.829395-58.812166-24.872645-111.631728-60.482966-156.977244-105.828482S87.427403 767.565592 62.543619 708.742288C36.779881 647.824914 23.714224 583.142671 23.714224 516.477744s13.065657-131.336031 38.829395-192.253404c24.872645-58.823304 60.482966-111.631728 105.828482-156.977244s98.15394-80.944698 156.977244-105.828482c60.917374-25.763738 125.599617-38.829396 192.264544-38.829396s131.336031 13.065657 192.253404 38.829396c58.823304 24.872645 111.631728 60.482966 156.977244 105.828482 45.345516 45.345516 80.944698 98.15394 105.828482 156.977244 25.763738 60.917374 38.829396 125.599617 38.829396 192.253404s-13.065657 131.336031-38.829396 192.264544c-24.872645 58.812166-60.482966 111.631728-105.828482 156.977244-45.345516 45.345516-98.15394 80.944698-156.977244 105.828482-60.917374 25.763738-125.599617 38.829396-192.253404 38.829395z m0-898.678849c-223.196624 0-404.779185 181.582561-404.779185 404.779184s181.582561 404.779185 404.779185 404.779185 404.779185-181.582561 404.779184-404.779185-181.582561-404.779185-404.779184-404.779184z m-19.091677 579.099334l285.617718-285.617717c17.398599-17.398599 17.398599-45.612844 0-63.011444-17.398599-17.398599-45.612844-17.398599-63.011444 0L467.010921 596.286299 314.088152 443.36353c-17.398599-17.398599-45.612844-17.398599-63.011443 0s-17.398599 45.612844 0 63.011443l184.43406 184.43406c8.354001 8.354001 19.693165 13.054519 31.500152 13.054518s23.146152-4.689379 31.500152-13.054518z"
p-id=
"4432"
fill=
"#674bd9"
></path></svg>
\ No newline at end of file
store/index.js
View file @
e137e193
...
...
@@ -22,7 +22,7 @@ const saveLifeData = function(key, value) {
const
store
=
new
Vuex
.
Store
({
state
:
{
x_xz
:
lifeData
.
x_xz
,
x_xz
:
lifeData
.
x_xz
,
// 用户选择的星座
},
mutations
:
{
xStore
(
state
,
payload
)
{
...
...
store/mixin.js
View file @
e137e193
...
...
@@ -9,10 +9,7 @@ try {
module
.
exports
=
{
beforeCreate
()
{
this
.
vuex
=
(
name
,
value
)
=>
{
this
.
$store
.
commit
(
'xStore'
,
{
name
,
value
})
this
.
$store
.
commit
(
'xStore'
,
{
name
,
value
})
}
},
computed
:
{
...
...
utils/const.js
View file @
e137e193
// 全局常量
export
default
{
baseUrl
:
'http://47.243.113.209:8081'
,
// 本地环境
// baseUrl: '/api', // 正式环境
// baseUrl: 'http://47.243.113.209:8081', // 正式环境
baseUrl
:
'http://192.168.200.12:8081'
,
// 鸿波
// 星座列表
ConstellationList
:
[
{
key
:
'Aries'
,
date
:
[
'3.21'
,
'4.19'
],
zodiacSignId
:
'1'
,
angle
:
330
},
{
key
:
'Taurus'
,
date
:
[
'4.20'
,
'5.20'
],
zodiacSignId
:
'2'
,
angle
:
300
},
{
key
:
'Gemini'
,
date
:
[
'5.21'
,
'6.21'
],
zodiacSignId
:
'3'
,
angle
:
270
},
{
key
:
'Cancer'
,
date
:
[
'6.22'
,
'7.22'
],
zodiacSignId
:
'4'
,
angle
:
240
},
{
key
:
'Leo'
,
date
:
[
'7.23'
,
'8.22'
],
zodiacSignId
:
'5'
,
angle
:
210
},
{
key
:
'Virgo'
,
date
:
[
'8.23'
,
'9.22'
],
zodiacSignId
:
'6'
,
angle
:
180
},
{
key
:
'HLibra'
,
date
:
[
'9.23'
,
'10.23'
],
zodiacSignId
:
'7'
,
angle
:
150
},
{
key
:
'Scorpio'
,
date
:
[
'10.24'
,
'11.22'
],
zodiacSignId
:
'8'
,
angle
:
120
},
{
key
:
'Sagittarius'
,
date
:
[
'11.23'
,
'12.21'
],
zodiacSignId
:
'9'
,
angle
:
90
},
{
key
:
'Capricornus'
,
date
:
[
'12.22'
,
'1.19'
],
zodiacSignId
:
'10'
,
angle
:
60
},
{
key
:
'Aquarius'
,
date
:
[
'1.20'
,
'2.18'
],
zodiacSignId
:
'11'
,
angle
:
30
},
{
key
:
'Pisces'
,
date
:
[
'2.19'
,
'3.20'
],
zodiacSignId
:
'12'
,
angle
:
0
},
]
{
key
:
'Aries'
,
date
:
[
'3.21'
,
'4.19'
],
zodiacSignId
:
'1'
,
angle
:
330
,
constellation
:
'白羊'
},
{
key
:
'Taurus'
,
date
:
[
'4.20'
,
'5.20'
],
zodiacSignId
:
'2'
,
angle
:
300
,
constellation
:
'金牛'
},
{
key
:
'Gemini'
,
date
:
[
'5.21'
,
'6.21'
],
zodiacSignId
:
'3'
,
angle
:
270
,
constellation
:
'双子'
},
{
key
:
'Cancer'
,
date
:
[
'6.22'
,
'7.22'
],
zodiacSignId
:
'4'
,
angle
:
240
,
constellation
:
'巨蟹'
},
{
key
:
'Leo'
,
date
:
[
'7.23'
,
'8.22'
],
zodiacSignId
:
'5'
,
angle
:
210
,
constellation
:
'狮子'
},
{
key
:
'Virgo'
,
date
:
[
'8.23'
,
'9.22'
],
zodiacSignId
:
'6'
,
angle
:
180
,
constellation
:
'处女'
},
{
key
:
'HLibra'
,
date
:
[
'9.23'
,
'10.23'
],
zodiacSignId
:
'7'
,
angle
:
150
,
constellation
:
'天秤'
},
{
key
:
'Scorpio'
,
date
:
[
'10.24'
,
'11.22'
],
zodiacSignId
:
'8'
,
angle
:
120
,
constellation
:
'天蝎'
},
{
key
:
'Sagittarius'
,
date
:
[
'11.23'
,
'12.21'
],
zodiacSignId
:
'9'
,
angle
:
90
,
constellation
:
'射手'
},
{
key
:
'Capricornus'
,
date
:
[
'12.22'
,
'1.19'
],
zodiacSignId
:
'10'
,
angle
:
60
,
constellation
:
'摩羯'
},
{
key
:
'Aquarius'
,
date
:
[
'1.20'
,
'2.18'
],
zodiacSignId
:
'11'
,
angle
:
30
,
constellation
:
'水瓶'
},
{
key
:
'Pisces'
,
date
:
[
'2.19'
,
'3.20'
],
zodiacSignId
:
'12'
,
angle
:
0
,
constellation
:
'双鱼'
},
],
// language映射
languageMap
:
{
Tc
:
'中文繁体'
,
Cn
:
'中文简体'
,
En
:
'英文'
,
},
}
\ 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