11
This commit is contained in:
33
untils/uniModal.js
Normal file
33
untils/uniModal.js
Normal file
@@ -0,0 +1,33 @@
|
||||
let showModal = true
|
||||
export function showUniModal(modalTitle, content, whetherCancel, confirmText, pageUrl, cancelUrl) {
|
||||
if (showModal) {
|
||||
|
||||
showModal = false;
|
||||
uni.showModal({
|
||||
id: 'testModal',
|
||||
title: modalTitle,
|
||||
content: content,
|
||||
showCancel: whetherCancel,
|
||||
confirmText: confirmText,
|
||||
success({
|
||||
confirm
|
||||
}) {
|
||||
if (confirm) {
|
||||
uni.navigateTo({
|
||||
url: pageUrl
|
||||
});
|
||||
} else {
|
||||
if (cancelUrl != '') {
|
||||
uni.switchTab({
|
||||
url: cancelUrl
|
||||
})
|
||||
}
|
||||
}
|
||||
showModal = true
|
||||
},
|
||||
fail() {
|
||||
showModal = true
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user