@ -1,176 +0,0 @@ |
|||||||
<template> |
|
||||||
<view class="container"> |
|
||||||
|
|
||||||
<view class="input_box"> |
|
||||||
<text class="input_title">{{$t('pages.user.auth.login.mobile')}}</text> |
|
||||||
<view class="input_content"> |
|
||||||
<u--input |
|
||||||
:placeholder="$t('pages.user.auth.login.input_mobile')" |
|
||||||
prefixIcon="phone" |
|
||||||
prefixIconStyle="font-size: 24rpx;color: #909399" |
|
||||||
v-model="form.mobile" |
|
||||||
@change="mobileChange" |
|
||||||
></u--input> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class="input_box"> |
|
||||||
<text class="input_title">{{$t('pages.user.auth.login.password')}}</text> |
|
||||||
<view class="input_content"> |
|
||||||
<u--input |
|
||||||
:placeholder="$t('pages.user.auth.login.input_password')" |
|
||||||
prefixIcon="lock" |
|
||||||
prefixIconStyle="font-size: 24rpx;color: #909399" |
|
||||||
border="surround" |
|
||||||
password |
|
||||||
clearable |
|
||||||
v-model="form.password" |
|
||||||
@change="pwdChange" |
|
||||||
></u--input> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class="button_box"> |
|
||||||
<view class="submit"> |
|
||||||
<u-button type="primary" :plain="true" :hairline="true" :text="$t('locale.login')" size="normal" @click="login"></u-button> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
<view class="footer"> |
|
||||||
<!-- <text class="footer-text">找回密码</text> --> |
|
||||||
<text class="footer-text" @click="regist">{{$t('locale.regist')}}</text> |
|
||||||
<!-- <text class="footer-text">投诉建议</text> --> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
</template> |
|
||||||
<script> |
|
||||||
export default { |
|
||||||
components: { |
|
||||||
|
|
||||||
}, |
|
||||||
data() { |
|
||||||
return { |
|
||||||
|
|
||||||
form:{ |
|
||||||
mobile:'', |
|
||||||
password:'', |
|
||||||
}, |
|
||||||
}; |
|
||||||
}, |
|
||||||
onShow() { |
|
||||||
var _this =this; |
|
||||||
|
|
||||||
}, |
|
||||||
methods:{ |
|
||||||
//跳转到注册 |
|
||||||
regist(){ |
|
||||||
uni.$u.route({ |
|
||||||
type:'redirectTo', |
|
||||||
url: 'pages/user/auth/regist', |
|
||||||
params: {} |
|
||||||
}); |
|
||||||
}, |
|
||||||
//手机号 |
|
||||||
mobileChange(e) |
|
||||||
{ |
|
||||||
var _this = this; |
|
||||||
_this.form['mobile'] = e; |
|
||||||
|
|
||||||
}, |
|
||||||
//密码 |
|
||||||
pwdChange(e) |
|
||||||
{ |
|
||||||
var _this = this; |
|
||||||
_this.form['password'] = e; |
|
||||||
}, |
|
||||||
login(){ |
|
||||||
var _this =this; |
|
||||||
var form = _this.form; |
|
||||||
if(!_this.$com.check(form.mobile,'mobile')) |
|
||||||
{ |
|
||||||
uni.$u.toast(_this.$t('pages.user.auth.login.mobile_must')); |
|
||||||
return false; |
|
||||||
} |
|
||||||
if(form.password.length < 6) |
|
||||||
{ |
|
||||||
uni.$u.toast(_this.$t('pages.user.auth.login.password_must')); |
|
||||||
return false; |
|
||||||
} |
|
||||||
|
|
||||||
var post = form; |
|
||||||
_this.$api.post('user/log',post,function(rs){ |
|
||||||
console.log(rs); |
|
||||||
_this.$user.session('userInfo',rs.userinfo); |
|
||||||
_this.$user.session('token',rs.token); |
|
||||||
uni.$u.route({ |
|
||||||
type:'navigateBack', |
|
||||||
delta:2, |
|
||||||
params: {} |
|
||||||
}); |
|
||||||
},function(err){ |
|
||||||
console.log(err); |
|
||||||
}); |
|
||||||
}, |
|
||||||
|
|
||||||
}, |
|
||||||
}; |
|
||||||
</script> |
|
||||||
|
|
||||||
<style scoped lang="scss"> |
|
||||||
/*输入框*/ |
|
||||||
.input_box{ |
|
||||||
width: 90%; |
|
||||||
margin: 40rpx auto 40rpx auto; |
|
||||||
height: auto; |
|
||||||
} |
|
||||||
.input_title{ |
|
||||||
font-size: 30rpx; |
|
||||||
color: #ABABAB; |
|
||||||
height: 50rpx; |
|
||||||
line-height: 50rpx; |
|
||||||
margin: 10rpx auto; |
|
||||||
display: block; |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
.button_box { |
|
||||||
width: 90%; |
|
||||||
margin: 40rpx auto 20rpx auto; |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
.submit { |
|
||||||
width: 100%; |
|
||||||
background-color: #4CAF50; |
|
||||||
justify-content: center; |
|
||||||
align-items: center; |
|
||||||
border-radius: 10rpx; |
|
||||||
} |
|
||||||
|
|
||||||
.submit-text { |
|
||||||
color: white; |
|
||||||
padding: 30rpx; |
|
||||||
} |
|
||||||
|
|
||||||
.submit:active { |
|
||||||
background-color: green; |
|
||||||
opacity: 0.5; |
|
||||||
} |
|
||||||
|
|
||||||
.footer { |
|
||||||
flex-direction: row; |
|
||||||
justify-content: center; |
|
||||||
text-align: center; |
|
||||||
align-items: center; |
|
||||||
margin-top: 100rpx; |
|
||||||
} |
|
||||||
|
|
||||||
.footer-text { |
|
||||||
font-size: 28rpx; |
|
||||||
color: #296db5; |
|
||||||
padding: 30rpx; |
|
||||||
} |
|
||||||
</style> |
|
@ -1,205 +0,0 @@ |
|||||||
<template> |
|
||||||
<view class="container"> |
|
||||||
|
|
||||||
<view class="input_box"> |
|
||||||
<text class="input_title">{{$t('pages.user.auth.login.mobile')}}</text> |
|
||||||
<view class="input_content"> |
|
||||||
<u--input |
|
||||||
:placeholder="$t('pages.user.auth.login.input_mobile')" |
|
||||||
prefixIcon="phone" |
|
||||||
prefixIconStyle="font-size: 24rpx;color: #909399" |
|
||||||
type="number" |
|
||||||
v-model="form.mobile" |
|
||||||
@change="mobileChange" |
|
||||||
></u--input> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class="input_box"> |
|
||||||
<text class="input_title">{{$t('pages.user.auth.login.password')}}</text> |
|
||||||
<view class="input_content"> |
|
||||||
<u--input |
|
||||||
:placeholder="$t('pages.user.auth.login.input_password')" |
|
||||||
prefixIcon="lock" |
|
||||||
prefixIconStyle="font-size: 24rpx;color: #909399" |
|
||||||
border="surround" |
|
||||||
password |
|
||||||
clearable |
|
||||||
v-model="form.password" |
|
||||||
@change="pwdChange" |
|
||||||
></u--input> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
|
|
||||||
<view class="input_box"> |
|
||||||
<text class="input_title">{{$t('pages.user.auth.login.email')}}</text> |
|
||||||
<view class="input_content"> |
|
||||||
<u--input |
|
||||||
:placeholder="$t('pages.user.auth.login.input_email')" |
|
||||||
prefixIcon="email" |
|
||||||
prefixIconStyle="font-size: 24rpx;color: #909399" |
|
||||||
v-model="form.email" |
|
||||||
@change="emailChange" |
|
||||||
></u--input> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
|
|
||||||
<view class="button_box"> |
|
||||||
<view class="submit"> |
|
||||||
<u-button type="primary" :plain="true" :hairline="true" :text="$t('locale.regist')" size="normal" @click="regist"></u-button> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
<view class="footer"> |
|
||||||
<!-- <text class="footer-text">找回密码</text> --> |
|
||||||
<text class="footer-text" @click="login">{{$t('locale.login')}}</text> |
|
||||||
<!-- <text class="footer-text">投诉建议</text> --> |
|
||||||
</view> |
|
||||||
</view> |
|
||||||
</template> |
|
||||||
<script> |
|
||||||
export default { |
|
||||||
components: { |
|
||||||
|
|
||||||
}, |
|
||||||
data() { |
|
||||||
return { |
|
||||||
form:{ |
|
||||||
mobile:'', |
|
||||||
password:'', |
|
||||||
email:'', |
|
||||||
}, |
|
||||||
|
|
||||||
}; |
|
||||||
}, |
|
||||||
onShow() { |
|
||||||
var _this =this; |
|
||||||
|
|
||||||
}, |
|
||||||
methods:{ |
|
||||||
//跳转到登录 |
|
||||||
login(){ |
|
||||||
uni.$u.route({ |
|
||||||
type:'redirectTo', |
|
||||||
url: 'pages/user/auth/login', |
|
||||||
params: {} |
|
||||||
}); |
|
||||||
}, |
|
||||||
//手机号 |
|
||||||
mobileChange(e) |
|
||||||
{ |
|
||||||
var _this = this; |
|
||||||
_this.form['mobile'] = e; |
|
||||||
|
|
||||||
}, |
|
||||||
//密码 |
|
||||||
pwdChange(e) |
|
||||||
{ |
|
||||||
var _this = this; |
|
||||||
_this.form['password'] = e; |
|
||||||
}, |
|
||||||
//email |
|
||||||
emailChange(e) |
|
||||||
{ |
|
||||||
var _this = this; |
|
||||||
_this.form['email'] = e; |
|
||||||
}, |
|
||||||
regist() |
|
||||||
{ |
|
||||||
var _this =this; |
|
||||||
var form = _this.form; |
|
||||||
if(!_this.$com.check(form.mobile,'mobile')) |
|
||||||
{ |
|
||||||
uni.$u.toast(_this.$t('pages.user.auth.login.mobile_must')); |
|
||||||
return false; |
|
||||||
} |
|
||||||
if(form.password.length < 6) |
|
||||||
{ |
|
||||||
uni.$u.toast(_this.$t('pages.user.auth.login.password_must')); |
|
||||||
return false; |
|
||||||
} |
|
||||||
if(!_this.$com.check(form.email,'email')) |
|
||||||
{ |
|
||||||
uni.$u.toast(_this.$t('pages.user.auth.login.email_must')); |
|
||||||
return false; |
|
||||||
} |
|
||||||
|
|
||||||
var post = form; |
|
||||||
_this.$api.post('user/reg',post,function(rs){ |
|
||||||
console.log(rs); |
|
||||||
uni.showModal({ |
|
||||||
title: _this.$t('locale.tips'), |
|
||||||
content: _this.$t('pages.user.auth.regist.regist_success'), |
|
||||||
success: function (res) { |
|
||||||
if (res.confirm) { |
|
||||||
console.log('用户点击确定'); |
|
||||||
_this.login(); |
|
||||||
} else if (res.cancel) { |
|
||||||
console.log('用户点击取消'); |
|
||||||
} |
|
||||||
} |
|
||||||
}); |
|
||||||
},function(err){ |
|
||||||
console.log(err); |
|
||||||
}); |
|
||||||
}, |
|
||||||
}, |
|
||||||
}; |
|
||||||
</script> |
|
||||||
|
|
||||||
<style scoped lang="scss"> |
|
||||||
/*输入框*/ |
|
||||||
.input_box{ |
|
||||||
width: 90%; |
|
||||||
margin: 40rpx auto 40rpx auto; |
|
||||||
height: auto; |
|
||||||
} |
|
||||||
.input_title{ |
|
||||||
font-size: 30rpx; |
|
||||||
color: #ABABAB; |
|
||||||
height: 50rpx; |
|
||||||
line-height: 50rpx; |
|
||||||
margin: 10rpx auto; |
|
||||||
display: block; |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
.button_box { |
|
||||||
width: 90%; |
|
||||||
margin: 40rpx auto 20rpx auto; |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
.submit { |
|
||||||
width: 100%; |
|
||||||
background-color: #4CAF50; |
|
||||||
justify-content: center; |
|
||||||
align-items: center; |
|
||||||
border-radius: 10rpx; |
|
||||||
} |
|
||||||
|
|
||||||
.submit-text { |
|
||||||
color: white; |
|
||||||
padding: 30rpx; |
|
||||||
} |
|
||||||
|
|
||||||
.submit:active { |
|
||||||
background-color: green; |
|
||||||
opacity: 0.5; |
|
||||||
} |
|
||||||
|
|
||||||
.footer { |
|
||||||
flex-direction: row; |
|
||||||
justify-content: center; |
|
||||||
text-align: center; |
|
||||||
align-items: center; |
|
||||||
margin-top: 100rpx; |
|
||||||
} |
|
||||||
|
|
||||||
.footer-text { |
|
||||||
font-size: 28rpx; |
|
||||||
color: #296db5; |
|
||||||
padding: 30rpx; |
|
||||||
} |
|
||||||
</style> |
|
Before Width: | Height: | Size: 750 B |
Before Width: | Height: | Size: 733 B |
Before Width: | Height: | Size: 93 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 721 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 805 B |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 7.8 KiB |