让unisocket通用化;把showToast(...)集成在 cToast库里
This commit is contained in:
17
cToast/cToast.js
Normal file
17
cToast/cToast.js
Normal file
@@ -0,0 +1,17 @@
|
||||
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}.png`
|
||||
}
|
||||
uni.showToast({icon, image, title, duration})
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
if (uni.getSystemInfoSync().platform==='android') {
|
||||
uni.showToast({icon:'none', title, duration})
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user