企业🤖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) }) } ~~~