prepayOrderItemInfo.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. }
  22. },
  23. buttonText1:{
  24. type:String,
  25. value:"按钮一"
  26. },
  27. buttonText2:{
  28. type:String,
  29. value:"按钮二"
  30. }
  31. },
  32. /**
  33. * 组件的初始数据
  34. */
  35. data: {
  36. contentHeight: 21,
  37. isHide:false,
  38. rotateDeg:0
  39. },
  40. /**
  41. * 组件的方法列表
  42. */
  43. methods: {
  44. showOrHide(){
  45. const height = this.data.isHide?21:38;
  46. console.log("点击了",this.data.isHide,height)
  47. this.setData({
  48. contentHeight:height,
  49. isHide:!this.data.isHide,
  50. rotateDeg:this.data.rotateDeg+180
  51. })
  52. },
  53. //第一个按钮的点击事件
  54. buttonClick1(){
  55. this.triggerEvent('bottonEvent1',{
  56. order:this.properties.order,
  57. event:this.properties.buttonText1
  58. })
  59. },
  60. //第二个按钮的点击事件
  61. buttonClick2(){
  62. this.triggerEvent('bottonEvent2',{
  63. order:this.properties.order,
  64. event:this.properties.buttonText2
  65. })
  66. },
  67. }
  68. })