Ver Fonte

登录滑块

tanxue há 7 meses atrás
pai
commit
c571268f1c
2 ficheiros alterados com 32 adições e 6 exclusões
  1. 11 1
      pages/login/index.vue
  2. 21 5
      pages/login/login.vue

+ 11 - 1
pages/login/index.vue

@@ -38,6 +38,7 @@
 		clearTelIcon: false,
 		telStatus:'',
 		isAgreed: false,
+		sliderObj:{},
 	})
 	
 	onLoad((options) => {
@@ -56,6 +57,9 @@
 		            renderTo: "yzm-slider",
 		            //前端滑动验证通过时会触发该回调参数。您可以在该回调参数中将会话ID(sessionId)、签名串(sig)、请求唯一标识(token)字段记录下来,随业务请求一同发送至您的服务端调用验签。
 		            success: function (data) {
+						data.sliderObj = data;
+						console.log(data,'data111');
+						console.log(data.sliderObj,'data.sliderObj');
 		                window.console && console.log(data.sessionId)
 		                window.console && console.log(data.sig)
 		                window.console && console.log(data.token)
@@ -72,9 +76,15 @@
 		    })
 	}
 	
+	let req  ={
+		sessionId:data.sliderObj.sessionId,
+		sig:data.sliderObj.sig,
+	}
 	const getYzmBtn = () => {
+			
 		uni.navigateTo({
-			url: `/pages/login/login?telNum=${data.phoneNumber}`
+		//	url: `/pages/login/login?telNum=${data.phoneNumber}&slider=${encodeURIComponent(data.sliderObj)}`,
+				url: `/pages/login/login?data=`+JSON.stringify(data)
 		})
 	}
 	

+ 21 - 5
pages/login/login.vue

@@ -1,6 +1,7 @@
 <template>
   <view class="ezy-login-page">
-	  <view class="ezy-login-wrap" >
+	  
+<!-- 	  <view class="ezy-login-wrap" >
 			<view class="login-body-box">
 				<view class="login-title-img"></view>
 				<view class="yzm-show">验证码已发送至:{{data.phoneNumber}}</view>
@@ -15,7 +16,7 @@
 				<text class="login-text">无法收到验证码</text>
 				<text class="login-text">客服电话:400-052-2130</text>
 			</view>
-		</view>
+		</view> -->
 		  
   </view>
 </template>
@@ -36,22 +37,37 @@
 		timeLeft: 60, // 初始倒计时时间(秒)
 		intervalId: null, // 定时器ID
 		isDisabled: false, // 按钮是否禁用
-		buttonText: '重新发送' // 按钮文本
+		buttonText: '重新发送' ,// 按钮文本
+		sliderObj:{},
 	})
 
 	onLoad((options) => {
-			startCountdown();
+		console.log(JSON.parse(options.data),'options');
+			// startCountdown();
+			// init(options);
 			// getYzmBtn();
 	})
 		
 	/********* 验证码 *********/
+	const init = (options) => {
+		let encodedJsonString = options;
+		console.log(options.slider,'options.slider');
+		// 解码URL参数
+		data.sliderObj = JSON.parse(decodeURIComponent(encodedJsonString.slider));
+		console.log(data.sliderObj,'data.sliderObj');
+		// data.phoneNumber = 
+	}
+	
 	const getYzmBtn = () => {
 		return request({
 			url: "/common/app/send/code",
 			method: "POST",
 			data: {
 				phone: 18842603074,
-				sign: ''
+				appkey: 'FFFF0N00000000007EC0',
+				sign: '',
+				sessionid: '',
+				
 			}
 		})
 	}