|
@@ -0,0 +1,147 @@
|
|
|
|
+<!DOCTYPE html>
|
|
|
|
+<html>
|
|
|
|
+<head>
|
|
|
|
+ <meta charset="UTF-8">
|
|
|
|
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
+ <link rel="icon" href="../static/img/favicon3.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="../static/js/vender/toastr/toastr.min.css">
|
|
|
|
+ <script src="../static/js/vender/toastr/toastr.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" />
|
|
|
|
+ <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>
|
|
|
|
+<script>
|
|
|
|
+ toastr.options.positionClass = 'toast-center-center';
|
|
|
|
+ toastr.options.timeOut = '1500';
|
|
|
|
+</script>
|
|
|
|
+<script type="text/javascript">
|
|
|
|
+ document.addEventListener("visibilitychange",()=>{
|
|
|
|
+ if(document.hidden){
|
|
|
|
+ init();
|
|
|
|
+ }else{
|
|
|
|
+ init();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ const tagDom = document.getElementById("tag-wrap");
|
|
|
|
+ let flag = true, timer=null;
|
|
|
|
+ (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/${uploadKey}?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 class="right-arrow-heght"></div>
|
|
|
|
+ </div>`
|
|
|
|
+ }
|
|
|
|
+ tagDom.innerHTML = node;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ };
|
|
|
|
+ tagDom.addEventListener('click',(e)=>{
|
|
|
|
+ let plateName = e.target.dataset.platename;
|
|
|
|
+ let id = e.target.dataset.id;
|
|
|
|
+ if(!id) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ $.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){
|
|
|
|
+ isGetStatus(id, plateName);
|
|
|
|
+ } else {
|
|
|
|
+ stopManyClick(() => {
|
|
|
|
+ toastr.error(res.msg);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },false);
|
|
|
|
+ // 验证是否下架
|
|
|
|
+ function isGetStatus(id, plateName) {
|
|
|
|
+ $.ajax({
|
|
|
|
+ url: `${baseUrl}/api/public/v1/browserPlate/getStatus/${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}`;
|
|
|
|
+ } else {
|
|
|
|
+ stopManyClick(() => {
|
|
|
|
+ toastr.error(res.msg);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ //防止提示一秒内重复显示
|
|
|
|
+ function stopManyClick(fn) {
|
|
|
|
+ if (flag) {
|
|
|
|
+ fn();
|
|
|
|
+ }
|
|
|
|
+ flag = false;
|
|
|
|
+ if(timer){clearTimeout(timer);}
|
|
|
|
+ timer = setTimeout(() => {flag = true}, 1500);
|
|
|
|
+ }
|
|
|
|
+ $("#myform").bind('search', searchFun);
|
|
|
|
+ //点击按钮搜索
|
|
|
|
+ const searchDom = document.getElementById("search-icon");
|
|
|
|
+ searchDom.addEventListener('click',searchFun,false);
|
|
|
|
+ function searchFun() {
|
|
|
|
+ var key = document.getElementById("ipt").value;
|
|
|
|
+ var wd = "https://www.baidu.com/s?wd=" + key;
|
|
|
|
+ window.open(wd);
|
|
|
|
+ }
|
|
|
|
+ // input 监听回车事件
|
|
|
|
+ $("#ipt").keydown(function (e){
|
|
|
|
+ // 当 keyCode 是13时,是回车操作
|
|
|
|
+ if (e.keyCode == 13){
|
|
|
|
+ searchFun();
|
|
|
|
+ // 取消之前的keydown事件
|
|
|
|
+ e.preventDefault();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+</script>
|
|
|
|
+</body>
|
|
|
|
+</html>
|