| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- // 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: 20,
- isHide:false,
- rotateDeg:0
- },
- /**
- * 组件的方法列表
- */
- methods: {
-
- showOrHide(){
-
- const height = this.data.isHide?20:35;
- 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
- })
- },
- }
- })
|