index.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. res.data.regProvince = item.regProvince;
  41. that.setData({
  42. queryShow: false,
  43. queryList: null
  44. })
  45. that.triggerEvent("callback", res.data)
  46. })
  47. }
  48. }
  49. })
  50. },
  51. /* 工商查询 */
  52. queryClient(enterprisename) {
  53. _Http.basic({
  54. id: 20221208103601,
  55. content: {
  56. pageNumber: 1,
  57. pageTotal: 1,
  58. pageSize: 5,
  59. keyword: enterprisename,
  60. }
  61. }).then(res => {
  62. console.log("工商查询", res)
  63. if (!res.data[0]) return wx.showToast({
  64. title: getApp().globalData.Language.getMapText('未查询到相关企业') + '!',
  65. icon: "none"
  66. });
  67. this.setData({
  68. queryList: res.data.map(v => {
  69. for (const key in v) {
  70. if (v[key] == "-") v[key] = ''
  71. }
  72. return v
  73. }),
  74. queryShow: true
  75. })
  76. })
  77. },
  78. openQuery() {
  79. this.triggerEvent("queryClient")
  80. },
  81. onClose() {
  82. this.setData({
  83. queryShow: false
  84. })
  85. },
  86. }
  87. })