yichael 4 лет назад
Родитель
Сommit
6d36d10c03
3 измененных файлов с 97 добавлено и 21 удалено
  1. 10 1
      components/user/stuManage.vue
  2. 38 16
      components/user/stuTestDetails.vue
  3. 49 4
      components/user/user.vue

+ 10 - 1
components/user/stuManage.vue

@@ -23,7 +23,9 @@
 							<th>{{student.class}}</th>
 							<th>{{student.progress}}</th>
 							<th>{{student.score}}</th>
-							<th style="position: relative;"><button type="default" size="mini" class="m_delete">实验情况</button></th>
+							<th style="position: relative;">
+								<button type="default" size="mini" class="m_delete" @click="onClick_XSSYQK(studentI)">实验情况</button>
+							</th>
 						</tr>
 					</tbody>
 				</table>
@@ -106,6 +108,7 @@
 			updateInfo() {
 				this.index = 1;
 				this.allStudent = userController.studentList;
+				// console.log('this.allStudent=',this.allStudent)
 				this.pageCount = Math.ceil(this.allStudent.length / 7);
 				this.updateTable();
 				// console.log("学生管理,更新页面", this.allStudent);
@@ -148,6 +151,12 @@
 					self.addStudentData = {};
 					userController.updateStudentList(self.updateInfo,null)
 				}, null);
+			},
+			onClick_XSSYQK(studentI){
+				console.log("实验情况=");
+				let UserID = this.allStudent[studentI].UserID;
+				console.log("UserID=",this.allStudent[studentI].UserID);
+				this.$emit('onClick_XSSYQK',UserID);	
 			}
 		}
 	}

+ 38 - 16
components/user/stuTestDetails.vue

@@ -21,9 +21,9 @@
 							</thead>
 							<tbody>
 								<tr>
-									<th style="color: #EA252C;">张小旭</th>
-									<th>实时特效</th>
-									<th>96</th>
+									<th style="color: #EA252C;">{{model.Name}}</th>
+									<th>{{model.Class}}</th>
+									<th>{{model.StudentID}}</th>
 								</tr>
 							</tbody>
 						</table>
@@ -98,27 +98,27 @@
 							<tbody>
 								<tr>
 									<th>原理认知</th>
-									<th>是</th>
-									<th>是</th>
-									<th>96</th>
+									<th>{{model.Score_ylrz>0?'':'否'}}</th>
+									<th>{{model.Score_ylrz>=10?'':'否'}}</th>
+									<th>{{model.Score_ylrz>0?model.Score_ylrz:'0'}}</th>
 								</tr>
 								<tr>
 									<th>实景勘察</th>
-									<th>是</th>
-									<th>是</th>
-									<th>96</th>
+									<th>{{model.Score_sjkc>0?'':'否'}}</th>
+									<th>{{model.Score_sjkc>=10?'':'否'}}</th>
+									<th>{{model.Score_sjkc>0?model.Score_sjkc:'0'}}</th>
 								</tr>
 								<tr>
 									<th>虚拟技术搭建</th>
-									<th>是</th>
-									<th>是</th>
-									<th>96</th>
+									<th>{{model.Score_xnjsdj>0?'':'否'}}</th>
+									<th>{{model.Score_xnjsdj>=10?'':'否'}}</th>
+									<th>{{model.Score_xnjsdj>0?model.Score_xnjsdj:'0'}}</th>
 								</tr>
 								<tr>
 									<th>虚拟艺术创作</th>
-									<th>是</th>
-									<th>是</th>
-									<th>96</th>
+									<th>{{model.Score_xnyscz>0?'':'否'}}</th>
+									<th>{{model.Score_xnyscz>=10?'':'否'}}</th>
+									<th>{{model.Score_xnyscz>0?model.Score_xnyscz:'0'}}</th>
 								</tr>
 							</tbody>
 						</table>
@@ -147,7 +147,17 @@
 				sexIndex: 0,
 				zjIndex: 0,
 				mzIndex: 0,
-
+				
+				model: {
+					"Name": "", //姓名
+					"Class": "", //班级
+					"StudentID": '', //学号
+					"Score_ylrz": null, //原理认知分数
+					"Score_sjkc": null, //实景勘察分数
+					"Score_xnjsdj": null, //虚拟技术搭建分数
+					"Score_xnyscz": null, //虚拟艺术创作分数
+				},
+				
 				array_sex: ['男', '女'],
 				array_zj: ['身份证', '护照'],
 				array_mz: ['汉族', '少数民族'],
