index.js 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. let _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. callback: {
  5. type: Function
  6. },
  7. queryClient: {
  8. type: Function
  9. }
  10. },
  11. data: {
  12. queryShow: false,
  13. },
  14. lifetimes: {
  15. attached: function () {
  16. getApp().globalData.Language.getLanguagePackage(this)
  17. }
  18. },
  19. methods: {
  20. /* 引入 */
  21. introduce(e) {
  22. let {
  23. item
  24. } = e.currentTarget.dataset,
  25. that = this;
  26. wx.showModal({
  27. title: getApp().globalData.Language.getMapText('提示'),
  28. content: getApp().globalData.Language.getMapText('是否确定引入') + `“${item.companyName}”` + getApp().globalData.Language.getMapText('信息'),
  29. cancelText: getApp().globalData.Language.getMapText('取消'),
  30. confirmText: getApp().globalData.Language.getMapText('确定'),
  31. complete: (res) => {
  32. if (res.confirm) {
  33. _Http.basic({
  34. id: 2024060715002601,
  35. content: {
  36. companyName: item.companyName,
  37. }
  38. }).then(res => {
  39. console.log("工商详情查询", res)
  40. that.setData({
  41. queryShow: false,
  42. queryList: null
  43. })
  44. that.triggerEvent("callback", res.data)
  45. })
  46. }
  47. }
  48. })
  49. },
  50. /* 工商查询 */
  51. queryClient(enterprisename) {
  52. _Http.basic({
  53. id: 20221208103601,
  54. content: {
  55. pageNumber: 1,
  56. pageTotal: 1,
  57. pageSize: 5,
  58. keyword: enterprisename,
  59. }
  60. }).then(res => {
  61. console.log("工商查询", res)
  62. if (!res.data[0]) return wx.showToast({
  63. title: getApp().globalData.Language.getMapText('未查询到相关企业') + '!',
  64. icon: "none"
  65. });
  66. this.setData({
  67. queryList: res.data.map(v => {
  68. for (const key in v) {
  69. if (v[key] == "-") v[key] = ''
  70. }
  71. return v
  72. }),
  73. queryShow: true
  74. })
  75. })
  76. },
  77. openQuery() {
  78. this.triggerEvent("queryClient")
  79. },
  80. onClose() {
  81. this.setData({
  82. queryShow: false
  83. })
  84. },
  85. }
  86. })