浏览代码

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

huangxiaojing 3 年之前
父节点
当前提交
a570403d52

+ 120 - 0
microserviceUserH5/static/css/browser.css

@@ -0,0 +1,120 @@
+@media screen and (max-width: 750px) {
+  html {
+    font-size: calc(100vw / 7.5);
+  }
+}
+
+@media screen and (min-width: 750px) {
+  html {
+    font-size: calc(450px / 7.5);
+  }
+}
+
+html, body, div, ul, li, p {
+  padding: 0;
+  margin: 0;
+}
+
+ul, li {
+  list-style: none;
+}
+
+input{  
+  background:none;  
+  outline:none;  
+  border:0px;
+}
+.logo-row{
+  width: 100%;
+  display: flex;
+  justify-content: center;
+  padding-top: 3rem;
+}
+.logo{
+  width: 2.4rem;
+  height: 0.72rem;
+}
+.search-wrap{
+  display: flex;
+  align-items: center;
+  margin: auto;
+  margin-top: 0.4rem;
+  width: 6.9rem;
+  height: 0.9rem;
+  background: #FFFFFF;
+  border-radius: 0.2rem;
+  border: 0.03rem solid #696969;
+}
+.search-icon{
+  width: 0.52rem;
+  height: 0.52rem;
+  margin-left: 0.24rem;
+}
+.ipt{
+  margin-left: 0.1rem;
+  font-size: 0.3rem;
+  font-weight: 500;
+  color: #333333;
+}
+.tag-wrap{
+  padding-top: 0.24rem;
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: space-around;
+}
+.tag-item{
+  width: 1.6rem;
+  height: 1.96rem;
+  background: #FFF9F1;
+  border-radius: 0.2rem;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-around;
+  padding-left: 0.1rem;
+  margin-top: 0.3rem;
+}
+.icon-row{
+  width: 0.68rem;
+  height: 0.64rem;
+  display: inline-block;
+}
+.icon-title{
+  font-size: 0.28rem;
+  font-weight: 500;
+  color: #333333;
+}
+.right-arrow{
+  width: 0.32rem;
+  height: 0.32rem;
+  display: inline-block;
+}
+
+#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;
+  }
+}

+ 242 - 0
microserviceUserH5/static/css/browserDetail.css

