|
|
@ -1,62 +1,43 @@ |
|
|
|
<template> |
|
|
|
<view class="login"> |
|
|
|
<!-- <view class="logo"> |
|
|
|
<image :src="configList.logo_image" mode=""></image> |
|
|
|
</view> --> |
|
|
|
<view class="title"> |
|
|
|
{{ configList.logo_name }} |
|
|
|
|
|
|
|
<view class="logo"> |
|
|
|
<!-- 后续改回接口获取 --> |
|
|
|
<image src="../static/auth/logo.png" mode=""></image> |
|
|
|
<view class="text"> |
|
|
|
{{ configList.logo_name }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="title"> |
|
|
|
申请获取你的头像、昵称 |
|
|
|
</view> |
|
|
|
|
|
|
|
<button class="chooseAvatar" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"> |
|
|
|
<view class="line"> |
|
|
|
<view class=""> |
|
|
|
<view class="form"> |
|
|
|
<view class="form-item"> |
|
|
|
<view class="label"> |
|
|
|
头像 |
|
|
|
</view> |
|
|
|
<view class=""> |
|
|
|
<image :src="userInfoForm.headImage" v-if="userInfoForm.headImage" style="width: 60rpx;height: 60rpx;" |
|
|
|
mode=""></image> |
|
|
|
<view class="content"> |
|
|
|
<button class="btn-avatar" :plain="true" :hairline="false" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"> |
|
|
|
<image :src="userInfoForm.headImage" v-if="userInfoForm.headImage" class="avatar" |
|
|
|
mode=""></image> |
|
|
|
|
|
|
|
<image src="../static/auth/headImage.png" v-else style="width: 50rpx;height: 50rpx;" mode=""></image> |
|
|
|
<image src="../static/auth/headImage.png" v-else class="avatar" mode=""></image> |
|
|
|
</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</button> |
|
|
|
<view class="line"> |
|
|
|
<view class=""> |
|
|
|
昵称 |
|
|
|
</view> |
|
|
|
<view class=""> |
|
|
|
<input type="nickname" placeholder="请输入昵称" style="text-align: right;" id="nickName" |
|
|
|
v-model="userInfoForm.nickName" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="line"> |
|
|
|
<view class=""> |
|
|
|
手机号 |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="" |
|
|
|
v-if="userInfoForm.phone"> |
|
|
|
<input placeholder="请输入手机号" style="text-align: right;" |
|
|
|
disabled |
|
|
|
v-model="userInfoForm.phone" /> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="" |
|
|
|
v-else> |
|
|
|
<button |
|
|
|
class="getPhoneNumber" |
|
|
|
open-type="getPhoneNumber" |
|
|
|
@getphonenumber="getPhone"> |
|
|
|
获取电话号码 |
|
|
|
</button> |
|
|
|
<view class="form-item"> |
|
|
|
<view class="label"> |
|
|
|
昵称 |
|
|
|
</view> |
|
|
|
<view class="content"> |
|
|
|
<input type="nickname" placeholder="请输入昵称" style="text-align: right;" id="nickName" |
|
|
|
v-model="userInfoForm.nickName" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="btn" @click="submit"> |
|
|
|
确认 |
|
|
|
</view> |
|
|
@ -70,13 +51,11 @@ |
|
|
|
userInfoForm: { |
|
|
|
headImage: '', |
|
|
|
nickName: '', |
|
|
|
phone : '', |
|
|
|
} |
|
|
|
}; |
|
|
|
}, |
|
|
|
onShow() {}, |
|
|
|
onLoad() { |
|
|
|
this.userInfoForm.phone = this.userInfo.phone || '' |
|
|
|
this.userInfoForm.nickName = this.userInfo.nickName || '' |
|
|
|
this.userInfoForm.headImage = this.userInfo.headImage || '' |
|
|
|
}, |
|
|
@ -88,23 +67,6 @@ |
|
|
|
this.userInfoForm.headImage = url |
|
|
|
}) |
|
|
|
}, |
|
|
|
getPhone(e){ |
|
|
|
this.$api('bindPhone', { |
|
|
|
phoneCode : e.detail.code |
|
|
|
}, res => { |
|
|
|
if(res.code == 200){ |
|
|
|
let phoneObj = JSON.parse(res.result) |
|
|
|
if(phoneObj.errmsg == 'ok'){ |
|
|
|
this.userInfoForm.phone = phoneObj.phone_info.phoneNumber |
|
|
|
}else{ |
|
|
|
uni.showModal({ |
|
|
|
title: phoneObj.errmsg |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log(phoneObj); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
submit() { |
|
|
|
let self = this |
|
|
|
|
|
|
@ -120,7 +82,6 @@ |
|
|
|
if (self.$utils.verificationAll(self.userInfoForm, { |
|
|
|
headImage: '请选择头像', |
|
|
|
nickName: '请填写昵称', |
|
|
|
phone: '请填写昵称', |
|
|
|
})) { |
|
|
|
return |
|
|
|
} |
|
|
@ -128,7 +89,6 @@ |
|
|
|
self.$api('updateInfo', { |
|
|
|
avatarUrl : self.userInfoForm.headImage, |
|
|
|
nickName : self.userInfoForm.nickName, |
|
|
|
phone : self.userInfoForm.phone, |
|
|
|
}, res => { |
|
|
|
if (res.code == 200) { |
|
|
|
uni.reLaunch({ |
|
|
@ -146,66 +106,117 @@ |
|
|
|
<style lang="scss" scoped> |
|
|
|
.login { |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
justify-content: center; |
|
|
|
justify-content: flex-start; |
|
|
|
align-items: center; |
|
|
|
height: 80vh; |
|
|
|
height: 100vh; |
|
|
|
flex-direction: column; |
|
|
|
position: relative; |
|
|
|
|
|
|
|
background: $uni-bg-color; |
|
|
|
|
|
|
|
.logo{ |
|
|
|
height: 140rpx; |
|
|
|
width: 140rpx; |
|
|
|
margin-top: 334rpx; |
|
|
|
width: 320rpx; |
|
|
|
image{ |
|
|
|
height: 140rpx; |
|
|
|
width: 140rpx; |
|
|
|
border-radius: 30rpx; |
|
|
|
height: 150rpx; |
|
|
|
width: 320rpx; |
|
|
|
} |
|
|
|
.text{ |
|
|
|
margin-top: 90rpx; |
|
|
|
font-size: 38rpx; |
|
|
|
font-family: PingFang SC, PingFang SC-Bold; |
|
|
|
font-weight: 700; |
|
|
|
text-align: center; |
|
|
|
color: #000000; |
|
|
|
} |
|
|
|
margin-bottom: 20rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.title { |
|
|
|
line-height: 45rpx; |
|
|
|
font-weight: 900; |
|
|
|
margin-top: 48rpx; |
|
|
|
font-size: 32rpx; |
|
|
|
font-family: PingFang SC, PingFang SC-Regular; |
|
|
|
font-weight: 400; |
|
|
|
color: #000000; |
|
|
|
} |
|
|
|
|
|
|
|
.line { |
|
|
|
.form { |
|
|
|
margin-top: 45rpx; |
|
|
|
width: 100%; |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
flex-direction: column; |
|
|
|
align-items: center; |
|
|
|
width: 80%; |
|
|
|
border-bottom: 1px solid #00000023; |
|
|
|
padding: 30rpx 0; |
|
|
|
margin: 0 auto; |
|
|
|
} |
|
|
|
|
|
|
|
.chooseAvatar { |
|
|
|
width: 100%; |
|
|
|
padding: 0; |
|
|
|
margin: 0; |
|
|
|
margin-top: 10vh; |
|
|
|
border: none; |
|
|
|
.form-item { |
|
|
|
width: 85%; |
|
|
|
display: flex; |
|
|
|
align-items: baseline; |
|
|
|
padding: 11rpx 23rpx; |
|
|
|
|
|
|
|
position: relative; |
|
|
|
|
|
|
|
&::after { |
|
|
|
position: absolute; |
|
|
|
bottom: 0; |
|
|
|
left: 0; |
|
|
|
content: " "; |
|
|
|
width: 100%; |
|
|
|
height: 1rpx; |
|
|
|
border-top: 1px solid rgba(112, 112, 112, 0.35); |
|
|
|
transform: scaleY(.5); |
|
|
|
} |
|
|
|
|
|
|
|
.label { |
|
|
|
width: 60rpx; |
|
|
|
font-size: 30rpx; |
|
|
|
font-family: SimSun, SimSun-Regular; |
|
|
|
font-weight: 400; |
|
|
|
text-align: left; |
|
|
|
color: #000000; |
|
|
|
} |
|
|
|
|
|
|
|
.content { |
|
|
|
flex: 1; |
|
|
|
text-align: right; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.form-item + .form-item { |
|
|
|
margin-top: 50rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.btn-avatar { |
|
|
|
background: transparent; |
|
|
|
border: none; |
|
|
|
border-radius: none; |
|
|
|
box-shadow: none; |
|
|
|
padding: 0; |
|
|
|
margin: 0; |
|
|
|
font-size: 0; |
|
|
|
text-align: right; |
|
|
|
} |
|
|
|
|
|
|
|
.avatar { |
|
|
|
width: 70rpx; |
|
|
|
height: 70rpx; |
|
|
|
margin-right: 63rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.btn { |
|
|
|
// background: $uni-linear-gradient-btn-color; |
|
|
|
background: $uni-color; |
|
|
|
color: #fff; |
|
|
|
width: 80%; |
|
|
|
padding: 20rpx 0; |
|
|
|
text-align: center; |
|
|
|
border-radius: 15rpx; |
|
|
|
margin-top: 10vh; |
|
|
|
} |
|
|
|
.getPhoneNumber{ |
|
|
|
// all: unset; |
|
|
|
margin-top: 155rpx; |
|
|
|
|
|
|
|
width: 80%; |
|
|
|
height: 100rpx; |
|
|
|
border-radius: 50rpx; |
|
|
|
background-color: #B3997E; |
|
|
|
color: #fff; |
|
|
|
|
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
// background: $uni-linear-gradient-btn-color; |
|
|
|
background: $uni-color; |
|
|
|
color: #fff; |
|
|
|
width: 200rpx; |
|
|
|
height: 60rpx; |
|
|
|
border-radius: 30rpx; |
|
|
|
font-size: 24rpx; |
|
|
|
border-radius: 50rpx; |
|
|
|
border: none; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |