index.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // pages/stroke/index.js
  2. import api from "../../api/index";
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. meetingList: {}
  9. },
  10. toPage(e) {
  11. const {
  12. id
  13. } = e.currentTarget.dataset;
  14. api.getSeatImage({
  15. id
  16. }).then(r => {
  17. wx.previewMedia({
  18. sources: [{
  19. url: r.content
  20. }]
  21. })
  22. })
  23. },
  24. /**
  25. * 生命周期函数--监听页面加载
  26. */
  27. onLoad(options) {
  28. api.getStroke().then(strokeList => {
  29. console.log(strokeList)
  30. const sl = {}
  31. for (let i = 0; i < strokeList.length; i++) {
  32. const v = strokeList[i];
  33. const time = (v.agendaTime || "").split(" ");
  34. if (!time.length) continue
  35. if (!sl[time[0]]) sl[time[0]] = [];
  36. sl[time[0]].push(v);
  37. }
  38. this.setData({
  39. meetingList: sl
  40. })
  41. })
  42. },
  43. /**
  44. * 生命周期函数--监听页面初次渲染完成
  45. */
  46. onReady() {
  47. },
  48. /**
  49. * 生命周期函数--监听页面显示
  50. */
  51. onShow() {
  52. },
  53. /**
  54. * 生命周期函数--监听页面隐藏
  55. */
  56. onHide() {
  57. },
  58. /**
  59. * 生命周期函数--监听页面卸载
  60. */
  61. onUnload() {
  62. },
  63. /**
  64. * 页面相关事件处理函数--监听用户下拉动作
  65. */
  66. onPullDownRefresh() {
  67. },
  68. /**
  69. * 页面上拉触底事件的处理函数
  70. */
  71. onReachBottom() {
  72. },
  73. /**
  74. * 用户点击右上角分享
  75. */
  76. onShareAppMessage() {
  77. },
  78. onShareTimeline() {}
  79. })