Ver Fonte

二维码调整

zhengkaixin há 3 anos atrás
pai
commit
1b9afb034f
2 ficheiros alterados com 33 adições e 8 exclusões
  1. 7 1
      apis/index.js
  2. 26 7
      pages/login/welcome.vue

+ 7 - 1
apis/index.js

@@ -2,8 +2,14 @@ import request from '../utils/request.js';
 import requestWhite from '../utils/requestWhite.js';
 import Qs from 'qs';
 
-export function codeOperation(res) {
+export function codeOperation(url) {
 	// res="jp_team51_charge_id:A_11111"
+	//http://localhost:8080/#/?jpcode=jp_team51_charge_id%3AA_111
+	var res=url
+	if(url.indexOf("#/?jpcode=")>-1){
+		res=url.split("#/?jpcode=")[1]
+	}
+	
 	if(res&&res.length>22){
 		
 	}else if(res == 'toLogin') {

+ 26 - 7
pages/login/welcome.vue

@@ -22,6 +22,7 @@
 
 <script>
 	import * as loginApi from '@/apis/login.js'
+	import * as API from '@/apis/index.js'
 	
 	export default {
 		data() {
@@ -108,21 +109,39 @@
 						}
 						
 					},1000)
-			}
-			
+			},
+			onReadyIng(){
+				this.indexstep()
+				this.setBackImg( )
+			},
 			
 		},
-		onLoad() {
-			this.indexstep()
-			this.setBackImg( )
+		onLoad(op) {
+			this.findNoLTextConfigure()
+			this.findByOpenId()
+			
+			if(op.jpcode){
+				
+				var k=API.codeOperation(op.jpcode);
+				if(k){
+					uni.redirectTo({
+						url:k
+					})
+				}else{
+					this.onReadyIng()
+				}
+				
+			}else{
+				this.onReadyIng()
+			}
+			
 			 
 		},
 		onUnload(){
 			document.body.style=""
 		},
 		onReady() {
-			this.findNoLTextConfigure()
-			this.findByOpenId()
+			
 		}
 	}
 </script>