// package_mine/pages/feedbackDetail/index.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        dataSource: {},
        statusList: [
            {title: '未处理', color: '#F34747'},
            {title: '未处理', color: '#F34747'},
            {title: '已处理', color: '#2a82e4'},
            {title: '已处理', color: '#2a82e4'}
        ]
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        if(options.data) {
            let dataSource = this.data.dataSource
            dataSource = JSON.parse(options.data)
            this.setData({dataSource})
            let imageList = dataSource.feedbackUrl.split(',')
            let handleImgList = []
            if(dataSource.handleUrl) {
                handleImgList = dataSource.handleUrl.split(',')
            }
            this.setData({imageList,handleImgList})
        }
    },

    showImgPreview(e) {
        let current = e.currentTarget.dataset.current
        let type = e.currentTarget.dataset.type
        let urls = this.data[type]
        wx.previewImage({
          urls: urls,
          current:current
        })
    }
})