duanshenglang hace 4 meses
padre
commit
0a996046f4
Se han modificado 2 ficheros con 14 adiciones y 3 borrados
  1. 7 1
      lottery/h5Type-20.html
  2. 7 2
      lottery/lottery.html

+ 7 - 1
lottery/h5Type-20.html

@@ -638,7 +638,7 @@
 					let bId = getQueryParam('bId')
 					gerQwAuth(bId);
 				} else {
-					if (getQueryParam('externalUserid') === 'unknown') {
+					if (isUnknownType(getQueryParam('externalUserid'))) {
 						let bId = getQueryParam('bId')
 						gerQwCode(bId);
 					} else {
@@ -765,6 +765,7 @@
 			mui.ajax(httpUrl + '/scrm/v1/wxcp-raffle/p/getUnknown', {
 				data: {
 					bId: bId,
+					externalUserId: getQueryParam('externalUserid'),
 				},
 				dataType: 'json',//服务器返回json格式数据
 				type: 'get',//HTTP请求类型
@@ -952,6 +953,11 @@
 			// 返回指定参数的值,如果不存在则返回null  
 			return urlParams.get(paramName);
 		};
+		function isUnknownType(value) {
+			// 1. 先检查是否为字符串类型
+			// 2. 再检查是否以"unknown"开头(区分大小写)
+			return typeof value === 'string' && value.startsWith('unknown');
+		};
 	</script>
 </body>
 

+ 7 - 2
lottery/lottery.html

@@ -688,7 +688,7 @@
             if (!this.getQueryParam('externalUserid')) {
               this.gerQwAuth(this.bId);
             } else {
-              if (this.getQueryParam('externalUserid') === 'unknown') {
+              if (this.isUnknownType(this.getQueryParam('externalUserid'))) {
                 this.gerQwCode(this.bId);
               } else {
                 this.raffleInfo();
@@ -723,7 +723,7 @@
         },
         // 获取二维码
         gerQwCode(bId) {
-          fetch(this.httpUrl + `/scrm/v1/wxcp-raffle/p/getUnknown?bId=${bId}`)
+          fetch(this.httpUrl + `/scrm/v1/wxcp-raffle/p/getUnknown?bId=${bId}&externalUserId=${this.getQueryParam('externalUserid')}`)
             .then(res => {
               return res.json()
             }).then(result => {
@@ -1124,6 +1124,11 @@
             return format
           }
         },
+        isUnknownType(value) {
+          // 1. 先检查是否为字符串类型
+          // 2. 再检查是否以"unknown"开头(区分大小写)
+          return typeof value === 'string' && value.startsWith('unknown');
+        },
       }
     })   
   </script>