@@ -0,0 +1,242 @@
+@media screen and (max-width: 750px) {
+  html {
+    font-size: calc(100vw / 7.5);
+  }
+}
+
+@media screen and (min-width: 750px) {
+  html {
+    font-size: calc(450px / 7.5);
+  }
+}
+
+html, body, div, ul, li, p {
+  padding: 0;
+  margin: 0;
+}
+
+ul, li {
+  list-style: none;
+}
+
+input{  
+  background:none;  
+  outline:none;  
+  border:0px;
+}
+.container{
+  min-height: 99vh;
+  padding-top: 0.01rem;
+  background: #F5F7FA;
+}
+.download-wrap{
+  padding-top: 2.74rem;
+  padding-bottom: 0.3rem;
+  height: calc(99vh - 2.94rem);
+  overflow-y: scroll;
+}
+.header-wrap{
+  width: 100%;
+  position: fixed;
+  top: 0;
+  left: 0;
+  z-index: 999;
+  padding-top: 0.18rem;
+  background: #FFFFFF;
+  overflow: hidden;
+}
+.search-wrap{
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin: 0 auto;
+  margin-bottom: 0.18rem;
+  width: 7.14rem;
+  height: 0.66rem;
+  background: #CCCDD4;
+  border-radius: 0.2rem;
+  opacity: 0.4;
+}
+.search-icon{
+  width: 0.28rem;
+  height: 0.28rem;
+  margin-left: 0.24rem;
+}
+.ipt{
+  width: 2rem;
+  margin-left: 0.1rem;
+  font-size: 0.32rem;
+  font-weight: 500;
+  color: rgba(0, 0, 0, 0.85);
+}
+.title-wrap{
+  display: flex;
+  align-items: center;
+  height: 0.88rem;
+  border-top: 0.01rem solid rgba(238,238,238,1);
+}
+.left-arrow{
+  width: 0.48rem;
+  height: 0.48rem;
+  margin-left: 0.44rem;
+}
+.title{
+  flex: 1;
+  text-align: center;
+  margin-right: 0.44rem;
+  font-size: 0.36rem;
+  font-weight: 500;
+  color: rgba(51, 51, 51, 0.85);
+}
+.tag-wrap{
+  /* width: 100%; */
+  height: 0.8rem;
+  display: flex;
+  align-items: center;
+  padding-left: 0.58rem;
+  overflow-x: auto;
+  box-shadow: 0 0.04rem 0.08rem 0 rgba(0, 0, 0, 0.05);
+  border-radius: 0 0 0.2rem 0.2rem;
+}
+.tag-item{
+  min-width: 0.6rem;
+  padding-bottom: 0.06rem;
+  margin-right: 0.84rem;
+  font-size: 0.28rem;
+  font-weight: 500;
+  color: rgba(0, 0, 0, 0.85);
+}
+.active{
+  border-bottom: 0.06rem solid #3B7FFF;
+}
+.download-item{
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  width: 6.5rem;
+  height: 1.4rem;
+  border-radius: 0.32rem;
+  margin: 0.36rem 0.3rem;
+  padding: 0 0.2rem;
+  background: #FFFFFF;
+}
+.main-wrap{
+  display: flex;
+}
+.app-icon{
+  align-self: flex-start;
+  width: 1.2rem;
+  height: 1.2rem;
+  margin-top: -0.46rem;
+  border-radius: 0.32rem;
+  border: 0.02rem solid #EBEBEB;
+  /* background-color: #666666; */
+}
+.app-wrap{
+  margin-left: 0.2rem;
+}
+.app-title{
+  width: 3.6rem;
+  font-size: 0.32rem;
+  font-weight: 500;
+  color: #333333;
+  white-space:nowrap;
+  overflow:hidden;
+  text-overflow:ellipsis;
+}
+.app-description{
+  width: 3.6rem;
+  font-size: 0.26rem;
+  color: #666666;
+  white-space:nowrap;
+  overflow:hidden;
+  text-overflow:ellipsis;
+}
+.btn-wrap{
+  position: relative;
+  width: 1.2rem;
+  height: 0.54rem;
+  line-height: 0.54rem;
+  text-align: center;
+  background: linear-gradient(180deg, #6DB6FF 0%, #3B7FFF 100%);
+  border-radius: 0.16rem;
+  font-size: 0.24rem;
+  color: #FFFFFF;
+  overflow: hidden;
+}
+
+.btn-active{
+  width: 1.16rem;
+  height: 0.5rem;
+  background: #FFFFFF;
+  border: 0.04rem solid #3B7FFF;
+  color: rgba(59, 127, 255, 1);
+}
+
+.progress{
+  position: absolute;
+  left: -1.2rem;
+  width: 1.2rem;
+  height: 0.54rem;
+  background: rgba(59, 127, 255, 0.3);
+}
+
+.none-wrap{
+  position: fixed;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+}
+.none-img{
+  width: 4.82rem;
+  height: 2.6rem;
+}
+
+.none-text{
+  text-align: center;
+  margin-top: 0.4rem;
+  font-size: 0.26rem;
+  color: #BBBBBB;
+}
+
+.loading{
+  font-size: 0.26rem;
+  color: #BBBBBB;
+  text-align: center;
+}
+
+#toast-container>.toast-error {
+  background-image: none !important;
+  border-radius: 0.2rem;
+}
+
+.toast-error {
+  background-color: rgba(0, 0, 0, 0.8);
+  border-radius: 0.2rem;
+}
+
+#toast-container>div {
+  font-size: 14px;
+  min-width: 80px !important;
+  padding: 12px !important;
+  box-shadow: none;
+  border-radius: 0.2rem;
+}
+
+.toast-center-center {
+  position: fixed;
+  width: 220px;
+  top: 50%;
+  left: 50%;
+  text-align: center;
+  transform: translate(-50%, -50%);
+  color: #FFFFFF;
+  border-radius: 0.2rem;
+}
+
+@media (max-width: 480px) and (min-width: 241px) {
+  #toast-container>div {
+    min-width: 88px !important;
+    width: auto;
+  }
+}

二进制
microserviceUserH5/static/img/browser/icon.png


二进制
microserviceUserH5/static/img/browser/left-arrow.png


二进制
microserviceUserH5/static/img/browser/logo.png


二进制
microserviceUserH5/static/img/browser/none.png


二进制
microserviceUserH5/static/img/browser/right-arrow.png


二进制
microserviceUserH5/static/img/browser/search-icon.png


二进制
microserviceUserH5/static/img/browser/search-icon2.png


+ 1 - 0
microserviceUserH5/static/js/vender/config.js

@@ -1,6 +1,7 @@
 var url = window.location.href;
 url = url.split('/');
 var baseUrl = url[0] + '//' + url[2];
+// var baseUrl = 'http://14.18.190.141:24380'
 // var baseUrl = 'http://prese.phone.androidscloud.com'
 // var baseUrl = 'http://vclusters.imwork.net:2221'
 

+ 84 - 0
microserviceUserH5/vcloud/browser.html

