index.js 1.6 KB

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