Przeglądaj źródła

Auto merge base into tabbar

GitHub Actions 10 miesięcy temu
rodzic
commit
de32f4515f

+ 8 - 6
src/hooks/useUpload.ts

@@ -37,19 +37,21 @@ export default function useUpload<T extends TfileType>(options: TOptions<T> = {}
       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) => {

+ 1 - 2
src/pages.json

@@ -57,8 +57,7 @@
       "type": "page",
       "layout": "tabbar",
       "style": {
-        "navigationBarTitleText": "关于",
-        "navigationStyle": "custom"
+        "navigationBarTitleText": "关于"
       }
     }
   ],

+ 0 - 2
src/pages/about/about.vue

@@ -3,14 +3,12 @@
   layout: 'tabbar',
   style: {
     navigationBarTitleText: '关于',
-    navigationStyle: 'custom', // 开启自定义导航栏
   },
 }
 </route>
 
 <template>
   <view>
-    <fg-navbar>关于</fg-navbar>
     <view
       class="bg-white overflow-hidden pt-2 px-4"
       :style="{ marginTop: safeAreaInsets?.top + 'px' }"

+ 2 - 2
src/pages/about/components/upload.vue

@@ -14,8 +14,8 @@
     <template v-else>
       <view class="m-2">上传后返回的接口数据:</view>
       <view class="m-2">{{ data }}</view>
-      <view class="h-80 w-full">
-        <image v-if="data" :src="data.url" mode="scaleToFill" />
+      <view v-if="data" class="h-80 w-full">
+        <image :src="data.url" mode="scaleToFill" />
       </view>
     </template>
   </view>

+ 2 - 4
src/pages/index/index.vue

@@ -3,16 +3,14 @@
 {
   layout: 'tabbar',
   style: {
+    // 'custom' 表示开启自定义导航栏,默认 'default'
     navigationStyle: 'custom',
     navigationBarTitleText: '首页',
   },
 }
 </route>
 <template>
-  <view
-    class="bg-white overflow-hidden pt-2 px-4"
-    :style="{ marginTop: safeAreaInsets?.top + 'px' }"
-  >
+  <view class="bg-white pt-2 px-4" :style="{ marginTop: safeAreaInsets?.top + 'px' }">
     <view class="mt-12">
       <image src="/static/logo.svg" alt="" class="w-28 h-28 block mx-auto" />
     </view>