//Component Object
Component({
    properties: {
        commentsList: {
            type: Array,
            value: [],
            observer: function () {}
        },
        
    },
    
    data: {
        
    },
    methods: {
        // 预览图片
        previewImg: function (e) {
            
            //获取当前图片的下标
            var index = e.currentTarget.dataset.index;
            var active = e.currentTarget.dataset.active;
            //所有图片
            var imgurls = this.properties.commentsList[active].comments.imgs;
            var imgs = []
            imgurls.forEach(function (item,i,array) {
                imgs.push(item.imgurl);
            })
            wx.previewImage({
                //当前显示图片
                current: imgs[index],
                //所有图片
                urls: imgs
            })
        },
    },
    created: function () {

    },
    attached: function () {

    },
    ready: function () {
       
    },
    moved: function () {

    },
    detached: function () {

    },
});