// components/orderItemInfo/orderItemInfo.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    order:{
      type:Object,
      value:{
        nozzle:5,
        status:'已授权',
        statusColor:'#a6d53f',
        oilName:'92#汽油',
        volume:30,
        amount:224.7,
        payAmount:209.4,
        discount:15.3,
        refund:0,
        orderId:'20251111111111',
        time:'2025-01-20 18:33',
        station:'油站名'
      }
    },
    buttonText1:{
      type:String,
      value:"按钮一"
    },
    buttonText2:{
      type:String,
      value:"按钮二"
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    contentHeight: 22,
    isHide:false,
    rotateDeg:0
  },

  /**
   * 组件的方法列表
   */
  methods: {
    
    showOrHide(){
      
      const height = this.data.isHide?22:37;
      console.log("点击了",this.data.isHide,height)
      
      this.setData({
        contentHeight:height,
        isHide:!this.data.isHide,
        rotateDeg:this.data.rotateDeg+180
      })
    },

    //第一个按钮的点击事件
    buttonClick1(){
      this.triggerEvent('bottonEvent1',{
        order:this.properties.order,
        event:this.properties.buttonText1
      })
    },
    //第二个按钮的点击事件
    buttonClick2(){
      this.triggerEvent('bottonEvent2',{
        order:this.properties.order,
        event:this.properties.buttonText2
      })
    },
  }
})