增加other分包页面
我的页面里增加跳转other分包跳转(仅在ios不是浏览器审核时展示)
This commit is contained in:
74
tuniao-ui/libs/function/messageUtils.js
Normal file
74
tuniao-ui/libs/function/messageUtils.js
Normal file
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* 弹出系统内置的toast
|
||||
*/
|
||||
function toast(title, mask = false, cb = null, icon = 'none', duration = 1500) {
|
||||
uni.showToast({
|
||||
title: title,
|
||||
icon: icon,
|
||||
mask: mask,
|
||||
duration: duration,
|
||||
success: () => {
|
||||
setTimeout(() => {
|
||||
cb && cb()
|
||||
}, duration)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 弹出内置的加载框
|
||||
*/
|
||||
function loading(title) {
|
||||
uni.showLoading({
|
||||
title: title,
|
||||
mask: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 弹出系统内置的modal
|
||||
*/
|
||||
function modal(title,
|
||||
content,
|
||||
confirmCb,
|
||||
showCancel = false,
|
||||
cancelCb = null,
|
||||
confirmText = "确定",
|
||||
cancelText = "取消") {
|
||||
uni.showModal({
|
||||
title: title,
|
||||
content: content,
|
||||
showCancel: showCancel,
|
||||
cancelText: cancelText,
|
||||
confirmText: confirmText,
|
||||
success: (res) => {
|
||||
if (res.cancel) {
|
||||
cancelCb && cancelCb()
|
||||
} else if (res.confirm) {
|
||||
confirmCb && confirmCb()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭系统内置toast
|
||||
*/
|
||||
function closeToast() {
|
||||
uni.hideToast()
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭系统内置的加载框
|
||||
*/
|
||||
function closeLoading() {
|
||||
uni.hideLoading()
|
||||
}
|
||||
|
||||
export default {
|
||||
toast,
|
||||
loading,
|
||||
modal,
|
||||
closeToast,
|
||||
closeLoading
|
||||
}
|
||||
Reference in New Issue
Block a user