index.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. methods: {
  15. /* 引入 */
  16. introduce(e) {
  17. let {
  18. item
  19. } = e.currentTarget.dataset,
  20. that = this;
  21. wx.showModal({
  22. title: '提示',
  23. content: `是否确定引入“${item.companyName}”信息`,
  24. complete: (res) => {
  25. if (res.confirm) {
  26. _Http.basic({
  27. id: 2024060715002601,
  28. content: {
  29. companyName: item.companyName,
  30. }
  31. }).then(res => {
  32. console.log("工商详情查询", res)
  33. that.setData({
  34. queryShow: false,
  35. queryList: null
  36. })
  37. that.triggerEvent("callback", res.data)
  38. })
  39. }
  40. }
  41. })
  42. },
  43. /* 工商查询 */
  44. queryClient(enterprisename) {
  45. _Http.basic({
  46. id: 20221208103601,
  47. content: {
  48. pageNumber: 1,
  49. pageTotal: 1,
  50. pageSize: 5,
  51. keyword: enterprisename,
  52. }
  53. }).then(res => {
  54. console.log("工商查询", res)
  55. if (!res.data[0]) return wx.showToast({
  56. title: '未查询到相关企业!',
  57. icon: "none"
  58. });
  59. this.setData({
  60. queryList: res.data.map(v => {
  61. for (const key in v) {
  62. if (v[key] == "-") v[key] = ''
  63. }
  64. return v
  65. }),
  66. queryShow: true
  67. })
  68. })
  69. },
  70. openQuery() {
  71. this.triggerEvent("queryClient")
  72. },
  73. onClose() {
  74. this.setData({
  75. queryShow: false
  76. })
  77. },
  78. }
  79. })