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