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
56627079
Commit
56627079
authored
Jul 02, 2025
by
jtwu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_ck'
# Conflicts: # stores/global.js
parents
8a342fa9
122875ea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
11 deletions
+27
-11
request.js
api/request.js
+3
-0
naming.vue
pages/naming/naming.vue
+9
-4
namingResult.vue
pages/naming/namingResult.vue
+9
-5
global.js
stores/global.js
+6
-2
No files found.
api/request.js
View file @
56627079
...
...
@@ -47,18 +47,21 @@ const request = (options = {}) => {
icon
:
'none'
});
reject
(
data
);
globalStore
.
setIsShowLoading
(
false
);
}
else
if
(
!
data
.
data
?.
ok
)
{
uni
.
showToast
({
title
:
data
.
data
?.
message
,
icon
:
'none'
});
reject
(
data
.
data
);
globalStore
.
setIsShowLoading
(
false
);
}
else
{
resolve
(
data
.
data
);
}
})
.
catch
((
error
)
=>
{
reject
(
error
);
globalStore
.
setIsShowLoading
(
false
);
});
});
};
...
...
pages/naming/naming.vue
View file @
56627079
...
...
@@ -246,7 +246,8 @@
@click="onNaming">
</view>
</view>
<CustomLoading
:show=
"showLoading"
:text=
"'起名中...'"
:imgPath=
"$baseUrl+'aiNaming/loading_icon.png'"
>
<CustomLoading
:show=
"globalStore.isShowLoading"
:text=
"'起名中...'"
:imgPath=
"$baseUrl+'aiNaming/loading_icon.png'"
>
</CustomLoading>
</view>
</
template
>
...
...
@@ -273,8 +274,12 @@
aiNaming
}
from
'../../api/naming.js'
;
import
CustomLoading
from
'../../components/CustomLoading.vue'
;
import
{
useGlobalStore
}
from
"@/stores/global.js"
;
const
globalStore
=
useGlobalStore
();
const
showLoading
=
ref
(
false
)
// 出生状态
const
birthStatus
=
ref
(
''
);
//姓氏
...
...
@@ -487,11 +492,11 @@
// title: '生成中...',
// mask: true // 是否显示透明蒙层(防止触摸穿透)
// })
showLoading
.
value
=
true
;
globalStore
.
setIsShowLoading
(
true
)
;
let
d
=
await
aiNaming
(
param
);
// 隐藏
// uni.hideLoading()
showLoading
.
value
=
false
;
globalStore
.
setIsShowLoading
(
false
)
;
if
(
d
)
{
let
nameList
=
d
?.
data
;
console
.
log
(
'取名回调:'
,
nameList
)
...
...
pages/naming/namingResult.vue
View file @
56627079
...
...
@@ -48,7 +48,7 @@
</view>
</view>
<CustomLoading
:show=
"
s
howLoading"
:text=
"'起名中...'"
:imgPath=
"$baseUrl+'aiNaming/loading_icon.png'"
>
<CustomLoading
:show=
"
globalStore.isS
howLoading"
:text=
"'起名中...'"
:imgPath=
"$baseUrl+'aiNaming/loading_icon.png'"
>
</CustomLoading>
</view>
</
template
>
...
...
@@ -71,7 +71,12 @@
import
{
onLoad
}
from
'@dcloudio/uni-app'
import
CustomLoading
from
'../../components/CustomLoading.vue'
;
import
CustomLoading
from
'../../components/CustomLoading.vue'
;
import
{
useGlobalStore
}
from
"@/stores/global.js"
;
const
globalStore
=
useGlobalStore
();
const
{
proxy
...
...
@@ -81,7 +86,6 @@
const
param
=
ref
();
const
nameList
=
ref
(
null
);
const
showLoading
=
ref
(
false
)
onLoad
((
options
)
=>
{
param
.
value
=
JSON
.
parse
(
decodeURIComponent
(
options
.
param
))
...
...
@@ -99,10 +103,10 @@
// title: '生成中...',
// mask: true // 是否显示透明蒙层(防止触摸穿透)
// })
showLoading
.
value
=
true
;
globalStore
.
setIsShowLoading
(
true
)
;
let
d
=
await
aiNaming
(
param
.
value
);
// uni.hideLoading();
showLoading
.
value
=
false
;
globalStore
.
setIsShowLoading
(
false
)
;
if
(
d
)
{
nameList
.
value
=
d
?.
data
;
console
.
log
(
'重新生成:'
,
nameList
.
value
)
...
...
stores/global.js
View file @
56627079
...
...
@@ -9,7 +9,8 @@ export const useGlobalStore = defineStore('global', {
return
{
cuk
:
cuk
,
// 用户登录后获取的凭证,调用接口时headers中携带
curTabIndex
:
0
,
// 当前Tab索引
isWxFriendCircle
:
false
isWxFriendCircle
:
false
,
isShowLoading
:
false
};
},
actions
:
{
...
...
@@ -35,7 +36,10 @@ export const useGlobalStore = defineStore('global', {
*/
setIsWxFriendCircle
(
v
){
this
.
isWxFriendCircle
=
v
},
setIsShowLoading
(
v
){
this
.
isShowLoading
=
v
}
},
});
\ 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