let _Http = getApp().globalData.http;
Component({
    properties: {
        callback: Function
    },
    data: {
        queryShow: false,
    },
    methods: {
        /* 引入 */
        introduce(e) {
            let {
                item
            } = e.currentTarget.dataset,
                that = this;
            wx.showModal({
                title: '提示',
                content: `是否确定引入“${item.companyName}”信息`,
                complete: (res) => {
                    if (res.confirm) {
                        that.setData({
                            queryShow: false,
                            queryList: null
                        })
                        that.triggerEvent("callback", item)
                        
                    }
                }
            })
        },
        /* 工商查询 */
        queryClient(enterprisename) {
            _Http.basic({
                id: 20221208103601,
                content: {
                    pageNumber: 1,
                    pageTotal: 1,
                    pageSize: 5,
                    keyword: enterprisename,
                }
            }).then(res => {
                console.log("工商查询", res)
                if (!res.data[0]) return wx.showToast({
                    title: '未查询到相关企业！',
                    icon: "none"
                });
                this.setData({
                    queryList: res.data,
                    queryShow: true
                })
            })
        },
        onClose() {
            this.setData({
                queryShow: false
            })
        },
    }
})