|
@@ -1,50 +1,168 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <header class="mui-bar mui-bar-nav">
|
|
|
- <h1 class="mui-title">登录账号</h1>
|
|
|
- <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
|
|
|
- </header>
|
|
|
+ <common @asynCallBack="asynCallBack"></common>
|
|
|
+ <top-header :pageTitle="pageTitle" :leftShow="false"></top-header>
|
|
|
+
|
|
|
<div class="mui-content">
|
|
|
<div class="mui-content-padded">
|
|
|
<div class="vongi-login-logo">
|
|
|
- <img src="~$project/assets/img/logo.jpg" />
|
|
|
+ <img src="~$project/assets/img/logo.jpg" />
|
|
|
</div>
|
|
|
<form class="mui-input-group vongi-login-form">
|
|
|
<div class="mui-input-row">
|
|
|
- <input type="text" class="mui-input-clear" placeholder="请填写您的姓名">
|
|
|
+ <input v-model="subForm.name" type="text" class="mui-input-clear" placeholder="请填写您的姓名">
|
|
|
</div>
|
|
|
<div class="mui-input-row">
|
|
|
- <input type="text" class="mui-input-clear" placeholder="请输入手机号码">
|
|
|
+ <input v-model="subForm.phone" type="text" class="mui-input-clear" placeholder="请输入手机号码">
|
|
|
</div>
|
|
|
<div class="mui-input-row">
|
|
|
- <input type="text" class="mui-input-clear" placeholder="请输入验证码">
|
|
|
- <a href="">发送验证码</a>
|
|
|
- </div>
|
|
|
+ <input v-model="verifyCode" type="text" class="mui-input-clear" placeholder="请输入验证码">
|
|
|
+ <a @click="findByNameAndPhone" v-html="sendMsgWz"></a>
|
|
|
+ </div>
|
|
|
</form>
|
|
|
- <form class="mui-input-group vongi-xieyi">
|
|
|
+ <!-- <form class="mui-input-group vongi-xieyi">
|
|
|
<div class="mui-input-row mui-radio mui-left">
|
|
|
<label class="mui-h6">我已阅读并同意<span class="color4fc5f7">《用户使用协议》</span></label>
|
|
|
<input name="radio1" type="radio">
|
|
|
</div>
|
|
|
- </form>
|
|
|
-
|
|
|
+ </form> -->
|
|
|
+
|
|
|
</div>
|
|
|
<div class="vongi-btn">
|
|
|
- <button class="mui-btn mui-btn-primary ">
|
|
|
+ <button class="mui-btn mui-btn-primary" @click="nextStep">
|
|
|
登录
|
|
|
</button>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <loading :visible="isLoading"></loading>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import * as API_Person from '@/apis/person'
|
|
|
+ import * as API_Common from '@/apis/common'
|
|
|
+ import Common from '$project/components/Common.vue'
|
|
|
+ import Loading from '$project/components/Loading.vue'
|
|
|
+ import TopHeader from '$project/components/TopHeader.vue'
|
|
|
+ import {
|
|
|
+ mapGetters,
|
|
|
+ mapMutations
|
|
|
+ } from 'vuex'
|
|
|
+ import * as types from '$project/store/mutation-types'
|
|
|
export default {
|
|
|
- name: 'Login',
|
|
|
- components: {},
|
|
|
+ name: 'Home',
|
|
|
+ components: {
|
|
|
+ Common,
|
|
|
+ Loading,
|
|
|
+ TopHeader
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ pageTitle: '登录账号',
|
|
|
+
|
|
|
+ subForm: {
|
|
|
+ name: '',
|
|
|
+ phone: '',
|
|
|
+ },
|
|
|
+ personId: '',
|
|
|
+ verifyCode: '',
|
|
|
+ sendMsgWz: '发送验证码',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //根据用户名和手机号查询人员信息
|
|
|
+ findByNameAndPhone() {
|
|
|
+ this.isLoading = true;
|
|
|
+ API_Person.findByNameAndPhone(this.subForm).then(response => {
|
|
|
+
|
|
|
+ this.personId = response;
|
|
|
+ this.isLoading = false;
|
|
|
+
|
|
|
+ this.sendMsg();
|
|
|
+ }).catch(error => {
|
|
|
+ this.isLoading = false;
|
|
|
+ mui.toast(error);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ sendMsg() {
|
|
|
+ this.isLoading = true;
|
|
|
+ API_Common.sendMsg({
|
|
|
+ personId: this.personId
|
|
|
+ }).then(response => {
|
|
|
+ //倒计时
|
|
|
+ this.msgTimeInterval();
|
|
|
+ this.isLoading = false;
|
|
|
+ }).catch(error => {
|
|
|
+ this.isLoading = false;
|
|
|
+ mui.toast(error);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //倒计时
|
|
|
+ msgTimeInterval() {
|
|
|
+ var time = 60;
|
|
|
+ var _this = this;
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ if (time > 0) {
|
|
|
+ _this.sendMsgWz = time-- + '秒';
|
|
|
+ } else {
|
|
|
+ _this.isSendMsg = true;
|
|
|
+ _this.sendMsgWz = '发送验证码';
|
|
|
+ clearInterval(_this.timer)
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
+ },
|
|
|
+ //下一步
|
|
|
+ nextStep() {
|
|
|
+ if (!this.verifyCode || !this.personId) {
|
|
|
+ mui.toast('请获取并填写验证码');
|
|
|
+ } else {
|
|
|
+ this.isLoading = true;
|
|
|
+ API_Person.validateCode({
|
|
|
+ personId: this.personId,
|
|
|
+ verifyCode: this.verifyCode,
|
|
|
+ openId: this.openId
|
|
|
+ }).then(response => {
|
|
|
+
|
|
|
+ this.set_token(respone);
|
|
|
+ //上传头像
|
|
|
+ this.$router.push({
|
|
|
+ name: 'UploadPhoto',
|
|
|
+ query: {}
|
|
|
+ })
|
|
|
+
|
|
|
+ this.isLoading = false;
|
|
|
+ }).catch(error => {
|
|
|
+ this.isLoading = false;
|
|
|
+ mui.toast(error);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ asynCallBack() {
|
|
|
+
|
|
|
+ },
|
|
|
+ ...mapMutations({
|
|
|
+ set_token: types.SET_TOKEN,
|
|
|
+ })
|
|
|
+ },
|
|
|
mounted() {
|
|
|
- document.body.style.backgroundColor = '#fff';
|
|
|
- },
|
|
|
+ document.body.style.backgroundColor = '#fff';
|
|
|
+ },
|
|
|
+ destroyed() {
|
|
|
+
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ openId: 'wx_openid',
|
|
|
+ token: 'token',
|
|
|
+ person_data: 'person_data',
|
|
|
+ company_data: 'company_data',
|
|
|
+ vister_scene: 'vister_scene',
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|