| 123456789101112131415161718192021222324252627 |
- let dialog = {};
- /**
- * 封装模态框
- */
- dialog.showModal = (content, isShowCancel = true, title = '提示',) => {
- return new Promise((resolve, reject) => {
- uni.showModal({
- title: title,
- content: content,
- showCancel: isShowCancel,
- success: (res) => {
- if (res.confirm) {
- resolve(res)
- }
- }
- });
- })
- }
- dialog.showLoading = (title = '加载中...') => {
- uni.showLoading({
- title
- })
- }
- export default dialog
|