Forráskód Böngészése

Merge branch 'dev-5.2' of http://192.168.32.253:3000/Software/android-cloud-H5 into dev-5.2

huangxiaojing 3 éve%!(EXTRA string=óta)
szülő
commit
89b75b09eb

+ 8 - 4
microserviceUserH5/vcloud/browser.html

@@ -28,7 +28,9 @@
 		</div>
 		<div class="search-wrap">
 			<img class="search-icon" id="search-icon" src="../static/img/browser/search-icon.png" />
-			<input class="ipt" id="ipt" placeholder="搜索或输入网址" />
+			<form class="form" id="myform" action="javascript: void(0);">
+				<input class="ipt" id="ipt" type="search" placeholder="搜索或输入网址" />
+			</form>
 		</div>
 		<div class="tag-wrap" id="tag-wrap"></div>
 	</div>
@@ -122,13 +124,15 @@
 		if(timer){clearTimeout(timer);}
 		timer = setTimeout(() => {flag = true}, 1500);
 	}
+	$("#myform").bind('search', searchFun);
 	//点击按钮搜索
 	const searchDom = document.getElementById("search-icon");
-	searchDom.addEventListener('click',()=>{
+	searchDom.addEventListener('click',searchFun,false);
+	function searchFun() {
 		var key = document.getElementById("ipt").value;
-		var wd = "https://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=1&rsv_idx=1&tn=baidu&wd=" + key;
+		var wd = "https://www.baidu.com/s?wd=" + key;
 		window.open(wd);
-	},false);
+	}
 </script>
 </body>
 </html>

+ 46 - 19
microserviceUserH5/vcloud/browserDetail.html

@@ -52,7 +52,7 @@
 	})
 	let title = decodeURIComponent(GetRequest().plateName);
 	let timer,flag = true;
