heyang пре 4 година
родитељ
комит
adafd19649

BIN
microserviceUserH5/static/img/doubleElevenActivity/pic.jpg


+ 3 - 5
microserviceUserH5/vcloud/doubleElevenActivity.html

@@ -205,11 +205,8 @@
 		url = url.split('/');
 		var topVal = -0.5;
 		let obj = {};
-		// var baseUrl = 'https://test.androidscloud.com'
+		var baseUrl = 'https://test.androidscloud.com'
 		var loc = window.location.search,
-		    n1 = loc.length,//地址的总长度
-		    n2 = loc.indexOf("="),//取得=号的位置
-		    id = loc.substr(n2 + 1, n1 - n2),//从=号后面的内容
 			u = navigator.userAgent,
 			ua = navigator.userAgent.toLowerCase(),
 			isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
@@ -319,6 +316,7 @@
 						<div class="account">优惠券已放入您的账户${phoneNumber.substring(0,3)}****${phoneNumber.substring(7,11)}</div>`
 						$('.red-packet').eq(0).append(node);
 						$('.activity-btn-text').eq(0).text('在双子星APP使用红包');
+						$('.icon-left').eq(0).hide();
 					} else {
 						stopManyClick(() => {
 							toastr.error(res.msg);
@@ -334,7 +332,7 @@
 				url: baseUrl + '/api/user/v1/activity/orderRedEnvelopeSharing',
 				type: 'post',
 				headers: {
-					'Authorization': id //id
+					'Authorization': obj.id //id
 				},
 				contentType: "application/json",
 				dataType: 'json',

+ 78 - 37
microserviceUserH5/vcloud/downApp.html

@@ -39,6 +39,7 @@
 		.down-bg{
 			width: 100%;
 			height: 100%;
+			position: relative;
 		}
 		.down-row{
 			width: 6.7rem;
@@ -62,13 +63,17 @@
 		} */
 		.address{
 			text-align: center;
-			width: 4.16rem;
+			width: 4rem;
 			height: 0.6rem;
 			line-height: 0.6rem;
 			background-color: #ffffff;
 			color: #333333;
 			border-radius: 0.1rem;
 			z-index: 999;
+			overflow: hidden;
+			padding: 0 0.08rem;
+            text-overflow:ellipsis;
+            white-space: nowrap;
 		}
 		.right-btn{
 			width: 1.1rem;
@@ -80,59 +85,95 @@
 			border-radius: 0.1rem;
 			background-color: #6048D8;
 		}
+		.down-pic{
+			width: 4.74rem;
+			height: 4.74rem;
+			position: absolute;
+			bottom: 2.4rem;
+			left: 50%;
+			transform: translateX(-50%);
+		}
+
+		#toast-container>.toast-error {
+			background-image: none !important;
+		}
+
+		.toast-error {
+			background-color: rgba(0, 0, 0, 0.8);
+		}
+
+		#toast-container>div {
+			font-size: 14px;
+			min-width: 80px !important;
+			padding: 12px !important;
+			box-shadow: none;
+		}
+
+		.toast-center-center {
+			min-width: 100px;
+			top: 50%;
+			left: 50%;
+			text-align: center;
+			transform: translateX(-50%);
+		}
+
+		@media (max-width: 480px) and (min-width: 241px) {
+		#toast-container>div {
+			min-width: 80px !important;
+			width: auto;
+		}
+		}
 	</style>
 </head>
 
 <body>
 	<div class="container">
 		<img class="down-bg" src="../static/img/down-bg.png" />
+		<img class="down-pic" src="../static/img/doubleElevenActivity/pic.jpg" />
 		<div class="down-row">
 			<div class="left">下载链接</div>
-			<div class="address">下载链接</div>
+			<div class="address">http://www.androidscloud.com/suanchou</div>
 			<div class="right-btn">复制</div>
 		</div>
+		<div class="ipt"></div>
 	</div>
-	<script>
-		toastr.options.positionClass = 'toast-center-center';
-		toastr.options.timeOut = '1500';
-	</script>
 	<script type="text/javascript">
 	    let timer,flag = true;
-		var url = window.location.href;
-		url = url.split('/')
-		// var baseUrl = 'https://test.androidscloud.com/'
-		var loc = window.location.search,
-		    n1 = loc.length,//地址的总长度
-		    n2 = loc.indexOf("="),//取得=号的位置
-		    id = loc.substr(n2 + 1, n1 - n2),//从=号后面的内容
-			u = navigator.userAgent,
-			ua = navigator.userAgent.toLowerCase(),
-			isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
-			isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
-		//埋点
-		if(isAndroid){
-			operate('中秋活动落地页');
-		}
-		function operate(pointName,type){
-			$.ajax({
-				url: baseUrl + '/api/public/v1/systemBuriedPoint/stat',
-				type: 'post',
-				data:JSON.stringify({
-					pointName: pointName
-				}),
-				contentType:"application/json",
-				dataType: 'json',
-				cache: false,
-				success: function (res) {
-					if(isAndroid && type === 'click'){
-						getAppDownload();
-					}
-				},
+		//点击复制按钮
+		$('.right-btn')[0].addEventListener('click',copyUrl);
+		//复制
+		function copyUrl(){
+			stopManyClick(() => {
+				var oInput = document.createElement('input'); //创建一个input
+				oInput.setAttribute("readonly", "readonly");//设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
+				oInput.value = 'http://www.androidscloud.com/suanchou';
+				$('.ipt')[0].appendChild(oInput);//将input插入到body
+				// oInput.select(); // 选择对象 ios不支持
+				selectText(oInput, 0, oInput.value.length);
+				document.execCommand("Copy"); // 执行浏览器复制命令
+				toastr.error('复制当前网址成功!');
+				oInput.style.display='none'; // 将input隐藏
+				oInput.blur();
+				oInput.remove(); // 将input销毁
 			})
 		}
+		// input自带的select()方法在苹果端无法进行选择,所以需要自己去写一个类似的方法
+		// 选择文本。createTextRange(setSelectionRange)是input方法
+		function selectText(textbox, startIndex, stopIndex) {
+			if (textbox.createTextRange) {//ie
+				const range = textbox.createTextRange();
+				range.collapse(true);
+				range.moveStart('character', startIndex);//起始光标
+				range.moveEnd('character', stopIndex - startIndex);//结束光标
+				range.select();//不兼容苹果
+			} else {//firefox/chrome
+				textbox.setSelectionRange(startIndex, stopIndex);
+				textbox.focus();
+			}
+		}
 		//防止提示一秒内重复显示
 		function stopManyClick(fn) {
-			if (flag) {
+		if (flag) {
 				fn();
 			}
 			flag = false;