人工放行
This commit is contained in:
19
utils/utils.js
Normal file
19
utils/utils.js
Normal file
@@ -0,0 +1,19 @@
|
||||
export function confirmAction(title = "确认操作", content = "确定要执行此操作吗?", confirmCallback) {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.showModal({
|
||||
title: title,
|
||||
content: content,
|
||||
showCancel: true,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
resolve(true); // 调用确认回调
|
||||
if (confirmCallback) {
|
||||
confirmCallback();
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
resolve(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user