consumptionCode.js 778 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Component({
  2. options: {
  3. addGlobalClass: true
  4. }, //使用全局css样式
  5. properties: {
  6. show: {
  7. type: Boolean,
  8. observer: function (newVal) {
  9. this.setData({
  10. show: newVal
  11. });
  12. }
  13. },
  14. alternateData: {
  15. type: Object,
  16. observer: function (newVal) {
  17. this.setData({
  18. info: newVal
  19. });
  20. }
  21. },
  22. type:{
  23. type: Number,
  24. observer: function (newVal, oldVal) {
  25. this.setData({ type: newVal })
  26. }
  27. }
  28. },
  29. data: {
  30. show: false,
  31. info: {},
  32. type:0,
  33. },
  34. methods: {
  35. // 关闭弹窗
  36. closeTip(e) {
  37. this.close(e.detail)
  38. },
  39. closePopup() {
  40. this.close(false)
  41. },
  42. close(data) {
  43. this.triggerEvent("close");
  44. },
  45. }
  46. })