change code

This commit is contained in:
周源 2022-04-27 09:31:17 +08:00
parent 67d2a65c30
commit c776e7eb50
2 changed files with 223 additions and 204 deletions

View File

@ -25,6 +25,7 @@
<u--input type="password" placeholder="请输入密码" border="bottom" clearable v-model="userInfo.pasw">
</u--input>
</u-form-item>
<u-form-item prop="phone" ref="item1" class="data_itm" v-if="tab == 1">
<u--input placeholder="请输入手机号" border="bottom" clearable v-model="userInfo.phone"></u--input>
</u-form-item>
@ -62,16 +63,32 @@
},
rules: {
'number': [{
type: 'number',
required: true,
message: '请填写账号',
trigger: ['blur']
}],
'phone': [{
type: 'number',
required: true,
message: '请填写手机号',
trigger: ['blur']
}, {
validator: (rule, value, callback) => {
return uni.$u.test.mobile(value);
},
message: '请输入格式正确的手机号',
trigger: ['change', 'blur'],
}],
'pasw': [{
required: true,
message: '请填写密码',
trigger: ['blur']
}],
'code': [{
required: true,
message: '请填写验证码',
trigger: ['blur']
}],
},
tab: 0,
};
@ -79,9 +96,11 @@
methods: {
pwdLog() {
this.tab = 0
this.$refs.loginForm.clearValidate()
},
codeLog() {
this.tab = 1
this.$refs.loginForm.clearValidate()
},
goRegist() {
uni.navigateTo({
@ -94,7 +113,7 @@
})
},
login() {
if(this.tab == 0){
if (this.tab == 0) {
this.http.request('/auth/loginByPwd', {
phone: this.userInfo.number,
pwd: this.userInfo.pasw
@ -110,7 +129,7 @@
icon: "none",
});
})
}else if(this.tab == 1){
} else if (this.tab == 1) {
this.http.request('/auth/loginByPhone', {
phone: this.userInfo.phone,
code: this.userInfo.code

View File

@ -167,15 +167,15 @@
<view class="person_itm_sign" @click="goChangeInfo('地址','宁波象山县')">
<text class="person_itm_sign_tit">地址</text>
<view class="person_itm_sign_right">
<text>地址</text>
<text>宁波象山县</text>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<view class="person_itm_sign">
<view class="person_itm_sign" @click="goChangeInfo('实景照','照片url')">
<text class="person_itm_sign_tit">实景照</text>
<view class="person_itm_sign_right">
<!-- <text>地址</text> -->
<u-icon name="arrow-right"></u-icon>
</view>
</view>
@ -183,7 +183,7 @@
<view class="person_itm_sign">
<text class="person_itm_sign_tit">资质证</text>
<view class="person_itm_sign_right">
<!-- <text>地址</text> -->
<u-icon name="arrow-right"></u-icon>
</view>
</view>