Jelajahi Sumber

学生标签8

lijie 1 tahun lalu
induk
melakukan
2d69eb24b4

+ 35 - 23
pages/studentRanked/components/mark-score-list.vue

@@ -2,20 +2,24 @@
 	<el-drawer append-to-body title="点评记录" :visible.sync="show" size="400px" direction="ltr"
 		style="backdrop-filter: blur(4px);">
 		<u-cell-group v-for="(item,index) in list" :key="index">
-			<u-cell @click="itemClick(item,index)" class="ui-hover" clickable :title="item.student.student_name">
+			<view class="">
+				<u-cell  class="ui-hover ui-flex-1" clickable :title="item.student.student_name">
 
-				<view slot="icon" class="ui-mr10">
-					<image :src="item.stuSchool.student_photo" style="width: 40px;height: 40px;border-radius: 20px;">
-					</image>
-				</view>
-
-				<text slot="label" class="txt-muted">{{item.created_at}} </text>
-				<el-tag v-if="item.studentTab.type_text == '好评'" slot="value"
-					plain>{{item.studentTab.tab_name}}{{item.score}}</el-tag>
-				<el-tag slot="value" v-else plain type="danger">{{item.studentTab.tab_name}}{{item.score}}</el-tag>
-				<!-- <u-badge slot="value" value="+1" plain size="mini" type="success"></u-badge> -->
-			</u-cell>
+					<view slot="icon" class="ui-mr10">
+						<image :src="item.stuSchool.student_photo" style="width: 40px;height: 40px;border-radius: 20px;">
+						</image>
+					</view>
 
+					<text slot="label" class="txt-muted">{{item.created_at}} </text>
+					<el-tag v-if="item.studentTab.type_text == '好评'" slot="value"
+						plain>{{item.studentTab.tab_name}}{{item.score}}</el-tag>
+					<el-tag slot="value" v-else plain type="danger">{{item.studentTab.tab_name}}{{item.score}}</el-tag>
+					<!-- <u-badge slot="value" value="+1" plain size="mini" type="success"></u-badge> -->
+					<view class="" slot="right-icon">
+						<i class="el-icon-delete ui-ml30 " style="font-size: 20px;" @click="itemClick(item,index)"></i>
+					</view>
+				</u-cell>
+			</view>
 		</u-cell-group>
 		<view  @click="addTab" class="text-center ui-m ui-p" style="width: 100%;cursor: pointer;">
 			{{ showTitle }}
@@ -43,12 +47,21 @@
 				current_page : 1,
 				list : [],
 				last_page : 10,
-				showTitle : '加载更多',
+				
 				msgType: 'center',
 				itemInfo: {},
 				index:0
 			}
 		},
+		computed : {
+			showTitle(){
+				if (this.current_page > this.last_page) {
+					return '没有更多数据了。。。'
+				}else{
+					return '加载更多'
+				}
+			},
+		},
 		mounted() {
 
 		},
@@ -70,10 +83,9 @@
 					success: res => {
 						let arr = [...this.list, ...res.data.data]
 						this.current_page++
+						this.last_page=res.data.last_page
 						this.list =[...this.list,...res.data.data] 
-						if (this.current_page >= res.data.last_page) {
-							this.showTitle='没有更多数据了。。。'
-						}
+						
 					}
 				})
 			},
@@ -81,21 +93,21 @@
 				this.index = index
 				this.itemInfo = item
 				this.$refs.alertDialog.open('center')
-
 			},
 			dialogConfirm() {
 				this.$api.sendRequest({
 					url: `/mobile/studentTab/delstudentTabLog`,
 					method: "post",
 					data: {
-						tab_log_id: this.itemInfo.tab_id
+						tab_log_id: this.itemInfo.id
 					},
 					success: res => {
-						uni.showToast({
-							title: res.msg,
-						})
-						
-						this.$emit('success',this.index)
+						console.log("aaaaaaaaaaa");
+						this.show=false
+						this.$emit('delSuccess')
+					},
+					complete : res=>{
+						console.log(res,"resss");
 					}
 				})
 

+ 0 - 51
pages/studentRanked/components/mark-score.vue

@@ -115,57 +115,6 @@
 				}, {
 					name: '劳动'
 				}],
