| 12345678910111213141516171819202122232425262728 |
- /**
- * showModal 弹框封装
- * @property {String} title 标题
- * @property {String} content 内容
- * @property {String} confirmText 确定按钮文案,默认(确定)
- * @property {Function} confirmCallBack 确定按钮事件
- * @property {String} cancelText 取消按钮文案,默认 不显示取消按键
- * @property {Function} cancelCallBack 取消按钮事件
- */
- export const showModal = ({title,content,confirmText,confirmCallBack,cancelText,cancelCallBack})=>{
- uni.showModal({
- title,
- content: content,
- showCancel:cancelText?true:false,
- confirmText: confirmText || '确定',
- cancelText:cancelText || '取消',
- cancelColor: '#333333',
- confirmColor: '#FF7400',
- success: (res) => {
- if (res.confirm) {
- confirmCallBack && confirmCallBack()
- }else{
- cancelCallBack && cancelCallBack()
- }
- }
- })
- }
|