diff --git a/src/hooks/useUpload.ts b/src/hooks/useUpload.ts index a3edb3b..4347f67 100644 --- a/src/hooks/useUpload.ts +++ b/src/hooks/useUpload.ts @@ -37,19 +37,21 @@ 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]} - // 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 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) => { diff --git a/src/pages.json b/src/pages.json index 7bb9c27..e2d0823 100644 --- a/src/pages.json +++ b/src/pages.json @@ -57,8 +57,7 @@ "type": "page", "layout": "tabbar", "style": { - "navigationBarTitleText": "关于", - "navigationStyle": "custom" + "navigationBarTitleText": "关于" } } ], diff --git a/src/pages/about/about.vue b/src/pages/about/about.vue index f5cdf15..426555a 100644 --- a/src/pages/about/about.vue +++ b/src/pages/about/about.vue @@ -3,14 +3,12 @@ layout: 'tabbar', style: { navigationBarTitleText: '关于', - navigationStyle: 'custom', // 开启自定义导航栏 }, } diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index b8c873b..692dea7 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -3,16 +3,14 @@ { layout: 'tabbar', style: { + // 'custom' 表示开启自定义导航栏,默认 'default' navigationStyle: 'custom', navigationBarTitleText: '首页', }, }