coverPage_frm.html 5.06 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">
      <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/home.css"/>
      <link rel="stylesheet" type="text/css" href="../../css/element.css"/>
      <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
      <style>
          html,
          body{
            background: rgba(0, 0, 0, 0);
            width: 100%;
            height: 100%;
          }
      </style>
  </head>
  <body>
    <div id="app" style="height:100%;z-index:10;" tapmode  @click="closeCover">
    </div>
  </body>
  <script type="text/javascript" src="../../script/api.js"></script>
  <script type="text/javascript" src="../../script/jquery-3.3.1.min.js"></script>
  <script type="text/javascript" src="../../script/vue.min.js"></script>
  <script type="text/javascript" src="../../script/common.js"></script>
  <script type="text/javascript" src="../../script/element.js"></script>
  <script type="text/javascript" src="../../script/ctrl.js"></script>
  <script type="text/javascript">
      var vm,
          htmlStr;
      apiready = function(){
      api.parseTapmode();
      api.addEventListener({
        name: 'operate_and_alert_page'
      }, function(ret, err){
        htmlStr = ret.value.url
      });
        //---------初始化vue
        vm = new Vue({
          el: '#app',
          data: {
            closeVisable: false,
          },
          mounted() {
            //window.chooseProduct = this.chooseProduct;
          },
          created() {
            this.initPage()
          },
          methods: {
            async initPage() {
              this.setOrUnsetcover(true)
              let urlTemp = '';
              if (api.pageParam.value.storeType === '01001' ) {//  || api.pageParam.value.storeType === '02000'  || api.pageParam.value.storeType === '02001' || api.pageParam.value.storeType === '03001' || api.pageParam.value.storeType === '03002' ||  api.pageParam.value.storeType === '03003' || api.pageParam.value.storeType === '03004' 
              
                urlTemp = 'http://iot.uccc.cc:9090/app_html/store' + api.pageParam.value.storeType +'/alertPage.html'
              }else {
                urlTemp = '../utils/detailAlert_frm.html'
              }
              api.showProgress({
                style: 'default',
                animationType: 'fade',
                title: '加载中...',
                text: '',
                modal: false
              });
              // urlTemp = 'http://iot.uccc.cc:9090/app_html/store' + api.pageParam.value.storeType +'/alertPage.html'
              // let res = await get_remote_html_str(urlTemp)
              api.openFrame({
                name: 'detailAlertFrm',
                url: urlTemp,
                // data: res.data,
                bounces: false,
                rect: {
                  x:api.frameWidth/11,
                  y:api.frameHeight/8,
                  w:api.frameWidth- (api.frameWidth/11) *2,
                  h:api.frameHeight/1.5
                },
                animation: {
                  type:"movein",
                  subType:"from_bottom",
                  duration:300
                },
                pageParam: { value: api.pageParam.value},
                bgColor: 'rgba(0, 0, 0, 0)',
              });
            // }else {
              // this.closeCover()
              // api.toast({msg: res.message ,duration: 2000,location: 'bottom'})
            // }
              api.hideProgress();
              setTimeout(() => {
                this.closeVisable = true
              }, 3000);
            },
            setOrUnsetcover(bool) {
              if (bool) {
                document.body.style.backgroundColor="rgba(0,0,0,0.5)";
              }else {
                document.body.style.backgroundColor="rgba(0, 0, 0, 0);";
              }
            },
            closeCover() {
              if (!this.closeVisable) {
                api.toast({
                  msg: '请稍后再尝试关闭',
                  duration: 2000,
                  location: 'bottom'
                });
                return;
              }
              this.setOrUnsetcover(false)
              api.closeFrame({
                name: 'detailAlertFrm'
              });
              api.closeFrame({
                name: htmlStr
              });
              api.sendEvent({
                name: 'close_cover_page',
              });
              setTimeout(() => {
                api.closeFrame({
                  name: 'store_'+ api.pageParam.value.storeType +'operateHtml',
                });
              }, 1000);
              api.closeFrame();
              api.hideProgress();

            }
          }
        })
      };
  </script>
</html>