| | |
| | | |
| | | /* export function setData(dataset) { |
| | | for (let field in dataset) { |
| | | // 通过正则表达式 查找路径数据 |
| | |
| | | }) |
| | | } |
| | | |
| | | export function showToast(title,icon){ |
| | | uni.showToast({ |
| | | title: title, |
| | | icon: icon?icon:'none' |
| | | }) |
| | | export function showToast(title,duration="short") { |
| | | // uni.showToast({ |
| | | // title: title, |
| | | // icon: icon?icon:'none' |
| | | // }) |
| | | plus.nativeUI.toast(title, {duration}); |
| | | } |
| | | export function showLoading(title){ |
| | | |
| | |
| | | return option |
| | | } |
| | | |
| | | export function showInfo(ex){ |
| | | if( !ex) |
| | | return |
| | | let tip =ex |
| | | console.log(ex); |
| | | if( typeof ex !== "string" ) |
| | | { |
| | | let exStr = JSON.stringify(ex) |
| | | if (exStr == "{}") |
| | | exStr = ex |
| | | tip = typeof ex.errMsg == "string" ? ex.errMsg :typeof ex.message == "string" ? ex.message: exStr |
| | | } |
| | | plus.nativeUI.toast(tip , {verticalAlign:"center",duration:"short"}); |
| | | } |
| | | |
| | | export function showError(ex,title=""){ |
| | | if( !ex) |
| | | return |
| | | let tip =ex |
| | | console.log(ex); |
| | | if( typeof ex !== "string" ) |
| | | { |
| | | let exStr = JSON.stringify(ex) |
| | | if (exStr == "{}") |
| | | exStr = ex |
| | | tip = typeof ex.errMsg == "string" ? ex.errMsg :typeof ex.message == "string" ? ex.message: exStr |
| | | } |
| | | plus.nativeUI.alert(tip,title); |
| | | // uni.showModal({ |
| | | // title: title ||"", |
| | | // content: tip,, |
| | | // showCancel: false |
| | | // }); |
| | | } |