Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
飞
飞鹤小程序
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
FH
飞鹤小程序
Commits
7cf40d06
Commit
7cf40d06
authored
Jun 30, 2025
by
jtwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
970699b8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
37 deletions
+68
-37
.DS_Store
.DS_Store
+0
-0
request.js
api/request.js
+3
-1
my.js
mock/my.js
+2
-2
naming.vue
pages/naming/naming.vue
+39
-24
namingResult.vue
pages/naming/namingResult.vue
+16
-10
My.vue
views/My.vue
+8
-0
No files found.
.DS_Store
View file @
7cf40d06
No preview for this file type
api/request.js
View file @
7cf40d06
...
...
@@ -17,7 +17,9 @@ const {
// 通常可以吧 baseUrl 单独放在一个 js 文件了
// const baseUrl = "http://172.16.224.178:7777/pmall";
// const baseUrl = "https://docs.dui88.com/mock/1956";
let
baseUrl
=
"https://momclub-uat.feihe.com/pmall"
;
// let baseUrl = "https://momclub-uat.feihe.com/pmall";
let
baseUrl
=
"https://momclub.feihe.com/pmall"
;
const
request
=
(
options
=
{})
=>
{
// 在这里可以对请求头进行一些设置
...
...
mock/my.js
View file @
7cf40d06
...
...
@@ -43,8 +43,8 @@ export const myObj = {
},
{
"bgUrl"
:
"my/naming.png"
,
"title"
:
"
AI互娱
"
,
"desc"
:
"
AI互娱
"
,
"title"
:
"
星妈起名
"
,
"desc"
:
"
星妈起名
"
,
"link"
:
{
"type"
:
1
,
"url"
:
"/pages/naming/naming"
,
...
...
pages/naming/naming.vue
View file @
7cf40d06
...
...
@@ -2,9 +2,8 @@
<view>
<view
class=
"naming_bg"
:style=
"
{backgroundImage: `url(${$baseUrl}aiNaming/bg.jpg)`}">
<view
class=
"page-top"
>
<image
@
tap=
"backHandler"
class=
"btnback"
:src=
"$baseUrl+'aiNaming/back_btn.png'"
></image>
<view
class=
"page_title"
>
AI-宝宝取名
</view>
<image
@
tap=
"backHandler"
class=
"btnback"
:src=
"$baseUrl+'aiNaming/back_btn.png'"
></image>
<view
class=
"page_title"
>
星妈起名
</view>
</view>
<view
class=
"top_con"
>
...
...
@@ -48,7 +47,7 @@
<view
class=
"time-picker-container"
@
click=
"openPicker"
>
<!-- 隐藏的时间选择器 -->
<view
class=
"datetime-picker"
:style=
"
{'margin-left': '0rpx', 'width':'480rpx'}">
<uni-datetime-picker
ref=
"pickerRef"
v-model=
"birthTime"
>
<uni-datetime-picker
class=
"custom-picker"
ref=
"pickerRef"
v-model=
"birthTime"
>
<!-- 时间显示部分 -->
<view
class=
"time-display"
>
<text
class=
"date_txt"
>
{{
formattedDate
}}
</text>
...
...
@@ -82,7 +81,7 @@
<view
class=
"surname_box"
>
<view
class=
"item_top"
>
<span
class=
"title_txt"
><span
:style=
"
{color: '#b27c1e'}">*
</span>
姓氏
</span>
<input
class=
"name_input"
placeholder=
"仅限2个汉字"
v-model=
"surname"
@
input=
"setNameInput"
<input
class=
"name_input"
v-model=
"surname"
@
input=
"setNameInput"
@
blur=
"forceCorrection"
/>
</view>
<view
class=
"item_line"
></view>
...
...
@@ -125,7 +124,7 @@
<span
class=
"title_txt"
><span
:style=
"
{color: '#b27c1e'}">*
</span>
数字要求
</span>
<view
class=
"val_view"
>
<view
class=
"radio-group"
:style=
"
{display: 'flex'}">
<
!--
<
label
class=
"radio-item"
:class=
"
{ active: wordCount === '单字' }"
<label
class=
"radio-item"
:class=
"
{ active: wordCount === '单字' }"
@click="wordCount = '单字'">
<radio
:style=
"
{opacity: 0}" :checked="wordCount === '单字'" color="#4a90e2" />
<view
class=
"custom-radio"
:style=
"
{display: 'flex','margin-top': '-41rpx'}">
...
...
@@ -134,7 +133,7 @@
mode="aspectFit" />
<text
class=
"radio-label"
:style=
"
{'margin': '-6rpx 0 0 10rpx'}">单字
</text>
</view>
</label>
-->
</label>
<label
class=
"radio-item"
:class=
"
{ active: wordCount === '双字' }"
@click="wordCount = '双字'">
<radio
:style=
"
{opacity: 0}" :checked="wordCount === '双字'" color="#4a90e2" />
...
...
@@ -145,7 +144,7 @@
<text
class=
"radio-label"
:style=
"
{'margin': '-6rpx 0 0 10rpx'}">双字
</text>
</view>
</label>
<label
class=
"radio-item"
:class=
"
{ active: wordCount === '三字' }"
<
!--
<
label
class=
"radio-item"
:class=
"
{ active: wordCount === '三字' }"
@click="wordCount = '三字'">
<radio
:style=
"
{opacity: 0}" :checked="wordCount === '三字'" color="#4a90e2" />
<view
class=
"custom-radio"
:style=
"
{display: 'flex','margin-top': '-41rpx'}">
...
...
@@ -154,7 +153,7 @@
mode="aspectFit" />
<text
class=
"radio-label"
:style=
"
{'margin': '-6rpx 0 0 10rpx'}">三字
</text>
</view>
</label>
</label>
-->
</view>
</view>
</view>
...
...
@@ -309,11 +308,11 @@
const
month
=
String
(
date
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
)
const
day
=
String
(
date
.
getDate
()).
padStart
(
2
,
'0'
)
const
hours
=
String
(
date
.
getHours
()).
padStart
(
2
,
'0'
)
const
minutes
=
String
(
date
.
getMinutes
()).
padStart
(
2
,
'0'
)
const
minutes
=
String
(
date
.
getMinutes
()).
padStart
(
2
,
'0'
)
return
`
${
year
}
-
${
month
}
-
${
day
}
${
hours
}
:
${
minutes
}
`
}
}
//出生时间
const
birthTime
=
ref
(
getDefaultTime
())
// 默认时间
const
pickerRef
=
ref
(
null
)
...
...
@@ -371,7 +370,7 @@
const
inputVal
=
e
.
detail
.
value
// 1. 移除非中文字符(包括标点、英文、数字等)
const
chineseOnly
=
inputVal
.
replace
(
/
[^\u
4e00-
\u
9fa5
]
/g
,
''
).
slice
(
0
,
2
);
const
chineseOnly
=
inputVal
.
replace
(
/
[^\u
4e00-
\u
9fa5
]
/g
,
''
).
slice
(
0
,
17
);
// 3. 更新实际值
...
...
@@ -412,7 +411,7 @@
const
onNaming
=
(
data
)
=>
{
let
param
=
{
birthStatus
:
birthStatus
.
value
,
birthTime
:
birthTime
.
value
,
birthTime
:
birthTime
.
value
.
split
(
' '
)[
0
]
,
surname
:
surname
.
value
,
gender
:
gender
.
value
,
wordCount
:
wordCount
.
value
,
...
...
@@ -443,7 +442,14 @@
let
d
=
await
aiNaming
(
param
);
if
(
d
)
{
let
nameList
=
d
?.
data
;
console
.
log
(
'取名回调:'
,
nameList
)
console
.
log
(
'取名回调:'
,
nameList
)
if
(
nameList
[
0
].
meaning
==
"未获取解释"
){
uni
.
showToast
({
title
:
'生成失败,请检查你输入的内容'
,
icon
:
'none'
})
return
}
// 隐藏
uni
.
hideLoading
()
...
...
@@ -455,19 +461,28 @@
},
5000
)
// 首页组件逻辑
const
backHandler
=
()
=>
{
if
(
!
back_btn
)
{
uni
.
navigateBack
();
}
else
{
jump
({
type
:
JumpType
.
INNER
,
const
backHandler
=
()
=>
{
if
(
!
back_btn
)
{
uni
.
navigateBack
();
}
else
{
jump
({
type
:
JumpType
.
INNER
,
url
:
`/pages/index/index`
})
})
}
}
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
::v-deep .uni-datetime-picker--btn{
background-color: #d3a358 !important;
}
::v-deep .uni-calendar-item--checked{
background-color: #d3a358 !important;
}
::v-deep .uni-datetime-picker-btn-text{
color: #d3a358 !important;
}
.naming_bg {
// position: absolute;
width: 100%;
...
...
pages/naming/namingResult.vue
View file @
7cf40d06
...
...
@@ -3,13 +3,17 @@
<view
class=
"naming_result_bg"
:style=
"
{backgroundImage: `url(${$baseUrl}aiNaming/bg.jpg)`}">
<view
class=
"page-top"
>
<image
@
tap=
"backHandler"
class=
"btnback"
:src=
"$baseUrl+'aiNaming/back_btn.png'"
></image>
<view
class=
"page_title"
>
AI-宝宝取
名
</view>
<view
class=
"page_title"
>
星妈起
名
</view>
</view>
<view
class=
"box"
>
<view
class=
"name_box"
v-for=
"(item, index) in nameList"
:key=
"index"
>
<view
class=
"name_con"
>
<view
class=
"name_py"
>
{{
item
.
pinyin
}}
</view>
<view
class=
"name_txt"
>
{{
item
.
name
}}
</view>
<view
class=
"name_py"
:style=
"
{'fontSize': item.pinyin.length>15?'20rpx':'30rpx'}">
{{
item
.
pinyin
}}
</view>
<view
class=
"name_txt"
:style=
"
{'fontSize': item.name.length>7?'30rpx':'54rpx'}">
{{
item
.
name
}}
</view>
</view>
<view
class=
"jt_box"
@
click=
"onJtClick(index)"
>
<image
class=
"jt"
...
...
@@ -168,21 +172,23 @@
border-radius
:
28rpx
;
.name_con
{
width
:
3
80rpx
;
width
:
4
80rpx
;
margin-left
:
0rpx
;
font-size
:
30rpx
;
letter-spacing
:
10rpx
;
.name_py
{
width
:
100%
;
text-align
:
center
;
// background: #20ffff;
width
:
480rpx
;
text-align
:
center
;
word-break
:
break-all
;
/* 所有字符都可换行 */
}
.name_txt
{
// background: #fc0107;
margin-top
:
5rpx
;
width
:
100%
;
font-size
:
54rpx
;
text-align
:
center
;
width
:
480rpx
;
text-align
:
center
;
word-break
:
break-all
;
/* 所有字符都可换行 */
}
}
...
...
views/My.vue
View file @
7cf40d06
...
...
@@ -253,6 +253,14 @@ const handleToolClick = async (item) => {
}
};
// //跳转到ai取名页面
// const toAiNaming = () => {
// jump({
// type: JumpType.INNER,
// url: "/pages/naming/naming",
// })
// };
// 编辑个人资料
const
handleEditProfile
=
()
=>
{
if
(
!
userStore
.
userInfo
||
JSON
.
stringify
(
userStore
.
userInfo
)
===
"{}"
)
{
...
...
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