heyang 3 years ago
parent
commit
fba2d0a31d

+ 4 - 2
microserviceUserH5/vcloud/browser.html

@@ -28,7 +28,9 @@
 		</div>
 		</div>
 		<div class="search-wrap">
 		<div class="search-wrap">
 			<img class="search-icon" id="search-icon" src="../static/img/browser/search-icon.png" />
 			<img class="search-icon" id="search-icon" src="../static/img/browser/search-icon.png" />
-			<input class="ipt" id="ipt" placeholder="搜索或输入网址" />
+			<form class="form" @submit.prevent action="javascript: void(0);">
+				<input class="ipt" id="ipt" type="search" placeholder="搜索或输入网址" />
+			</form>
 		</div>
 		</div>
 		<div class="tag-wrap" id="tag-wrap"></div>
 		<div class="tag-wrap" id="tag-wrap"></div>
 	</div>
 	</div>
@@ -126,7 +128,7 @@
 	const searchDom = document.getElementById("search-icon");
 	const searchDom = document.getElementById("search-icon");
 	searchDom.addEventListener('click',()=>{
 	searchDom.addEventListener('click',()=>{
 		var key = document.getElementById("ipt").value;
 		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);
 		window.open(wd);
 	},false);
 	},false);
 </script>
 </script>

+ 46 - 19
microserviceUserH5/vcloud/browserDetail.html

