<template>
  <div class="servie">
    <div v-if="list.length>0">
      <div class="serviceItem" v-for="(op,i) in list" :key="i" @click="toServiceList(op)" hover-class="bg-hover">
        <img :src="op.icon"/>
        <div class="fill flex1">
          <div>{{ op.name }}</div>
          <u-gap height="6"/>
          <span>{{ op.desc }}</span>
        </div>
        <i class="iconfont">&#xe697;</i>
      </div>
    </div>
    <AiEmpty v-else/>
  </div>
</template>

<script>

export default {
  name: "AppServiceOnline",
  appName: "网上办事",
  data() {
    return {
      list: []
    }
  },
  onLoad() {
    this.getList()
  },
  methods: {
    toServiceList(item) {
      this.$linkTo(`./serviceList?id=${item.id}&title=${item.name}&subTitle=${item.desc}`)
    },
    getList() {
      this.$instance.post("/app/zwspapprovalclassification/list-xcx", null, {
        params: {size: 999},
        withoutToken: true
      }).then(res => {
        if (res?.data) {
          this.list = res.data.records || []
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.servie {
  min-height: 100vh;
  background: #fff;
}

.serviceItem {
  width: 100%;
  height: 160px;
  padding: 28px 40px 28px;
  display: flex;
  align-items: center;
  box-sizing: border-box;

  img {
    width: 80px;
    height: 80px;
  }

  .fill {
    display: flex;
    flex-direction: column;
    font-size: 30px;
    font-weight: 600;
    color: #3C435C;
    margin: 0 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    span {
      display: block;
      width: 100%;
      margin-right: 20px;
      font-size: 28px;
      font-weight: 500;
      color: #BEC1D0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  i {
    font-size: 44px;
    color: #979797;
  }
}
</style>
