qingyiay
2023-07-12 f52085a9bc8c61cf7097426d7a6b2985d890da68
pages/register/register.vue
@@ -120,8 +120,25 @@
                  width="250"
                  height="150"
                  :previewFullImage="true">
                  <!-- <image src="https://cdn.uviewui.com/uview/demo/upload/positive.png"
                  mode="widthFix" style="width: 250px;height: 150px;"></image> -->
               </u-upload>
            </u-form-item>
            <u-form-item prop="bodyOfCarJpg"
               label="车辆细节照片"
               labelWidth="20%"
               borderBottom
               v-if="radiovalue1 == '司机'"
               required
               @click="beforeRead">
               <u-upload :fileList="fileList3"
                  deletable
                  @afterRead="afterRead"
                  @delete="deletePic"
                  name="3"
                  multiple
                  :maxCount="3"
                  width="250"
                  height="150"
                  :previewFullImage="true">
               </u-upload>
            </u-form-item>
            <u-form-item prop="drivingImg"
@@ -141,8 +158,6 @@
                  width="250"
                  height="150"
                  :previewFullImage="true">
                  <!-- <image src="https://cdn.uviewui.com/uview/demo/upload/positive.png"
                  mode="widthFix" style="width: 250px;height: 150px;"></image> -->
               </u-upload>
            </u-form-item>
            <u-form-item label="推荐人账号"
@@ -175,8 +190,7 @@
</template>
<script>
   import { apiRegister } from '@/api/publicInterface.js';
   import { BaseUrl } from '@/api/publicInterface.js';
   import { apiRegister, BaseUrl } from '@/api/publicInterface.js';
   import { mapMutations } from 'vuex';
   export default {
      // onLoad: function() {
@@ -197,14 +211,10 @@
      // 监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
      onReady() {
         this.$refs.regesterFormRef.setRules(this.rules);
         // this.$refs.regesterFormRef.validate().then(res => {}).catch(err => {
         //   console.log(err);
         // })
      },
      onLoad(params) {
         if (params) {
            this.registerFormModel.openId = params.code;
            console.log('页面加载', this.registerFormModel.openId);
         }
      },
      data() {
@@ -225,10 +235,13 @@
               drivingImg: '',
               tuiJianMa: '',
               confirmPassword: '',
               vehicleColour: ''
               vehicleColour: '',
               bodyOfCarJpg: ''
            },
            fileList1: [],
            fileList2: [],
            fileList3: [],
            carBody: [],
            rules: {
               name: {
                  type: 'string',
@@ -317,6 +330,12 @@
                  message: '请上传车辆图片',
                  trigger: ['blur', 'change']
               },
               bodyOfCarJpg: {
                  type: 'string',
                  required: true,
                  message: '请上传车辆图片',
                  trigger: ['blur', 'change']
               },
               drivingImg: {
                  type: 'string',
                  required: true,
@@ -340,10 +359,13 @@
               },
               {
                  name: '绿色',
                  disabled: 'lvse'
                  value: 'lvse'
               },
               {
                  name: '蓝色',
                  value: 'lanse'
               }
            ],
            radiovalue2: '黄色',
            beforeChangeValue: '',
            // 更换角色弹框
            editRoleModelShow: false,
@@ -483,6 +505,11 @@
                     } else if (num == 2) {
                        this.registerFormModel.drivingImg = JSON.parse(res.data).data.url;
                        resolve(`${BaseUrl}${JSON.parse(res.data).data.url}`);
                     } else if (num == 3) {
                        let imageUrl = JSON.parse(res.data).data.url
                        this.carBody.push(imageUrl)
                        this.registerFormModel.bodyOfCarJpg = this.carBody.join(',')
                        resolve(`${BaseUrl}${JSON.parse(res.data).data.url}`);
                     }
                  }
               });