index.html 1.51 KB
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title></title>
		<script src="./js/common.js" type="text/javascript"></script>
		<script type="text/javascript">
			// function disp_confirm()
			//   {
			// 	  var r=  confirm("Press a button")
			// 	  if (r) {
			// 		  plus.storage.setItem('privacyPolicy', 'agree');
			// 	  }
			// 	  else
			// 	  {
			// 		  // plus.runtime.quit();
			// 	  }
			//   }
			document.addEventListener('plusready', function() {
				const data = getUrlData();
				if (!data) {
					window.location.href = 'http://118.178.131.219:8088/loginMobile';
					// showSettingPage();
				} else {
					showMainPage();
				}
				// const sPrivacyPolicy = plus.storage.getItem('privacyPolicy');
				// if (sPrivacyPolicy !== "agree") {
				// 	disp_confirm();
				// }
			});

			function showSettingPage() {
				const view = plus.webview.create('/setting.html', 'setting');
				view.show("pop-in");
			}

			function showMainPage() {
				const waitTime = 5000;
				const data = getUrlData();
				const url = `${data.protocol}://${data.url}:${data.port}/loginMobile`;
				// window.location.href = url;
				// console.log(url);
				const webview = plus.webview.currentWebview();

				const timerId = setTimeout(() => {
					webview.loadURL('/setting.html');
				}, waitTime);
				webview.onloaded = () => {
					clearTimeout(timerId);
				};
				webview.loadURL(url);
			}
		</script>
	</head>
	<body>

	</body>
</html>