功能:同步小程序流程

This commit is contained in:
xiaowang
2026-05-23 18:45:41 +08:00
parent 844516988b
commit 30ae763e18
117 changed files with 8823 additions and 76 deletions
+20
View File
@@ -1,5 +1,13 @@
/**
* Purpose: activeLoadingCount supports loading.js by holding or executing the active loading count page or API role.
* Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow.
*/
let activeLoadingCount = 0
/**
* Purpose: showLoading supports loading.js by holding or executing the show loading page or API role.
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
*/
function showLoading(options) {
const config = options || {}
activeLoadingCount += 1
@@ -14,6 +22,10 @@ function showLoading(options) {
})
}
/**
* Purpose: hideLoading supports loading.js by holding or executing the hide loading page or API role.
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
*/
function hideLoading() {
activeLoadingCount = Math.max(0, activeLoadingCount - 1)
@@ -26,6 +38,10 @@ function hideLoading() {
})
}
/**
* Purpose: resetLoading supports loading.js by holding or executing the reset loading page or API role.
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
*/
function resetLoading() {
activeLoadingCount = 0
wx.hideLoading({
@@ -33,6 +49,10 @@ function resetLoading() {
})
}
/**
* Purpose: runWithLoading supports loading.js by holding or executing the run with loading page or API role.
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
*/
function runWithLoading(task, options) {
showLoading(options)