Browse Source

最终版本

zg597198390 6 years ago
parent
commit
6c60639f93
5 changed files with 60 additions and 42 deletions
  1. 15 15
      src/assets/js/common.js
  2. 4 1
      src/components/AddBox.vue
  3. 9 5
      src/components/Login.vue
  4. 29 21
      src/views/ApplyAgent.vue
  5. 3 0
      src/views/Home.vue

+ 15 - 15
src/assets/js/common.js

@@ -110,7 +110,6 @@ var getInfo = function(that,url,method,params,success){
 			'Content-Type':'application/x-www-form-urlencoded;'
 		}
 	}
-	console.log(that.$qs.stringify(params));
 	that.$axios({
 		url: url,
 		method: method,
@@ -239,7 +238,7 @@ var inputTest = function(that){
 		if (that.regInfo.intype == "") {
 			that.$notify({
 	            title: '提示',
-	            message: that.tiptip,
+	            message: that.intip,
 	            type: 'warning',
 	            duration:'1500'
 	          })
@@ -288,7 +287,7 @@ var inputTest = function(that){
 		if (that.loginInfo.intype == "") {
 			that.$notify({
 	            title: '提示',
-	            message: that.tiptip,
+	            message: that.intip,
 	            type: 'warning',
 	            duration:'1500'
 	          })
@@ -306,11 +305,11 @@ var inputTest = function(that){
 		};
 		return true;
 		case 2:
-		if (that.operation == "mobile") {
+		if (that.operation == "email") {
 			if (that.resetInfo.intype == "") {
 				that.$notify({
 		            title: '提示',
-		            message: that.tiptip,
+		            message: that.intip,
 		            type: 'warning',
 		            duration:'1500'
 		          })
@@ -344,7 +343,7 @@ var inputTest = function(that){
 		          })
 				return false;
 			}
-			if (that.resetInfo.oldPassWord == that.resetInfo.newPassWord) {
+			if (that.resetInfo.oldPassWord != that.resetInfo.newPassWord) {
 				that.$notify({
 		          title: '提示',
 		          message: '两次输入的密码不同',
@@ -462,7 +461,6 @@ var loginOut = function(that){
 
 //找回密码发送信件
 var resetCode = function(that){
-	inputTest(that);
 	if (that.resetInfo.intype == '') {
 		return false;
 	}
@@ -470,13 +468,15 @@ var resetCode = function(that){
 		"email":that.operation=="email"? that.resetInfo.intype:"",
 		"mobile":that.operation=="mobile"? that.resetInfo.intype:"",
 		"os":"web",
-		"type":that.operation=="email"?"email":"sms",
+		"type":that.operation=="email"? "email":"sms",
 		"platkey":"fx66",
 		"ticket":"",
-		"businessId":""
+		"businessId":"",
+		"area":that.operation=="mobile"? that.coutry:""
 	}
+
 	getInfo(that,that.urlApi.resetEmailPassword,"POST",params,function(res){
-		console.log(res.code);
+		console.log(params);
 		if (res.code = 200) {
 			that.$notify({
 	          title: '成功',
@@ -516,17 +516,17 @@ var goReset = function(that,flag){
 
 //获取状态
 var getStatus = function(that){
-	getInfo(that,that.urlApi.applyStatus,"POST",'',function(res){
+	getInfo(that,that.urlApi.applyStatus,"GET",'',function(res){
 		if (res.code == 200) {
-			if (res.data.isApply == 1) {
+			if (res.data.isApplyed == 1) {
 				switch (res.data.info.status){
-					case 0:
+					case "0":
 					that.applicationStatus = 1;
 					break;
-					case 1:
+					case "1":
 					that.applicationStatus = 2;
 					break;
-					case -1:
+					case "-1":
 					that.applicationStatus = -1;
 					break;
 				}

+ 4 - 1
src/components/AddBox.vue

@@ -7,7 +7,7 @@
         <p>{{item.msg[2]}}</p>
         <img :src="item.url">
         <div class="add-btn" v-show="state===index">
-          <span>{{item.msg[3]}}</span>
+          <span @click="golink('/applyAgent')">{{item.msg[3]}}</span>
           <i class="el-icon-arrow-right"></i>
         </div>
       </li>
@@ -58,6 +58,9 @@
     methods:{
       addbtnShow(val){
         this.state = val;
+      },
+      golink(val){
+        this.$router.push({path:val});
       }
     }
   }

+ 9 - 5
src/components/Login.vue

@@ -82,8 +82,8 @@
     <div class="login-block" v-if="logintype == 2">
       <div class="contain">
         <div class="tab-box">
-          <span :class="{active:operation=='email'}" @click="operation='email'">邮箱找回</span>
-          <span :class="{active:operation=='mobile'}" @click="operation='mobile'">手机找回</span>
+          <span :class="{active:operation=='email'}" @click="tabChange()">邮箱找回</span>
+          <span :class="{active:operation=='mobile'}" @click="tabChange()">手机找回</span>
         </div>
         <div class="input-line">
           <span class="icon-box" v-show="operation=='email'">
@@ -103,16 +103,18 @@
         </div>
         <div class="verify-line" v-if="operation=='mobile'">
           <input type="text" placeholder="请输入验证码" v-model="resetInfo.verifyCode">
-          <button class="btn-primary">发送验证码</button>
+            <button class="btn-primary" @click="reCode()" v-if="verifyState == 0">发送验证码</button>
+            <button class="btn-primary" @click="reCode()" v-if="verifyState == 1" :class="{disgrey:verifyState == 1}">已发送{{secondNum}}</button>
+            <button class="btn-primary" @click="reCode()" v-if="verifyState == 2">重新发送</button>
         </div>
         <div class="input-line" v-if="operation=='mobile'">
           <span class="icon-box"><i class="iconfont icon-mima"></i></span>
-          <input type="text" placeholder="请输入您的新密码" class="input-user" v-model="resetInfo.oldPassWord">
+          <input type="password" placeholder="请输入您的新密码" class="input-user" v-model="resetInfo.oldPassWord">
           <span class="icon-box keyboard"><i class="iconfont icon-keyboard"></i></span>
         </div>
         <div class="input-line" v-if="operation=='mobile'">
           <span class="icon-box"><i class="iconfont icon-mima"></i></span>
-          <input type="text" placeholder="请再次输入您的新密码" class="input-user" v-model="resetInfo.newPassWord">
+          <input type="password" placeholder="请再次输入您的新密码" class="input-user" v-model="resetInfo.newPassWord">
           <span class="icon-box keyboard"><i class="iconfont icon-keyboard"></i></span>
         </div>
         <div class="tip-line">
@@ -274,6 +276,7 @@
       loginAction(){
         //不用做格式的检测因为后台会检测
         var flag = inputTest(this);
+        console.log(flag);
         //判断是哪种框,选择相应的动作,0代表注册、1代表登录、2代表密码找回
         switch(this.logintype){
           case 0:
@@ -336,6 +339,7 @@
       tabChange(){
         this.regInfo.intype = '';
         this.loginInfo.intype = '';
+        /*this.resetInfo.intype = '';*/
         if (this.operation == 'mobile') {
           this.operation = 'email';
         }else{

+ 29 - 21
src/views/ApplyAgent.vue

@@ -45,7 +45,8 @@
                 </el-col>
               </el-form-item>
               <el-form-item label="其它联系方式:">
-                <el-input placeholder="请输入您的其它联系方式:如微信、邮箱等" type="textarea" v-model="applyform.other" :disabled="unavailable"></el-input>
+                <el-input placeholder="请输入您的其它联系方式:如微信、邮箱等" type="textarea" v-model="applyform.other" :disabled="unavailable">
+                </el-input>
               </el-form-item>
               <el-form-item label="所在地:">
                 <el-col :span="12">
@@ -121,7 +122,7 @@
 <script>
   import myheader from '../components/Header.vue'
   import contactwe from '../components/ContactWe.vue'
-  import {getInfo} from '../assets/js/common.js'
+  import {getInfo,getcookie} from '../assets/js/common.js'
   export default{
     data(){
       return{
@@ -167,6 +168,12 @@
     mounted(){
       this.jumpdown();
       this.getCountry();
+      let token = getcookie("token");
+      if (token) {
+        this.getApplyStatus();
+      }else{
+        this.dialogtip = true;
+      }
     },
     components:{
       myheader,
@@ -174,36 +181,38 @@
     },
     methods:{
       getApplyStatus(){
-        getInfo(this,this.urlApi.applyStatue,"GET",'',function(res){
+        var that = this;
+        getInfo(this,this.urlApi.applyStatus,"GET",'',function(res){
           if (res.code = 200) {
-            if (res.data.isApply == 1) {
-              switch(res.data.info.status == 0){
-                case 0://待审核
-                  this.step = 2;
-                  this.disabled = true;
-                  this.applyform = res.data.info;//因为刷新页面后,需要把数据再显示出来,所以需要进行赋值
-                  this.$notify({
+            if (res.data.isApplyed == 1) {
+              switch(res.data.info.status){
+                case "0":
+                  that.step = 2;
+                  that.unavailable = true;
+                  that.applyform = res.data.info;//因为刷新页面后,需要把数据再显示出来,所以需要进行赋值
+                  that.$notify({
                     title: '提示',
                     message: '您的申请正在审核中!',
                     type: 'warning',
                     duration:'2000'
                   });
                   break;
-                case 1://已通过
-                  this.step = 3;
-                  this.disabled = true;
-                  this.applyform = res.data.info;
-                  this.$notify({
+                case "1"://已通过
+                  that.step = 3;
+                  that.unavailable = true;
+                  that.successshow = true;
+                  that.applyform = res.data.info;
+                  that.$notify({
                     title: '成功',
                     message: '您的申请已通过审核!',
                     type: 'success',
-                    duration:'5000'
+                    duration:'2000'
                   })
                   break;
-                case -1:
-                  this.getInfo = 1;
-                  this.disabled = false;
-                  this.$notify({
+                case "-1":
+                  that.getInfo = 1;
+                  that.unavailable = false;
+                  that.$notify({
                     title: '提示',
                     message: '您的申请已被拒绝!',
                     type: 'warning',
@@ -251,7 +260,6 @@
       },
       jumpdown(){
         document.documentElement.scrollTop = window.pageYOffset = document.body.scrollTop=400;
-        //这里为什么要设置window.pageYOffset?设置它也不会跳转呀?
       },
       loginBack(){
         window.location.href = "https://pms.licai.cn/#/";

+ 3 - 0
src/views/Home.vue

@@ -197,6 +197,9 @@
       addbox,
       mylogin
     },
+    mounted(){
+      document.documentElement.scrollTop = window.pageYOffset = document.body.scrollTop=0;
+    },
     methods:{
       showItem(index){
         this.services[index].flag = !this.services[index].flag;