<template>
    <div class="repairAcceptance">
      <div class="whiteBoard">
        <div class="addRepair" @tap="addRepair">新增报修 <van-icon name="add" style="margin-left: 8rpx"/></div>
        <div class="repairItem" v-for="item in repairList" @click="toDetail(item)">
          <div class="repairItemTitleRow">
            <span class="titleName">{{item.name}}</span>
            <span class="titleTag" :class="item.type==='待处理'?'titleTag2':item.type==='已处理'?'titleTag3':'titleTag'">{{item.type}}</span>
          </div>
          <div class="companyBox">
            <img src="https://www.idea-co-sf.com/gardenProduct/image/gs.svg" class="gsIcon">
            <span class="companyName">无锡 XXXX有限公司</span>
          </div>
          <div class="upTimeBox">上报时间：2021-1-21  13:00</div>
        </div>
      </div>
    </div>
</template>

<script>
export default {
  name: "repairAcceptance",
  data(){
    return{
      repairList:[
        {name:'上月水费不太对，怀疑水表异常',type:'待受理'},
        {name:'空调坏了，不能使用',type:'待处理'},
        {name:'空调坏了，不能使用',type:'已处理'},
      ]
    }
  },
  methods:{
    addRepair(){
      uni.navigateTo({
        url:'/pages/subPackages/todo/addRepair'
      })
    },
    toDetail(item) {
      uni.navigateTo({
        url:'/pages/subPackages/todo/dispatch?type=' + item.type
      })
    }
  }
}
</script>

<style lang="scss">
    .repairAcceptance{
      .whiteBoard{
        background: white;
        margin-top: 24rpx;
        box-sizing: border-box;
        padding: 32rpx;
        height: 1424rpx;
        .addRepair{
          display: flex;
          justify-content: flex-end;
          align-items: center;
          color: rgba(3, 101, 249, 1);

        }
        .repairItem{
          background: rgba(245, 247, 250, 1);
          border-radius: 16rpx;
          width: 686rpx;
          height: 224rpx;
          padding: 32rpx 0 24rpx 0;
          box-sizing: border-box;
          margin-top: 24rpx;
          .repairItemTitleRow{
            display: flex;
            justify-content: space-between;
            padding: 0 32rpx;
            .titleName{
              color: rgba(34, 34, 34, 1);
              font-size: 32rpx;
              font-weight: 600;
            }
            .titleTag{
              width: 112rpx;
              height: 48rpx;
              display: flex;
              align-items: center;
              justify-content: center;
              border-radius: 4rpx;
              color: rgba(242, 25, 18, 1);
              font-size: 28rpx;
              background: rgba(242, 25, 18, 0.20);
            }
            .titleTag2{
              width: 112rpx;
              height: 48rpx;
              display: flex;
              align-items: center;
              justify-content: center;
              border-radius: 4rpx;
              color: rgba(255, 107, 24, 1);
              font-size: 28rpx;
              background: rgba(255, 107, 24, 0.20);
            }
            .titleTag3{
              width: 112rpx;
              height: 48rpx;
              display: flex;
              align-items: center;
              justify-content: center;
              border-radius: 4rpx;
              color: rgba(34, 181, 101, 1);
              font-size: 28rpx;
              background: rgba(34, 181, 101, 0.20);
            }
          }
          .companyBox{
            display: flex;
            align-items: center;
            padding: 8rpx 32rpx 24rpx 32rpx;
            .gsIcon{
              width: 32rpx;
              height: 32rpx;
            }
            .companyName{
              font-size: 28rpx;
              color: rgba(102, 102, 102, 1);
              margin-left: 8rpx;
            }
          }
          .upTimeBox{
            padding: 16rpx 32rpx 0 32rpx;
            border-top: 1px solid rgba(230, 230, 230, 1);
            color: rgba(102, 102, 102, 1);
            font-size: 28rpx;
          }
        }
      }
    }
</style>
