From 237a32aadb51f4c7f51d4734f6e62663f8acde36 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期六, 08 四月 2023 17:02:18 +0800
Subject: [PATCH] 修复多个bug
---
pages/register/register.vue | 82 ++++++++++++++++++++++++----------------
1 files changed, 49 insertions(+), 33 deletions(-)
diff --git a/pages/register/register.vue b/pages/register/register.vue
index 1b90898..2ff209a 100644
--- a/pages/register/register.vue
+++ b/pages/register/register.vue
@@ -1,6 +1,5 @@
<template>
<view class="register">
- <!-- <home-species title="娉ㄥ唽"></home-species> -->
<view class="registerForm">
<u--form :rules="rules" :model="registerFormModel" ref="regesterFormRef">
<u-form-item labelWidth="20%" label="閫夋嫨韬唤" borderBottom ref="roleRef" required>
@@ -36,29 +35,58 @@
<u--input v-model="registerFormModel.carNo" placeholder="璇疯緭鍏ュ唴瀹�" clearable></u--input>
</u-form-item>
<u-form-item prop="carImg" label="杞﹁締鐓х墖" labelWidth="20%" borderBottom v-if="radiovalue1 == '鍙告満'" required>
- <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="1" width="250" height="150">
+ <u-upload
+ :fileList="fileList1"
+ deletable
+ @afterRead="afterRead"
+ @delete="deletePic"
+ name="1"
+ multiple
+ :maxCount="1"
+ 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="drivingImg" label="琛岄┒璇�" labelWidth="20%" borderBottom v-if="radiovalue1 == '鍙告満'" required>
- <u-upload :fileList="fileList2" @afterRead="afterRead" @delete="deletePic" name="2" multiple :maxCount="1" width="250" height="150">
+ <u-upload
+ :fileList="fileList2"
+ deletable
+ @afterRead="afterRead"
+ @delete="deletePic"
+ name="2"
+ multiple
+ :maxCount="1"
+ 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="鎺ㄨ崘浜鸿处鍙�" labelWidth="25%" borderBottom><u--input v-model="registerFormModel.tuiJianMa" placeholder="璇疯緭鍏ュ唴瀹�" clearable></u--input></u-form-item>
+ <u-form-item label="鎺ㄨ崘浜鸿处鍙�" labelWidth="25%" borderBottom>
+ <u--input v-model="registerFormModel.tuiJianMa" placeholder="璇疯緭鍏ュ唴瀹�" clearable></u--input>
+ </u-form-item>
</u--form>
</view>
<view class="roleModel">
<u-modal :show="editRoleModelShow" :title="title" :content="content" :showCancelButton="true" @confirm="roleConfirm" @cancel="roleCancel"></u-modal>
</view>
<view class="registerBtn"><u-button text="娉ㄥ唽" type="primary" @click="registerClick"></u-button></view>
+ <!-- 鍥剧墖棰勮寮瑰嚭妗� -->
+ <!-- <view class="previewImage-container">
+ <u-popup :show="previewImageShow" mode="center" @close="previewImageClose" @open="previewImageOpen">
+ <u--image :src="previewImageSrc != null ? BaseUrl + previewImageSrc : ''" width="400px" height="400px"></u--image>
+ </u-popup>
+ </view> -->
</view>
</template>
<script>
-// import HomeSpecies from '@/components/home-species/HomeSpecies.vue';
import { apiRegister } from '@/api/publicInterface.js';
import { BaseUrl } from '@/api/publicInterface.js';
export default {
@@ -77,9 +105,6 @@
// }
// })
// },
- components: {
- // HomeSpecies
- },
// 鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚銆傛敞鎰忓鏋滄覆鏌撻�熷害蹇紝浼氬湪椤甸潰杩涘叆鍔ㄧ敾瀹屾垚鍓嶈Е鍙�
onReady() {
// this.$refs.regesterFormRef.setRules(this.rules);
@@ -107,7 +132,7 @@
carImg: '',
drivingImg: '',
tuiJianMa: '',
- confirmPassword:''
+ confirmPassword: ''
},
fileList1: [],
fileList2: [],
@@ -149,7 +174,7 @@
message: '闀垮害鍦�6-12涓瓧绗︿箣闂�'
}
],
- confirmPassword:[
+ confirmPassword: [
{
required: true,
message: '璇疯缃垵濮嬪瘑鐮�',
@@ -182,7 +207,6 @@
trigger: ['blur', 'change']
}
},
- confirmPassword:'',
// 鍩烘湰妗堝垪鏁版嵁
radiolist1: [
{
@@ -229,7 +253,7 @@
},
methods: {
registerClick() {
- if(this.registerFormModel.password == this.registerFormModel.confirmPassword){
+ if (this.registerFormModel.password == this.registerFormModel.confirmPassword) {
this.$refs.regesterFormRef
.validate()
.then(res => {
@@ -237,10 +261,9 @@
this.registerFormModel.username = this.registerFormModel.phone;
apiRegister(this.registerFormModel)
.then(res => {
- console.log(res);
if (res.data.code == 0) {
uni.showToast({
- title: '娉ㄥ唽鎴愬姛,鍗冲皢杩涘叆鐧诲綍锛�',
+ title: '娉ㄥ唽鎴愬姛,鍗冲皢杩斿洖鐧诲綍椤�',
icon: 'none',
duration: 1000
});
@@ -248,7 +271,7 @@
uni.redirectTo({ url: '/pages/login/login' });
}, 1000);
} else {
- this.$u.toast(res.data.msg);
+ this.$u.toast(res.data.data ? res.data.data : '娣诲姞澶辫触');
}
})
.catch(err => {
@@ -260,15 +283,9 @@
uni.$u.toast('璇疯鑼冭緭鍏ュ唴瀹�');
});
} else {
- this.$u.toast('涓ゆ瀵嗙爜涓嶄竴鑷�')
+ this.$u.toast('涓ゆ瀵嗙爜涓嶄竴鑷�');
}
},
- // 闊宠棰戦�氳瘽
- // callingIn() {
- // uni.navigateTo({
- // url: '/pages/calling-index/calling-index'
- // });
- // },
// 鍗曢�夋浜嬩欢
groupChange(e) {
console.log('鍗曢�夋灏忕粍', e);
@@ -287,11 +304,10 @@
this.beforeChangeValue = e;
}
},
- jiaoYanPassword(){
- console.log('瀵嗙爜锛�',this.registerFormModel.password ,'纭瀵嗙爜锛�',this.confirmPassword);
- // if(this.registerFormModel.password != this.confirmPassword){
- // this.$u.toast('涓ゆ瀵嗙爜涓嶄竴鑷�')
- // }
+ jiaoYanPassword() {
+ if (this.registerFormModel.password != this.registerFormModel.confirmPassword) {
+ this.$u.toast('涓ゆ瀵嗙爜涓嶄竴鑷�');
+ }
},
// 涓婁紶鍥剧墖鏂规硶
// 鍒犻櫎鍥剧墖
@@ -300,7 +316,6 @@
},
// 鏂板鍥剧墖
async afterRead(event) {
- console.log('event', event);
// 褰撹缃� mutiple 涓� true 鏃�, file 涓烘暟缁勬牸寮忥紝鍚﹀垯涓哄璞℃牸寮�
let lists = [].concat(event.file);
let fileListLen = this[`fileList${event.name}`].length;
@@ -319,7 +334,7 @@
1,
Object.assign(item, {
status: 'success',
- message: '',
+ message: '涓婁紶鎴愬姛',
url: result
})
);
@@ -332,15 +347,16 @@
url: BaseUrl + '/admin/sys-file/uploadUnToken',
filePath: url,
name: 'file',
- // formData: {
- // user: 'test'
- // },
+ formData: {
+ // user: ''
+ },
success: res => {
- resolve(JSON.parse(res.data).data.url);
if (num == 1) {
this.registerFormModel.carImg = JSON.parse(res.data).data.url;
+ resolve(`${BaseUrl}${JSON.parse(res.data).data.url}`);
} else if (num == 2) {
this.registerFormModel.drivingImg = JSON.parse(res.data).data.url;
+ resolve(`${BaseUrl}${JSON.parse(res.data).data.url}`);
}
}
});
--
Gitblit v1.9.1