tableStatus.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. Component({
  2. properties: {
  3. show:{
  4. type: Boolean,
  5. observer: function (newVal) {
  6. this.setData({ show: newVal });
  7. this.statusToView()
  8. }
  9. },
  10. status:{
  11. type: Number,
  12. observer: function (newVal) {
  13. this.setData({ status: newVal });
  14. }
  15. },
  16. theam:{
  17. type: String,
  18. value:'redContent',
  19. observer: function (newVal) {
  20. this.setData({ theam: newVal });
  21. }
  22. }
  23. },
  24. data: {
  25. show:false,
  26. status:1,
  27. info:{
  28. imgsrc:'',
  29. art:''
  30. },
  31. theam:''
  32. },
  33. methods: {
  34. // 通过状态判断显示效果
  35. statusToView(){
  36. let url='',str='',that= this;
  37. switch (this.data.status) {
  38. case 0: //未开始
  39. url = 'http://img.bbztx.com/image_test/upload/thumbs/20210304/logo/1614830185869027775.png';
  40. str='活动尚未开始,先去积累抽奖机会吧!'
  41. break;
  42. case 4: //已结束
  43. url = 'http://img.bbztx.com/image_test/upload/thumbs/20210304/logo/1614830371608071320.png';
  44. str='本次大转盘已结束,下次早点来参与~'
  45. break;
  46. case 3: //机会不足
  47. url = 'http://img.bbztx.com/image_test/upload/thumbs/20210304/logo/1614830429832090767.png';
  48. str='您的转盘机会不够了,去获取更多机会吧!'
  49. break;
  50. case 2: //无奖品
  51. url = 'http://img.bbztx.com/image_test/upload/thumbs/20210304/logo/1614830481202038339.png';
  52. str='您来晚了一步,奖品已派完'
  53. break;
  54. }
  55. this.setData({
  56. 'info.imgsrc':url,
  57. 'info.art':str
  58. })
  59. },
  60. // 获取更多机会
  61. getMoreChange(){
  62. this.triggerEvent("getMoreChange");
  63. },
  64. // 关闭弹窗
  65. closeTip(e){
  66. this.close(e.detail)
  67. },
  68. // 确定
  69. closePopup(){
  70. this.close(false)
  71. },
  72. close(data){
  73. this.triggerEvent("close", {
  74. status:data,
  75. type:'table'
  76. });
  77. }
  78. }
  79. })