index.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. const _Http = getApp().globalData.http;
  2. Page({
  3. data: {
  4. ownertable: null,
  5. ownerid: null,
  6. sys_datafollowupid: null,
  7. detail: {},
  8. tabbarList: [{
  9. icon: "icon-bianji",
  10. label: "编辑"
  11. }, {
  12. icon: "icon-shanchu",
  13. label: "作废"
  14. }]
  15. },
  16. onLoad(options) {
  17. if (options.data) {
  18. this.setData({
  19. ...JSON.parse(options.data)
  20. })
  21. this.getDetail();
  22. }
  23. },
  24. getDetail() {
  25. _Http.basic({
  26. "id": 20221026085601,
  27. "content": {
  28. "sys_datafollowupid": this.data.sys_datafollowupid
  29. }
  30. }).then(res => {
  31. if (res.msg != '成功') return wx.showToast({
  32. title: res.data,
  33. icon: "none"
  34. })
  35. this.setData({
  36. detail: res.data
  37. })
  38. })
  39. },
  40. /* tab 切换回调 */
  41. tabbarOnClick({
  42. detail
  43. }) {
  44. const pages = getCurrentPages(),
  45. item = this.data.detail;
  46. switch (detail.label) {
  47. case "编辑":
  48. wx.navigateTo({
  49. url: `/packageA/setclient/modules/trace/add/index?ownertable=${this.data.ownertable}&ownerid=${this.data.ownerid}&content=${item.content}&type=${item.type}&sys_datafollowupid=${item.sys_datafollowupid}`
  50. });
  51. break;
  52. case "作废":
  53. wx.navigateTo({
  54. url: `/packageA/setclient/modules/trace/list/delete?item=${JSON.stringify({
  55. "sys_datafollowupid": item.sys_datafollowupid,
  56. "ownertable": this.data.ownertable,
  57. "ownerid": this.data.ownerid
  58. })}`,
  59. })
  60. break;
  61. }
  62. },
  63. onShareAppMessage() {}
  64. })