@@ -52,7 +52,7 @@
 	})
 	})
 	let title = decodeURIComponent(GetRequest().plateName);
 	let title = decodeURIComponent(GetRequest().plateName);
 	let timer,flag = true;
 	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);
 	$('.title').eq(0).text(title);
 	(function(){
 	(function(){
 		init();
 		init();
@@ -67,6 +67,7 @@
 			success: function (res) {
 			success: function (res) {
 				isLoading = false;
 				isLoading = false;
 				let node = '';
 				let node = '';
+				$('.tag-wrap').eq(0).text('');
 				let list = res.data;
 				let list = res.data;
 				if(list.length === 0) {
 				if(list.length === 0) {
 					node = `<div class="none-wrap">
 					node = `<div class="none-wrap">
@@ -128,35 +129,36 @@
 				cache: false,
 				cache: false,
 				success: function (res) {
 				success: function (res) {
 					if(res.status === 0){
 					if(res.status === 0){
-						let list = res.data.records;
-						nowlength += list.length;
+						appList = res.data.records;
+						nowlength += appList.length;
 						total = res.data.total;
 						total = res.data.total;
 						recordFlag = true;
 						recordFlag = true;
 						let node = '';
 						let node = '';
 						if(type != 'down'){
 						if(type != 'down'){
 							$('.download-content').eq(0).text('');
 							$('.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">
 							node += `<div class="download-item">
 										<div class="main-wrap">
 										<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-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>
 										</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>
 									</div>`
 									</div>`
 						}
 						}
-						if(nowlength < total && list.length !== 0){
+						if(nowlength < total && appList.length !== 0){
 							$('.loading').eq(0).text('正在努力加载中...');
 							$('.loading').eq(0).text('正在努力加载中...');
 						} else if(nowlength != 0) {
 						} else if(nowlength != 0) {
 							$('.loading').eq(0).text('已加载全部内容');
 							$('.loading').eq(0).text('已加载全部内容');
 						}
 						}
-						if(list.length === 0){
+						if(appList.length === 0){
 							node = `<div class="none-wrap">
 							node = `<div class="none-wrap">
 										<img class="none-img" src="../static/img/browser/none.png" />
 										<img class="none-img" src="../static/img/browser/none.png" />
 										<div class="none-text">没有更多内容哦~</div>
 										<div class="none-text">没有更多内容哦~</div>
@@ -219,6 +221,7 @@
 		if(className === 'btn-wrap btn-active' || e.target.innerText !== '下载'){
 		if(className === 'btn-wrap btn-active' || e.target.innerText !== '下载'){
 			return
 			return
 		}
 		}
+		let appName = $('.app-title').eq(index).text();
 		if(['btn-wrap','progress', 'text'].includes(className)){
 		if(['btn-wrap','progress', 'text'].includes(className)){
 			$.ajax({
 			$.ajax({
 				url: `${baseUrl}/api/public/v1/ranking/getstatus/${id}`,
 				url: `${baseUrl}/api/public/v1/ranking/getstatus/${id}`,
@@ -228,7 +231,6 @@
 				cache: false,
 				cache: false,
 				success: function (res) {
 				success: function (res) {
 					if(res.status === 0){
 					if(res.status === 0){
-						$('.btn-wrap')[index].className = 'btn-wrap btn-active';
 						const downloadUrl = `${fileCenterApi}/document/newFile/breakpointDownloadFile/3dn9b4585511476691c6?fileKey=${key}`;
 						const downloadUrl = `${fileCenterApi}/document/newFile/breakpointDownloadFile/3dn9b4585511476691c6?fileKey=${key}`;
 						window.location.href = downloadUrl;
 						window.location.href = downloadUrl;
 						let xhr = new XMLHttpRequest();
 						let xhr = new XMLHttpRequest();
@@ -237,12 +239,11 @@
 							// 响应头要有Content-Length
 							// 响应头要有Content-Length
 							if (event.lengthComputable) {
 							if (event.lengthComputable) {
 								let percentComplete = event.loaded / event.total;
 								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);
 						}, false);
 						xhr.send();
 						xhr.send();
@@ -255,6 +256,32 @@
 			})
 			})
 		}
 		}
 	},false);
 	},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',()=>{
 	$('.left-arrow')[0].addEventListener('click',()=>{
 		location.href = './browser.html'
 		location.href = './browser.html'

+ 2 - 2
screenAndroid/WXtrialInterface.html

@@ -272,7 +272,7 @@
       });
       });
     }
     }
     //云机倒计时
     //云机倒计时
-    let validTime = parameters['validTime'];
+    let validTime = parameters['validTime'] || 10000;
     let detailTime = validTime * 60 * 1000
     let detailTime = validTime * 60 * 1000
     setTimeout(() => {
     setTimeout(() => {
       $('.bug-title').eq(0).text('尊敬的用户您的云手机试用时间已到期');
       $('.bug-title').eq(0).text('尊敬的用户您的云手机试用时间已到期');
@@ -307,7 +307,7 @@
     var cardToken = parameters["cardToken"];
     var cardToken = parameters["cardToken"];
     cardToken = cardToken && cardToken.replace(/@/g, "=");
     cardToken = cardToken && cardToken.replace(/@/g, "=");
     var appletPushAddress = parameters["appletPushAddress"];
     var appletPushAddress = parameters["appletPushAddress"];
-    var socketURL = isWSS ? "wss://" + appletPushAddress + "?cardIp=" + ip + "&token=" + cardToken + "&type=business" : "ws://" + appletPushAddress + "?cardIp=" + ip + "&token=" + cardToken + "&type=business";
+    var socketURL = isWSS ? "wss://" + appletPushAddress + "?cardIp=" + ip + "&token=" + cardToken : "ws://" + appletPushAddress + "?cardIp=" + ip + "&token=" + cardToken;
 
 
     var jmuxer = new JMuxer({
     var jmuxer = new JMuxer({
       node: 'playerVideo',
       node: 'playerVideo',

+ 19 - 5
screenIos/WXtrialInterface.html

@@ -299,7 +299,7 @@
     });
     });
   </script>
   </script>
   <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 topwinHeight = window.screen.height - window.innerHeight + 30; //计算title top 头部
     var url = window.location.href;
     var url = window.location.href;
     url = url.split('/');
     url = url.split('/');
@@ -340,6 +340,14 @@
         isAudioPlay = true;
         isAudioPlay = true;
       }
       }
     });
     });
+    //云机倒计时
+    let validTime = parameters['validTime'] || 10000;
+    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横屏
     var orientation = 0; //0 竖屏,1横屏
     function array_unique(arr) {
     function array_unique(arr) {
       return arr.filter(function (e, i) {
       return arr.filter(function (e, i) {
@@ -1009,7 +1017,7 @@
     // 点击取消
     // 点击取消
     $('.cannel-btn')[0].addEventListener('click', () => {
     $('.cannel-btn')[0].addEventListener('click', () => {
       $('.buy-phone-wrap').eq(0).hide();
       $('.buy-phone-wrap').eq(0).hide();
-      if (disconnectionFlag) {//设置了断线时间,取消直接退出
+      if (disconnectionFlag || getDate) {//设置了断线时间,取消直接退出
         systemBuriedPoint('激活码-断线-取消');
         systemBuriedPoint('激活码-断线-取消');
         wx.miniProgram.switchTab({
         wx.miniProgram.switchTab({
           url: '/pages/home/home'
           url: '/pages/home/home'
@@ -1043,9 +1051,15 @@
         pointName = videoTime == 0 ? '激活码-关闭-去购买' : '激活码-强制关闭-去购买';
         pointName = videoTime == 0 ? '激活码-关闭-去购买' : '激活码-强制关闭-去购买';
       }
       }
       systemBuriedPoint(pointName);
       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', () => {
     $('.cannel-ad-btn')[0].addEventListener('click', () => {