Commit 8848772d authored by linxin's avatar linxin

升级登录注册

parent 93c344c3
...@@ -207,7 +207,7 @@ export default { ...@@ -207,7 +207,7 @@ export default {
let url = process.env.basePath + 'do_car_confirm' let url = process.env.basePath + 'do_car_confirm'
let param = { let param = {
master: { master: {
contract_id: '123', project_id: this.$route.params.project_id,
confirm_status: 'APPROVED', confirm_status: 'APPROVED',
}, },
} }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
:updateData="[showList]" :updateData="[showList]"
:pullUp="true" :pullUp="true"
> >
<div v-for="(item,index) in showList" :key="index" class="item" @click="changePage(item.project_id)"> <div v-for="(item,index) in showList" :key="index" class="item" @click="changePage(item)">
<div class="left"> <div class="left">
<span> <span>
<img src="@/assets/contractStart/icon.png" > <img src="@/assets/contractStart/icon.png" >
...@@ -107,7 +107,7 @@ export default { ...@@ -107,7 +107,7 @@ export default {
this.$router.push({ this.$router.push({
name: 'ConfirmDetail', name: 'ConfirmDetail',
params: { params: {
project_id: e, project_id: e.project_id,
}, },
}) })
}, },
......
<template> <template>
<scroll id="login" ref="scroll" class="content"> <scroll id="login" ref="scroll" class="content">
<div class="bird-icon"/> <div class="bird-icon" />
<div class="login-wrap"> <div class="login-wrap">
<img class="title" src="../assets/login/title.png" >
<div class="pwd"> <div class="pwd">
<div class="pwd-icon"><img src="../assets/login/user.png"></div> <div class="pwd-input">
<div class="pwd-input"><input v-model="username" type="text" placeholder="请输入用户名/手机号"></div> <input v-model="username" class="user" type="text" placeholder="请输入用户名/手机号" >
<div v-if="username" class="delete" @click="clearAccount"><img src="../assets/login/delete.png"></div> </div>
<div v-if="username" class="delete" @click="clearAccount">
<img src="../assets/login/login-delete.png" >
</div>
</div> </div>
<div class="pwd"> <div class="pwd">
<div class="pwd-icon"><img src="../assets/login/password.png"></div> <div class="pwd-input">
<div class="pwd-input"><input id="passwordInput" v-model="password" :type="pwdType" placeholder="请输入密码"></div> <input id="passwordInput" v-model="password" :type="pwdType" placeholder="请输入密码" >
<div v-if="password" class="delete" @click="changeType"><img :src="openEye"></div> </div>
<div v-if="password" class="delete" @click="changeType">
<img :src="openEye" >
</div>
</div> </div>
<div class="button submit" @click="access">登录</div>
<div class="other-function"> <div class="other-function">
<div class="register" @click="registerNew">注册</div> <div class="register" @click="registerNew">注册</div>
<div class="pwd-forgotten" @click="pwdForgotten">忘记密码?</div> <div class="pwd-forgotten" @click="pwdForgotten">忘记密码?</div>
</div> </div>
<div class="button submit" @click="access">登录</div>
</div> </div>
</scroll> </scroll>
</template> </template>
...@@ -28,8 +34,10 @@ export default { ...@@ -28,8 +34,10 @@ export default {
data () { data () {
return { return {
pwdType: 'password', // 密码类型 pwdType: 'password', // 密码类型
openEye: require('@/assets/login/passNoShow.png'), // 图片地址 openEye: require('@/assets/login/pwd.png'), // 图片地址
username: window.localStorage.username ? window.localStorage.username : '', username: window.localStorage.username
? window.localStorage.username
: '',
password: '', password: '',
version: process.env.currentVersion, version: process.env.currentVersion,
routeName: this.$route.params.routeName || '', routeName: this.$route.params.routeName || '',
...@@ -42,19 +50,23 @@ export default { ...@@ -42,19 +50,23 @@ export default {
}, },
methods: { methods: {
changeType () { changeType () {
this.pwdType = this.pwdType === 'password' ? 'text' : 'password' this.pwdType = this.pwdType === 'password' ? 'text' : 'password';
this.openEye = this.pwdType === 'password' ? require('@/assets/login/passNoShow.png') : require('@/assets/login/passShow.png') this.openEye =
this.pwdType === 'password'
? require('@/assets/login/passNoShow.png')
: require('@/assets/login/passShow.png')
}, },
login: function () { login: function () {
let vm = this let vm = this
// vm.password = CryptoJS.MD5(vm.password).toString().toUpperCase(); // vm.password = CryptoJS.MD5(vm.password).toString().toUpperCase();
let md5passwprd = CryptoJS.MD5(vm.password).toString().toUpperCase() let md5passwprd = CryptoJS.MD5(vm.password)
.toString()
.toUpperCase()
let param = { let param = {
'phone': vm.username, phone: vm.username,
'password': md5passwprd, password: md5passwprd,
} }
vm.$post(process.env.basePath + 'app_login', param) vm.$post(process.env.basePath + 'app_login', param).then(function (res) {
.then(function (res) {
if (res.result === 'S' && res.info.login_flag === 'Y') { if (res.result === 'S' && res.info.login_flag === 'Y') {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
window.localStorage.setItem('user_phone', vm.username) window.localStorage.setItem('user_phone', vm.username)
...@@ -88,7 +100,7 @@ export default { ...@@ -88,7 +100,7 @@ export default {
} else if (!vm.password || vm.password === undefined) { } else if (!vm.password || vm.password === undefined) {
vm.hlsPopup.showLongCenter('请输入密码') vm.hlsPopup.showLongCenter('请输入密码')
} else { } else {
let url = process.env.loginPath + 'admin' let url = process.env.loginPath + 'admin';
let param = {} let param = {}
vm.hlsPopup.showLoading('请稍等') vm.hlsPopup.showLoading('请稍等')
vm.$post(url, param).then(function (res) { vm.$post(url, param).then(function (res) {
...@@ -105,42 +117,55 @@ export default { ...@@ -105,42 +117,55 @@ export default {
this.$router.push('pwd-forgot') this.$router.push('pwd-forgot')
}, },
clearAccount: function () { clearAccount: function () {
this.username = '' this.username = '';
this.password = '' this.password = '';
}, },
clearPassword: function () { clearPassword: function () {
this.password = '' this.password = '';
}, },
}, },
} }
</script> </script>
<style lang="less" scoped type="text/less"> <style lang="less" scoped type="text/less">
#login { #login {
background: url("../assets/login/bg@2x.png") no-repeat; background: url("../assets/login/back.png") no-repeat;
background-size: cover; background-size: 100% 100%;
background-position-x: 0px; background-position-x: 0px;
color: #FFFFFF; color: #ffffff;
width: 100%; width: 100%;
height: 100%; height: 100%;
margin: 0 auto; margin: 0 auto;
.scrollContent{ .scrollContent {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.bird-icon{ .bird-icon {
padding-top: 20%; padding-top: 30%;
background: url("../assets/login/right.png") 90% no-repeat;
background-size: 51px 25px;
}
.login-wrap {
width: 87%;
height: 355px;
margin: 0 auto;
background-color: #fff;
border-radius: 8px;
margin-top: 15%;
padding: 32px 24px;
.title {
width: 227px;
height: 71px;
margin-left: -10px;
} }
.login-wrap{
width: 100%;
margin-top: 60%;
} }
.pwd { .pwd {
border-bottom: 1px solid #5D98F6; position: relative;
width: 279px;
margin: 0 auto;
display: flex; display: flex;
display: -webkit-flex; display: -webkit-flex;
margin: 5% 0 5% 14%;
.pwd-icon { .pwd-icon {
margin-top: 2px; margin-top: 2px;
margin-right: 6px; margin-right: 6px;
...@@ -151,61 +176,69 @@ export default { ...@@ -151,61 +176,69 @@ export default {
} }
} }
.pwd-input { .pwd-input {
margin-left: 4%;
width: 100%; width: 100%;
margin-bottom: 10px; .user {
display: flex; background: url("../assets/login/phone.png") 2px 2px no-repeat;
display: -webkit-flex; background-size: 25px 25px;
align-items: center; }
-webkit-align-items: center; #passwordInput {
// background-color: #0057C3 !important; background: url("../assets/login/passwordConfirm.png") 2px 2px no-repeat;
background-size: 25px 25px;
}
input { input {
width: 100%; width: 100%;
height: 100%; text-indent: 30px;
font-size: 16px; font-family: PingFangSC-Regular;
color: #fff; font-size: 14px;
line-height: 22px; color: #2a2a2a;
background-color: rgba(0,87,195,0) !important; height: 35px;
display: flex;
align-items: center;
border-bottom: 1px solid rgba(42, 42, 42, 0.4);
margin-top: 30px;
}
input:focus {
border-bottom: 1px solid #1d3fff;
} }
input::-webkit-input-placeholder { input::-webkit-input-placeholder {
font-size: 16px; font-family: PingFangSC-Regular;
color: #CDD1D3; font-size: 14px;
color: rgba(75, 74, 75, 0.4);
} }
} }
.delete { .delete {
position: absolute;
right: -15px;
top: 30px;
img { img {
margin-right: 20px; margin-right: 20px;
margin-top: 5px; margin-top: 5px;
width: 14px; width: 20px;
height: 14px; // height: 14px;
} }
} }
} }
.other-function { .other-function {
width: 64%; width: 279px;
margin: 0 auto;
display: flex; display: flex;
font-family: PingFangSC-Regular;
font-size: 13px;
color: #1d3fff;
margin-top: 8px;
font-weight: 500;
display: -webkit-flex; display: -webkit-flex;
justify-content: space-between; justify-content: space-between;
-webkit-justify-content: space-between; -webkit-justify-content: space-between;
margin: 0 0 0 23%;
.register {
color: #FDFDFD;
font-size: 15px;
}
.pwd-forgotten {
color: #FDFDFD;
font-size: 15px;
}
} }
.submit { .submit {
background: #1d3fff;
opacity: 1; border-radius: 4px;
background: #FDFDFD; width: 279px;
border-radius: 8px 0 0 8px; margin-top: 32px;
height: 50px; height: 49px;
margin: 10% 0 6% 14%; font-size: 16px;
font-size:16px; color: #fff;
color: #000000;
display: flex; display: flex;
display: -webkit-flex; display: -webkit-flex;
justify-content: center; justify-content: center;
...@@ -215,8 +248,8 @@ export default { ...@@ -215,8 +248,8 @@ export default {
&.activated { &.activated {
opacity: 0.8; opacity: 0.8;
-webkit-transform: scale(1, 1); -webkit-transform: scale(1, 1);
transform: scale(1, 1) transform: scale(1, 1);
}
} }
} }
}
</style> </style>
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</template> </template>
<script> <script>
var CryptoJS = require('crypto-js') var CryptoJS = require('crypto-js')
export default { export default {
data () { data () {
return { return {
...@@ -167,7 +167,7 @@ export default { ...@@ -167,7 +167,7 @@ export default {
let md5passwprd = CryptoJS.MD5(vm.user_password).toString().toUpperCase() let md5passwprd = CryptoJS.MD5(vm.user_password).toString().toUpperCase()
let params = { let params = {
phone: vm.phone_number, phone: vm.phone_number,
password: md5passwprd password: md5passwprd,
} }
hlsHttp.post(url, params).then(function (res) { hlsHttp.post(url, params).then(function (res) {
if (res.result === 'S') { if (res.result === 'S') {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment