<template>
  <view>
    <div class="managementBody" v-show="true">
    <image src="../../static/index/banner.png" class="banner"></image>
      <div class="needBox">
        <div class="needLeft">
          <div class="needLeftLeft" @click="toMsgPage('/pages/subPackages/todo/index')">
            <span style="color: #18172A;font-size: 4.5vw;margin-bottom: 1vw">我的待办</span>
            <span style="color: #666666;font-size: 3.5vw">需处理待办<span style="color: #0365F9;font-weight: 600;margin-left: 0.5vw">3</span></span>
          </div>
          <img src="../../static/index/dbImage.png" class="needImg">
        </div>
        <div class="needRight" @click="toMsgPage('/pages/subPackages/toread/index')">
          <div class="needLeftLeft">
            <span style="color: #18172A;font-size: 4.5vw;margin-bottom: 1vw">我的待阅</span>
            <span style="color: #666666;font-size: 3.5vw">需处理待阅<span style="color: #22B565;font-weight: 600;margin-left: 0.5vw">12</span></span>
          </div>
          <img src="../../static/index/dyImage.png" class="needImg">
        </div>
      </div>
      <div class="titleTips">
        <div class="myLine"></div>
        <div>服务入口</div>
      </div>
    <div class="map">
      <div
        class="mapdom"
        style="float: left"
        v-for="(item, index) in mapList"
        :key="index"
        @click="jumpPage(item.path)"
      >
        <img class="mapIcon" :src="item.url" />
        <div class="maptxt">{{ item.label }}</div>
      </div>
    </div>
    </div>
<!--    企业端页面-->
    <div class="enterpriseBody" v-show="false">
      <enterprise-side></enterprise-side>
    </div>
  </view>
</template>
<script>
// import {demo} from "@/js_sdk/http"
import { getUserPower, getUserLocalStorageInfo } from "@/js_sdk/http";
import EnterpriseSide from "./components/enterpriseSide.vue";
export default {
  components: {EnterpriseSide},
  data() {
    return {
      mapList: [
        // {
        //   label: "智慧党建",
        //   url: "https://hswkxc.idea-sf.com/fileService/static/slices/1@2x.png",
        //   path: "/pages/subPackages/buildmap/index",
        // },
        // {
        //   label: "经发填报",
        //   url: "https://hswkxc.idea-sf.com/fileService/static/slices/1@2x.png",
        //   path: "/pages/subPackages/companyHouse/companyHouse",
        // },
        {
          label: "企业库",
          url: require("./indexIcon/qyk.png"),
          path: "/pages/subPackages/companyHouse/companyHouse",
        },
        {
          label: "走访上报",
          url: require("./indexIcon/zfsb.png"),
          path: "/pages/subPackages/companyreport/companyreport",
        },
        {
          label: "上市跟进",
          url:  require("./indexIcon/ssgj.png"),
        },
        {
          label: "招商管理",
          url: require("./indexIcon/zsgl.png"),
          path: "/pages/subPackages/merchants/merchants",
        },
        // {
        //   label: "我的待办",
        //   url: require("./indexIcon/zsgl.png"),
        //   path: "/pages/subPackages/todo/index",
        // },
        // {
        //   label: "我的待阅",
        //   url: "https://hswkxc.idea-sf.com/fileService/static/slices/6@2x.png",
        //   path: "/pages/subPackages/toread/index",
        // },
        // {
        //   label: "会议室审核",
        //   url: "https://hswkxc.idea-sf.com/fileService/static/slices/12@2x.png",
        //   path: "/pages/subPackages/meetingroom/meetingroom",
        // },
        // {
        //   label: "周边发布",
        //   url: "https://hswkxc.idea-sf.com/fileService/static/slices/3@2x.png",
        //   path: "/pages/subPackages/peripheralService/index",
        // },
        // {
        //   label: "活动发布",
        //   url: "https://hswkxc.idea-sf.com/fileService/static/slices/3@2x.png",
        //   path: "/pages/subPackages/eventRelease/index",
        // },
        // {
        //   label: "安全管理自检",
        //   url: "https://hswkxc.idea-sf.com/fileService/static/slices/8@2x.png",
        //   path: "/pages/subPackages/secureselftest2/index",
        // },
        // {
        //   label: "安全管理统计",
        //   url: "https://hswkxc.idea-sf.com/fileService/static/slices/8@2x.png",
        //   path: "/pages/subPackages/secureselftest/index",
        // },
        // {
        //   label: "安全自检计划",
        //   url: "https://hswkxc.idea-sf.com/fileService/static/slices/9@2x.png",
        //   path: "/pages/subPackages/secureselfplan/index",
        // },

        {
          label: "报修派单",
          url: require("./indexIcon/bxpd.png"),
          path: "/pages/subPackages/repairDispatch-app/index",
        },
        {
          label: "报修处理",
          url: require("./indexIcon/bxcl.png"),
          path: "/pages/subPackages/repairprocessing-app/index",
        },
        {
          label: "房间管理",
          url: require("./indexIcon/fjgl.png"),
          path: "/pages/subPackages/repairprocessing-app/index",
        },
        {
          label: "通知发布",
          url: require("./indexIcon/tzfb.png"),
          path: "/pages/subPackages/repairprocessing-app/index",
        },
        {
          label: "活动发布",
          url: require("./indexIcon/hdfb.png"),
          path: "/pages/subPackages/repairprocessing-app/index",
        },
        {
          label: "周边发布",
          url: require("./indexIcon/zbfb.png"),
          path: "/pages/subPackages/repairprocessing-app/index",
        },

        // {
        //   label: "整改填报",
        //   url: "https://hswkxc.idea-sf.com/fileService/static/slices/15@2x.png",
        //   path: "/pages/subPackages/modifyReport/index",
        // },
        // {
        //   label: "整改派单",
        //   url: "https://hswkxc.idea-sf.com/fileService/static/slices/14@2x.png",
        //   path: "/pages/subPackages/modifySend/index",
        // },
        // {
        //   label: "整改处理",
        //   url: "https://hswkxc.idea-sf.com/fileService/static/slices/13@2x.png",
        //   path: "/pages/subPackages/modifyHandle/index",
        // },
        // {
        //   label: "活动核销",
        //   url: "https://hswkxc.idea-sf.com/fileService/static/slices/1@2x.png",
        //   path: "/pages/subPackages/activity/index",
        // },
        // {
        //   label: "可视化大屏",
        //   url: "https://hswkxc.idea-sf.com/fileService/static/slices/1@2x.png",
        //   path: "/pages/subPackages/bigscreen/bigscreen",
        // },
        // {
        //   label: "场馆审核",
        //   url: "https://hswkxc.idea-sf.com/fileService/static/slices/1@2x.png",
        //   path: "/pages/subPackages/venueRoom/meetingroom",
        // },
      ],
    };
  },
  onShareAppMessage() {},
  mounted() {
    // demo();
  },
  onLoad() {
    this.getUserPower();
  },
  methods: {
    toMsgPage(e){
      uni.navigateTo({
        url: e,
        fail: (fail) => {},
      });
    },
    // getUserLocalStorageInfo
    async getUserPower() {
      if (getUserLocalStorageInfo().user.id == 1) return;
      let that = this;
      let newList = [];
      let { data } = await getUserPower(getUserLocalStorageInfo().user.id);
      for (let i = 0; i < that.mapList.length; i++) {
        let index = data.findIndex((e) => e == that.mapList[i].label);
        if (index != -1) {
          newList.push(that.mapList[i]);
        }
      }
      that.mapList = newList;
    },
    jumpPage(path) {
      uni.navigateTo({
        url: path,
        fail: (fail) => {},
      });
    },
  },
};
</script>

