Component({
    properties: {
        list: {
            type: Array
        },
        deleteItem: {
            type: Function
        },
        disabled: {
            type: Boolean
        }
    },
    options: {
        addGlobalClass: true
    },
    lifetimes: {
        attached: function () {
            getApp().globalData.Language.getLanguagePackage(this)
        }
    },
    methods: {
        handleItem(e) {
            const {
                item,
                name
            } = e.target.dataset,
                that = this;
            if (!item) return;
            if (name == 'edit') {
                wx.navigateTo({
                    url: '/packageA/setclient/modules/bankcard/update?data=' + JSON.stringify(item)
                })
            } else {
                wx.showModal({
                    title: getApp().globalData.Language.getMapText('提示'),
                    content: getApp().globalData.Language.getMapText('是否确定删除') + '?',
                    cancelText: getApp().globalData.Language.getMapText('取消'),
                    confirmText: getApp().globalData.Language.getMapText('确定'),
                    complete: ({
                        confirm
                    }) => {
                        if (confirm) that.triggerEvent("deleteItem", item)
                    }
                })
            }
        }
    }
})