| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- 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.showModalAndBack=(content)=>{
- uni.showModal({
- title: "提示",
- content: content,
- showCancel:false,
- success: (res)=>{
- if (res.confirm) {
- uni.navigateBack({
- delta:1
- })
- }
- }
- });
- }
- dialog.showLoading=(title='加载中...')=>{
- uni.showLoading({
- title
- })
- }
- export default dialog
|