var Nova = getApp().Nova;
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        options: null,
    },
    /**
     * 组件的初始数据
     */
    data: {

    },
    ready: function() { // 在组件布局完成后执行，确保options参数中有data信息
        this.loadData();
    },
    /**
     * 组件的方法列表
     */
    methods: {
        async loadData() {
            let { options } = this.data
            console.log('单图组', options);
            let {
                data,
                style,
            } = options
            console.log(style);
            let { className, src, filter, list } = data
            this.setData({
                list,
                src,
                style,
                className,
                filter
            })
        },
        goNovaURL: function(ev) {
            let item = ev.currentTarget.dataset.item;
            let url = ''
            if (item.className == 'ShopGoods' && item.objectId) {
                url = "/nova-shop/pages/shop-goods/goods-detail/index?id=" + item.objectId
            }
            if (item.className == 'Article' && item.objectId) {
                url = "/common-page/pages/cates/article-detail/index?id=" + item.objectId
            }
            if (item.className == 'Lesson' && item.objectId) {
                url = ""
            }
            if (item.url) {
                url = item.url
            }

            Nova.goNovaURL(url);
        }
    }
})