index.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. const app = getApp(),
  2. {
  3. globalData: {
  4. util: {
  5. regeneratorRuntime,
  6. api: {
  7. home
  8. },
  9. navigate,
  10. navigate_native,
  11. navigate_auth_native,
  12. request: {
  13. get
  14. }
  15. }
  16. }
  17. } = app;
  18. Page({
  19. /**
  20. * 页面的初始数据
  21. */
  22. data: {
  23. currentSwiperElegant: 1,
  24. iconList: [{
  25. picUrl: '/images/message.png',
  26. content: '通知公告',
  27. url: './list/index?type=administrationInfo&title=通知公告'
  28. },
  29. {
  30. picUrl: '/images/video.png',
  31. content: '媒体科大',
  32. url: './list/index?type=servicePacesetter&title=媒体科大'
  33. }, {
  34. picUrl: '/images/audio.png',
  35. content: '科大视听',
  36. url: './list/index?type=administrationInfo&title=科大视听'
  37. }, {
  38. picUrl: '/images/wenhua.png',
  39. content: '校园文化',
  40. url: './list/index?type=administrationInfo&title=校园文化'
  41. }
  42. ],
  43. },
  44. async onLoad() {
  45. let data = await get(home);
  46. data._err || this.setData(data)
  47. },
  48. swiperChangeElegant({
  49. detail: {
  50. current: currentSwiperElegant
  51. }
  52. }) {
  53. this.setData({
  54. currentSwiperElegant
  55. })
  56. },
  57. navigate_native,
  58. navigate_auth_native
  59. })