提交 6924a42d 编写于 作者: DCloud_JSON's avatar DCloud_JSON

调整密码登陆

上级 845d00d6
...@@ -15,8 +15,8 @@ module.exports = { ...@@ -15,8 +15,8 @@ module.exports = {
"router":{ "router":{
"needLogin":[ //配置需要路由拦截的页面地址,在打开这些页面之前会自动检查(不联网)uni_id_token的值是否存在/过期等 "needLogin":[ //配置需要路由拦截的页面地址,在打开这些页面之前会自动检查(不联网)uni_id_token的值是否存在/过期等
"/pages/ucenter/edit/edit", "/pages/ucenter/edit/edit",
"/pages/ucenter/settings/settings", "/uni_modules/uni-login-page/pages/index/pwd-retrieve",
"/uni_modules/uni-login-page/pages/index/pwd-retrieve" "/uni_modules/uni-id-users/pages/uni-id-users/edit"
], ],
"login":["univerify","smsCode","username","weixin","apple"] //默认就是短信验证码登陆 "login":["univerify","smsCode","username","weixin","apple"] //默认就是短信验证码登陆
}, },
......
<template> <template>
<view class="center"> <view class="center">
<view class="userInfo" @click="toSettings"> <view class="userInfo" @click="toEdit">
<image class="logo-img" :src="login ? (userInfo.avatar || avatarUrl) :avatarUrl"></image> <image class="logo-img" :src="login ? (userInfo.avatar || avatarUrl) :avatarUrl"></image>
<view class="logo-title"> <view class="logo-title">
<text class="uer-name">{{login ? userInfo.nickname||userInfo.username||userInfo.mobile : '未登录'}}</text> <text class="uer-name">{{login ? userInfo.nickname||userInfo.username||userInfo.mobile : '未登录'}}</text>
...@@ -83,6 +83,9 @@ ...@@ -83,6 +83,9 @@
}, { }, {
title: '关于', title: '关于',
to: '/pages/ucenter/about/about' to: '/pages/ucenter/about/about'
}, {
title: '设置',
to: '/pages/ucenter/settings/settings'
}] }]
] ]
} }
...@@ -103,8 +106,7 @@ ...@@ -103,8 +106,7 @@
login: 'user/hasLogin' login: 'user/hasLogin'
}) })
// #ifdef APP-PLUS // #ifdef APP-PLUS
, ,appVersion() {
appVersion() {
return getApp().appVersion return getApp().appVersion
} }
// #endif // #endif
...@@ -130,18 +132,11 @@ ...@@ -130,18 +132,11 @@
console.log(await callCheckVersion()); console.log(await callCheckVersion());
checkUpdate() checkUpdate()
}, },
goLogin() { toEdit() {
if (!this.login) { console.log('点击编辑信息');
console.log('点击前往登录'); uni.navigateTo({
uni.navigateTo({ url: '/uni_modules/uni-id-users/pages/uni-id-users/edit'
url: '/uni_modules/uni-login-page/pages/index/index' })
});
} else {
console.log('点击编辑信息');
uni.navigateTo({
url: './edit/edit'
})
}
}, },
tapGrid(index) { tapGrid(index) {
uni.showToast({ uni.showToast({
...@@ -173,7 +168,6 @@ ...@@ -173,7 +168,6 @@
* 获取积分信息 * 获取积分信息
*/ */
getScore() { getScore() {
if (!this.userInfo) return uni.showToast({ if (!this.userInfo) return uni.showToast({
title: '请登录后查看积分', title: '请登录后查看积分',
icon: 'none' icon: 'none'
......
export default function(){ export default function(){
if (uni.getSystemInfoSync().platform == "android") { if (uni.getSystemInfoSync().platform == "android") {
let iKnowAgree = uni.getStorageSync('iKnowAgree') || false; let userprotocol = uni.getStorageSync('userprotocol') || false;
if(!iKnowAgree){ if(!userprotocol){
uni.navigateTo({ uni.navigateTo({
url:'uni_modules/uni-agree/pages/uni-agree/uni-agree', url:'uni_modules/uni-agree/pages/uni-agree/uni-agree',
animationType:"none" animationType:"none"
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<uni-forms ref="form" :value="formData" :rules="rules"> <uni-forms ref="form" :value="formData" :rules="rules">
<uni-forms-item name="phone"> <uni-forms-item name="phone">
<uni-easyinput type="number" class="phone-input-box" :inputBorder="false" <uni-easyinput type="number" class="phone-input-box" :inputBorder="false"
v-model="formData.phone" maxlength="11" placeholder="请输入手机号/用户名/邮箱"> v-model="formData.phone" maxlength="11" placeholder="请输入手机号/用户名">
<template slot="left"> <template slot="left">
<!-- 当前仅支持中国大陆手机号 --> <!-- 当前仅支持中国大陆手机号 -->
<!-- <picker mode="selector" :range="phoneArea" @change="selectPhoneArea"> --> <!-- <picker mode="selector" :range="phoneArea" @change="selectPhoneArea"> -->
...@@ -20,15 +20,14 @@ ...@@ -20,15 +20,14 @@
<uni-easyinput type="password" class="phone-input-box" :inputBorder="false" <uni-easyinput type="password" class="phone-input-box" :inputBorder="false"
v-model="formData.pwd" placeholder="请输入密码"></uni-easyinput> v-model="formData.pwd" placeholder="请输入密码"></uni-easyinput>
</uni-forms-item> </uni-forms-item>
<button class="send-btn-box" :disabled="!canLogin" :type="canLogin?'primary':'default'" <button class="send-btn-box" type="primary" @click="pwdLogin">登录</button>
@click="pwdLogin">登录</button>
</uni-forms> </uni-forms>
<!-- 忘记密码 --> <!-- 忘记密码 -->
<view class="auth-box"> <view class="auth-box">
<text class="login-text login-text-sub">忘记了?</text> <text class="login-text" @click="toRetrievePwd">忘记密码</text>
<text class="login-text" @click="toRetrievePwd">找回密码</text> <text class="login-text" @click="toRetrievePwd">注册账号</text>
</view> </view>
<button type="primary" class="toRegister" @click="toRegister">注册账号</button> <!-- <button type="primary" plain class="toRegister" @click="toRegister">注册账号</button> -->
</view> </view>
</view> </view>
<uni-quick-login ref="uniQuickLogin"></uni-quick-login> <uni-quick-login ref="uniQuickLogin"></uni-quick-login>
...@@ -132,8 +131,8 @@ ...@@ -132,8 +131,8 @@
margin-top: 20rpx; margin-top: 20rpx;
} }
.auth-box { .auth-box {
justify-content: flex-start; justify-content: space-between;
margin-top: 20rpx; margin-top: 20px;
} }
.login-text-sub { .login-text-sub {
color: #8a8f8b; color: #8a8f8b;
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
<uni-forms-item name="username" label="用户名" required> <uni-forms-item name="username" label="用户名" required>
<uni-easyinput placeholder="请输入用户名" v-model="formData.username" trim="both" /> <uni-easyinput placeholder="请输入用户名" v-model="formData.username" trim="both" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item name="gender" label="性别">
<uni-data-checkbox v-model="formData.gender" :localdata="formOptions.gender_localdata" />
</uni-forms-item>
<uni-forms-item name="nickname" label="昵称"> <uni-forms-item name="nickname" label="昵称">
<uni-easyinput placeholder="请输入用户昵称" v-model="formData.nickname" trim="both" /> <uni-easyinput placeholder="请输入用户昵称" v-model="formData.nickname" trim="both" />
</uni-forms-item> </uni-forms-item>
...@@ -32,25 +29,10 @@ import mixin from '../../common/loginPage.mixin.js'; ...@@ -32,25 +29,10 @@ import mixin from '../../common/loginPage.mixin.js';
return { return {
formData: { formData: {
"username": "", "username": "",
"gender": 0,
"nickname": "", "nickname": "",
'password':'', 'password':'',
'pwd2':'' 'pwd2':''
}, },
formOptions: {
"gender_localdata": [{
"text": "未知",
"value": 0
}, {
"text": "",
"value": 1
},
{
"text": "",
"value": 2
}
]
},
rules rules
} }
}, },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册