Kaynağa Gözat

feat:完善信息地址上传

ljc 2 ay önce
ebeveyn
işleme
4d47c9e720
1 değiştirilmiş dosya ile 7 ekleme ve 5 silme
  1. 7 5
      pages/mine/improveImmediately.vue

+ 7 - 5
pages/mine/improveImmediately.vue

@@ -425,7 +425,6 @@
               <uni-row class="demo-uni-row uni-row1">
                 <uni-col :xs="24" :sm="24" :md="16" :lg="16" :xl="16">
                   <cwg-file-picker
-                    v-if="!fileListAdd1.path"
                     v-model="fileListAdd1.path"
                     :editable="fileListAdd1.status != 2"
                     :limit="1"
@@ -438,11 +437,14 @@
                     :canDelete="false"
                     :uploadError="false"
                     :showProgress="false"
+                    :canChoose="true"
+                    :showError="false"
+                    :show-progress="false"
+                    disablePreview
                     :image-styles="imageStyle"
                     @update:modelValue="(val) => handleFileUpdate(val, '1')"
                     customClass="avatar-uploader"
-                  />
-                  <view v-else>
+                  >
                     <view class="file-item">
                       <image
                         v-if="!isPdf(fileListAdd1.path)"
@@ -453,7 +455,7 @@
                         <image class="icon" :src="icon_doc" />
                       </view>
                     </view>
-                  </view>
+                  </cwg-file-picker>
                 </uni-col>
                 <uni-col :xs="24" :sm="24" :md="4" :lg="4" :xl="4">
                   <view class="refresh">
@@ -1379,7 +1381,7 @@
         responseType: 'arraybuffer',
       })
       // console.log(res);
-      mobile.value = 'data:image/png;base64,' + Buffer.from(res).toString('base64')
+      mobile.value = 'data:image/png;base64,' + uni.arrayBufferToBase64(res)
     } catch (error: any) {
       uni.showToast({ title: error.message || t('Msg.SystemError'), icon: 'none' })
     }