<template>
  <div class="my-services">
    <div v-for="(it, idx) in items" :key="idx">
      <div class="header ">
        {{ it.title }}
      </div>
      <div v-for="(item, index) in it.serviceList" :key="index">
        <div class="my-services-item line">
          <cr-cell is-link @click="jumpToReason(item.navUrl)">
            <div class="item-between">
              <div :style="{ color: item.titleColor }">{{ item.title }}</div>
              <div :style="{ color: item.subTitleColor }">{{ item.subTitle }}</div>
            </div>
          </cr-cell>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    items: {
      type: Array,
      default: () => []
    }
  },
  methods: {
    jumpToReason(link) {
      if (link) {
        window.location.href = link;
      }
      return false;
    }
  }
};
</script>

<style lang="less" scoped>
.my-services {
  margin-top: 13px;
  background: #fff;
  .header {
    border-top: none;
    font-size: 14px;
    color: rgba(51, 51, 51, 1);
    font-family: PingFangSC-Medium;
    font-weight: 600;
    padding-left: 20px;
    height: 48px;
    display: flex;
    align-items: center;
  }
  &-item {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-left: 16px;
    padding-left: 4px;
    height: 48px;
    box-sizing: border-box;
    .item-between {
      display: flex;
      justify-content: space-between;
    }
  }
  .line::after {
    position: absolute;
    border-top: 1px solid #f2f3f5;
    box-sizing: border-box;
    content: ' ';
    pointer-events: none;
    left: 0;
    right: 0;
    transform: scaleY(0.5);
    top: 0;
  }
  /deep/ .cr-cell {
    padding: 0 20px 0 0;
    &:last-child::after {
      border-bottom: none;
    }
  }
}
</style>
