<template>
    <div class="myOrder">
        <div class="myOrderItem" v-for="item in orderList">
            <div class="myOrderItemTop">
              <span class="myOrderItemTopLeft">
                <img src="./image/frame.svg" class="frameIcon">
                共享资源·会议室预约
              </span>
              <span :class="item.status==='等待审核'?'orgColor':item.status==='预定成功'?'greColor':'grayColor'">{{item.status}}</span>
            </div>
          <div class="orderTheme">{{item.theme}}</div>
          <div class="myOrderItemBottom">
            <div class="myOrderItemBottomLeft">
              <span>订单号：202405061228</span>
              <span>预约时间：2021-1-21  13:00</span>
            </div>
            <button class="cancelBtn" v-if="item.status!=='已取消'" @tap.stop="toCancel">去取消</button>
          </div>
          <div class="cancleBox" v-if="item.status==='已取消'">
            取消原因：取消原因取消原因取消原因取消原因取消原因取消原因取消原因取消原因取消原因取消原因取消原因取消原因取消原因取消原因
          </div>
        </div>
      <van-dialog
          use-slot
          title="取消预约"
          :show="show"
          show-cancel-button
          confirm-button-open-type="getUserInfo"
          @confirm="confirm"
      >
        <div class="dialogBox">
          <van-field
              :value="contant"
              autosize
              type="textarea"
              placeholder="请输入取消原因"
              class="myField"
              maxlength="800"
              show-word-limit
          />
        </div>
      </van-dialog>
    </div>
</template>

<script>
export default {
  name: "myOrder",
  data(){
    return{
      orderList:[
        {theme:'会议主题会议主题会议主题会议主题会议主题会议主题会议主题会议主',status:'等待审核'},
        {theme:'会议主题会议主题会议主题会议主题会议主题会议主题会议主题会议主',status:'预定成功'},
        {theme:'会议主题会议主题会议主题会议主题会议主题会议主题会议主题会议主',status:'已取消'},
      ],
      show: false,
      contant: ''
    }
  },
  methods:{
    toCancel() {
      console.log(11111)
       this.show = true
    },
    confirm(){
       console.log(22222)
       this.show = false
    }
  }
}
</script>

<style lang="scss">
    .myOrder{
      padding: 24rpx 32rpx;
      .myOrderItem{
        width: 686rpx;
        padding: 32rpx 0;
        border-radius: 16rpx;
        background: white;
        box-sizing: border-box;
        margin-bottom: 24rpx;
        .myOrderItemTop{
          display: flex;
          justify-content: space-between;
          padding:0 32rpx 24rpx 32rpx;
          border-bottom: 1px solid rgba(232, 237, 245, 1);
          .myOrderItemTopLeft{
            display: flex;
            align-items: center;
            color: rgba(102, 102, 102, 1);
            font-size: 28rpx;
            .frameIcon{
              width: 28rpx;
              height: 28rpx;
              margin-right: 16rpx;
            }
          }
          .orgColor{
            font-size: 28rpx;
            color: rgba(226, 81, 0, 1);
          }
          .greColor{
            font-size: 28rpx;
            color: rgba(34, 181, 101, 1);
          }
          .grayColor{
            font-size: 28rpx;
            color: rgba(136, 136, 136, 1);
          }
        }
        .orderTheme{
          padding: 16rpx 32rpx;
          color: rgba(34, 34, 34, 1);
          font-size: 32rpx;
          line-height: 50rpx;
          display: flex;
          flex-wrap: wrap;
          font-weight: 600;
        }
        .myOrderItemBottom{
          display: flex;
          align-items: center;
          padding: 0 32rpx;
          justify-content: space-between;
          .myOrderItemBottomLeft{
            display: flex;
            flex-direction: column;
            font-size: 28rpx;
            color:rgba(136, 136, 136, 1);
            line-height: 44rpx;
          }
          .cancelBtn{
            background: linear-gradient( 316deg, #84AAFF 0%, #0365F9 100%);
            width: 160rpx;
            height: 60rpx;
            border-radius: 32rpx;
            display: flex;
            align-items: center;
            justify-content: center;
            color: rgba(255, 255, 255, 1);
            font-size: 28rpx;
            &::after{
              border: none;
            }
          }
        }
        .cancleBox{
          font-size: 28rpx;
          color:rgba(242, 25, 18, 1);
          width: 622rpx;
          background: rgba(245, 247, 250, 1);
          padding: 24rpx;
          box-sizing: border-box;
          margin-left: 32rpx;
          display: flex;
          flex-wrap: wrap;
          line-height: 40rpx;
          margin-top: 16rpx;
        }
      }
      .dialogBox{
        padding: 32rpx;
      }
      .van-cell {
        background: #F5F7FA !important;
        border-radius: 8rpx;
        font-size: 28rpx;
      }
    }
</style>
