1 onSubmit() { 2 //定义一个空数组 3 let activeLabel = [] 4 this.data.lableList.map((item)=>{ 5 if(item.activeIndex != null){ 6 //获取到child的所需携带的索引值,赋值给标签 7 let label = item.child[item.activeIndex] 8 label.type = item.type 9 activeLabel.push(label) 10 } 11 }); 12 let pages = getCurrentPages(); 13 let prevPage = pages[pages.length - 2]; //上一个页面 14 prevPage.setData({ 15 activeLabel: activeLabel 16 }) 17 wx.navigateBack() 18 },