You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.7KB

  1. // package_A/page/alltask/index.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. list:[],
  8. current: '/information/getRegisterInformation',
  9. params: {},
  10. startTime: '',
  11. startCurrent: -1,
  12. endTime: '',
  13. endCurrent: -1,
  14. uploadType: ['车辆登记', '访客人员']
  15. },
  16. onLoad(e) {
  17. },
  18. onShow() {
  19. },
  20. /* 更新数据 */
  21. updateList(e) {
  22. let list = this.data.list.concat(e.detail || [])
  23. this.setData({ list })
  24. },
  25. /* 重置数据 */
  26. resetList() {
  27. this.setData({ list: [] })
  28. },
  29. /**
  30. * 选择
  31. * @param {*} e
  32. */
  33. selectTime(e) {
  34. let value = e.detail.value
  35. let type = e.currentTarget.dataset.type
  36. if(type === 'start') {
  37. if(this.data.endTime) {
  38. this.setData({endTime: '', params: {}})
  39. }
  40. this.setData({startTime: value})
  41. } else if(type === 'end') {
  42. let params = this.data.params
  43. this.setData({endTime: value})
  44. if(this.data.startTime) {
  45. params.startTime = this.data.startTime
  46. params.endTime = value
  47. this.setData({params})
  48. }
  49. }
  50. },
  51. /**
  52. * 跳转详情页
  53. * @param {*} e
  54. */
  55. showDetail(e) {
  56. let data = e.currentTarget.dataset.item
  57. if(data.registerType === 0) {
  58. wx.navigateTo({
  59. url: '/package_A/page/upload/index?id=' + data.id,
  60. })
  61. } else {
  62. wx.navigateTo({
  63. url: '/package_A/page/register/index?id=' + data.id,
  64. })
  65. }
  66. }
  67. })