소스 검색

Merge branch 'master' of 121.40.237.253:lijie/zhxy-desk

# Conflicts:
#	pages/studentRanked/components/mark-score-list.vue
#	pages/studentRanked/studentRanked.vue
lijie 1 년 전
부모
커밋
e8f6b469fb
2개의 변경된 파일85개의 추가작업 그리고 8개의 파일을 삭제
  1. 37 1
      pages/studentRanked/components/mark-score-list.vue
  2. 48 7
      pages/studentRanked/studentRanked.vue

+ 37 - 1
pages/studentRanked/components/mark-score-list.vue

@@ -2,7 +2,7 @@
 	<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 class="ui-hover" clickable :title="item.student.student_name">
+			<u-cell @click="itemClick(item,index)" class="ui-hover" 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;">
@@ -20,6 +20,11 @@
 		<view  @click="addTab" class="text-center ui-m ui-p" style="width: 100%;cursor: pointer;">
 			{{ showTitle }}
 		</view>
+
+		<uni-popup ref="alertDialog" type="dialog">
+			<uni-popup-dialog type="center" cancelText="关闭" confirmText="确认" title="确认撤销?" content="您确认撤销该条点评记录?"
+				@confirm="dialogConfirm" @close="dialogClose"></uni-popup-dialog>
+		</uni-popup>
 	</el-drawer>
 </template>
 
@@ -34,10 +39,14 @@
 		data() {
 			return {
 				show: false,
+
 				current_page : 1,
 				list : [],
 				last_page : 10,
 				showTitle : '加载更多',
+				msgType: 'center',
+				itemInfo: {},
+				index:0
 			}
 		},
 		mounted() {
@@ -67,7 +76,34 @@
 						}
 					}
 				})
+			},
+			itemClick(item,index) {
+				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
+					},
+					success: res => {
+						uni.showToast({
+							title: res.msg,
+						})
+						
+						this.$emit('success',this.index)
+					}
+				})
+
+			},
+			dialogClose() {
+				
 			}
+
 		},
 
 	}

+ 48 - 7
pages/studentRanked/studentRanked.vue

@@ -94,7 +94,12 @@
 			ref="markScore"></markScore>
 
 		<!-- 点评记录 -->
+<<<<<<< HEAD
 		<markScoreList :chooseClassId="chooseClassId" ref="markScoreList"></markScoreList>
+=======
+		<markScoreList @success='DelectSuccess' @add='addTab' :list='studentTab.data' ref="markScoreList">
+		</markScoreList>
+>>>>>>> 0d8c02ba5c71fa1c8a3b7acdb1044e14d1156fc2
 
 		<el-drawer title="排行榜" :visible.sync="showRankList" direction="rtl">
 			<view style="text-align: center;" class="">
@@ -158,7 +163,6 @@
 </template>
 
 <script>
-
 	import markScore from './components/mark-score.vue'
 	import markScoreList from './components/mark-score-list.vue'
 	import {
@@ -186,14 +190,12 @@
 				studentTab: [],
 				type: 1,
 				stuNameList: [],
-				stuName: ''
+				stuName: '',
+				
 			}
 		},
 		mounted() {
-
-			// this.id = this.$route.query.id
 			this.id = this.$store.state.teacherInfo.selfclass.id
-			
 			// this.getStudent()
 			this.getClassroomList();
 		},
@@ -224,7 +226,13 @@
 				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`,
@@ -327,8 +335,41 @@
 				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
+
+					}
+				})
+			}
 
 		},