|  |  | @ -6,11 +6,13 @@ Page({ | 
			
		
	
		
		
			
				
					
					|  |  |  |     selectedStudent: {},        // 选中的学生
 |  |  |  |     selectedStudent: {},        // 选中的学生
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     rankings: [] , |  |  |  |     rankings: [] , | 
			
		
	
		
		
			
				
					
					|  |  |  |     currentIndex: 0, |  |  |  |     currentIndex: 0, | 
			
		
	
		
		
			
				
					
					|  |  |  |     isAllspot: 0 |  |  |  |     isAllspot: 0, | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     showSolidMode: false | 
			
		
	
		
		
			
				
					
					|  |  |  |   }, |  |  |  |   }, | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   onLoad: function() { |  |  |  |   onLoad: function() { | 
			
		
	
		
		
			
				
					
					|  |  |  |     // 假设从全局或云端获取学生数据
 |  |  |  |     // 假设从全局或云端获取学生数据
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     showSolidMode = false; | 
			
		
	
		
		
			
				
					
					|  |  |  |     const studentsWithDetails = app.globalData.array.map(student => { |  |  |  |     const studentsWithDetails = app.globalData.array.map(student => { | 
			
		
	
		
		
			
				
					
					|  |  |  |       return { |  |  |  |       return { | 
			
		
	
		
		
			
				
					
					|  |  |  |         ...student, |  |  |  |         ...student, | 
			
		
	
	
		
		
			
				
					|  |  | @ -27,10 +29,14 @@ Page({ | 
			
		
	
		
		
			
				
					
					|  |  |  |   }, |  |  |  |   }, | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   titleClick: function (e) { |  |  |  |   titleClick: function (e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     const index = e.currentTarget.dataset.idx; | 
			
		
	
		
		
			
				
					
					|  |  |  |     this.setData({ |  |  |  |     this.setData({ | 
			
		
	
		
		
			
				
					
					|  |  |  |         //拿到当前索引并动态改变
 |  |  |  |         //拿到当前索引并动态改变
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         currentIndex: e.currentTarget.dataset.idx |  |  |  |         currentIndex: e.currentTarget.dataset.idx | 
			
		
	
		
		
			
				
					
					|  |  |  |     }) |  |  |  |     }) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     if (index == 2) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       this.showRankings(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |   }, |  |  |  |   }, | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   switch1Change: function(e) { |  |  |  |   switch1Change: function(e) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -63,7 +69,7 @@ Page({ | 
			
		
	
		
		
			
				
					
					|  |  |  |   }, |  |  |  |   }, | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   // 课中点名 - 随机点名
 |  |  |  |   // 课中点名 - 随机点名
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   randomRollCall: function() { |  |  |  |   beginrandom: function(e) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     app.globalData.part = 0; |  |  |  |     app.globalData.part = 0; | 
			
		
	
		
		
			
				
					
					|  |  |  |     wx.navigateTo({ |  |  |  |     wx.navigateTo({ | 
			
		
	
		
		
			
				
					
					|  |  |  |       url: '/pages/cardM/cardM', |  |  |  |       url: '/pages/cardM/cardM', | 
			
		
	
	
		
		
			
				
					|  |  | @ -76,13 +82,18 @@ Page({ | 
			
		
	
		
		
			
				
					
					|  |  |  |     }) |  |  |  |     }) | 
			
		
	
		
		
			
				
					
					|  |  |  |   }, |  |  |  |   }, | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   // 课中点名 - 指定点名
 |  |  |  |   beginsolid: function() { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   specifiedRollCall: function() { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     app.globalData.part = 1; |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |       this.setData({ |  |  |  |       this.setData({ | 
			
		
	
		
		
			
				
					
					|  |  |  |       showStudentPicker: true  // 显示下拉选择框
 |  |  |  |         showSolidMode: true,   // 设置为 true 来隐藏当前内容并显示新的内容
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |       }); |  |  |  |       }); | 
			
		
	
		
		
			
				
					
					|  |  |  |   }, |  |  |  |   } | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   // 课中点名 - 指定点名
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   // specifiedRollCall: function() {
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   //   app.globalData.part = 1;
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   //   this.setData({
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   //     showStudentPicker: true 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   //   });
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   // },
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   // 选择学生
 |  |  |  |   // 选择学生
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   selectStudent: function(e) { |  |  |  |   selectStudent: function(e) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -139,6 +150,7 @@ Page({ | 
			
		
	
		
		
			
				
					
					|  |  |  |     }) |  |  |  |     }) | 
			
		
	
		
		
			
				
					
					|  |  |  |      |  |  |  |      | 
			
		
	
		
		
			
				
					
					|  |  |  |   }, |  |  |  |   }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   showRankings: function() { |  |  |  |   showRankings: function() { | 
			
		
	
		
		
			
				
					
					|  |  |  |     // 处理学生没有积分的情况,将没有积分的学生默认积分设为0
 |  |  |  |     // 处理学生没有积分的情况,将没有积分的学生默认积分设为0
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     const studentsWithScores = this.data.students.map(student => ({ |  |  |  |     const studentsWithScores = this.data.students.map(student => ({ | 
			
		
	
	
		
		
			
				
					|  |  | @ -163,13 +175,6 @@ Page({ | 
			
		
	
		
		
			
				
					
					|  |  |  |     }); |  |  |  |     }); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     // 进入排行榜页面,并携带排行榜数据
 |  |  |  |     // 进入排行榜页面,并携带排行榜数据
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     wx.navigateTo({ |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         url: '/pages/rankings/rankings',  // 假设有一个显示排行榜的页面
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         success: (res) => { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             // 将排名数据传递给排行榜页面
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             res.eventChannel.emit('sendRankingsData', { rankings }); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     }); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | 
 |