// subpages/demand/pages/demandList/demandList.js Page({ /** * 页面的初始数据 */ data: { current: 0, currentStatus: 0, tabsList: [ { name: '需求大厅', id: 0, }, { name: '我的需求', id: 1, } ], commonStatus: [ { name: '未处理', status: 'unprocessed', id: 0, url: 'heart/residemand/list-hall' }, { name: '处理中', status: 'processing', id: 1, url: 'heart/residemand/list-hall' }, { name: '已完成', status: 'finished', id: 2, url: 'heart/residemand/list-hall' } ], myDemand: [ { name: '未处理', status: 'unprocessed', id: 0, url: 'heart/residemand/mydemand' }, { name: '处理中', status: 'processing', id: 1, url: 'heart/residemand/mydemand' }, { name: '已完成', status: 'finished', id: 2, url: 'heart/residemand/mydemand' }, { name: '已取消', status: 'canceled', id: 3, url: 'heart/residemand/mydemand' } ] }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { }, handleTabs(e) { const id = e.currentTarget.dataset.id this.setData({ current: id }) }, handleSwiperChange(e) { const { detail: { current, source }, } = e if (source == "touch") { this.setData({ current: current }) } }, handleTo() { wx.navigateTo({ url: `../myDemand/myDemand` }) }, })