jiangping
2024-02-28 300d75d257dbe60401dfb97123ae39e32f37380e
h5/pages/userinfo/userinfo.vue
@@ -73,6 +73,7 @@
         return {
            show: false,
            visit: '',
            type: '',
            columns: [[{name: '身份证', id: 0}, {name: '港澳证件', id: 1},{name: '护照', id: 2}]],
            fileList: [],
            visitorData: {
@@ -93,6 +94,9 @@
      onLoad(option) {
         this.visitorData.userAnswerId = option.userAnswerId
         this.getVisit()
         uni.$on('update', (data) => {
            this.uploadImg(data.tempFilePath)
         })
      },
      methods: {
@@ -150,14 +154,41 @@
               }
            })
         },
         uploadImg(file) {
            uni.showLoading({ title: '上传中', mask: true });
            uni.uploadFile({
               url: `${this.$baseUrl}public/api/uploadFtp.do`,
               filePath: file,
               name: 'file',
               formData: {
                  folderCode: 'MEMBER_IMG'
               },
               success: (uploadFileRes) => {
                  let res = JSON.parse(uploadFileRes.data)
                  if (this.type === 'faceImg') {
                     this.visitorData.faceImg = res.data.halfPath
                     this.visitorData.faceImgUrl = res.data.prefixPath + res.data.folder + res.data.halfPath
                  } else {
                     this.visitorData.imgurl = res.data.halfPath
                     this.visitorData.imgurlUrl = res.data.prefixPath + res.data.folder + res.data.halfPath
                  }
               },
               complete() {
                  uni.hideLoading();
               }
            });
         },
         upload(type) {
            this.type = type
            uni.chooseImage({
               count: 1,
               success: (chooseImageRes) => {
                  // console.log(chooseImageRes.tempFilePaths[0])
                  uni.navigateTo({
                     url: `/pages/cropping/cropping?item=${JSON.stringify({ tempFilePath: chooseImageRes.tempFilePaths[0] })}`
                  })
                  return
                  if (type === 'faceImg') {
                     uni.navigateTo({
                        url: `/pages/cropping/cropping?item=${JSON.stringify({ tempFilePath: chooseImageRes.tempFilePaths[0] })}`
                     })
                     return
                  }
                  uni.showLoading({ title: '上传中', mask: true });
                  for (let i = 0; i < chooseImageRes.tempFilePaths.length; i++) {
                     uni.uploadFile({