diff --git a/.env.development b/.env.development
index 918c77c..0f1526e 100644
--- a/.env.development
+++ b/.env.development
@@ -7,7 +7,8 @@ VITE_APP_PORT = 4096
VITE_APP_BASE_API = '/dev-api'
# API 服务器的 URL
-VITE_APP_API_URL = http://localhost:8000
+# VITE_APP_API_URL = http://localhost:8000
+VITE_APP_API_URL = https://api.youlai.tech
# WebSocket 服务器的 URL,不配置默认关闭 WebSocket
#VITE_APP_WS_ENDPOINT= ws://localhost:4096/ws
diff --git a/package.json b/package.json
index 5ff97b8..cde8483 100644
--- a/package.json
+++ b/package.json
@@ -133,7 +133,7 @@
"stylelint-config-recommended-scss": "^14.1.0",
"stylelint-config-recommended-vue": "^1.6.1",
"stylelint-prettier": "^5.0.3",
- "typescript": "^4.9.5",
+ "typescript": "^5.7.0",
"typescript-eslint": "^8.46.0",
"uni-mini-router": "^0.1.6",
"unocss": "^0.62.4",
@@ -141,6 +141,6 @@
"unplugin-auto-import": "^0.18.6",
"vite": "6.3.2",
"vue-eslint-parser": "^9.4.3",
- "vue-tsc": "^1.8.27"
+ "vue-tsc": "^2.2.0"
}
}
diff --git a/pages.config.ts b/pages.config.ts
index 3c490fd..b0d8eb8 100644
--- a/pages.config.ts
+++ b/pages.config.ts
@@ -7,7 +7,7 @@ export default defineUniPages({
globalStyle: {
navigationBarBackgroundColor: "@navBgColor",
navigationBarTextStyle: "@navTxtStyle",
- navigationBarTitleText: "vue-uniapp-template",
+ navigationBarTitleText: "youlai-app",
backgroundColor: "@bgColor",
backgroundTextStyle: "@bgTxtStyle",
backgroundColorTop: "@bgColorTop",
diff --git a/src/App.vue b/src/App.vue
index de40390..d18088c 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,3 +1,11 @@
diff --git a/src/api/file.ts b/src/api/file.ts
index daf20a4..5a4687b 100644
--- a/src/api/file.ts
+++ b/src/api/file.ts
@@ -1,4 +1,4 @@
-import { getToken } from "@/utils/storage";
+import { getAccessToken } from "@/utils/auth";
import { ApiCode } from "@/enums/api-code-enum";
// H5 使用 VITE_APP_BASE_API 作为代理路径,其他平台使用 VITE_APP_API_URL 作为请求路径
@@ -25,7 +25,7 @@ const FileAPI = {
filePath: filePath,
name: "file",
header: {
- Authorization: getToken() ? `Bearer ${getToken()}` : "",
+ Authorization: getAccessToken() ? `Bearer ${getAccessToken()}` : "",
},
formData: {},
success: (response) => {
diff --git a/src/components/custom-navbar/index.vue b/src/components/custom-navbar/index.vue
index ea3132c..d62d206 100644
--- a/src/components/custom-navbar/index.vue
+++ b/src/components/custom-navbar/index.vue
@@ -57,13 +57,13 @@ interface Props {
const props = withDefaults(defineProps(), {
title: "",
- titleColor: "#333333",
- bgColor: "#ffffff",
+ titleColor: "var(--color-text)",
+ bgColor: "var(--color-bg)",
showBack: true,
showHome: false,
backIcon: "arrow-left",
backIconSize: "20px",
- iconColor: "#333333",
+ iconColor: "var(--color-text)",
fixed: true,
placeholder: false,
navBarHeight: 44,
diff --git a/src/composables/useNavbar.ts b/src/composables/useNavbar.ts
index a765ea6..d16e264 100644
--- a/src/composables/useNavbar.ts
+++ b/src/composables/useNavbar.ts
@@ -1,4 +1,4 @@
-import { ref, computed, onMounted } from "vue";
+import { ref, computed, type Ref, type ComputedRef } from "vue";
/**
* 微信小程序导航栏高度计算
@@ -175,6 +175,15 @@ export function useNavbar(options: UseNavbarOptions = {}): UseNavbarReturn {
}, delayMs);
} else {
console.warn("getMenuButtonBoundingClientRect 返回值无效,使用默认值");
+ // 兜底:设置合理的默认胶囊按钮尺寸,避免导航栏高度为 0
+ menuButton.value = {
+ width: 87,
+ height: 32,
+ top: statusBarHeight.value + 6,
+ right: windowWidth.value - 10,
+ bottom: statusBarHeight.value + 38,
+ left: windowWidth.value - 97,
+ };
}
} catch (e) {
console.warn("获取胶囊按钮位置失败,使用默认值", e);
@@ -208,10 +217,8 @@ export function useNavbar(options: UseNavbarOptions = {}): UseNavbarReturn {
}
};
- // 在 onMounted 中调用,确保页面渲染完成
- onMounted(() => {
- init();
- });
+ // setup 阶段同步调用,避免首次渲染闪烁
+ init();
return {
// 高度信息
@@ -236,7 +243,3 @@ export function useNavbar(options: UseNavbarOptions = {}): UseNavbarReturn {
init,
};
}
-
-// 类型导出
-type Ref = import("vue").Ref;
-type ComputedRef = import("vue").ComputedRef;
diff --git a/src/manifest.json b/src/manifest.json
index 492dfcf..e38f0ec 100644
--- a/src/manifest.json
+++ b/src/manifest.json
@@ -1,5 +1,5 @@
{
- "name": "vue-uniapp-template",
+ "name": "youlai-app",
"appid": "",
"description": "有来移动端跨端解决方案开发模板",
"versionName": "1.0.0",
@@ -44,7 +44,9 @@
"mp-weixin": {
"appid": "wx99a151dc43d2637b",
"setting": {
- "urlCheck": false
+ "urlCheck": false,
+ "ignoreDevUnusedFiles": false,
+ "ignoreUploadUnusedFiles": false
},
"usingComponents": true,
"darkMode": true,
diff --git a/src/pages.json b/src/pages.json
index 4d7ffcd..0b42a76 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -40,6 +40,7 @@
"type": "page",
"name": "work",
"style": {
+ "navigationStyle": "custom",
"navigationBarTitleText": "工作台"
},
"layout": "tabbar"
@@ -200,7 +201,7 @@
"globalStyle": {
"navigationBarBackgroundColor": "@navBgColor",
"navigationBarTextStyle": "@navTxtStyle",
- "navigationBarTitleText": "vue-uniapp-template",
+ "navigationBarTitleText": "youlai-app",
"backgroundColor": "@bgColor",
"backgroundTextStyle": "@bgTxtStyle",
"backgroundColorTop": "@bgColorTop",
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 9326238..b70c4bf 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -45,23 +45,23 @@
-
-
+
+
-
+
{{ visitOverviewData.todayUvCount }}
-
-
+
+
-
+
{{ visitOverviewData.todayPvCount }}
@@ -69,7 +69,7 @@
-
+
@@ -133,7 +133,7 @@ const userStore = useUserStore();
const current = ref(0);
const recentDaysRange = ref(7);
-const swiperList = ref(["https://www.youlai.tech/storage/blog/banner9.png"]);
+const swiperList = ref(["https://www.youlai.tech/storage/youlai/bg02.png" ,"https://www.youlai.tech/storage/blog/banner9.png" ]);
const visitOverviewData = ref({
todayUvCount: 0,
@@ -477,11 +477,11 @@ onShow(() => {
&__icon {
position: absolute;
- right: -10rpx;
- bottom: -10rpx;
- width: 100rpx;
- height: 100rpx;
- opacity: 0.15;
+ right: 4px;
+ bottom: 4px;
+ width: 72rpx;
+ height: 72rpx;
+ opacity: 0.25;
}
&__dot {
@@ -489,19 +489,16 @@ onShow(() => {
height: 12rpx;
border-radius: 50%;
+ &--uv,
&--green {
- background: var(--color-success);
- box-shadow: 0 0 10rpx rgba(52, 209, 157, 0.4);
+ background: #34d19d;
+ box-shadow: 0 0 10rpx rgba(52, 209, 157, 0.35);
}
+ &--pv,
&--blue {
- background: var(--color-primary);
- box-shadow: 0 0 10rpx rgba(37, 99, 235, 0.4);
- }
-
- &--orange {
- background: var(--color-warning);
- box-shadow: 0 0 12rpx rgba(245, 158, 11, 0.4);
+ background: #4d80f0;
+ box-shadow: 0 0 10rpx rgba(77, 128, 240, 0.3);
}
}
@@ -513,16 +510,14 @@ onShow(() => {
line-height: 1;
letter-spacing: -1rpx;
+ &--uv,
&--green {
- color: var(--color-success);
+ color: #34d19d;
}
+ &--pv,
&--blue {
- color: var(--color-primary);
- }
-
- &--orange {
- color: var(--color-warning);
+ color: #4d80f0;
}
}
diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue
index ab3e79f..30ffb66 100644
--- a/src/pages/login/index.vue
+++ b/src/pages/login/index.vue
@@ -1,56 +1,57 @@
-
+
-
-
-
+
+
+
-
-
-
- ‹
+
+
+
+
+ ‹
-
-
+
+
-
+
-
-
- youlai-app
+
+
+ youlai-app
-
+
-