index.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // components/signName/index.js
  2. import api from '../../api/api'
  3. Component({
  4. /**
  5. * 组件的属性列表
  6. */
  7. properties: {
  8. bindData: {
  9. value: {},
  10. type: Object
  11. },
  12. showBut: {
  13. type: Boolean,
  14. value: true
  15. }
  16. },
  17. /**
  18. * 组件的初始数据
  19. */
  20. data: {
  21. },
  22. /**
  23. * 组件生命周期
  24. */
  25. lifetimes: {
  26. attached() {
  27. this.fileData()
  28. }
  29. },
  30. /**
  31. * 组件的方法列表
  32. */
  33. methods: {
  34. async fileData() {
  35. let page = getCurrentPages()[getCurrentPages().length - 1]
  36. if (page.data.bindSignNameData) {
  37. const res = await api._post({
  38. "classname": "system.attachment.Attachment",
  39. "method": "queryFileLink",
  40. "content": page.data.bindSignNameData
  41. })
  42. console.log("res.data", res.data)
  43. this.setData({
  44. originFiles: res.data,
  45. showBut: res.data.length == 0
  46. })
  47. }
  48. },
  49. async deleteFile(data) {
  50. let item = data.detail.file
  51. const res = await api._post({
  52. "classname": "system.attachment.Attachment",
  53. "method": "deleteFileLink",
  54. "content": {
  55. "linksids": [item.linksid]
  56. }
  57. })
  58. this.fileData()
  59. },
  60. // 签字
  61. signName() {
  62. wx.navigateTo({
  63. url: '/Eservice/signName/index?id=' + this.data.bindData.ownerid,
  64. })
  65. },
  66. }
  67. })