activeRules.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. const util = require('../../../utils/util.js');
  2. Component({
  3. properties: {
  4. show:{
  5. type: Boolean,
  6. observer: function (newVal) {
  7. this.setData({ show: newVal });
  8. if (this.data.show) {
  9. this.getPopupContent()
  10. }
  11. }
  12. },
  13. theam:{
  14. type: String,
  15. value:'redContent',
  16. observer: function (newVal) {
  17. this.setData({ theam: newVal });
  18. }
  19. },
  20. wheelId:{
  21. type: String,
  22. observer: function (newVal) {
  23. this.setData({ wheelId: newVal });
  24. }
  25. }
  26. },
  27. data: {
  28. show:false,
  29. height:'60%',
  30. theam:'',
  31. wheelId:'',
  32. content:{}
  33. },
  34. methods: {
  35. // 获取弹窗内容
  36. getPopupContent(){
  37. let that=this;
  38. util.ajax({
  39. func: "v2/market/wheel/info",
  40. data: {wheelId:that.data.wheelId}
  41. }, function (res) {
  42. if (res.code==0) {
  43. that.setData({content:res.data})
  44. } else {
  45. util.showTips(res.reason);
  46. }
  47. })
  48. },
  49. // 关闭弹窗
  50. closeTip(e){
  51. this.colse(e.detail)
  52. },
  53. // 确定
  54. closePopup(){
  55. this.colse(false)
  56. },
  57. colse(data){
  58. this.triggerEvent("close",{
  59. status:data,
  60. type:'rules'
  61. } );
  62. }
  63. }
  64. })