prepayOrderItemInfo.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // components/orderItemInfo/orderItemInfo.js
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. order:{
  8. type:Object,
  9. value:{
  10. nozzle:5,
  11. status:'已授权',
  12. statusColor:'#a6d53f',
  13. oilName:'92#汽油',
  14. volume:30,
  15. amount:224.7,
  16. payAmount:209.4,
  17. discount:15.3,
  18. refund:0,
  19. orderId:'20251111111111',
  20. time:'2025-01-20 18:33',
  21. station:'油站名'
  22. }
  23. },
  24. buttonText1:{
  25. type:String,
  26. value:"按钮一"
  27. },
  28. buttonText2:{
  29. type:String,
  30. value:"按钮二"
  31. }
  32. },
  33. /**
  34. * 组件的初始数据
  35. */
  36. data: {
  37. contentHeight: 20,
  38. isHide:false,
  39. rotateDeg:0
  40. },
  41. /**
  42. * 组件的方法列表
  43. */
  44. methods: {
  45. showOrHide(){
  46. const height = this.data.isHide?20:35;
  47. console.log("点击了",this.data.isHide,height)
  48. this.setData({
  49. contentHeight:height,
  50. isHide:!this.data.isHide,
  51. rotateDeg:this.data.rotateDeg+180
  52. })
  53. },
  54. //第一个按钮的点击事件
  55. buttonClick1(){
  56. this.triggerEvent('bottonEvent1',{
  57. order:this.properties.order,
  58. event:this.properties.buttonText1
  59. })
  60. },
  61. //第二个按钮的点击事件
  62. buttonClick2(){
  63. this.triggerEvent('bottonEvent2',{
  64. order:this.properties.order,
  65. event:this.properties.buttonText2
  66. })
  67. },
  68. }
  69. })