@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
+	<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
+	<title>双子星浏览器</title>
+	<link rel="stylesheet" href="https://cdn.bootcss.com/weui/1.1.3/style/weui.min.css">
+	<script src="../static/js/vender/vue/axios.min.js"></script>
+	<script src="../static/js/vender/jquery-3.4.1.min.js"></script>
+	<script src="../static/js/vender/vue/vue.min.js"></script>
+	<link rel="stylesheet" href="https://cdn.bootcss.com/jquery-weui/1.2.1/css/jquery-weui.min.css">
+	<script src="../static/js/vender/config.js"></script>
+	<link rel="stylesheet" href="../static/css/browser.css">
+	<script src="../static/js/vender/vue/config.js"></script>
+    <script type="text/javascript">
+        var deviveWidth = document.documentElement.clientWidth;
+        document.documentElement.style.fontSize = deviveWidth / 7.5 + 'px';
+    </script>
+</head>
+<body>
+	<div class="container">
+		<div class="logo-row">
+			<img class="logo" src="../static/img/browser/logo.png" />
+		</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="搜索或输入网址" />
+		</div>
+		<div class="tag-wrap" id="tag-wrap"></div>
+	</div>
+<script type="text/javascript">
+	const tagDom = document.getElementById("tag-wrap");
+	(function(){
+		init();
+	})();
+	function init(){
+		$.ajax({
+				url: `${baseUrl}/api/public/v1/browserPlate/client/query`,
+				type: 'get',
+				contentType:"application/json",
+				dataType: 'json',
+				cache: false,
+				success: function (res) {
+					let list = res.data;
+					let node = '';
+					for(let i=0; i < list.length; i++){
+						node += `<div class="tag-item" data-plateName="${list[i].plateName}" data-id="${list[i].id}">
+								<img class="icon-row" data-plateName="${list[i].plateName}" data-id="${list[i].id}" src=${fileCenterApi}/document/newFile/download/0/3dn9b4585511476691c6?fileKey=${list[i].iconImage} />
+								<div class="icon-title" data-plateName="${list[i].plateName}" data-id="${list[i].id}">${list[i].plateName}</div>
+								<img class="right-arrow" src="../static/img/browser/right-arrow.png" data-plateName="${list[i].plateName}" data-id="${list[i].id}" />
+							</div>`
+					}
+					tagDom.innerHTML = node;
+				}
+		})
+	};
+	tagDom.addEventListener('click',(e)=>{
+		let plateName = e.target.dataset.platename;
+		let id = e.target.dataset.id;
+		$.ajax({
+				url: `${baseUrl}/api/public/v1/browserPlate/reportClickNum/${id}`,
+				type: 'get',
+				contentType:"application/json",
+				dataType: 'json',
+				cache: false,
+				success: function (res) {
+					if(res.status === 0){
+						location.href = `./browserDetail.html?plateName=${encodeURIComponent(plateName)}&plateId=${id}`;
+					}
+				}
+			})
+	},false);
+	//点击按钮搜索
+	const searchDom = document.getElementById("search-icon");
+	searchDom.addEventListener('click',()=>{
+		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;
+		window.open(wd);
+	},false);
+</script>
+</body>
+</html>

+ 266 - 0
microserviceUserH5/vcloud/browserDetail.html

