index.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. },
  13. /**
  14. * 组件的初始数据
  15. */
  16. data: {
  17. },
  18. lifetimes:{
  19. attached () {
  20. setTimeout(() => {
  21. this.fileData()
  22. }, 1000);
  23. }
  24. },
  25. /**
  26. * 组件的方法列表
  27. */
  28. methods: {
  29. async fileData () {
  30. let page = getCurrentPages()[getCurrentPages().length - 1]
  31. const res = await api._post({
  32. "classname": "system.attachment.Attachment",
  33. "method": "queryFileLink",
  34. "content": page.data.bindSignNameData
  35. })
  36. this.setData({
  37. originFiles:res.data
  38. })
  39. },
  40. async deleteFile (data) {
  41. let item = data.detail.file
  42. const res = await api._post({
  43. "classname": "system.attachment.Attachment",
  44. "method": "deleteFileLink",
  45. "content": {
  46. "linksids": [item.linksid]
  47. }
  48. })
  49. this.fileData()
  50. },
  51. // 签字
  52. signName () {
  53. wx.navigateTo({
  54. url: '/pages/signName/index?id=' + this.data.bindData.ownerid,
  55. })
  56. },
  57. }
  58. })