/** * 显示成功提示框 */ export const showSuccess = (msg, callback) => { uni.showToast({ title: msg, icon: 'success', mask: true, duration: 1500, success() { callback && callback() } }) } export function createCode(): string { const data = new Date(); const code = `${data.getFullYear()}${data.getMonth()}${data.getDate()}${data.getHours()}${data.getMilliseconds()}`; return code.slice(0); } /** * 显示失败提示框 */ export const showError = (msg, callback) => { uni.showModal({ title: '友情提示', content: msg, showCancel: false, success(res) { callback && callback() } }) }