<template>
  <view>
    <view class="">
      <view class="flex items-center m-2">
        <image class="bg-yellow-700 w-8 h-8 rounded-full ml-1 mr-4" src="../../static/local_play1.png"></image>
        <view class="text-sm font-semibold">我的LWBS</view>
      </view>
      <view class="task flex items-center justify-between p-2" v-for="(task, index) in tasks" :key="index">
        <view class="flex items-center">
          <view class="bg-blue-300 w-8 h-8 rounded-full ml-1 mr-2">
            <view class="w-8 h-8 flex items-center justify-center">{{ index + 1 }}</view>
          </view>
          <view>
            <view class="flex items-center">
              <view class="text-sm font-semibold">{{ task.taskName }}</view>
              <view class="rounded-full pl-2 pr-2 bg-green-200 text-green-500">{{ task.state }}</view>
            </view>
            <view class="flex items-center text-gray-400">
              <view class="pr-2">{{ task.time }}</view>
              <view>时长：{{ task.duration }}</view>
            </view>
          </view>
        </view>
        <u-icon name="arrow-right" size="28"></u-icon>
      </view>
    </view>
  </view>
</template>
<script>
export default {
  data() {
    return {
      isrotate: -1,
      tasks: [
        {
          taskName: '山西省三大中心建设',
          state: '正在进行',
          time: '05月31日 00：00',
          duration: '365天',
        },
        {
          taskName: '1号康复室',
          state: '正在进行',
          time: '01月31日 00：00',
          duration: '727天',
        },
        {
          taskName: '盐湖医院远程康复',
          state: '正在进行',
          time: '05月31日 00：00',
          duration: '65天',
        },
        {
          taskName: '山西省三大中心建设',
          state: '正在进行',
          time: '05月31日 00：00',
          duration: '365天',
        },
        {
          taskName: '1号康复室',
          state: '正在进行',
          time: '01月31日 00：00',
          duration: '727天',
        },
        {
          taskName: '盐湖医院远程康复',
          state: '正在进行',
          time: '05月31日 00：00',
          duration: '65天',
        },
      ],
    };
  },
  methods: {
    // 展开子项目
    openProjectItem(index) {
      if (this.isrotate === -1) {
        this.isrotate = index;
      } else {
        this.isrotate = -1;
      }
    },
  },
};
</script>
<style lang="scss">
.task {
  border-bottom: 1px solid #c0b9b9;
}
</style>
