index.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. const sl = {}
  30. for (let i = 0; i < strokeList.length; i++) {
  31. const v = strokeList[i];
  32. const time = (v.agendaTime || "").split(" ");
  33. if (!time.length) continue
  34. let t0 = time[0].split('-');
  35. let key = [t0[1] , t0[2]].join("-");
  36. if (!sl[key]) sl[key] = [];
  37. sl[key].push(v);
  38. }
  39. this.setData({
  40. meetingList: sl
  41. })
  42. })
  43. },
  44. /**
  45. * 生命周期函数--监听页面初次渲染完成
  46. */
  47. onReady() {
  48. },
  49. /**
  50. * 生命周期函数--监听页面显示
  51. */
  52. onShow() {
  53. },
  54. /**
  55. * 生命周期函数--监听页面隐藏
  56. */
  57. onHide() {
  58. },
  59. /**
  60. * 生命周期函数--监听页面卸载
  61. */
  62. onUnload() {
  63. },
  64. /**
  65. * 页面相关事件处理函数--监听用户下拉动作
  66. */
  67. onPullDownRefresh() {
  68. },
  69. /**
  70. * 页面上拉触底事件的处理函数
  71. */
  72. onReachBottom() {
  73. },
  74. /**
  75. * 用户点击右上角分享
  76. */
  77. onShareAppMessage() {
  78. },
  79. onShareTimeline() {}
  80. })