|
@@ -53,5 +53,73 @@ class util {
|
|
framework_log.log.Debug("WEIXIN", v);
|
|
framework_log.log.Debug("WEIXIN", v);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ // Loadding
|
|
|
|
+ static showLoading(title = "加载中...", mask = false) {
|
|
|
|
+ common_vendor.index.showLoading({
|
|
|
|
+ title,
|
|
|
|
+ mask
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ static hideLoading() {
|
|
|
|
+ common_vendor.index.hideLoading();
|
|
|
|
+ }
|
|
|
|
+ // Toast
|
|
|
|
+ static showInfoToast(title, duration = 1500, mask = false) {
|
|
|
|
+ common_vendor.index.showToast({
|
|
|
|
+ title,
|
|
|
|
+ icon: "none",
|
|
|
|
+ duration,
|
|
|
|
+ mask
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ static showSuccessToast(title, duration = 1500, mask = false) {
|
|
|
|
+ common_vendor.index.showToast({
|
|
|
|
+ title,
|
|
|
|
+ icon: "success",
|
|
|
|
+ duration,
|
|
|
|
+ mask
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ static showErrorToast(title, duration = 1500, mask = false) {
|
|
|
|
+ common_vendor.index.showToast({
|
|
|
|
+ title,
|
|
|
|
+ icon: "error",
|
|
|
|
+ duration,
|
|
|
|
+ mask
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ // Modal
|
|
|
|
+ static showModal(title, content, confirm_cb = null, cancel_cb = null, confirmText = "确定", showCancel = true, cancelText = "取消") {
|
|
|
|
+ common_vendor.index.showModal({
|
|
|
|
+ title,
|
|
|
|
+ content,
|
|
|
|
+ confirmText,
|
|
|
|
+ showCancel,
|
|
|
|
+ cancelText,
|
|
|
|
+ success: function(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ confirm_cb && confirm_cb();
|
|
|
|
+ } else if (res.cancel) {
|
|
|
|
+ cancel_cb && cancel_cb();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ static showModalNoCancel(title, content, confirm_cb = null, cancel_cb = null, confirmText = "确定") {
|
|
|
|
+ this.showModal(title, content, confirm_cb, cancel_cb, confirmText, false);
|
|
|
|
+ }
|
|
|
|
+ // ActionSheet
|
|
|
|
+ static showActionSheet(alertText, itemList, confirm_cb, cancel_cb = null) {
|
|
|
|
+ common_vendor.index.showActionSheet({
|
|
|
|
+ alertText,
|
|
|
|
+ itemList,
|
|
|
|
+ success: function(res) {
|
|
|
|
+ confirm_cb && confirm_cb(res.tapIndex);
|
|
|
|
+ },
|
|
|
|
+ fail: function(err) {
|
|
|
|
+ cancel_cb && cancel_cb();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
exports.util = util;
|
|
exports.util = util;
|