From f31015deb04ef8fc34401721f079efcb08096ee1 Mon Sep 17 00:00:00 2001
From: dzc <2388224167@qq.com>
Date: Tue, 10 Mar 2026 11:05:33 +0800
Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F?=
=?UTF-8?q?=E4=B8=80=E9=94=AE=E7=99=BB=E5=BD=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages.json | 14 +--
src/pages/root/login.vue | 98 ++++++++++----------
src/pages/tabbar/canteen.vue | 10 +-
src/pages/tabbar/my.vue | 27 +++---
src/pages/tabbar/order.vue | 8 +-
src/sheep/api/index.ts | 1 +
src/sheep/api/mini-platform.ts | 15 +++
src/sheep/components/common/service-text.vue | 17 +++-
src/sheep/constant/app-env.ts | 4 +-
src/sheep/constant/service-enum.ts | 7 ++
src/sheep/hooks/use-page.ts | 6 +-
src/sheep/utils/request.ts | 11 +--
12 files changed, 132 insertions(+), 86 deletions(-)
create mode 100644 src/sheep/api/mini-platform.ts
diff --git a/src/pages.json b/src/pages.json
index cb3947d..4118a9a 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -16,13 +16,6 @@
"disableScroll": true
}
},
- {
- "path": "pages/root/login",
- "style": {
- "navigationBarTitleText": "登录",
- "disableScroll": true
- }
- },
{
"path": "pages/tabbar/order",
"style": {
@@ -36,6 +29,13 @@
"navigationBarTitleText": "我的",
"disableScroll": true
}
+ },
+ {
+ "path": "pages/root/login",
+ "style": {
+ "navigationBarTitleText": "登录",
+ "disableScroll": true
+ }
}
],
"globalStyle": {
diff --git a/src/pages/root/login.vue b/src/pages/root/login.vue
index d6ed4ae..dec6c50 100644
--- a/src/pages/root/login.vue
+++ b/src/pages/root/login.vue
@@ -1,73 +1,59 @@
@@ -103,7 +92,22 @@ const doLogin = () => {
-
+
+
+
+
+
+ 登录错误,获取本机微信手机号失败,请联系客服
+
+
+ 登录错误,本系统只为浦江县机关事务服务,如有疑问请联系客服
+
+
+ 登录错误,请联系客服
+
+
+
diff --git a/src/pages/tabbar/canteen.vue b/src/pages/tabbar/canteen.vue
index fa66034..a945f13 100644
--- a/src/pages/tabbar/canteen.vue
+++ b/src/pages/tabbar/canteen.vue
@@ -16,14 +16,16 @@ const state = reactive({
onLoad(() => {
const app = getApp({ allowDefault: true })
- console.log("app:", app);
-
- app._initTabbar()
+ if (app._initTabbar) {
+ app._initTabbar()
+ }
})
onShow(() => {
const app = getApp({ allowDefault: true })
- app._initTabbar()
+ if (app._initTabbar) {
+ app._initTabbar()
+ }
reportPageAccess("pages/tabbar/canteen")
if (pageRef.value) {
pageRef.value.reload(false)
diff --git a/src/pages/tabbar/my.vue b/src/pages/tabbar/my.vue
index b019674..dea1546 100644
--- a/src/pages/tabbar/my.vue
+++ b/src/pages/tabbar/my.vue
@@ -1,6 +1,5 @@
-
+
-
+
@@ -71,12 +70,12 @@ const state = reactive({
wallet: [],
userInfo: {},
menuList: [
- // { text: "扫一扫", icon: "/static/icon/scan.png", path: "" },
- { text: "钱包", icon: "/static/icon/service_3.png", path: "/pages/wallet/list" },
- { text: "喜好", icon: "/static/icon/service_4.png", path: "/pages/tabbar/canteenAnalyse" },
- // { text: "我的人脸", icon: "/static/icon/service_5.png", path: "/pages/human-face/list" },
- { text: "赚米", icon: "/static/icon/service_7.png", path: "/pages/ad/make-money" },
- // { text: "车辆管理", icon: "/static/icon/service_6.png", path: "/pages/car/user-car/list" },
+ { text: "扫一扫", icon: "/static/icon/scan.png", path: "" },
+ { text: "我参加的活动", icon: "/static/icon/act.png", path: "/pages/merchant/my-act-list" },
+ { text: "我的钱包", icon: "/static/icon/service_3.png", path: "/pages/wallet/list" },
+ { text: "我的人脸", icon: "/static/icon/service_5.png", path: "/pages/human-face/list" },
+ { text: "车辆管理", icon: "/static/icon/service_6.png", path: "/pages/car/user-car/list" },
+ { text: "清除缓存", icon: "/static/icon/clear-storage.png", path: "" },
],
appInfo: "",
actModalShow: false,
@@ -339,7 +338,9 @@ const initMenuConfig = () => {
onLoad(async () => {
const app = getApp({ allowDefault: true })
- app._initTabbar()
+ if (app._initTabbar) {
+ app._initTabbar()
+ }
// 初始化配置菜单
initMenuConfig()
// 获取应用信息
@@ -352,12 +353,12 @@ onLoad(async () => {
})
onShow(() => {
const app = getApp({ allowDefault: true })
- app._initTabbar()
+ if (app._initTabbar) {
+ app._initTabbar()
+ }
reportPageAccess("pages/tabbar/my")
// 获取存储中的用户信息
storage.getUserInfo()
- // 刷新用户
- app._getUserInfo()
})
diff --git a/src/pages/tabbar/order.vue b/src/pages/tabbar/order.vue
index 49d32e7..11fbc6a 100644
--- a/src/pages/tabbar/order.vue
+++ b/src/pages/tabbar/order.vue
@@ -17,12 +17,16 @@ const state = reactive({
onLoad(() => {
const app = getApp({ allowDefault: true })
- app._initTabbar()
+ if (app._initTabbar) {
+ app._initTabbar()
+ }
})
onShow(() => {
const app = getApp({ allowDefault: true })
- app._initTabbar()
+ if (app._initTabbar) {
+ app._initTabbar()
+ }
reportPageAccess("pages/tabbar/canteen")
if (pageRef.value) {
pageRef.value.reload(false)
diff --git a/src/sheep/api/index.ts b/src/sheep/api/index.ts
index c8999f1..67a52b1 100644
--- a/src/sheep/api/index.ts
+++ b/src/sheep/api/index.ts
@@ -5,6 +5,7 @@ export { default as boxesApi } from "./boxes"
export { default as faceApi } from "./face"
export { default as foodApi } from "./food"
export { default as merchantApi } from "./merchant"
+export { default as miniPlatformApi } from "./mini-platform"
export { default as orderApi } from "./order"
export { default as payApi } from "./pay"
export { default as productApi } from "./product"
diff --git a/src/sheep/api/mini-platform.ts b/src/sheep/api/mini-platform.ts
new file mode 100644
index 0000000..920df7c
--- /dev/null
+++ b/src/sheep/api/mini-platform.ts
@@ -0,0 +1,15 @@
+import request from "@/sheep/utils/request"
+
+type AutoAdminLoginDto = {
+ miniPlatformType?: string
+ code?: string
+}
+
+export default {
+ autoAdminLogin: (data: AutoAdminLoginDto) =>
+ request({
+ url: "/third/third-mini-app-oath/auto-admin-login",
+ method: "POST",
+ data,
+ }),
+}
diff --git a/src/sheep/components/common/service-text.vue b/src/sheep/components/common/service-text.vue
index 3849230..bf780cf 100644
--- a/src/sheep/components/common/service-text.vue
+++ b/src/sheep/components/common/service-text.vue
@@ -3,6 +3,13 @@ import { reactive } from "vue"
import { useMakePhoneCall } from "@@/hooks"
+const props = defineProps({
+ showPhoneText: {
+ type: Boolean,
+ default: true
+ }
+})
+
const state = reactive({
showModal: false,
phoneList: ['15557321501']
@@ -16,11 +23,19 @@ const doPhone = (v: string) => {
useMakePhoneCall(v)
}
+const openModal = () => {
+ state.showModal = true
+}
+
+defineExpose({
+ openModal,
+})
+
-
+
联系热线
diff --git a/src/sheep/constant/app-env.ts b/src/sheep/constant/app-env.ts
index dee8bf4..6756239 100644
--- a/src/sheep/constant/app-env.ts
+++ b/src/sheep/constant/app-env.ts
@@ -1,6 +1,6 @@
export default {
// 微信小程序
- WECHAT: "wechat",
+ WECHAT: "WECHAT",
// 支付宝
- ALI_PAY: "ali_pay",
+ ALI_PAY: "ALI_PAY",
} as const
diff --git a/src/sheep/constant/service-enum.ts b/src/sheep/constant/service-enum.ts
index 1bde5f7..8f9cbfb 100644
--- a/src/sheep/constant/service-enum.ts
+++ b/src/sheep/constant/service-enum.ts
@@ -55,6 +55,12 @@ const actCancelStatusEnum = {
"3": "已过期",
}
+const errorMsginiPlatformLoginErrorEnum = {
+ "10": "获取手机号错误",
+ "20": "用户不存在",
+ "30": "登录错误",
+}
+
export default {
hardwareOrderStatusEnum,
hardwareOrderTypeEnum,
@@ -64,4 +70,5 @@ export default {
hardwareRefundStatusEnum,
carTypeEnum,
actCancelStatusEnum,
+ errorMsginiPlatformLoginErrorEnum,
}
diff --git a/src/sheep/hooks/use-page.ts b/src/sheep/hooks/use-page.ts
index 3369ab5..530f11c 100644
--- a/src/sheep/hooks/use-page.ts
+++ b/src/sheep/hooks/use-page.ts
@@ -52,9 +52,13 @@ export const usePage = (ref: any = null, fn: Function | null = null, sticky = nu
}
let _arr = res
for (let key of struct.split(".")) {
+ if (_arr == null) {
+ break
+ }
_arr = _arr[key]
}
- setPage(_arr)
+ const list = Array.isArray(_arr) ? _arr : (_arr?.records ?? [])
+ setPage(list)
} catch (e) {
console.error(e)
setPage([])
diff --git a/src/sheep/utils/request.ts b/src/sheep/utils/request.ts
index 1ffbb4c..21fb14c 100644
--- a/src/sheep/utils/request.ts
+++ b/src/sheep/utils/request.ts
@@ -20,17 +20,10 @@ const SKIP_REFRESH_TOKEN = ["/sys/auth/refresh-token", "/auth/token/check_token"
let refreshTokenLock = true
-// 创建https请求实例
-let baseUrl = ""
-// #ifdef WEB
-baseUrl = import.meta.env.VITE_API_URL
-// #endif
-// #ifndef WEB
-baseUrl = getBaseApiUrl()
-// #endif
+console.log("getBaseApiUrl:", getBaseApiUrl())
const https = new Request({
- baseURL: baseUrl,
+ baseURL: getBaseApiUrl(),
timeout: 15000,
method: "GET",
header: {