@@ -0,0 +1,266 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
+	<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
+	<title>双子星浏览器</title>
+	<link rel="stylesheet" href="https://cdn.bootcss.com/weui/1.1.3/style/weui.min.css">
+	<script src="../static/js/vender/vue/axios.min.js"></script>
+	<script src="../static/js/vender/vue/vue.min.js"></script>
+	<link rel="stylesheet" href="https://cdn.bootcss.com/jquery-weui/1.2.1/css/jquery-weui.min.css">
+	<link rel="stylesheet" href="../static/css/browserDetail.css">
+	<script src="../static/js/vender/jquery-3.4.1.min.js"></script>
+	<script src="../static/js/vender/config.js"></script>
+	<script src="../static/js/vender/toastr/toastr.min.js"></script>
+	<script src="../static/js/vender/vue/config.js"></script>
+    <script type="text/javascript">
+        var deviveWidth = document.documentElement.clientWidth;
+        document.documentElement.style.fontSize = deviveWidth / 7.5 + 'px';
+    </script>
+	<script>
+		toastr.options.positionClass = 'toast-center-center';
+		// toastr.options.timeOut = '1500';
+	</script>
+</head>
+<body>
+	<div class="container">
+		<div class="header-wrap">
+			<div class="search-wrap" id="search-wrap">
+				<img class="search-icon" src="../static/img/browser/search-icon2.png" />
+				<div class="ipt" id="ipt">双子星浏览器</div>
+			</div>
+			<div class="title-wrap">
+				<img class="left-arrow" src="../static/img/browser/left-arrow.png" />
+				<div class="title"></div>
+			</div>
+			<div class="tag-wrap"></div>
+		</div>
+		<div class="download-wrap">
+			<div class="download-content"></div>
+			<div class="loading"></div>
+		</div>
+	</div>
+<script type="text/javascript">
+	let title = decodeURIComponent(GetRequest().plateName);
+	let timer,flag = true;
+	let labelId = '', pageNum = 1, pageSize = 10, index = 0, recordFlag = true, total = 0, nowlength = 0;
+	$('.title').eq(0).text(title);
+	(function(){
+		init();
+	})();
+	function init(){
+		if(nowlength === 0) {
+			toastr.error('加载中...');
+		}
+		$.ajax({
+			url: `${baseUrl}/api/public/v1/browserLabel/client/query/${GetRequest().plateId}`,
+			type: 'get',
+			contentType:"application/json",
+			dataType: 'json',
+			cache: false,
+			success: function (res) {
+				let list = res.data;
+				labelId = list[0].id;
+				rankingGet();
+				let node = '';
+				for(let i=0; i < list.length; i++){
+					node += `<div class="tag-item ${i === index ? 'active' : ''}" data-id="${list[i].id}" data-index="${i}">${list[i].labelName}</div>`
+				}
+				$('.tag-wrap').eq(0).append(node);
+			}
+		})
+	};
+	function getType() {
+		return new Promise((resolve, reject) => {
+			$.ajax({
+				url: `http://192.168.211.215:9000/getType`,
+				type: 'get',
+				contentType:"application/json",
+				dataType: 'json',
+				cache: false,
+				success: function (res) {
+					if(res.code === 200){
+						let cardType = res.data.devType;
+						let phoneObj = {
+							'RK_3399': 'SVIP'
+						}
+						phoneType = phoneObj[cardType];
+						resolve(phoneType);
+					}
+				}
+			})
+		})
+	}
+	function rankingGet(){
+		getType().then((phoneType) => {
+			$.ajax({
+				url: `${baseUrl}/api/public/v1/ranking/client/get`,
+				type: 'post',
+				data: JSON.stringify({
+					labelId: +labelId,
+					phoneType: phoneType,
+					pageNum: pageNum,
+					pageSize: pageSize
+				}),
+				contentType:"application/json",
+				dataType: 'json',
+				cache: false,
+				success: function (res) {
+					if(res.status === 0){
+						let list = res.data.records;
+						nowlength += list.length;
+						total = res.data.total;
+						recordFlag = true;
+						let node = '';
+						for(let i=0; i < list.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} />
+											<div class="app-wrap">
+												<div class="app-title">${list[i].appName}</div>
+												<div class="app-description">${list[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>
+									</div>`
+						}
+						if(nowlength !== total){
+							$('.loading').eq(0).text('正在努力加载中...');
+						} else {
+							$('.loading').eq(0).text('已加载全部内容');
+						}
+						if(list.length === 0){
+							node = `<div class="none-wrap">
+										<img class="none-img" src="../static/img/browser/none.png" />
+										<div class="none-text">没有更多内容哦~</div>
+									</div>`
+						}
+						$('.download-content').eq(0).append(node);
+					}else{
+						stopManyClick(() => {
+							toastr.error(res.msg);
+						})
+					}
+				}
+			})
+		})
+	};
+	//点击切换
+	$('.tag-wrap')[0].addEventListener('click',(e)=>{
+		labelId = e.target.dataset.id;
+		let className = e.target.className;
+		if(className.includes('tag-item')){
+			pageNum = 1;
+			nowlength = 0;
+			total = 0;
+			toastr.error('加载中...');
+			$('.loading').eq(0).text('');
+			$('.download-content').eq(0).text('');
+			$('.tag-item')[index].className = 'tag-item';
+			index = e.target.dataset.index;
+			$('.tag-item')[index].className = 'tag-item active';
+			rankingGet();
+		}
+	},false);
+	// 点击下载按钮
+	$('.download-wrap')[0].addEventListener('click',(e)=>{
+		let key = e.target.dataset.key;
+		let md5 = e.target.dataset.md5;
+		let index = e.target.dataset.index;
+		let id = e.target.dataset.id;
+		let className = e.target.className;
+		if(className === 'btn-wrap btn-active'){
+			return
+		}
+		if(['btn-wrap','progress', 'text'].includes(className)){
+			$('.btn-wrap')[index].className = 'btn-wrap btn-active';
+			$.ajax({
+				url: `${baseUrl}/api/public/v1/ranking/getstatus/${id}`,
+				type: 'get',
+				contentType:"application/json",
+				dataType: 'json',
+				cache: false,
+				success: function (res) {
+					if(res.status === 0){
+						const downloadUrl = `${fileCenterApi}/document/newFile/breakpointDownloadFile/3dn9b4585511476691c6?fileKey=${key}`;
+						window.location.href = downloadUrl;
+						let xhr = new XMLHttpRequest();
+						xhr.open('GET', downloadUrl, true);
+						xhr.addEventListener('progress', function (event) {
+							// 响应头要有Content-Length
+							if (event.lengthComputable) {
+								let percentComplete = event.loaded / event.total;
+								// 进度条的位置也是translate,一开始是用translateX(-100%)挪到外面去
+								$('.progress')[0].style.transform = `translateX(${percentComplete * 100}%)`;
+								$('.text').eq(0).text(`${(percentComplete * 100).toFixed(1)}%`);
+							}
+						}, false);
+						xhr.send();
+						// var formData = new FormData();
+						// formData.append("file",$("#photo")[0].files[0]);
+						// $.ajax({
+						// 	url: `${baseUrl}/document/file/breakUpload`,
+						// 	type: 'post',
+						// 	headers: {
+						// 		'file-access-key': '3dn9b4585511476691c6',
+						// 		'md5': md5
+						// 	},
+						// 	data: formData,
+						// 	contentType: false,
+        				// 	processData: false,
+						// 	cache: false,
+						// 	success: function (res) {
+						// 		console.log(res)
+						// 		if(res.status === 0){
+						// 		}
+						// 	}
+						// })
+					} else {
+						stopManyClick(() => {
+							toastr.error(res.msg);
+						})
+					}
+				}
+			})
+		}
+	},false);
+	//点击返回按钮
+	$('.left-arrow')[0].addEventListener('click',()=>{
+		location.href = './browser.html'
+	},false);
+	//数据下拉加载
+	$('.download-wrap')[0].addEventListener('scroll',function () {
+		let scrollTop = $('.download-wrap')[0].scrollTop;
+		let clientHeight = $('.download-wrap')[0].clientHeight;
+		let scrollHeight = $('.download-wrap')[0].scrollHeight;
+		if(scrollTop + clientHeight + 10 > scrollHeight){
+			if(recordFlag && nowlength < total && total > 0){
+				recordFlag = false;
+				pageNum++;
+				rankingGet();
+			}
+		}
+	});
+	//防止提示一秒内重复显示
+	function stopManyClick(fn) {
+		if (flag) {
+			fn();
+		}
+		flag = false;
+		if(timer){clearTimeout(timer);}
+		timer = setTimeout(() => {flag = true}, 1500);
+	}
+	//点击按钮搜索
+	const searchDom = document.getElementById("search-wrap");
+	searchDom.addEventListener('click',()=>{
+		var wd = "https://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=1&rsv_idx=1&tn=baidu";
+		window.open(wd);
+	},false);
+</script>
+</body>
+</html>

+ 260 - 9
screenAndroid/WXtrialInterface.html

@@ -102,6 +102,35 @@
     <p class="weui-toast_content">数据加载中</p>
   </div>
 
+  <div class="try-use-wrap">
+    <div class="try-use-container">
+      <video width="100%" height="100%" muted autoplay="autoplay" loop="loop">
+        <source id="source" src="http://110.53.221.195:8210/document/newFile/download/0/3dn9b4585511476691c6?fileKey=LowLevelMultipartUpload_16522192367175270411" type="video/mp4"></source>
+        您的浏览器不支持 video 标签。
+      </video>
+      <div class="time-close-wrap"><span class="time-node"></span> 关闭</div>
+    </div>
+  </div>
+  <div class="buy-phone-wrap">
+    <div class="bug-wrap">
+      <div class="bug-title">体验完整云手机服务请前往购买</div>
+      <div class="btn-list">
+        <div class="btn cannel-btn">取消</div>
+        <div class="btn go-bug">去购买</div>
+      </div>
+    </div>
+  </div>
+
+  <div class="look-wrap">
+    <div class="bug-wrap">
+      <div class="bug-title">关闭广告会退出云手机是否继续观看</div>
+      <div class="btn-list">
+        <div class="btn cannel-btn cannel-ad-btn">放弃</div>
+        <div class="btn go-bug looking">继续观看</div>
+      </div>
+    </div>
+  </div>
+
   <body oncontextmenu="Back()">
   </body>
   <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
@@ -115,7 +144,12 @@
   <script type="text/javascript" src="jmuxer.js"></script>
   <script type="text/javascript" src="spsParser.js"></script>
   <script>
+    var baseUrl = 'http://14.18.190.141:24380'
     var parameters = GetRequest();
+    var form = {};
+    form.token = parameters['token'];
+    form.userCardId = 1710808;
+    var videoTimer = null, videoTime = 0, adType = 0, sourceType = 2;
     if (parameters['mealType'] === 'VIP') {
       $(".loading_sceen_pic").attr('src', '../static/img/home_bg_VIP.png');
     } else if (parameters['mealType'] === 'SVIP') {
@@ -125,6 +159,7 @@
     } else if (parameters['mealType'] === 'STARPRO') {
       $(".loading_sceen_pic").attr('src', '../static/img/home_bg_PRO.png');
     }
+    adInit();
     var isAudioPlay = false;
     if (navigator.userAgent.toLowerCase().includes('toutiaomicroapp')) {
       var video = document.getElementById("playerVideo");
@@ -141,16 +176,216 @@
         });
       }, 1000)
     } else {
-      $.alert({
-        title: '提示',
-        text: '开始使用云手机',
-        onOK: function () {
-          var video = document.getElementById("playerVideo");
-          video.play();
-          isAudioPlay = true;
-        }
-      });
+      // $.alert({
+      //   title: '提示',
+      //   text: '开始使用云手机',
+      //   onOK: function () {
+      //     var video = document.getElementById("playerVideo");
+      //     video.play();
+      //     isAudioPlay = true;
+      //   }
+      // });
+    }
+    // 
+    function getConfigByPhoneType() {
+      return new Promise((resolve, reject) => {
+        $.ajax({
+          url: baseUrl + "/api/pay/v5/trialCodeConfig/getConfigByPhoneType",
+          headers: {
+            'Authorization': form.token
+          },
+          data: {
+            userCardId: 1710808,
+            phoneType: 'STARPRO'
+          },
+          type: 'get',
+          dataType: 'json',
+          success: function (res) {
+            console.log(res)
+            // if (res.status === 0) {
+            //   let list = res.data;
+            //   list.map((item) => {
+            //     // if(item.phoneType === parameters['mealType']){
+            //     if(item.phoneType === 'STARPRO'){
+            //       resolve(item)
+            //     }
+            //   })
+            // } else {
+            //   $.toast(res.msg, "text");
+            // }
+          }
+        })
+      })
+    }
+    //列表
+    function getSetmealList() {
+      return new Promise((resolve, reject) => {
+        $.ajax({
+          url: baseUrl + "/api/resources/v4/freetrial/setmeal/list",
+          headers: {
+            'Authorization': form.token
+          },
+          type: 'get',
+          dataType: 'json',
+          success: function (res) {
+            if (res.status === 0) {
+              let list = res.data;
+              list.map((item) => {
+                // if(item.phoneType === parameters['mealType']){
+                if(item.phoneType === 'STARPRO'){
+                  resolve(item)
+                }
+              })
+            } else {
+              $.toast(res.msg, "text");
+            }
+          }
+        })
+      })
+    }
+    //广告信息
+    function adInit() {
+      // sourceType = parameters['sourceType'];
+      if(sourceType == 1) {
+        getSetmealList().then((res) => {
+          if(res.pushFlowAdvert === 1){
+            getAdList(15);
+          }
+          if(res.intervalSwitch === 1) {
+            let time = res.intervalAdvertDuration * 60 * 1000;
+            setInterval(() => {
+              $('.try-use-wrap').eq(0).hide();
+              getAdList(16);
+            }, time);
+          }
+        })
+      }else if(sourceType === 2) {
+        getConfigByPhoneType().then((res) => {
+          if(res.pushFlowAdvert === 1){
+            getAdList(15);
+          }
+          if(res.intervalSwitch === 1) {
+            let time = res.intervalAdvertDuration * 60 * 1000;
+            setInterval(() => {
+              $('.try-use-wrap').eq(0).hide();
+              getAdList(16);
+            }, time);
+          }
+        })
+      }
+    }
+    // 广告接口
+    function getAdList(type){
+      adType = type;
+      $.ajax({
+            url: baseUrl + "/api/public/v5/advertising/getAdInfoByAdPlace",
+            headers: {
+              'Authorization': form.token
+            },
+            data: JSON.stringify({
+              adPlace: type,
+              os: 0
+            }),
+            type: 'POST',
+            dataType: 'json',
+					  contentType: "application/json;charset=UTF-8",
+            success: function (res) {
+              if (res.status === 0) {
+                let list = res.data;
+                videoTime = list[0].forcedTime;
+                $('#source').src = list[0].adVideoBase.videoUrl;
+                videoTimer = setInterval(() =>{
+                  if(videoTime > 0) {
+                    videoTime--;
+                    $('.time-node').eq(0).text(videoTime + 's');
+                  } else {
+                    clearInterval(videoTimer);
+                    $('.time-node').eq(0).text('');
+                  }
+                },1000)
+                if (adType === 16 && sourceType == 1) { // 间隔广告和试用才上报
+                  report(0);
+                }
+                $('.try-use-wrap').eq(0).show();
+              } else {
+                $.toast(res.msg, "text");
+              }
+            }
+          })
     }
+    //间隔广告上报
+    function report(type) {
+      $.ajax({
+        url: baseUrl + "/api/resources/v1/trial/report",
+        headers: {
+          'Authorization': form.token
+        },
+        data: JSON.stringify({
+          userCardId: form.userCardId,
+          reportType: type
+        }),
+        type: 'POST',
+        dataType: 'json',
+        contentType: "application/json;charset=UTF-8",
+        success: function (res) {}
+      })
+    }
+    //关闭广告
+    $('.time-close-wrap')[0].addEventListener('click', () => {
+      $('.buy-phone-wrap').eq(0).show();
+    })
+    // 点击取消
+    $('.cannel-btn')[0].addEventListener('click', () => {
+      $('.buy-phone-wrap').eq(0).hide();
+      let pointName = '';
+      if(sourceType == 1){
+        pointName = videoTime == 0 ? '免费试用-关闭-取消' : '免费试用-强制关闭-取消';
+      } else {
+        pointName = videoTime == 0 ? '激活码-关闭-取消' : '激活码-强制关闭-取消';
+      }
+      systemBuriedPoint(pointName);
+      if(videoTime == 0) {
+        if (adType === 16 && sourceType == 1) {
+          report(1);
+        }
+        $('.try-use-wrap').eq(0).hide();
+        return
+      }
+      $('.look-wrap').eq(0).show();
+    })
+    // 点击去购买
+    $('.go-bug')[0].addEventListener('click', () => {
+      let pointName = '';
+      if(sourceType == 1){
+        pointName = videoTime == 0 ? '免费试用-关闭-去购买' : '免费试用-强制关闭-去购买';
+      } else {
+        pointName = videoTime == 0 ? '激活码-关闭-去购买' : '激活码-强制关闭-去购买';
+      }
+      systemBuriedPoint(pointName);
+      wx.miniProgram.switchTab({
+        url: '/pages/home/home'
+      })
+    })
+    // 放弃
+    $('.cannel-ad-btn')[0].addEventListener('click', () => {
+      if(sourceType == 1){
+        systemBuriedPoint('免费试用-强制关闭-放弃');
+      } else {
+        systemBuriedPoint('激活码-强制关闭-放弃');
+      }
+      wx.miniProgram.switchTab({
+        url: '/pages/home/home'
+      })
+    })
+    // 继续观看
+    $('.looking')[0].addEventListener('click', () => {
+      $('.look-wrap').eq(0).hide();
+      if(sourceType == 1){
+        systemBuriedPoint('免费试用-强制关闭-继续观看');
+      } else {
+        systemBuriedPoint('激活码-强制关闭-继续观看');
+      }
+    })
     var topwinHeight = window.screen.height - window.innerHeight + 30; //计算title top 头部  
     $('#wine').css({
       "width": window.screen.width,
@@ -783,6 +1018,22 @@
         })
       }
     })
+    // 埋点
+    function systemBuriedPoint(pointName){
+      $.ajax({
+        url: baseUrl + "/api/public/v1/systemBuriedPoint/stat",
+        headers: {
+          'Authorization': form.token
+        },
+        type: 'post',
+        data:JSON.stringify({
+					pointName: pointName
+				}),
+				contentType:"application/json",
+        dataType: 'json',
+        success: function (res) {}
+      })
+    }
     window.onbeforeunload = function () {
       ws.close();
       wsss.close();

+ 83 - 0
screenAndroid/css/WXtrialInterface.css

@@ -484,4 +484,87 @@ ul, li {
 	top: 0;
 	left: 0;
 	z-index: 4;
+}
+
+.try-use-wrap, .buy-phone-wrap, .look-wrap{
+    width: 100%;
+    height: 100%;
+    position: fixed;
+    top: 0;
+    left: 0;
+    z-index: 9999;
+    background: rgba(0, 0, 0, 0.5);
+	display: none;
+}
+  
+.try-use-container{
+	width: 80%;
+	height: 409px;
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+	background-color: #FFFFFF;
+	border-radius: 0.66em;
+}
+
+.time-close-wrap{
+	width: 5.46em;
+	height: 2em;
+	line-height: 2em;
+	text-align: center;
+	position: absolute;
+	top: 0.24em;
+	right: 0.3em;
+	background: rgba(0, 0, 0, 0.49);
+	border-radius: 1.26em;
+	font-size: 12px;
+	color: #FFFFFF;
+}
+
+.bug-wrap{
+	width: 90%;
+	height: 115px;
+	background: #FFFFFF;
+	border-radius: 10px;
+	position: absolute;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+}
+
+.bug-title{
+	text-align: center;
+	margin: 25px 0;
+	font-size: 18px;
+	font-weight: 600;
+	color: #333333;
+}
+
+.btn-list{
+	width: 100%;
+	height: 44px;
+	line-height: 44px;
+	border-top: 1px solid rgba(238,238,238,1);
+	position: absolute;
+	bottom: 0;
+	left: 0;
+	display: flex;
+	align-items: center;
+}
+
+.btn{
+	flex: 1;
+	text-align: center;
+}
+
+.cannel-btn{
+	font-size: 18px;
+	color: #666666;
+}
+
+.go-bug{
+	font-size: 18px;
+	color: #3B7FFF;
+	border-left: 1px solid rgba(238,238,238,1);
 }

+ 7 - 1
screenIos/WXdraw.js

@@ -75,10 +75,16 @@ function doConnect() {
         tt.miniProgram.switchTab({
           url: '/pages/home/home'
         })
-      } else {
+      } else if(window.__wxjs_environment === 'miniprogram') {
         wx.miniProgram.switchTab({
           url: '/pages/home/home'
         })
+      } else {
+        document.addEventListener('UniAppJSBridgeReady', function() {
+          uni.navigateTo({
+            url: '/pages/index/index'
+          });
+        })
       }
     }
   };

+ 27 - 4
screenIos/WXtrialInterface.html

@@ -98,6 +98,7 @@
     <div class="weui_loading"><i class="weui-loading weui-icon_toast"></i></div>
     <p class="weui-toast_content">数据加载中</p>
   </div>
+  <script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script>
   <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
   <script src="https://lf1-cdn-tos.bytegoofy.com/goofy/developer/jssdk/jssdk-1.0.3.js"></script>
   <script type="text/javascript" src="jquery-1.11.0.min.js"></script>
@@ -549,10 +550,19 @@
         tt.miniProgram.switchTab({
           url: '/pages/home/home'
         })
-      } else {
+      } else if(window.__wxjs_environment === 'miniprogram') {
         wx.miniProgram.switchTab({
           url: '/pages/home/home'
         })
+      } else {
+        location.href = 'http://test_zt_ip62.phone.androidscloud.com/cloud/phone/web/#/pages/index/index'
+        // 动态设置有问题 https://ask.dcloud.net.cn/question/96060
+        // document.addEventListener('UniAppJSBridgeReady', function() {
+        //   console.log(222)
+        //   uni.navigateTo({
+        //     url: '/pages/index/index'
+        //   });
+        // })
       }
     })
 
@@ -643,7 +653,6 @@
     var ip = parameters["ip"];
     var appletPushAddress = parameters["appletPushAddress"];
     var token = parameters["cardToken"];
-    cardToken = cardToken && cardToken.replace(/@/g, "=");
     var webSocketWorker = new Worker('websocket.js?ip=' + ip + '&appletPushAddress=' + appletPushAddress + '&token=' + token);
 
     webSocketWorker.onmessage = function (event) {
@@ -674,10 +683,17 @@
               tt.miniProgram.switchTab({
                 url: '/pages/home/home'
               })
-            } else {
+            } else if(window.__wxjs_environment === 'miniprogram') {
               wx.miniProgram.switchTab({
                 url: '/pages/home/home'
               })
+            } else {
+              location.href = 'http://test_zt_ip62.phone.androidscloud.com/cloud/phone/web/#/pages/index/index'
+              // document.addEventListener('UniAppJSBridgeReady', function() {
+              //   uni.navigateTo({
+              //     url: '/pages/index/index'
+              //   });
+              // })
             }
           }
         }
@@ -707,10 +723,17 @@
           tt.miniProgram.switchTab({
             url: '/pages/home/home'
           })
-        } else {
+        } else if(window.__wxjs_environment === 'miniprogram') {
           wx.miniProgram.switchTab({
             url: '/pages/home/home'
           })
+        } else {
+          location.href = 'http://test_zt_ip62.phone.androidscloud.com/cloud/phone/web/#/pages/index/index'
+          // document.addEventListener('UniAppJSBridgeReady', function() {
+          //   uni.navigateTo({
+          //     url: '/pages/index/index'
+          //   });
+          // })
         }
       }
     }