一、apiCloud-封装消息提示的方法
/*** 消息提示 ****/
function showMsg(type, data, call) {
switch (type) {
case "success":
api.toast({
msg: data,
duration: 2000,
location: 'middle'
}, call);
break;
case "fail":
api.toast({
msg: data,
duration: 2000,
location: 'middle'
}, call);
break;
case "loading":
api.showProgress({
title: '努力加载中...',
text: '先喝杯茶...',
modal: false
});
break;
case "zdy":
api.toast({
msg: data,
duration: 2000,
location: 'middle'
}, call);
break;
case "zdy1":
api.toast({
msg: data,
duration: 2000,
location: 'middle'
}, call);
break;
case "zdy2":
api.toast({
msg: data,
duration: 2000,
location: 'bottom'
}, call);
break;
default:
break;
}
}
举例: