index.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. let _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. callback: Function,
  5. queryClient: Function
  6. },
  7. data: {
  8. queryShow: false,
  9. },
  10. methods: {
  11. /* 引入 */
  12. introduce(e) {
  13. let {
  14. item
  15. } = e.currentTarget.dataset,
  16. that = this;
  17. wx.showModal({
  18. title: '提示',
  19. content: `是否确定引入“${item.companyName}”信息`,
  20. complete: (res) => {
  21. if (res.confirm) {
  22. that.setData({
  23. queryShow: false,
  24. queryList: null
  25. })
  26. that.triggerEvent("callback", item)
  27. }
  28. }
  29. })
  30. },
  31. /* 工商查询 */
  32. queryClient(enterprisename) {
  33. _Http.basic({
  34. id: 20221208103601,
  35. content: {
  36. pageNumber: 1,
  37. pageTotal: 1,
  38. pageSize: 5,
  39. keyword: enterprisename,
  40. }
  41. }).then(res => {
  42. console.log("工商查询", res)
  43. if (!res.data[0]) return wx.showToast({
  44. title: '未查询到相关企业!',
  45. icon: "none"
  46. });
  47. this.setData({
  48. queryList: res.data,
  49. queryShow: true
  50. })
  51. })
  52. },
  53. openQuery() {
  54. this.triggerEvent("queryClient")
  55. },
  56. onClose() {
  57. this.setData({
  58. queryShow: false
  59. })
  60. },
  61. }
  62. })