cuiqian2004
2025-08-29 7662665a4f88da0f8afa804bd4a34dfbefc1fb56
js/Page.js
@@ -1,4 +1,3 @@
/* export function setData(dataset) {
   for (let field in dataset) {
      // 通过正则表达式  查找路径数据
@@ -33,11 +32,12 @@
    })
}
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){
   
@@ -83,4 +83,37 @@
   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
   // });
}