ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
>[info] 通用提示 ~~~ export const showToast = async (option) => { if(typeof(option) === "string"){ let message = option option = { code: 1 } option['msg'] = message } if(!option){ option = { code: 1 } } let object = { icon: option.icon || 'none', duration: option.duration || 1500, } if (option.code === 1) { object['title'] = option.msg || '成功' } else { object['title'] = option.msg || '失败' } uni.showToast(object) await sleep(object.duration) } ~~~ ~~~ export const sleep = (ms) => { return new Promise((resolve)=>{ setTimeout(resolve, ms) }) } ~~~