// pages/order/confirmOreder/confirmOreder.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        currentList: [{
            tit: '塑封包膜',
            num: "30",
            id:1
        }, {
            tit: '绒面鞋补色',
            num: "20",
            id:2
        }, {
            tit: '防水处理',
            num: "20",
            id:3
        }, {
            tit: '防水处理',
            num: "10",
            id:4
        }],
        mode:true,
        checked:false,
        show1:false,
        show2:false,

    },
    onLoad() {
        let currentList = this.data.currentList
        currentList.map(item => {
            item.active = false
        })
        this.setData({
            currentList
        })
    },

    changeClose1(e){
        this.setData({
            show1:!this.data.show1
        })
    },

    changeClose2(e){
        this.setData({
            show2:!this.data.show2
        })
    },
    onChange(event) {
        console.log(event);
        this.setData({
            checked: event.detail,
        });
      },
    chios(e){
        let {item} = e.currentTarget.dataset

        let currentList = this.data.currentList
        currentList.map((it,index)=>{
            if (item.id == it.id) {
                it.active = !it.active
            }
        })
        this.setData({
            currentList
        })
    },
    changeMode(e){
        let {mode} = e.currentTarget.dataset
        this.setData({
            mode
        })
    },

})