<style lang="scss">
page {
  background: white;
}
.managementBody{
  padding: 4vw;
}
.banner {
  width: 92vw;
  height: 250rpx;
  //position: absolute;
  z-index: 1;
}
.mapdom {
  width: 25%;
  height: 184rpx;
}
.maptxt {
  width: 100%;
  height: 34rpx;
  font-size: 24rpx;
  font-family: PingFang SC-Medium, PingFang SC;
  font-weight: 500;
  color: #18172A;
  text-align: center;
  margin-top: 8rpx;
}
.mapIcon {
  width: 65rpx;
  height: 80rpx;
  //background: linear-gradient(141deg, #89BCFF 0%, #2782FA 100%);
  display: block;
  margin: auto;
}
.map {
  //position: absolute;
  z-index: 2;
  width: calc(100% - 24rpx);
  //height: 770rpx;
  border-radius: 48rpx 48rpx 0rpx 0rpx;
  background: white;
  //margin-top: 402rpx;
  padding: 24rpx 12rpx;
  overflow-y: auto;
}
.needBox{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2vw 0;
  .needLeft{
    display: flex;
    justify-content: space-around;
    background: rgba(238, 244, 255, 1);
    border-radius: 8rpx;
    align-items: center;
    width: 45vw;
    height: 23vw;
  }
  .needRight{
    display: flex;
    justify-content: space-around;
    background: #DEF6F8;
    border-radius: 8rpx;
    align-items: center;
    width: 45vw;
    height: 23vw;
  }
  .needLeftLeft{
    display: flex;
    flex-direction: column;
  }
  .needImg{
    width: 100rpx;
    height: 100rpx;
  }
}
.titleTips{
  display: flex;
  align-items: center;
  font-size: 4.7vw;
  font-weight: 600;
  color:#18172A;
  margin:4vw 0 2vw 0;
  .myLine{
    width: 13rpx;
    height: 40rpx;
    background: linear-gradient( 180deg, #509FFF 0%, #034DF7 100%);
    margin-right: 20rpx;
  }
}
</style>
