| | |
| | | |
| | | var SESSION_SUFFIX = "diniu_app_" |
| | | export function showModal(message, title = '提示', iscancel = true) { |
| | | export function showModal(message, title = '提示', iscancel = true, confirmText = "是", cancelText = "否") { |
| | | return new Promise((resolve) => { |
| | | uni.showModal({ |
| | | title: title, |
| | | content: message, |
| | | showCancel: iscancel, |
| | | confirmText, |
| | | cancelText, |
| | | success: function(res) { |
| | | if (res.confirm) { |
| | | resolve(true) |
| | |
| | | icon: icon ? icon : 'none' |
| | | }) |
| | | } |
| | | 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 , {duration:"short"}); |
| | | } |
| | | export function showLoading(title) { |
| | | |
| | | |
| | |
| | | }) |
| | | |
| | | } |
| | | export function hexToRGBA(hex, alpha) { |
| | | const r = parseInt(hex.slice(1, 3), 16); |
| | | const g = parseInt(hex.slice(3, 5), 16); |
| | | const b = parseInt(hex.slice(5, 7), 16); |
| | | |
| | | return `rgba(${r}, ${g}, ${b}, ${alpha})`; |
| | | } |
| | | |
| | | export function hideLoading() { |
| | | |