// pages/commodity/index.js Page({ /** * 页面的初始数据 */ data: { checkedId: '1' }, onLoad(options) { }, onShow() { }, checked({ currentTarget }) { console.log(currentTarget); this.setData({ checkedId: currentTarget.dataset.id }) } })