-	let labelId = '', pageNum = 1, pageSize = 10, index = 0, recordFlag = true, total = 0, nowlength = 0, isLoading = false;
+	let labelId = '', pageNum = 1, pageSize = 10, index = 0, recordFlag = true, total = 0, nowlength = 0, isLoading = false, appList= [], downloadObj = {};
 	$('.title').eq(0).text(title);
 	(function(){
 		init();
@@ -67,6 +67,7 @@
 			success: function (res) {
 				isLoading = false;
 				let node = '';
+				$('.tag-wrap').eq(0).text('');
 				let list = res.data;
 				if(list.length === 0) {
 					node = `<div class="none-wrap">
@@ -128,35 +129,36 @@
 				cache: false,
 				success: function (res) {
 					if(res.status === 0){
-						let list = res.data.records;
-						nowlength += list.length;
+						appList = res.data.records;
+						nowlength += appList.length;
 						total = res.data.total;
 						recordFlag = true;
 						let node = '';
 						if(type != 'down'){
 							$('.download-content').eq(0).text('');
 						}
-						for(let i=0; i < list.length; i++){
+						
+						for(let i=0; i < appList.length; i++){
 							node += `<div class="download-item">
 										<div class="main-wrap">
-											<img class="app-icon" src=${fileCenterApi}/document/newFile/download/0/3dn9b4585511476691c6?fileKey=${list[i].iconKey} />
+											<img class="app-icon" src=${fileCenterApi}/document/newFile/download/0/3dn9b4585511476691c6?fileKey=${appList[i].iconKey} />
 											<div class="app-wrap">
-												<div class="app-title">${list[i].appName}</div>
-												<div class="app-description">${list[i].introduction}</div>
+												<div class="app-title">${appList[i].appName}</div>
+												<div class="app-description">${appList[i].introduction}</div>
 											</div>
 										</div>
-										<div class="btn-wrap" data-key="${list[i].fileKey}" data-id="${list[i].id}" data-index="${i}" data-md5="${list[i].md5}">
-											<div class="progress" data-key="${list[i].fileKey}" data-id="${list[i].id}" data-index="${i}" data-md5="${list[i].md5}"></div>
-											<text class="text" data-key="${list[i].fileKey}" data-id="${list[i].id}" data-index="${i}" data-md5="${list[i].md5}">下载</text>
+										<div class="btn-wrap" data-key="${appList[i].fileKey}" data-id="${appList[i].id}" data-index="${i}" data-md5="${appList[i].md5}">
+											<div class="progress" data-key="${appList[i].fileKey}" data-id="${appList[i].id}" data-index="${i}" data-md5="${appList[i].md5}"></div>
+											<text class="text" data-key="${appList[i].fileKey}" data-id="${appList[i].id}" data-index="${i}" data-md5="${appList[i].md5}">下载</text>
 										</div>
 									</div>`
 						}
-						if(nowlength < total && list.length !== 0){
+						if(nowlength < total && appList.length !== 0){
 							$('.loading').eq(0).text('正在努力加载中...');
 						} else if(nowlength != 0) {
 							$('.loading').eq(0).text('已加载全部内容');
 						}
-						if(list.length === 0){
+						if(appList.length === 0){
 							node = `<div class="none-wrap">
 										<img class="none-img" src="../static/img/browser/none.png" />
 										<div class="none-text">没有更多内容哦~</div>
@@ -219,6 +221,7 @@
 		if(className === 'btn-wrap btn-active' || e.target.innerText !== '下载'){
 			return
 		}
+		let appName = $('.app-title').eq(index).text();
 		if(['btn-wrap','progress', 'text'].includes(className)){
 			$.ajax({
 				url: `${baseUrl}/api/public/v1/ranking/getstatus/${id}`,
@@ -228,7 +231,6 @@
 				cache: false,
 				success: function (res) {
 					if(res.status === 0){
-						$('.btn-wrap')[index].className = 'btn-wrap btn-active';
 						const downloadUrl = `${fileCenterApi}/document/newFile/breakpointDownloadFile/3dn9b4585511476691c6?fileKey=${key}`;
 						window.location.href = downloadUrl;
 						let xhr = new XMLHttpRequest();
@@ -237,12 +239,11 @@
 							// 响应头要有Content-Length
 							if (event.lengthComputable) {
 								let percentComplete = event.loaded / event.total;
-								// 进度条的位置也是translate,一开始是用translateX(-100%)挪到外面去
-								$('.progress')[index].style.transform = `translateX(${percentComplete * 100}%)`;
-								$('.text').eq(index).text(`${(percentComplete * 100).toFixed(1)}%`);
-								if((percentComplete * 100).toFixed(1) == 100){
-									$('.text').eq(index).text('下载完成');
-								}
+								downloadObj[appName] = {
+									index: index,
+									name: appName,
+									percentComplete: percentComplete
+								};
 							}
 						}, false);
 						xhr.send();
@@ -255,6 +256,32 @@
 			})
 		}
 	},false);
+	setInterval(() => {
+		newData();
+	},2000);
+	//更新百分数
+	function newData() {
+		if(JSON.stringify(downloadObj) == "{}"){
+			return
+		}
+		appList.map((item, index) => {
+			Object.keys(downloadObj).map((key) => {
+				if(item.appName === downloadObj[key].name){
+				// 进度条的位置也是translate,一开始是用translateX(-100%)挪到外面去
+				$('.btn-wrap')[index].className = 'btn-wrap btn-active';
+				$('.progress')[index].style.transform = `translateX(${downloadObj[key].percentComplete * 100}%)`;
+				$('.text').eq(index).text(`${(downloadObj[key].percentComplete * 100).toFixed(1)}%`);
+				if((downloadObj[key].percentComplete * 100).toFixed(1) == 100){
+					delete downloadObj[key]
+					console.log(downloadObj)
+					$('.text').eq(index).text('下载完成');
+				}
+			}
+			})
+			
+		})
+		
+	}
 	//点击返回按钮
 	$('.left-arrow')[0].addEventListener('click',()=>{
 		location.href = './browser.html'

+ 8 - 4
screenAndroid/WXtrialInterface.html

@@ -272,8 +272,11 @@
       });
     }
     //云机倒计时
-    let validTime = parameters['validTime'];
-    let detailTime = validTime * 60 * 1000
+    let validTime = parameters['validTime'] || 10000;
+    if(validTime > 32000) {
+      validTime = 32000
+    }
+    let detailTime = validTime * 60 * 1000;
     setTimeout(() => {
       $('.bug-title').eq(0).text('尊敬的用户您的云手机试用时间已到期');
       getDate = true;
@@ -307,7 +310,8 @@
     var cardToken = parameters["cardToken"];
     cardToken = cardToken && cardToken.replace(/@/g, "=");
     var appletPushAddress = parameters["appletPushAddress"];
-    var socketURL = isWSS ? "wss://" + appletPushAddress + "?cardIp=" + ip + "&token=" + cardToken + "&type=business" : "ws://" + appletPushAddress + "?cardIp=" + ip + "&token=" + cardToken + "&type=business";
+    // "&type=business"
+    var socketURL = isWSS ? "wss://" + appletPushAddress + "?cardIp=" + ip + "&token=" + cardToken : "ws://" + appletPushAddress + "?cardIp=" + ip + "&token=" + cardToken;
 
     var jmuxer = new JMuxer({
       node: 'playerVideo',
@@ -1080,7 +1084,7 @@
     // 点击取消
     $('.cannel-btn')[0].addEventListener('click', () => {
       $('.buy-phone-wrap').eq(0).hide();
-      if (disconnectionFlag) {//设置了断线时间,取消直接退出
+      if (disconnectionFlag || getDate) {//设置了断线时间,取消直接退出
         systemBuriedPoint('激活码-断线-取消');
         wx.miniProgram.switchTab({
           url: '/pages/home/home'

+ 22 - 5
screenIos/WXtrialInterface.html

@@ -299,7 +299,7 @@
     });
   </script>
   <script>
-    var videoTimer = null, videoTime = 0, adType = 0, sourceType = 0, disconnectionFlag = false;
+    var videoTimer = null, videoTime = 0, adType = 0, sourceType = 0, disconnectionFlag = false, getDate = false;
     var topwinHeight = window.screen.height - window.innerHeight + 30; //计算title top 头部
     var url = window.location.href;
     url = url.split('/');
@@ -340,6 +340,17 @@
         isAudioPlay = true;
       }
     });
+    //云机倒计时
+    let validTime = parameters['validTime'] || 10000;
+    if(validTime > 32000) {
+      validTime = 32000;
+    }
+    let detailTime = validTime * 60 * 1000;
+    setTimeout(() => {
+      $('.bug-title').eq(0).text('尊敬的用户您的云手机试用时间已到期');
+      getDate = true;
+      $('.buy-phone-wrap').eq(0).show();
+    }, detailTime)
     var orientation = 0; //0 竖屏,1横屏
     function array_unique(arr) {
       return arr.filter(function (e, i) {
@@ -1009,7 +1020,7 @@
     // 点击取消
     $('.cannel-btn')[0].addEventListener('click', () => {
       $('.buy-phone-wrap').eq(0).hide();
-      if (disconnectionFlag) {//设置了断线时间,取消直接退出
+      if (disconnectionFlag || getDate) {//设置了断线时间,取消直接退出
         systemBuriedPoint('激活码-断线-取消');
         wx.miniProgram.switchTab({
           url: '/pages/home/home'
@@ -1043,9 +1054,15 @@
         pointName = videoTime == 0 ? '激活码-关闭-去购买' : '激活码-强制关闭-去购买';
       }
       systemBuriedPoint(pointName);
-      wx.miniProgram.navigateTo({
-        url: '/packageA/order/renew/index?record=' + form.userCardId
-      })
+      if(getDate){
+        wx.miniProgram.navigateTo({
+          url: '/packageA/order/buy/index'
+        })
+      } else {
+        wx.miniProgram.navigateTo({
+          url: '/packageA/order/renew/index?record=' + form.userCardId
+        })
+      }
     })
     // 放弃
     $('.cannel-ad-btn')[0].addEventListener('click', () => {