fileItem.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // component/fileItem/fileItem.ts
  2. import { TimeUtil } from '../../utils/TimeUtil'
  3. import { httpUtil } from "../../utils/restful";
  4. Component({
  5. /**
  6. * 组件的属性列表
  7. */
  8. properties: {
  9. itemData: null
  10. },
  11. /**
  12. * 组件的初始数据
  13. */
  14. data: {
  15. fileUploadTime: ''
  16. },
  17. lifetimes: {
  18. attached: function () {
  19. // 在组件实例被从页面节点树添加时执行
  20. console.log("fileItem:", this.properties.itemData.uploadTime)
  21. this.setData({
  22. fileUploadTime: TimeUtil.dateFormat(parseInt(this.properties.itemData.uploadTime), "yyyy-MM-dd HH:mm"),
  23. })
  24. },
  25. detached: function () {
  26. // 在组件实例被从页面节点树移除时执行
  27. },
  28. },
  29. /**
  30. * 组件的方法列表
  31. */
  32. methods: {
  33. clickFileItem: function (event: any) {
  34. wx.navigateTo({
  35. url: '../../../pages/document/document?lessId=' + event.currentTarget.id
  36. })
  37. },
  38. clickMore: function (event: any) {
  39. this.triggerEvent("showWindow", { item: this.data.itemData })
  40. }
  41. }
  42. })