初始化万家商超用户端仓库
This commit is contained in:
60
common/utils/message.js
Normal file
60
common/utils/message.js
Normal file
@ -0,0 +1,60 @@
|
||||
const message = {
|
||||
|
||||
success(params) {
|
||||
if (typeof params !== 'object') params = {
|
||||
content: params + ''
|
||||
};
|
||||
uni.showToast({
|
||||
title: params.content || '',
|
||||
icon: 'success',
|
||||
duration: params.duration || 1500,
|
||||
success: params.resolve
|
||||
})
|
||||
return true
|
||||
},
|
||||
|
||||
error(params) {
|
||||
if (typeof params !== 'object') params = {
|
||||
content: params + ''
|
||||
};
|
||||
uni.showToast({
|
||||
title: params.content,
|
||||
icon: 'error',
|
||||
duration: params.duration || 1500,
|
||||
success: params.resolve
|
||||
})
|
||||
return true
|
||||
},
|
||||
|
||||
info(params) {
|
||||
if (typeof params !== 'object') params = {
|
||||
content: params + ''
|
||||
};
|
||||
uni.showToast({
|
||||
title: params.content || '',
|
||||
icon: 'none',
|
||||
// position: 'bottom',
|
||||
duration: params.duration || 1500,
|
||||
success: params.resolve
|
||||
})
|
||||
return true
|
||||
},
|
||||
|
||||
tips(params) {
|
||||
if (typeof params !== 'object') params = {
|
||||
content: params + ''
|
||||
};
|
||||
uni.showToast({
|
||||
title: params.content || '',
|
||||
icon: 'none',
|
||||
// position: 'bottom',
|
||||
duration: params.duration || 1500,
|
||||
success: params.resolve
|
||||
})
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
message
|
||||
};
|
||||
Reference in New Issue
Block a user