Selaa lähdekoodia

学生标签6

lijie 1 vuosi sitten
vanhempi
commit
e07b8aa859

+ 2 - 1
pages/login/login.vue

@@ -19,7 +19,8 @@
 			}
 		},
 		mounted(){
-			this.school_id=this.getUrlParam("school_id")
+			// this.school_id=this.getUrlParam("school_id")
+			this.school_id=1
 			
 			if(!this.school_id){
 				this.school_id=uni.getStorageSync("school_id")

+ 28 - 10
pages/studentRanked/components/mark-score-list.vue

@@ -8,10 +8,6 @@
 					<image :src="item.stuSchool.student_photo" style="width: 40px;height: 40px;border-radius: 20px;">
 					</image>
 				</view>
-				<!-- <view slot="title" class="ui-flex-row ui-flex-align-center">
-                    <u-tag plain size="mini" text="优秀发言"></u-tag>
-                    <text>李杰</text>
-                </view> -->
 
 				<text slot="label" class="txt-muted">{{item.created_at}} </text>
 				<el-tag v-if="item.studentTab.type_text == '好评'" slot="value"
@@ -22,7 +18,7 @@
 
 		</u-cell-group>
 		<view  @click="addTab" class="text-center ui-m ui-p" style="width: 100%;cursor: pointer;">
-			加载更多
+			{{ showTitle }}
 		</view>
 	</el-drawer>
 </template>
@@ -30,14 +26,18 @@
 <script>
 	export default {
 		props: {
-			list: {
-				type: Array,
-				default: () => []
-			}
+			chooseClassId :{
+				type : Number|String,
+				default : ""
+			},
 		},
 		data() {
 			return {
 				show: false,
+				current_page : 1,
+				list : [],
+				last_page : 10,
+				showTitle : '加载更多',
 			}
 		},
 		mounted() {
@@ -48,7 +48,25 @@
 				this.show = true
 			},
 			addTab() {
-				this.$emit('add')
+				if(this.showTitle=="没有更多数据了。。。"){
+					return
+				}
+				this.$api.sendRequest({
+					url: `/mobile/studentTab/getstudentTabLog`,
+					method: "post",
+					data: {
+						page: this.current_page,
+						class_id: this.chooseClassId
+					},
+					success: res => {
+						let arr = [...this.list, ...res.data.data]
+						this.current_page++
+						this.list =[...this.list,...res.data.data] 
+						if (this.current_page >= res.data.last_page) {
+							this.showTitle='没有更多数据了。。。'
+						}
+					}
+				})
 			}
 		},
 

+ 14 - 52
pages/studentRanked/studentRanked.vue

@@ -94,7 +94,7 @@
 			ref="markScore"></markScore>
 
 		<!-- 点评记录 -->
-		<markScoreList @add='addTab' :list='studentTab.data' ref="markScoreList"></markScoreList>
+		<markScoreList :chooseClassId="chooseClassId" ref="markScoreList"></markScoreList>
 
 		<el-drawer title="排行榜" :visible.sync="showRankList" direction="rtl">
 			<view style="text-align: center;" class="">
@@ -108,10 +108,10 @@
 				<view class="ui-flex-column text-center ui-p bottom-btn-item" @click="show_classes=true">
 					<image src="../../static/uni.png" style="width: 30px;height: 30px;" mode=""></image>
 					<view style="line-height: 1;">
-						<text class="txt-white f24">评分记录</text>
+						<text class="txt-white f24">选择班级</text>
 					</view>
 				</view>
-				<view class="ui-flex-column text-center ui-p bottom-btn-item" @click="$refs.markScoreList.open()">
+				<view class="ui-flex-column text-center ui-p bottom-btn-item" @click="getLog">
 					<image src="../../static/uni.png" style="width: 30px;height: 30px;" mode=""></image>
 					<view style="line-height: 1;">
 						<text class="txt-white f24">点评记录</text>
@@ -146,7 +146,7 @@
 						<text class="txt-white f24">切换老师</text>
 					</view>
 				</view>
-				<view class="ui-flex-column text-center ui-p bottom-btn-item">
+				<view class="ui-flex-column text-center ui-p bottom-btn-item" @click="loginOut()">
 					<image src="../../static/uni.png" style="width: 30px;height: 30px;" mode=""></image>
 					<view style="line-height: 1;">
 						<text class="txt-white f24">退出登录</text>
@@ -193,20 +193,17 @@
 
 			// this.id = this.$route.query.id
 			this.id = this.$store.state.teacherInfo.selfclass.id
-			this.getstudentTabLog()
+			
 			// this.getStudent()
 			this.getClassroomList();
-
-			setTimeout(() => {
-				this.doChooseClass({
-					value: [{
-						class_name: "二年级2班",
-						id: 2
-					}]
-				})
-			}, 400)
 		},
 		methods: {
+			getLog(){
+				this.$refs.markScoreList.open()
+				this.$refs.markScoreList.list=[]
+				this.$refs.markScoreList.current_page=1
+				this.$refs.markScoreList.addTab()
+			},
 			change(e) {
 				this.type = e == 0 ? 1 : 2
 				this.getTabs()
@@ -237,7 +234,6 @@
 					},
 					success: res => {
 						this.teachList.push(res.data)
-
 					}
 				})
 
@@ -295,7 +291,6 @@
 			getTabs() {
 				this.$api.sendRequest({
 					url: `/mobile/studentTab/getStudentTabs`,
-
 					method: "post",
 					data: {
 						teacher_id: this.$store.state.teacher_id,
@@ -332,41 +327,8 @@
 				this.getStudent()
 				this.getstudentTabLog()
 			},
-			getstudentTabLog() {
-				this.$api.sendRequest({
-					url: `/mobile/studentTab/getstudentTabLog`,
-					data: {
-						class_id: 2
-					},
-					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: 2
-					},
-					success: res => {
-						let arr = [...this.studentTab.data, ...res.data.data]
-						this.studentTab = res.data
-						this.studentTab.data = arr
-
-					}
-				})
-			}
+			
+			
 
 		},
 
@@ -377,7 +339,7 @@
 	.page {
 		background-image: url('https://zhxy.obs.cn-hz1.ctyun.cn:443/static/desk_bg/class_bj.jpg');
 		background-size: 100% 100%;
-		height: 100vh;
+		height: auto;
 		// width: 750rpx;
 	}