-				// 老师配置标签的时候,需要选择图标
-				tagIcons: [
-					'a-001-pencil.png',
-					'a-010-astronomy.png',
-					'a-017-protractor.png',
-					'a-024-schoollocker.png',
-					'a-031-mortarboard.png',
-					'a-038-schoolbag.png',
-					'a-045-liquidglue.png',
-					'a-002-alarmclock.png',
-					'a-011-maths.png',
-					'a-018-squareruler.png',
-					'a-025-idea.png',
-					'a-032-certificate.png',
-					'a-039-ask.png',
-					'a-046-school.png',
-					'a-003-book.png',
-					'a-012-eraser.png',
-					'a-019-abacus.png',
-					'a-026-chemicals.png',
-					'a-033-medal.png',
-					'a-040-compass.png',
-					'a-047-books.png',
-					'a-004-notebook.png',
-					'a-013-schoolbell.png',
-					'a-020-physics.png',
-					'a-027-maths.png',
-					'a-034-diploma.png',
-					'a-041-clipboard.png',
-					'a-048-books.png',
-					'a-007-calendar.png',
-					'a-014-calculator.png',
-					'a-021-dna.png',
-					'a-028-paintpalette.png',
-					'a-035-trophy.png',
-					'a-042-computer.png',
-					'a-049-books.png',
-					'a-008-worldgrid.png',
-					'a-015-squareruler.png',
-					'a-022-schoollocker.png',
-					'a-029-atom.png',
-					'a-036-milkcarton.png',
-					'a-043-laptop.png',
-					'a-050-coffeemug.png',
-					'a-009-molecule.png',
-					'a-016-ruler.png',
-					'a-023-sharpener.png',
-					'a-030-eyeglasses.png',
-					'a-037-pen.png',
-					'a-044-microscope.png',
-				]
 			}
 		},
 		watch: {

+ 23 - 76
pages/studentRanked/studentRanked.vue

@@ -37,7 +37,6 @@
 						<el-dropdown-item divided>退出登录</el-dropdown-item>
 					</el-dropdown-menu>
 				</el-dropdown>
-
 			</view>
 
 			<view class="ui-p ui-flex ui-flex-1 ui-flex-align-center" style="justify-content: end;" v-if="multiSelect">
@@ -94,13 +93,7 @@
 			ref="markScore"></markScore>
 
 		<!-- 点评记录 -->
-<<<<<<< HEAD
-		<markScoreList :chooseClassId="chooseClassId" ref="markScoreList"></markScoreList>
-=======
-		<markScoreList @success='DelectSuccess' @add='addTab' :list='studentTab.data' ref="markScoreList">
-		</markScoreList>
->>>>>>> 0d8c02ba5c71fa1c8a3b7acdb1044e14d1156fc2
-
+		<markScoreList :chooseClassId="chooseClassId" ref="markScoreList" @delSuccess="delSuccess"></markScoreList>
 		<el-drawer title="排行榜" :visible.sync="showRankList" direction="rtl">
 			<view style="text-align: center;" class="">
 				开发中....!
@@ -122,7 +115,7 @@
 						<text class="txt-white f24">点评记录</text>
 					</view>
 				</view>
-				<view class="ui-flex-column text-center ui-p bottom-btn-item" @click="$pageTo('./studentRankedChange')">
+				<view class="ui-flex-column text-center ui-p bottom-btn-item" @click="goSeatChange">
 					<image src="../../static/uni.png" style="width: 30px;height: 30px;" mode=""></image>
 					<view style="line-height: 1;">
 						<text class="txt-white f24">座位调整</text>
@@ -191,15 +184,23 @@
 				type: 1,
 				stuNameList: [],
 				stuName: '',
-				
+				course_id : '',
 			}
 		},
 		mounted() {
 			this.id = this.$store.state.teacherInfo.selfclass.id
-			// this.getStudent()
 			this.getClassroomList();
+			
 		},
 		methods: {
+			goSeatChange(){
+				uni.navigateTo({
+					url: "./studentRankedChange"
+				})
+			},
+			delSuccess(){
+				this.getStudent()
+			},
 			getLog(){
 				this.$refs.markScoreList.open()
 				this.$refs.markScoreList.list=[]
@@ -208,13 +209,14 @@
 			},
 			change(e) {
 				this.type = e == 0 ? 1 : 2
-				this.getTabs()
+				this.
+				sdfsdfsdfsdf()
 			},
 			setMulti() {
 				this.multiSelect = !this.multiSelect;
 				this.activeList = [];
 			},
-			loginOut() {
+			loginOut(){
 				uni.setStorageSync("token", '')
 				uni.navigateTo({
 					url: "/pages/login/login"
@@ -226,13 +228,7 @@
 				this.getStudent()
 				this.show_classes = false
 			},
-			DelectSuccess(index) {
-				console.log(index);
-				this.getStudent()
-				this.getstudentTabLog()
-			},
 			getClassroomList() {
-
 				let teacher_id = this.$store.state.teacherInfo.id
 				this.$api.sendRequest({
 					url: `/mobile/teacher/teachClasses`,
@@ -242,9 +238,13 @@
 					},
 					success: res => {
 						this.teachList.push(res.data)
+						if(this.chooseClassId=="" && this.teachList[0]){
+							console.log(this.teachList[0][0].id,"this.teachList[0].id");
+							this.chooseClassId=this.teachList[0][0].id
+							this.getStudent()
+						}
 					}
 				})
-
 			},
 			// 多选学生点评
 			commentMulti() {
@@ -253,7 +253,6 @@
 				this.$refs.markScore.open(1);
 			},
 			Comment(item) {
-
 				if (this.multiSelect) {
 					let index = this.activeList.indexOf(item.id)
 					if (index >= 0) {
@@ -270,20 +269,6 @@
 				this.stuName = item.title
 				this.getTabs()
 				this.$refs.markScore.open(1);
-				return;
-				//item的id是studentClass的id,需要转换成stu_school_id传到
-				this.$api.sendRequest({
-					url: getStuSchoolIdByStuClassId,
-					data: {
-						stu_class_id: item.id
-					},
-					success: res => {
-						let stu_school_id = res.data.stu_school_id
-						uni.navigateTo({
-							url: "/pages/studentTab/studentTab?stu_school_id=" + stu_school_id
-						})
-					}
-				})
 			},
 			getStudent() {
 				this.$api.sendRequest({
@@ -302,8 +287,8 @@
 					method: "post",
 					data: {
 						teacher_id: this.$store.state.teacher_id,
-
-						type: this.type
+						type: this.type,
+						course_id : this.course_id,
 					},
 					success: res => {
 						this.tabList = res.data
@@ -324,8 +309,6 @@
 							title: `${this.info.title} ${item.tab_name} ${item.type == 1 ? '+':'-'} ${score}分`,
 							icon: 'none'
 						})
-
-						this.$refs.CommentPopup.close()
 					}
 				})
 			},
@@ -333,44 +316,8 @@
 				this.activeList = []
 				this.multiSelect = false
 				this.getStudent()
-				this.getstudentTabLog()
-			},
-			getstudentTabLog() {
-				this.$api.sendRequest({
-					url: `/mobile/studentTab/getstudentTabLog`,
-					data: {
-						class_id: this.chooseClassId
-					},
-					method: "post",
-					success: res => {
-						this.studentTab = res.data
-					}
-				})
+				
 			},
-			addTab() {
-				if (this.studentTab.current_page == this.studentTab.last_page) {
-					uni.showToast({
-						title: '没有更多数据',
-						'icon': 'none',
-					});
-					return
-				}
-				this.$api.sendRequest({
-					url: `/mobile/studentTab/getstudentTabLog`,
-					method: "post",
-					data: {
-						page: this.studentTab.current_page + 1,
-						class_id: this.chooseClassId
-					},
-					success: res => {
-						let arr = [...this.studentTab.data, ...res.data.data]
-						this.studentTab = res.data
-						this.studentTab.data = arr
-
-					}
-				})
-			}
-
 		},
 
 	}