Component({
    properties: {
        list: {
            type: Array
        },
        getResult: {
            type: Function
        },
        result: {
            type: Array
        }
    },
    options: {
        addGlobalClass: true
    },
    data: {
        show: false
    },
    lifetimes: {
        attached: function () {
            getApp().globalData.Language.getLanguagePackage(this)
        }
    },
    methods: {
        onChange({
            detail
        }) {
            this.setData({
                result: detail
            })
        },
        onClose() {
            this.setData({
                show: false
            })
        },
        handleReturn() {
            if (!this.data.result.length) return;
            this.triggerEvent("getResult", this.data.result)
            this.setData({
                show: false,
                result: []
            })
        }
    }
})