
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>生产数据</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <!--<link rel="stylesheet" type="text/css" href="../../css/aui.css"/>-->
    <link rel="stylesheet" type="text/css" href="../../css/popoPicker.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" href="../../css/projeck.css">
    <style>
        body,html{
            background: #F5F5F5;
        }
        .api_layout{
            /*border-top: 1px solid #37b0e9;*/
            /*padding: 13px 10px;*/
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
        }

        .collectionl_listContainer {
          display: flex;
          justify-content: space-between;
          align-items: center;
          background: #fff;
          padding: 10px;
          margin-top: 5px;
        }

        .collectionl_listContainer div:first-child {
          display: flex;
          justify-content: flex-start;
          align-items: center;
          margin-left: 15px;
        }

        .collectionl_listContainer div:first-child .page_name {
          margin-left: 10px;
        }

        .collectionl_listContainer div:first-child img{
          width: 45px;
          height: 45px;
        }


        .collectionl_listContainer div:last-child {
          margin-right: 20px;
        }
        .collectionl_listContainer div:last-child img {
          width: 15px;
          height: 15px;
        }
    </style>
</head>
<body>
<div class="api_layout">
  <div id="collectionListContainer"></div>
</div>

<script type="text/template" id="collectionListTemplate">
  {{~it:value}}
    <div class="collectionl_listContainer" onclick="openBrowseQrcode('{{=value.pageId}}','{{=value.pageName}}')">
      <div>
        <img src="{{=value.url}}" alt="">
        <div class="page_name">{{=value.pageName}}</div>
      </div>
      <div><img src="../../image/more.png" alt=""></div>
    </div>
  {{~}}
</script>
<script src="../../script/api.js"></script>
<script src="../../script/popoPicker.js"></script>
<script src="../../script/doT.min.js"></script>
 <script src="../../script/f2.js"></script>
<script src="../../script/config.js"></script>
<script>
    var userNo = '';
    apiready = function () {
      var info = $api.getStorage('data');
      userNo = JSON.parse(info).data.user.staff_num;
      api.addEventListener({
          name: 'getCollectionListEvent'
      }, function(ret, err) {
          getCollectionList()
      });
      getCollectionList()
    };
    function getCollectionList() {
      let query = {
        userNo: userNo,
        pageNum: 1,
        pageSize: 10
      }
      $http.requestDataLoging(UrlRouter.getSelectPageCollect,'get',query).then(res => {
        if(res.status === 20000) {
          $apis.html(collectionListContainer, '#collectionListTemplate', res.data);
        }
      }).catch(err => {
        console.log(JSON.stringify(err));
      })
    }

    // 详情
    function openBrowseQrcode(pageId,pageName) {
      $event.openWin('browseQrcode_win','../browseQrcode/browseQrcode_win',{pageId:pageId,title:pageName},'');
    }
</script>
</body>
</html>
