From eee75e1d71c9278031e25f7c30482ece8ae49f43 Mon Sep 17 00:00:00 2001 From: YOGO <1587218160@qq.com> Date: Wed, 18 Mar 2026 13:51:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dapp=E7=99=BB=E9=99=86?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 4 +++ config.js | 5 +++ hooks/useLoading.js | 33 ++++++++++++++++++++ index.html | 71 ++++++++++++++++++++++-------------------- main.js | 4 +-- manifest.json | 6 ++-- pages/index/index.vue | 4 ++- pages/unlock/index.vue | 2 +- utils/common.js | 39 +++++++++++++++++++++-- 9 files changed, 124 insertions(+), 44 deletions(-) create mode 100644 config.js create mode 100644 hooks/useLoading.js diff --git a/App.vue b/App.vue index 24b165d..f19e471 100644 --- a/App.vue +++ b/App.vue @@ -119,6 +119,10 @@ export default { }).catch((err) => { logOut(); }) + }else{ + if(window.sf.isSfApp()){ + shunfenLogin(); + } } // 清掉请求有优惠价的时间记录 diff --git a/config.js b/config.js new file mode 100644 index 0000000..a36f49e --- /dev/null +++ b/config.js @@ -0,0 +1,5 @@ +window.config = { + BACK_URL: "https://uat.kingkongcang.com/client/", + ENV: "sit", + SF_APP_ID: "202603041358374970", +} \ No newline at end of file diff --git a/hooks/useLoading.js b/hooks/useLoading.js new file mode 100644 index 0000000..fc27345 --- /dev/null +++ b/hooks/useLoading.js @@ -0,0 +1,33 @@ +// /hooks/useLoading.js + +const loadingMap = new Set() + +export function useLoading() { + + const openLoading = (key = 'default', loadingObj) => { + loadingMap.add(key) + + uni.showLoading({ + ...loadingObj + }) + } + + const closeLoading = (key = 'default') => { + loadingMap.delete(key) + + if (loadingMap.size === 0) { + uni.hideLoading() + } + } + + const clearLoading = () => { + loadingMap.clear() + uni.hideLoading() + } + + return { + openLoading, + closeLoading, + clearLoading + } +} \ No newline at end of file diff --git a/index.html b/index.html index fddb072..3d17cb5 100644 --- a/index.html +++ b/index.html @@ -12,44 +12,47 @@ - + +