<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0"
    />
    <title>商户检查页面</title>
    <meta charset="UTF-8" />
    <meta
      http-equiv="X-UA-Compatible"
      content="IE=edge"
    />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, viewprot-fit:cover"
    />
    <title>高区安全“码”上查监管平台-首页</title>
    <link
      rel="stylesheet"
      href="index.css"
    />
    <script
      type="text/javascript"
      src="./sdk/includeHead.js"
    ></script>
  </head>

  <body>
    <!-- 获取授权用户信息 本地token等操作 -->
    <!-- <script type="text/javascript" src="sdk/jssdk2/index.js"></script> -->
    <script type="text/javascript">
      gemhoUtil.setCookie(
        'token',
        'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImxvZ2luX3VzZXJfa2V5IjoiMTU4YjM0M2MtNTFmMS00ZDYzLTk0ZWUtNzcxZWRkYTAxMjFmIn0.ehBDVx2ldKNypKcQ4Vnzzii7Dy9El8gRBRQ1Fs_Lq0tkp-zCxSHoEesF5YsWD5weKSaYdAYj_3gXQk-P832QrA'
      ) // 存储1天后过期
      console.log(gemhoUtil.getCookie('token'))
    </script>
    <div
      id="app"
      class="page_wrapper"
    >
      <!-- 第二层：商户图标、名称、等级、场所类型和地址 -->
      <div
        class="second-layer second-layer-zf"
        v-if="userInfo.userType!=='shop'"
      >
        <img
          class="merchant-icon"
          src="image/code/zhengfu_logo.png"
          alt=""
        />
        <div class="merchant-info welcome">
          <p>欢迎您，{{userInfo.deptName}}<br />进入安全“码”上查</p>
          <div class="user_tag">
            <img
              src="image/code/user.png"
              alt=""
            />
            <span>{{userInfo.roleName}}</span>
          </div>
        </div>
      </div>

      <!-- 第二层：商户图标、名称、等级、场所类型和地址 -->
      <div
        class="second-layer-sj"
        v-if="userInfo.userType=='shop'"
      >
        <div class="header">
          <span>商家信息</span>
          <div class="user_tag">
            <img
              src="image/code/user.png"
              alt=""
            />
            <span>商家</span>
          </div>
        </div>
        <div class="bottom">
          <div class="left">
            <img
              class="merchant-icon"
              src="image/code/sj.png"
              alt="商户图标"
            />
          </div>
          <div class="right">
            <div class="merchant-info">
              <div class="name-rank">
                <span class="merchant-name">{{userInfo.unitName}}</span>
                <span class="user-rank">安全等级:绿</span>
              </div>
              <div class="divider"></div>
              <div class="type-address">
                <p>场所类型：{{userInfo.smallPlaceTypeName}}</p>
                <p>{{userInfo.businessAddress}}</p>
              </div>
            </div>
          </div>
        </div>
      </div>
      <!-- 第三层：统计信息 -->
      <div class="third-layer">
        <div class="stats-header">
          <div class="stats-title">数据统计</div>
          <!-- <van-cell-group> -->
          <div
            @click="showPopup('showPopup4completionDate')"
            style="position: absolute; top: -0.08rem; right: 0.4rem"
          >
            <span class="formValue">{{showDate|formatterData}}</span
            ><van-icon name="arrow-down" />
          </div>
          <van-popup
            v-model="showPopup4completionDate"
            position="bottom"
          >
            <van-datetime-picker
              v-model="selectedDate"
              :min-date="minDate"
              type="year-month"
              title="选择年月"
              @confirm="confirm4completionDate"
              @cancel="showPopup4completionDate=false"
              :formatter="needData"
            />
          </van-popup>
          <!-- </van-cell-group> -->
        </div>
        <div class="stats-content">
          <div class="stat-item">
            <div class="stat-value">{{userData.checkCount}}次</div>
            <div class="stat-label">检查数</div>
          </div>
          <div class="stat-item">
            <div class="stat-value">{{userData.checkSelfCount}}次</div>
            <div class="stat-label">自查数</div>
          </div>
          <div class="stat-item">
            <div class="stat-value">{{userData.hiddenCount}}处</div>
            <div class="stat-label">隐患数</div>
          </div>
          <div class="stat-item">
            <div class="stat-value">{{userData.hiddenNoReCount}}处</div>
            <div class="stat-label">未整改</div>
          </div>
        </div>
      </div>

      <!-- 第四层：检查专区 -->
      <div class="fourth-layer">
        <h2>检查专区</h2>
        <div class="check-modules">
          <div
            class="check-module"
            v-for="(item,index) in menuList"
            :key="index"
            :class="item.className"
            @click="scanCode(item.navTo)"
          >
            <p>{{item.title}} <van-icon name="arrow" /></p>
            <p class="module-intro">{{item.remark}}</p>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
