Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. const reqInterface = require("../../../api/models");
  2. import {
  3. toLink
  4. } from '../../../utils/nav';
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. publicityList: [],
  11. searchParams: {
  12. current: 1,
  13. size: 5
  14. },
  15. total: 0,
  16. conut: 0
  17. },
  18. /**
  19. * 生命周期函数--监听页面加载
  20. */
  21. onLoad(options) {
  22. this.getPublicityList(this.data.searchParams);
  23. },
  24. onShow() {
  25. if(wx.getStorageSync('token')) {
  26. reqInterface.GetQuotaGet().then(res => {
  27. this.setData({
  28. conut: res.remaining
  29. })
  30. })
  31. }
  32. },
  33. getPublicityList(val) {
  34. reqInterface.GetConsumerinfopublicList(val).then(res => {
  35. this.setData({
  36. publicityList: res.records,
  37. 'searchParams.current': this.data.searchParams.current - 1,
  38. total: parseInt(res.total / 5 + 1)
  39. })
  40. })
  41. },
  42. toUp() {
  43. this.setData({
  44. 'searchParams.current': this.data.searchParams.current - 1
  45. })
  46. this.getPublicityList(this.data.searchParams);
  47. },
  48. toNext() {
  49. this.setData({
  50. 'searchParams.current': this.data.searchParams.current + 1
  51. })
  52. this.getPublicityList(this.data.searchParams);
  53. },
  54. toApplyFor() {
  55. wx.navigateTo({
  56. url: '/pages/home/guide/detail/index',
  57. })
  58. },
  59. getRefresh() {
  60. let self = this;
  61. self.setData({
  62. searchParams: {
  63. current: 1,
  64. size: 5
  65. }
  66. })
  67. self.getPublicityList(self.data.searchParams);
  68. },
  69. toMore() {
  70. toLink('/pages/home/publicity/index/index')
  71. },
  72. toDetail(e) {
  73. toLink('/pages/home/publicity/detail/index', {id: e.currentTarget.dataset.id})
  74. },
  75. })