// pages/my/cleanReport/cleanReport.js
var app = getApp()
Page({

    /**
     * 页面的初始数据
     */
    data: {
        id: '',
        info: ''
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        this.setData({id:options.id})
    },
    onShow(){
        this.detail()
    },
    detail() {
        var that = this;
        app.api.useApi(app.globalData.baseAppUrl + "api/CleaningReport", {
            order_id: that.data.id,
        }, "get").then(function (res) {
            if (res.code != 200) {
                wx.showLoading({
                    title: res.message.msg,
                })
                setTimeout(function () {
                    wx.hideLoading({
                        success: (res) => { },
                    })
                }, 2000);
            } else {
                that.setData({info:res.message.data})
                console.log(res.message.data);
            }

        }).catch(function (err) {
            console.log(222);
        })
    },
    previewImg(e){
        let that = this;
        wx.previewImage({
         current:e.currentTarget.dataset.src,   //当前图片地址
         urls: e.currentTarget.dataset.list,        //所有要预览的图片的地址集合 数组形式
        })
       }
})