websoft-uniapp仓库模板
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
635 B

/**
* 显示成功提示框
*/
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()
}
})
}