wo-user-part-uniapp/cToast/cToast.js
2020-05-23 21:24:13 +08:00

17 lines
508 B
JavaScript

module.exports = function showToast({type, icon, image, title, duration}){
if (this.$refs && this.$refs.toast) {
this.$refs.toast.open({type, content:title, duration})
}else {
// #ifndef APP-PLUS
if (!image){
image = `../static/Common.${type?type:'info'}.png`
}
uni.showToast({icon, image, title, duration})
// #endif
// #ifdef APP-PLUS
if (uni.getSystemInfoSync().platform==='android') {
uni.showToast({icon:'none', title, duration})
}
// #endif
}
}