index.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. lifetimes: {
  23. attached() {
  24. setTimeout(() => {
  25. this.fileData()
  26. }, 1000);
  27. }
  28. },
  29. /**
  30. * 组件的方法列表
  31. */
  32. methods: {
  33. async fileData() {
  34. let page = getCurrentPages()[getCurrentPages().length - 1]
  35. if (page.data.bindSignNameData) {
  36. const res = await api._post({
  37. "classname": "system.attachment.Attachment",
  38. "method": "queryFileLink",
  39. "content": page.data.bindSignNameData
  40. })
  41. console.log("res.data", res.data)
  42. this.setData({
  43. originFiles: res.data,
  44. showBut: res.data.length == 0
  45. })
  46. }
  47. },
  48. async deleteFile(data) {
  49. let item = data.detail.file
  50. const res = await api._post({
  51. "classname": "system.attachment.Attachment",
  52. "method": "deleteFileLink",
  53. "content": {
  54. "linksids": [item.linksid]
  55. }
  56. })
  57. this.fileData()
  58. },
  59. // 签字
  60. signName() {
  61. wx.navigateTo({
  62. url: '/Eservice/signName/index?id=' + this.data.bindData.ownerid,
  63. })
  64. },
  65. }
  66. })