noticeList.js 887 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. var app = getApp();
  2. var that;
  3. Page({
  4. data: {
  5. noticeList: []
  6. },
  7. onLoad(e) {
  8. that = this
  9. dd.setNavigationBar({ title: "公告列表" });
  10. },
  11. onShow() {
  12. if (app.globalData.userData) {
  13. dd.hideLoading();
  14. that.getList();
  15. } else {
  16. app.login(app.globalData.corpId, function (is) {
  17. if (is) {
  18. dd.hideLoading();
  19. that.getList();
  20. } else {
  21. dd.reLaunch({
  22. url: '../../noJurisdiction/noJurisdiction'
  23. })
  24. }
  25. }, function () { })
  26. }
  27. },
  28. getList() {
  29. app.$get("api/information/list").then((res) => {
  30. console.log(res.data.data)
  31. this.setData({
  32. noticeList: res.data.data.list
  33. })
  34. })
  35. },
  36. getDetails(e) {
  37. var id = e.target.dataset.id;
  38. console.log(id)
  39. dd.navigateTo({
  40. url: '../noticeDetail/noticeDetail?id=' + id
  41. })
  42. }
  43. });