From 119edac05a458aab04364743f63e24b208f8c96e Mon Sep 17 00:00:00 2001
From: feige996 <1020102647@qq.com>
Date: Sat, 21 Jun 2025 10:27:59 +0800
Subject: [PATCH 1/3] =?UTF-8?q?refactor(=E9=A1=B5=E9=9D=A2=E5=B8=83?=
=?UTF-8?q?=E5=B1=80):=20=E7=A7=BB=E9=99=A4=E8=87=AA=E5=AE=9A=E4=B9=89?=
=?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=A0=8F=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=E5=B9=B6=E7=AE=80=E5=8C=96=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
移除about页面的自定义导航栏代码及相关配置,统一使用默认导航栏样式
优化index页面布局,移除多余的overflow-hidden样式
修复upload组件图片显示条件判断
---
src/pages.json | 3 +--
src/pages/about/about.vue | 2 --
src/pages/about/components/upload.vue | 4 ++--
src/pages/index/index.vue | 6 ++----
4 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/src/pages.json b/src/pages.json
index 0ba59a0..76e0b39 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -52,8 +52,7 @@
"path": "pages/about/about",
"type": "page",
"style": {
- "navigationBarTitleText": "关于",
- "navigationStyle": "custom"
+ "navigationBarTitleText": "关于"
}
}
],
diff --git a/src/pages/about/about.vue b/src/pages/about/about.vue
index 30e39e4..19f3804 100644
--- a/src/pages/about/about.vue
+++ b/src/pages/about/about.vue
@@ -2,14 +2,12 @@
{
style: {
navigationBarTitleText: '关于',
- navigationStyle: 'custom', // 开启自定义导航栏
},
}
- 关于
上传后返回的接口数据:
{{ data }}
-
-
+
+
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 440917f..8d3beed 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -2,16 +2,14 @@
{
style: {
+ // 'custom' 表示开启自定义导航栏,默认 'default'
navigationStyle: 'custom',
navigationBarTitleText: '首页',
},
}
-
+
From 7bd338e07c31f61b35b465789d618f4a37e1113e Mon Sep 17 00:00:00 2001
From: feige996 <1020102647@qq.com>
Date: Sat, 21 Jun 2025 10:29:55 +0800
Subject: [PATCH 2/3] =?UTF-8?q?fix(useUpload):=20=E4=BF=AE=E5=A4=8D?=
=?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84=E5=92=8C=E5=A4=A7=E5=B0=8F?=
=?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
调整条件编译逻辑,确保在非微信小程序环境下也能正确获取文件路径和大小
---
src/hooks/useUpload.ts | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/hooks/useUpload.ts b/src/hooks/useUpload.ts
index a3edb3b..c9accca 100644
--- a/src/hooks/useUpload.ts
+++ b/src/hooks/useUpload.ts
@@ -37,19 +37,19 @@ export default function useUpload(options: TOptions = {}
count: 1,
success: (res: any) => {
console.log('File selected successfully:', res)
- // h5中res:{errMsg: "chooseImage:ok", tempFilePaths: "blob:http://localhost:9000/f74ab6b8-a14d-4cb6-a10d-fcf4511a0de5", tempFiles: [File]}
+ // App or h5中res:{errMsg: "chooseImage:ok", tempFilePaths: "blob:http://localhost:9000/f74ab6b8-a14d-4cb6-a10d-fcf4511a0de5", tempFiles: [File]}
// h5的File有一下字段:{name: "girl.jpeg", size: 48976, type: "image/jpeg"}
// 小程序中res:{errMsg: "chooseImage:ok", tempFiles: [{fileType: "image", size: 48976, tempFilePath: "http://tmp/5iG1WpIxTaJf3ece38692a337dc06df7eb69ecb49c6b.jpeg"}]}
let tempFilePath = ''
let size = 0
- // #ifdef H5
- tempFilePath = res.tempFilePaths[0]
- size = res.tempFiles[0].size
- // #endif
// #ifdef MP-WEIXIN
tempFilePath = res.tempFiles[0].tempFilePath
size = res.tempFiles[0].size
// #endif
+ // #ifndef MP-WEIXIN
+ tempFilePath = res.tempFilePaths[0]
+ size = res.tempFiles[0].size
+ // #endif
handleFileChoose({ tempFilePath, size })
},
fail: (err: any) => {
From 74e52f000a6db3fbb90654bf46121422c55a3afa Mon Sep 17 00:00:00 2001
From: feige996 <1020102647@qq.com>
Date: Sat, 21 Jun 2025 10:33:22 +0800
Subject: [PATCH 3/3] =?UTF-8?q?docs(useUpload):=20=E6=9B=B4=E6=96=B0?=
=?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BB=A5=E6=98=8E=E7=A1=AE=E4=B8=8D=E5=90=8C?=
=?UTF-8?q?=E5=B9=B3=E5=8F=B0=E7=9A=84=E8=BF=94=E5=9B=9E=E5=80=BC=E5=B7=AE?=
=?UTF-8?q?=E5=BC=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
补充说明H5和App平台返回的File对象字段差异,并调整注释顺序使其更清晰
---
src/hooks/useUpload.ts | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/hooks/useUpload.ts b/src/hooks/useUpload.ts
index c9accca..4347f67 100644
--- a/src/hooks/useUpload.ts
+++ b/src/hooks/useUpload.ts
@@ -37,9 +37,11 @@ export default function useUpload(options: TOptions = {}
count: 1,
success: (res: any) => {
console.log('File selected successfully:', res)
- // App or h5中res:{errMsg: "chooseImage:ok", tempFilePaths: "blob:http://localhost:9000/f74ab6b8-a14d-4cb6-a10d-fcf4511a0de5", tempFiles: [File]}
- // h5的File有一下字段:{name: "girl.jpeg", size: 48976, type: "image/jpeg"}
// 小程序中res:{errMsg: "chooseImage:ok", tempFiles: [{fileType: "image", size: 48976, tempFilePath: "http://tmp/5iG1WpIxTaJf3ece38692a337dc06df7eb69ecb49c6b.jpeg"}]}
+ // h5中res:{errMsg: "chooseImage:ok", tempFilePaths: "blob:http://localhost:9000/f74ab6b8-a14d-4cb6-a10d-fcf4511a0de5", tempFiles: [File]}
+ // h5的File有以下字段:{name: "girl.jpeg", size: 48976, type: "image/jpeg"}
+ // App中res:{errMsg: "chooseImage:ok", tempFilePaths: "file:///Users/feige/xxx/gallery/1522437259-compressed-IMG_0006.jpg", tempFiles: [File]}
+ // App的File有以下字段:{path: "file:///Users/feige/xxx/gallery/1522437259-compressed-IMG_0006.jpg", size: 48976}
let tempFilePath = ''
let size = 0
// #ifdef MP-WEIXIN