Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
uplus-fapai-mp
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5d64a73a
authored
Apr 27, 2026
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化Dialog组件,新增禁用点击操作功能;调整退出登录逻辑,防止重复提交
1 parent
6d883a55
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
4 deletions
components/Dialog/Dialog.js
pages/tab/mine/index.js
pages/tab/mine/index.scss
pages/tab/mine/index.wxml
components/Dialog/Dialog.js
View file @
5d64a73
...
@@ -38,6 +38,11 @@ Component({
...
@@ -38,6 +38,11 @@ Component({
statusIcon
:
{
statusIcon
:
{
type
:
String
,
type
:
String
,
default
:
""
default
:
""
},
// 是否禁用点击操作(用于防重复提交等场景,由外部传入控制)
disabled
:
{
type
:
Boolean
,
value
:
false
}
}
},
},
...
@@ -53,6 +58,9 @@ Component({
...
@@ -53,6 +58,9 @@ Component({
*/
*/
methods
:
{
methods
:
{
handleClick
(
e
)
{
handleClick
(
e
)
{
// 通过外部传入的 disabled 属性判断是否禁止点击
if
(
this
.
data
.
disabled
)
return
;
let
{
let
{
index
index
}
=
e
.
currentTarget
.
dataset
}
=
e
.
currentTarget
.
dataset
...
@@ -60,6 +68,8 @@ Component({
...
@@ -60,6 +68,8 @@ Component({
this
.
triggerEvent
(
eventFn
)
this
.
triggerEvent
(
eventFn
)
},
},
handleClose
()
{
handleClose
()
{
if
(
this
.
data
.
disabled
)
return
;
this
.
triggerEvent
(
'dialogCancel'
)
this
.
triggerEvent
(
'dialogCancel'
)
}
}
}
}
...
...
pages/tab/mine/index.js
View file @
5d64a73
...
@@ -36,6 +36,7 @@ Page({
...
@@ -36,6 +36,7 @@ Page({
},
},
],
],
showLogoutDialog
:
false
,
showLogoutDialog
:
false
,
isLogouting
:
false
,
logoutButtons
:
[
logoutButtons
:
[
{
text
:
"取消"
,
extClass
:
"btn_cancel"
,
eventFn
:
"dialogCancel"
},
{
text
:
"取消"
,
extClass
:
"btn_cancel"
,
eventFn
:
"dialogCancel"
},
{
text
:
"确认退出"
,
extClass
:
"btn_primary"
,
eventFn
:
"dialogConfirm"
},
{
text
:
"确认退出"
,
extClass
:
"btn_primary"
,
eventFn
:
"dialogConfirm"
},
...
@@ -86,11 +87,15 @@ Page({
...
@@ -86,11 +87,15 @@ Page({
},
},
onLogoutConfirm
()
{
onLogoutConfirm
()
{
this
.
toggleLogoutDialog
();
if
(
this
.
data
.
isLogouting
)
return
;
this
.
setData
({
isLogouting
:
true
});
wx
.
p
.
wxApi
.
showLoading
(
"加载中..."
);
wx
.
p
.
wxApi
.
showLoading
(
"加载中..."
);
commonApi
commonApi
.
logout
()
.
logout
()
.
then
(()
=>
{
.
then
(()
=>
{
this
.
setData
({
showLogoutDialog
:
false
}).
then
(()
=>
{
this
.
setData
({
isLogouting
:
false
});
});
wx
.
hideLoading
();
wx
.
hideLoading
();
wx
.
p
.
storage
.
rm
(
"token"
);
wx
.
p
.
storage
.
rm
(
"token"
);
wx
.
p
.
isLogin
=
false
;
wx
.
p
.
isLogin
=
false
;
...
@@ -98,13 +103,14 @@ Page({
...
@@ -98,13 +103,14 @@ Page({
wx
.
p
.
router
.
redirectTo
(
"/pages/Login/Login"
);
wx
.
p
.
router
.
redirectTo
(
"/pages/Login/Login"
);
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
this
.
setData
({
isLogouting
:
false
});
wx
.
hideLoading
();
wx
.
hideLoading
();
});
});
},
},
async
goToInspection
()
{
async
goToInspection
()
{
console
.
log
(
wx
.
p
.
api
.
systemApi
)
console
.
log
(
wx
.
p
.
api
.
systemApi
);
const
{
report_webview
}
=
await
wx
.
p
.
api
.
systemApi
.
getFrontConfig
()
const
{
report_webview
}
=
await
wx
.
p
.
api
.
systemApi
.
getFrontConfig
();
console
.
log
(
"获取的mock数据:"
,
report_webview
);
console
.
log
(
"获取的mock数据:"
,
report_webview
);
// TODO: 跳转到检测管理页面
// TODO: 跳转到检测管理页面
const
targetUrl
=
`/pages/webView/h5FullNoShare/h5FullNoShare?url=
${
encodeURIComponent
(
report_webview
)}
&openType=miniApp`
;
const
targetUrl
=
`/pages/webView/h5FullNoShare/h5FullNoShare?url=
${
encodeURIComponent
(
report_webview
)}
&openType=miniApp`
;
...
...
pages/tab/mine/index.scss
View file @
5d64a73
...
@@ -210,10 +210,12 @@ page {
...
@@ -210,10 +210,12 @@ page {
/* Footer */
/* Footer */
.footer
{
.footer
{
position
:
absolute
;
bottom
:
32rpx
;
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
align-items
:
center
;
align-items
:
center
;
margin-top
:
6
0rpx
;
margin-top
:
2
0rpx
;
}
}
.version
{
.version
{
...
...
pages/tab/mine/index.wxml
View file @
5d64a73
...
@@ -84,6 +84,7 @@
...
@@ -84,6 +84,7 @@
show="{{showLogoutDialog}}"
show="{{showLogoutDialog}}"
title="退出登录"
title="退出登录"
buttons="{{logoutButtons}}"
buttons="{{logoutButtons}}"
disabled="{{isLogouting}}"
bind:dialogCancel="toggleLogoutDialog"
bind:dialogCancel="toggleLogoutDialog"
bind:dialogConfirm="onLogoutConfirm"
bind:dialogConfirm="onLogoutConfirm"
>
>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment