huangxiaojing 3 年之前
父節點
當前提交
4796202a67

+ 9 - 3
microserviceUserH5/static/css/replacementActivities.css

@@ -27,7 +27,7 @@ ul, li {
 }
 .share-node{
   width: 0.7rem;
-  height: 1.8rem;
+  height: 2.5rem;
   position: fixed;
   background: #084558;
   border-radius: 0.15rem 0 0 0.15rem;
@@ -35,10 +35,16 @@ ul, li {
   right: 0;
   overflow: hidden;
 }
+.share{ 
+  width: 0.45rem;
+  height: 0.46rem;
+  margin: 0.23rem auto 0;
+  display: block;
+}
 .qq{ 
   width: 0.44rem;
   height: 0.46rem;
-  margin: 0.28rem auto 0;
+  margin: 0.17rem auto 0;
   display: block;
 }
 .line {
@@ -46,7 +52,7 @@ ul, li {
   height: 1px;
   background: #53A3B7;
   opacity: 0.4;
-  margin: 0.18rem;
+  margin: 0.18rem auto 0;
 }
 .cs{ 
   width: 0.44rem;

二進制
microserviceUserH5/static/img/replacementActivities/share.png


+ 7 - 2
microserviceUserH5/static/js/vender/verify.js

@@ -465,6 +465,9 @@
 							_this.htmlDoms.tips.animate({"bottom":"-35px"});
 						}, 1000);
 					}
+			},
+			function(res){
+				_this.options.error(res)
 			});
 			this.htmlDoms.sub_block.css('left', "0px");
         },
@@ -680,8 +683,10 @@
 					_this.htmlDoms.back_img[0].src = 'images/default.jpg';
 					_this.$element.find('.verify-msg').text(res.repMsg);
 				}
-			})
-        
+			}),
+			function(res){
+				_this.options.error(res)
+			}
 		},
 		pointTransfrom:function(pointArr,imgSize){
 			var newPointArr = pointArr.map(function(p){

+ 102 - 51
microserviceUserH5/vcloud/invite.html

@@ -28,9 +28,12 @@
 <body>
 	<div class="container">
 		<div class="share-node">
+			<img class="share" onclick="share()" src="../static/img/replacementActivities/share.png" alt="">
+			<div class="line"></div>
 			<img class="qq" onclick="urlToQQ()" src="../static/img/replacementActivities/qq.png" alt="">
 			<div class="line"></div>
-			<a href="qq://mqqwpa://im/chat?chat_type=wpa&uin=800183764&version=1&src_type=web&web_src=oicqzone.com"><img class="cs" src="../static/img/replacementActivities/cs.png" alt=""></a>
+			<a href="qq://mqqwpa://im/chat?chat_type=wpa&uin=800183764&version=1&src_type=web&web_src=oicqzone.com"><img
+					class="cs" src="../static/img/replacementActivities/cs.png" alt=""></a>
 		</div>
 		<div class="date">2022.1.4-2022.2.8</div>
 		<div class="header">
@@ -194,6 +197,46 @@
 				copyUrl();
 			}
 		}, false);
+		function share() {
+			if (!id) {
+				copyUrl();
+			} else if (isiOS) {
+				$.ajax({
+					url: baseUrl + '/api/user/v1/promote',
+					type: 'get',
+					headers: {
+						'Authorization': id  //id
+					},
+					contentType: "application/json",
+					dataType: 'json',
+					cache: false,
+					success: function (res) {
+						var jsonStr = JSON.stringify(res.data)
+						var jsonObj = JSON.parse(jsonStr)
+						// WKWebView使用
+						// 使用下方方法,会报错,为使界面执行逻辑通畅,因此使用try-catch
+						try {
+							getMessage(jsonObj);
+						} catch (error) {
+							console.log(error)
+						}
+						try {
+							window.webkit.messageHandlers.getMessage.postMessage(jsonObj)
+						} catch (error) {
+							copyUrl();
+						}
+					}
+				})
+			} else if (isAndroid) {
+				if (window.native) {
+					window.native.onClikWebView()
+				} else {
+					copyUrl();
+				}
+			} else {
+				copyUrl();
+			}
+		}
 		//复制
 		function copyUrl() {
 			stopManyClick(() => {
@@ -265,57 +308,64 @@
 		var imgWidth = html.getBoundingClientRect().width / 750 * 400 + 'px';
 		var imgHeight = html.getBoundingClientRect().width / 750 * 200 + 'px';
 		var barHeight = html.getBoundingClientRect().width / 750 * 70 + 'px';
-		$('#mpanel2').slideVerify({
-			baseUrl: baseUrl + '/api/user',  //服务器请求地址, 默认地址为安吉服务器;
-			mode: 'pop',     //展示模式
-			containerId: 'form-btn', //pop模式 必填 被点击之后出现行为验证码的元素id
-			imgSize: { //图片的大小对象,有默认值{ width: '310px',height: '155px'},可省略
-				width: imgWidth,
-				height: imgHeight
-			},
-			barSize: {//下方滑块的大小对象,有默认值{ width: '310px',height: '50px'},可省略
-				width: imgWidth,
-				height: barHeight
-			},
-			beforeCheck: function () {
-				account = $('#account').val();
-				account = account.replace(/\s+/g, "");
-				password = $('#password').val();
-				password = password.replace(/\s+/g, "");
-				if (!account) {
-					$('.tip-text1').text('账号格式不正确,请重新输入!');
-					$('#account').addClass('br');
-					return false
-				} else {
-					$('.tip-text1').text('');
-					$('#account').removeClass('br')
-				}
-				if (!/^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(account)) {
-					$('.tip-text1').text('账号格式不正确,请重新输入!');
-					$('#account').addClass('br');
-					return false
-				} else {
-					$('.tip-text1').text('');
-					$('#account').removeClass('br')
-				}
-				if (!password) {
-					$('.tip-text2').text('密码为空,请重新输入!');
-					$('#password').addClass('br');
-					return false
-				} else {
-					$('.tip-text2').text('');
-					$('#password').removeClass('br');
-					return true
+		validate(); // 生成验证码
+		function validate() {
+			$('#mpanel2').slideVerify({
+				baseUrl: baseUrl + '/api/user',  //服务器请求地址, 默认地址为安吉服务器;
+				mode: 'pop',     //展示模式
+				containerId: 'form-btn', //pop模式 必填 被点击之后出现行为验证码的元素id
+				imgSize: { //图片的大小对象,有默认值{ width: '310px',height: '155px'},可省略
+					width: imgWidth,
+					height: imgHeight
+				},
+				barSize: {//下方滑块的大小对象,有默认值{ width: '310px',height: '50px'},可省略
+					width: imgWidth,
+					height: barHeight
+				},
+				beforeCheck: function () {
+					account = $('#account').val();
+					account = account.replace(/\s+/g, "");
+					password = $('#password').val();
+					password = password.replace(/\s+/g, "");
+					if (!account) {
+						$('.tip-text1').text('账号格式不正确,请重新输入!');
+						$('#account').addClass('br');
+						return false
+					} else {
+						$('.tip-text1').text('');
+						$('#account').removeClass('br')
+					}
+					if (!/^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(account)) {
+						$('.tip-text1').text('账号格式不正确,请重新输入!');
+						$('#account').addClass('br');
+						return false
+					} else {
+						$('.tip-text1').text('');
+						$('#account').removeClass('br')
+					}
+					if (!password) {
+						$('.tip-text2').text('密码为空,请重新输入!');
+						$('#password').addClass('br');
+						return false
+					} else {
+						$('.tip-text2').text('');
+						$('#password').removeClass('br');
+						return true
+					}
+				},
+				ready: function () { },  //加载完毕的回调
+				success: function (params) { //成功的回调
+					operate('dt_yhs_点击免费换机按钮', 'click', params.captchaVerification);
+				},
+				error: function (err) {
+					if (err.repCode == "6202") {
+						toastr.error(err.repMsg)
+						$('#mpanel2').empty()
+						validate()
+					}
 				}
-			},
-			ready: function () {},  //加载完毕的回调
-			success: function (params) { //成功的回调
-				operate('dt_yhs_点击免费换机按钮', 'click', params.captchaVerification);
-			},
-			error: function () {
-				console.log('error');
-			}        //失败的回调
-		});
+			});
+		}
 		//调用免费换机接口
 		function changePhone(captchaVerification) {
 			let data = {
@@ -434,4 +484,5 @@
 		color: #BBBBBB;
 	}
 </style>
+
 </html>