42 lines
824 B
TypeScript
42 lines
824 B
TypeScript
import dialog from "./dialog"
|
|
|
|
const jxMOdal = {
|
|
/**
|
|
* 弹出提示
|
|
*/
|
|
alert(options: any) {
|
|
uni.showModal({
|
|
title: options.title,
|
|
content: options.content,
|
|
confirmText: options.confirmText || '确定',
|
|
showCancel: false,
|
|
confirmColor: "#51b535",
|
|
success: options.success
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 确认提示框
|
|
*/
|
|
confirm(options: any) {
|
|
uni.showModal({
|
|
content: options.content,
|
|
title: options.title,
|
|
confirmText: options.confirmText || '确定',
|
|
cancelText: options.cancelText || '取消',
|
|
confirmColor: "#51b535",
|
|
success: (e) => {
|
|
if (e.confirm) {
|
|
options.success && options.success()
|
|
} else if (e.cancel) {
|
|
options.fail && options.fail()
|
|
}
|
|
},
|
|
fail: (e) => {
|
|
console.log(e, '自定义弹窗发生错误')
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
export default jxMOdal |