index.js 497 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. const app = getApp(),
  2. {
  3. globalData: {
  4. util: {
  5. regeneratorRuntime,
  6. api: {
  7. newsList: url
  8. }
  9. }
  10. }
  11. } = app;
  12. Page({
  13. onLoad: function({
  14. title,
  15. type
  16. }) {
  17. wx.setNavigationBarTitle({
  18. title
  19. })
  20. this.setData({
  21. template: type,
  22. request: {
  23. url,
  24. data: {
  25. type
  26. },
  27. type: 'post'
  28. }
  29. })
  30. },
  31. onPullDownRefresh() {
  32. this.setData({
  33. reload: {}
  34. })
  35. }
  36. })