<template>
  <m-card mode="4" title="便民设施">
    <div>
      <m-sub2>为老服务</m-sub2>
      <div class="old">
        <div v-for="item in forOld" :key="item.name">
          <p>{{ item.name }}</p>
          <m-count class="count" :value="item.value" />
        </div>
      </div>
    </div>
    <div class="live">
      <m-sub2>生活便利</m-sub2>
      <Brief :list="forLive" color="#fff" />
    </div>
  </m-card>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import Brief, { BriefProp } from '../components/brief.vue'
import icon27 from '@/assets/images/icon27.png'
import icon28 from '@/assets/images/icon28.png'
import icon29 from '@/assets/images/icon29.png'
import icon30 from '@/assets/images/icon30.png'

export default defineComponent({
  name: 'Convenient',
  components: { Brief },
  setup() {
    const forOld = ref([
      { name: '综合为老服务', value: 26 },
      { name: '长者照护之家', value: 64 },
      { name: '睦邻中心', value: 331 },
      { name: '日托所', value: 157 },
      { name: '洗衣房', value: 91 },
      { name: '敬老院', value: 53 },
      { name: '老年活动室', value: 38 },
      { name: '助餐点', value: 87 },
      { name: '助浴点', value: 68 },
    ])
    const forLive = ref<BriefProp[]>([
      { name: '菜场', value: 26, icon: icon27 },
      { name: '街面废物箱', value: 64, icon: icon28 },
      { name: '公厕', value: 18, icon: icon29 },
      { name: '电话亭', value: 12, icon: icon30 },
    ])
    return {
      forOld,
      forLive,
    }
  },
})
</script>

<style lang="stylus" scoped>
@import '../../components/MyComponent/main.styl'

.old
  display flex
  flex-wrap wrap
  justify-content space-between
  >div
    width 49%
    display flex
    justify-content space-between
    align-items center
    padding 0 .1rem
    background rgba(70,83,97,.4)
    box-shadow inset 0 .01rem .02rem 0 rgba(204,204,204,.2)
    border-radius .03rem
    margin-bottom .04rem
    .count
      font-size .13rem
.live
  margin-bottom .1rem
</style>
