convertNextPopup.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. const util = require('../../../utils/util.js');
  2. Component({
  3. options: {
  4. addGlobalClass: true
  5. }, //使用全局css样式
  6. properties: {
  7. show: {
  8. type: Boolean,
  9. observer: function (newVal) {
  10. this.setData({
  11. show: newVal
  12. });
  13. }
  14. },
  15. aid: {
  16. type: String,
  17. observer: function (newVal) {
  18. this.setData({
  19. aid: newVal
  20. });
  21. }
  22. },
  23. checkedTime: {
  24. type: Number,
  25. observer: function (newVal) {
  26. console.log('checkedTime', newVal)
  27. this.setData({
  28. checkedTime: newVal
  29. });
  30. }
  31. },city: {
  32. type: String,
  33. observer: function (newVal) {
  34. console.log('city', newVal)
  35. this.setData({
  36. city: newVal
  37. });
  38. }
  39. },
  40. },
  41. data: {
  42. aid: '',
  43. show: false,
  44. checkedTime: 5,
  45. city:''
  46. },
  47. methods: {
  48. close() {
  49. this.triggerEvent('close')
  50. },
  51. sub() {
  52. let that = this;
  53. util.ajax({
  54. func: 'v2/article/advance/buy',
  55. data: {
  56. minuteNum: this.data.checkedTime,
  57. aid: this.data.aid
  58. },
  59. load: false
  60. }, function (res) {
  61. if (res.code == 0) {
  62. that.triggerEvent('changePrivilege', {
  63. time: that.data.checkedTime
  64. })
  65. } else {
  66. util.showTips(res.reason);
  67. }
  68. })
  69. }
  70. }
  71. })