|
|
@ -10,8 +10,17 @@ |
|
|
|
|
|
|
|
<!-- 头像 --> |
|
|
|
<view class="userIamge"> |
|
|
|
<view> |
|
|
|
<img src="/static/image/center/11.svg" alt="" style="width: 100%;height: 100%;"> |
|
|
|
<view |
|
|
|
@click="upload"> |
|
|
|
<image |
|
|
|
:src="form.image" |
|
|
|
v-if="form.image" |
|
|
|
mode="aspectFill" style="width: 100%;height: 100%;"> |
|
|
|
|
|
|
|
<image |
|
|
|
src="/static/image/center/11.svg" |
|
|
|
v-else |
|
|
|
style="width: 100%;height: 100%;"> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
@ -32,8 +41,8 @@ |
|
|
|
<uv-checkbox size="30rpx" :name="1"></uv-checkbox> |
|
|
|
请你阅读并同意我们的<span style="color: #fd5100" |
|
|
|
@click="$refs.popup.open('getPrivacyPolicy')">《隐私条款》</span>和<span |
|
|
|
style="color: #fd5100" |
|
|
|
@click="$refs.popup.open('getUserAgreement')">《服务协议》</span> |
|
|
|
style="color: #fd5100" |
|
|
|
@click="$refs.popup.open('getUserAgreement')">《服务协议》</span> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uv-checkbox-group> |
|
|
@ -89,16 +98,13 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- tab --> |
|
|
|
<!-- <view class="bottomTab"> |
|
|
|
<span :class="titleIndex==0 ? 'tabbarItemActive' : 'tabbarItemNoActive'" |
|
|
|
@click='changePage(0)'>注册账号</span> |
|
|
|
<span style="color: #9c9fa4">|</span> |
|
|
|
<span :class="titleIndex==1 ? 'tabbarItemActive' : 'tabbarItemNoActive'" |
|
|
|
@click='changePage(1)'>账号登录</span> |
|
|
|
<span style="color: #9c9fa4">|</span> |
|
|
|
<span :class="titleIndex==2 ? 'tabbarItemActive' : 'tabbarItemNoActive'" |
|
|
|
@click='changePage(2)'>忘记密码</span> |
|
|
|
</view> --> |
|
|
|
<view class="bottomTab"> |
|
|
|
<text |
|
|
|
:key="index" |
|
|
|
v-for="(item, index) in titleList" |
|
|
|
:class="{tabbarItemActive : titleIndex == index}" |
|
|
|
@click='changePage(index)'>{{ item }}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
@ -115,16 +121,17 @@ |
|
|
|
configPopup |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
this.titleIndex = option.index || 1 |
|
|
|
this.titleIndex = option.index || 0 |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
titleIndex: 0, |
|
|
|
titleList: ['注册', '登录', '重置密码'], |
|
|
|
titleList: ['登录', '注册'],//, '重置密码' |
|
|
|
checkboxValue: [], |
|
|
|
form: { |
|
|
|
account: '13135294009', |
|
|
|
password: 'lzx123456', |
|
|
|
image : '', |
|
|
|
account: '李靖1', |
|
|
|
password: '123456', |
|
|
|
}, |
|
|
|
form1: { |
|
|
|
userName: '', |
|
|
@ -137,6 +144,17 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 上传头像 |
|
|
|
upload(){ |
|
|
|
if(this.titleIndex != 1){ |
|
|
|
return |
|
|
|
} |
|
|
|
this.$Oss.ossUploadImage({ |
|
|
|
success : url => { |
|
|
|
this.form.image = url |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
submit(){ |
|
|
|
if(!this.checkboxValue.length){ |
|
|
|
return uni.showToast({ |
|
|
@ -152,7 +170,40 @@ |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.$store.commit('accountLogin', this.form) |
|
|
|
// 注册 |
|
|
|
if(this.titleIndex == 1){ |
|
|
|
|
|
|
|
if(this.$utils.verificationAll(this.form, { |
|
|
|
image: '请上传头像', |
|
|
|
})){ |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.$api('register', { |
|
|
|
name : this.form.account, |
|
|
|
password : this.form.password, |
|
|
|
image : this.form.image, |
|
|
|
}, res => { |
|
|
|
if(res.code == 200){ |
|
|
|
uni.showToast({ |
|
|
|
title: '注册成功,请登录', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
this.form = { |
|
|
|
image : '', |
|
|
|
account: '', |
|
|
|
password: '', |
|
|
|
} |
|
|
|
this.titleIndex = 0 |
|
|
|
} |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.$store.commit('accountLogin', { |
|
|
|
userName : this.form.account, |
|
|
|
password : this.form.password, |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 切换页面 |
|
|
|
changePage(index) { |
|
|
@ -224,7 +275,7 @@ |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
height: 10vh; |
|
|
|
|
|
|
|
|
|
|
|
>view:nth-of-type(1) { |
|
|
|
width: 25%; |
|
|
|
height: 100%; |
|
|
@ -257,7 +308,6 @@ |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
margin: 90rpx 0 0 0; |
|
|
|
|
|
|
|
.a { |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
@ -266,7 +316,6 @@ |
|
|
|
height: 80rpx; |
|
|
|
color: #FFF; |
|
|
|
background-color: $uni-color; |
|
|
|
border: 1px solid red; |
|
|
|
border-radius: 100rpx; |
|
|
|
font-size: 30rpx; |
|
|
|
} |
|
|
@ -274,18 +323,14 @@ |
|
|
|
|
|
|
|
.bottomTab { |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
height: 10vh; |
|
|
|
padding: 0 80rpx; |
|
|
|
justify-content: space-around; |
|
|
|
padding: 0 60rpx; |
|
|
|
margin-top: 30rpx; |
|
|
|
|
|
|
|
color: #9c9fa4; |
|
|
|
.tabbarItemActive { |
|
|
|
color: $uni-color; |
|
|
|
} |
|
|
|
|
|
|
|
.tabbarItemNoActive { |
|
|
|
color: #9c9fa4; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.forgetPassword { |
|
|
|