@@ -169,6 +179,18 @@
 			bindPickerChange_mz: function(e) {
 				this.mzIndex = e.target.value
 			},
+			updateInfo(data) {
+				console.log('data=',data)
+				this.model.Name = data.Name;
+				this.model.Class = data.Class;
+				this.model.StudentID = data.StudentID;
+				
+				userController.data_scores = data.UserScore;
+				this.model.Score_ylrz=userController.getScore_ylrz();
+				this.model.Score_sjkc=userController.getScore_sjck();
+				this.model.Score_xnjsdj=userController.getScore_xnjsdj();
+				this.model.Score_xnyscz=userController.getScore_xnyscz();
+			},
 		}
 	}
 </script>

+ 49 - 4
components/user/user.vue

@@ -45,7 +45,7 @@
 			<scroll-view class="rightBox user-right-box" scroll-y="true" :scroll-top="scrollTop" @scroll="scroll">
 				<!-- <view class="user-right-box"> -->
 				<GRXX ref="GRXX" v-show="showIndex==1"></GRXX>
-				<XSGL ref="XSGL" v-show="showIndex==2&&userInfo.role=='老师'&&!isShow_xssyqk"></XSGL>
+				<XSGL ref="XSGL" v-show="showIndex==2&&userInfo.role=='老师'&&!isShow_xssyqk" v-on:onClick_XSSYQK="onClick_XSSYQK"></XSGL>
 				<XSSYQK ref="XSSYQK" v-show="showIndex==2&&userInfo.role=='老师'&&isShow_xssyqk"></XSSYQK>
 				<GRXXJL ref="GRXXJL" v-show="showIndex==2&&userInfo.role=='学生'"></GRXXJL>
 				<!-- </view> -->
@@ -54,6 +54,7 @@
 	</view>
 </template>
 
+
 <script>
 	import GRXX from './selfInfo.vue'
 	import XSGL from './stuManage.vue'
@@ -125,12 +126,20 @@
 			initData() {
 				this.showIndex = 0;
 			},
+			onshow()
+			{
+				console.log('onshow......')
+				this.showIndex = false;
+			},
 			onClick_Btn1(index) {
 				if (index == this.userMenu_student.length - 1) {
 					this.$emit("onClick_proManage");
 				} else {
+					this.isShow_xssyqk = false;
 					this.checkedIndex_leftMenu = index;
 					this.showIndex = index + 1;
+					// console.log('checkedIndex_leftMenu=',index)
+					// console.log('showIndex=',index+1)
 				}
 				if (this.userInfo.role == '老师') {
 					switch (index) {
@@ -182,8 +191,9 @@
 							console.log("请求成功", res);
 							this.$refs.GRXX.updateInfo(data.User);
 							mydata_userInfo.email = data.User.Email;
+							// console.log('00000000000=',mydata_userInfo.role)
 							if (mydata_userInfo.role == '老师') {
-
+								// this.$refs.XSSYQK.updateInfo(data.User);
 							} else {
 								this.$refs.GRXXJL.updateInfo(data.User);
 							}
@@ -211,8 +221,6 @@
 					this.scrollTop = 0
 				});
 			},
-
-
 			//范例,直接复制
 			testPost() {
 				let url = this.$Api + "/user/getuserinfo";
@@ -242,6 +250,43 @@
 						console.log("fail+**+*", res)
 					}
 				});
+			},
+			onClick_XSSYQK(UserID){
+				// console.log("11111=",this.userInfo.role);
+				// console.log("2222=",this.isShow_xssyqk);
+				console.log("UserID=",UserID);
+				this.isShow_xssyqk = true;
+				this.checkedIndex_leftMenu = 1;
+				this.showIndex = 2;
+				
+				let url = this.$Api + "/user/getuserinfo";
+				uni.request({
+					header: {
+						'Content-Type': 'application/json;charset=UTF-8'
+					},
+					url: url,
+					method: 'POST',
+					data: {
+						"UserID": UserID,
+					},
+					dataType: 'json',
+					success: (res) => {
+						let data = res.data;
+						//100成功
+						if (data.Code == 100) {
+							console.log("请求成功", res);
+							 this.$refs.XSSYQK.updateInfo(data.User);
+						}
+						//200失败
+						else {
+				
+						}
+						// console.log("success+++**+*", res.data.Code)
+					},
+					fail: (res) => {
+						console.log("fail+**+*", res)
+					}
+				});
 			}
 		}
 	}