import request from '../../../util/http' import apiUrl from '../../../util/apiUrl' import apiUrl1 from '../../../util/apiUrl1' var app = getApp(); Page({ data: { allList: [] }, onLoad(options) { console.log(options); }, onShow() { this.initDailyTaskList(); }, //数据加载 initDailyTaskList() { let params = { } request.httpServiceGet(apiUrl.getDailyTaskList, params).then(data => { if (data.length > 0) { //添加选中的状态列 let dailytasklist = data; var that = this; for(let i=0;i { console.log(e); }) }, //点击选中任务 toggleWashinGandnursing(e) { let currentIndex= e.target.dataset.index;//类型ID let id = e.target.dataset.id;//选中当前ID let dailytasklist=this.data.allList; for(let i=0;i0){ dailytasklist.push({categoryId:this.data.allList[i].categoryId,itemIds:itemIds}); } } request.httpServicePost(apiUrl1.createDayTaskItem,{employRelationNo:employRelationNo,taskItems:dailytasklist}).then(data=>{ my.alert({ title: '提示', content: '保存完成', buttonText: '确定', success: () => { my.navigateBack(); } } ); }); }, });