index_win.html 5.8 KB
<!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">
      <meta name="referrer" content="no-referrer">
      <title>02001首页_win</title>
      <link rel="stylesheet" type="text/css" href="http://iot.uccc.cc:9090/app/css/api.css"/>
      <link rel="stylesheet" type="text/css" href="http://iot.uccc.cc:9090/app/css/aui.css"/>
      <link rel="stylesheet" type="text/css" href="http://iot.uccc.cc:9090/app/css/home.css"/>
      <link rel="stylesheet" type="text/css" href="http://iot.uccc.cc:9090/app/css/element.css"/>
      <link rel="stylesheet" type="text/css" href="http://iot.uccc.cc:9090/app/css/style.css"/>

      <style>
          html,
          body{
            background: #F4F6F9;
          }
      </style>
  </head>
  <body>
    <div id="app">
      <div id="status"></div>
      <header class="aui-header-bar  title-home" style="width:'auto';height:44px;">
        <div class="aui-header-left">
          <i class="aui-iconfont aui-icon-left" style="color:#FFFFFF;font-size:16px;margin-top: 0.1rem;" @click="closeWin"></i>
          <span style="margin-left:15px;font-size:16px;">TY-401 在线监测装置</span>
        </div>
        <div class="aui-header-right">
          <i class="aui-iconfont aui-icon-location" style="margin-top: 0.1rem;font-size: 0.6rem;"></i>
          <span style="font-size: 12px;">{{ province }} {{ city }}</span>
        </div>
      </header>
      <div style="background:linear-gradient(90deg,rgba(91,127,248,1) 0%,rgba(75,175,239,1) 100%);height:50%;width:auto;"></div>
      <footer></footer>
    </div>
  </body>
  <script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/api.js"></script>
  <script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/jquery-3.3.1.min.js"></script>
  <script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/vue.min.js"></script>
  <!-- <script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/common.js"></script> -->
  <script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/element.js"></script>
  <!-- <script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/ctrl.js"></script> -->
  <script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/fastclick.js"></script>
  <script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/common.js"></script>
  <script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/ctrl.js"></script>
  <script type="text/javascript">
      var vm;
      apiready = function(){
        api.parseTapmode();
        $(function() {
                  FastClick.attach(document.body);
        }); 

        //---------初始化vue
        vm = new Vue({
          el: '#app',
          data: {
            imei: api.pageParam.imei,
            productId: api.pageParam.productId,
            statusH: api.getPrefs({sync: true,key: 'SAFEAREATOP'}),
            userId: api.getPrefs({sync: true,key: 'userID'}),
            token: api.getPrefs({sync: true,key: 'userToken'}),
            province: '',
            city: '',
            userType: Number(api.getPrefs({sync: true,key: 'userType'})),
          },
          mounted() {
            //window.chooseProduct = this.chooseProduct;
          },
          created() {
            this.initPage()
          },
          methods: {
            initPage() {
              this.initStatusH()
              this.initImeiInfos()
            },
            initStatusH() {
              //------设置状态栏
              document.getElementById("status").style.cssText = "height:"+ this.statusH +"px;width:'auto';background:linear-gradient(90deg,rgba(91,127,248,1) 0%,rgba(75,175,239,1) 100%);"
              api.setStatusBarStyle({
                  style: 'light'
              });
              //------
            },
            async initImeiInfos() {
              let params = {
                imei: this.imei,
                userId: this.userId,
                token: this.token,
              }
              let deviceInfoRes = await get_device_info_by_user(params) 
              
              let deviceInfo = deviceInfoRes.data.device
              if (this.userType === 1) {
                if (deviceInfo.bind.province != '') {
                  this.province = deviceInfo.bind.province 
                }
                if (deviceInfo.bind.city != '') {
                  this.city = deviceInfo.bind.city
                }  
              }else {
                this.city = deviceInfo.location
              }
              api.showProgress({
                style: 'default',
                animationType: 'fade',
                title: '加载中...',
                text: '',
                modal: false
              });
              let res = await get_remote_html_str("http://iot.uccc.cc:9090/app_html/store02001/index_frm.html")
              api.hideProgress();
              //这里以后全部是配置对应的http地址...
              api.openFrame({
                name: 'store_' + this.productId + '_indexFrm',
                // url: 'http://iot.uccc.cc:9090/app_html/store02001/index_frm.html',
                url: './index_frm.html',
                // data: res.data,
                bounces: true,
                rect: {
                  x: 0,
                  y: 44+Number(this.statusH),
                  w: api.winWidth,
                  h: api.winHeight-40-Number(this.statusH)
                },
                pageParam: {deviceInfo: deviceInfo,
                            productId:  this.productId,
                            imei: this.imei},
              });
            },
            closeWin() {
              api.closeWin();
            }
          }
        })
      };
  </script>
</html>