lansir 1 жил өмнө
parent
commit
5b7d470c7f

+ 7 - 0
pages.json

@@ -54,6 +54,13 @@
 				"navigationBarTitleText": "",
 				"enablePullDownRefresh": false
 			}
+		},{
+            "title" : "座位调整",
+			"path": "pages/studentRanked/studentRankedChange",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
 		},{
 			"path": "pages/studentRanked/tag",
 			"style": {

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

@@ -0,0 +1,210 @@
+<template>
+    <u-popup :show="show" @close="show = false" closeable :closeOnClickOverlay="false" mode="center" overlayStyle="background-color: #00142f63;backdrop-filter: blur(4px);">
+        <view class="ui-flex-column content" style="width: 600px;">
+            <view class="ui-p" style="background: #022c5a80;border-bottom: 2px solid #051d37;">
+                <text class="txt-white">标记点评给 马东/徐策 等5人 </text>
+            </view>
+            <view class="ui-flex-row">
+                <view class="ui-flex-1 ui-flex-align-center ui-flex-row">
+                    <view class="ui-pl20">
+                        <view class="ui-flex-row ui-border-radius-20" @click="showType=true" style="background-color: #1C63A8;padding: 4px 8px;">
+                            <text class="txt-white f26 ui-mr10">全部类型</text>
+                            <u-icon color="#fff" name="list-dot"></u-icon>
+                        </view>
+                    </view>
+                </view>
+                <view style="width: 220px;" class="ui-p">
+                    <u-subsection :list="['表扬', '需改进']" mode="button" 
+                        bgColor="#1b63a8" inactiveColor="#aec3ee"
+                        :current="curIndex" @change="curIndex=$event"></u-subsection>
+                </view>
+                <view class="ui-flex-1"></view>
+            </view>
+            
+            <scroll-view scroll-y style="height: 400px;" show-scrollbar>
+                <u-grid :col="6" :border="false" @click="toActive">
+                    <u-grid-item v-for="(item, index) in tagList" :key="index" class="ui-p" :class="{'no-select' : activeId >= 0 && activeId != index}">
+                        <u--image :src="'https://zhxy.obs.cn-hz1.ctyun.cn:443/static/tag_learn/' + tagIcons[index]" width="46px" height="46px"></u--image>
+                        <view class="ui-pt10">
+                            <text class="grid-text txt-white f28">{{item}}</text>
+                        </view>
+                        <u-badge v-if="activeId == index" absolute :offset="[0,10]" :value="score"></u-badge>
+                    </u-grid-item>
+                </u-grid>
+            </scroll-view>
+            
+            <view class="ui-p ui-flex" style="background-color: #1b63a870;justify-content: end;">
+                <view class="ui-flex" style="width: 250px;">
+                    <u-button size="small" plain :text="score ? '取消选择' : '关闭点评'" @click="cancelAct" style="background-color: #0d4980;" class="ui-mr10"></u-button>
+                    <u-button size="small" :disabled="!score" type="primary" @click="submit" text="提交点评"></u-button>
+                </view>
+            </view>
+        </view>
+        
+        <u-popup :show="showType" mode="left" @close="showType=false">
+            <view class="ui-p" style="width: 400px;">
+                <text>这里展示学生标签记录、以及类型切换</text>
+            </view>
+            <u-cell-group>
+                <u-cell icon="setting-fill" isLink title="个人设置"></u-cell>
+                <u-cell icon="integral-fill" isLink title="会员等级" value="新版本"></u-cell>
+            </u-cell-group>
+        </u-popup>
+    </u-popup>
+</template>
+
+<script>
+    export default {
+        data(){
+            return {
+                show : false,
+                curIndex : 0,
+                
+                score : 0, //加扣分分数
+                activeId : -1, //选中项
+                
+                showType : false,
+
+                tagList : [
+                    '小测优秀',
+                    '作业加分',
+                    '口算优秀',
+                    '班级贡献',
+                    '优秀发言',
+                    '阅读认真',
+                    '卫生干净',
+                    '值日认真',
+                    '勤奋学习',
+                    '课堂积极',
+                    '乐于助人',
+                    '团队合作',
+                    '诚实守信',
+                    '书写工整',
+                    '数学优秀',
+                    '语文优秀',
+                    '英语优秀',
+                    '美术优秀',
+                    '音乐优秀',
+                    '体育优秀',
+                    '科学优秀',
+                    '社会优秀',
+                    '历史优秀',
+                    '地理优秀',
+                    '政治优秀',
+                    '物理优秀',
+                    '化学优秀',
+                    '生物优秀',
+                    '作文优秀',
+                    '诗歌优秀',
+                    '故事优秀',
+                    '演讲优秀',
+                    '表演优秀',
+                    '手工优秀',
+                    '实验优秀',
+                    '研究优秀',
+                    '科研优秀',
+                    '表现优秀',
+                    '表现突出',
+                    '进步明显',
+                    '专注听讲',
+                    '课外阅读',
+                    // '体育锻炼',
+                    // '社会实践',
+                    // '志愿服务',
+                    // '爱护环境',
+                    // '安全文明',
+                    // '爱国爱校',
+                ],
+                // 老师配置标签的时候,需要选择图标
+                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',
+                ]
+            }
+        },
+        methods : {
+            // 外部访问使用
+            open(id) {
+                this.show = true;
+            },
+            toActive(index){
+                // 是否旧的选中项
+                let always = this.activeId >= 0 && this.activeId == index;
+                this.activeId = index;
+                if(always){
+                    this.score ++;
+                }else{
+                    this.score = 1;
+                }
+            },
+            cancelAct(){
+                if(this.score){
+                    this.activeId = -1;
+                    this.score = 0;
+                }else{
+                    this.show = false;
+                }
+            },
+            submit(){
+                console.log('提交')
+            }
+        }
+    }
+</script>
+
+<style>
+    .content{
+        background-image: url('https://zhxy.obs.cn-hz1.ctyun.cn:443/static/desk_bg/class_bj.jpg');
+        background-size: auto;
+        border: 1px solid #0d5396;
+    }
+    .no-select{
+        opacity: .5;
+    }
+</style>

+ 375 - 463
pages/studentRanked/studentRanked.vue

@@ -1,471 +1,383 @@
 <template>
-
-	<view class="">
-		<view style="margin-bottom: 32rpx;" class="">
-			<topBtn :list="btnList" :active.sync='reActive' />
-		</view>
-		<view v-if="reActive == 1" @click="openPop"
-			style="box-sizing: border-box;padding: 0 32rpx;margin-bottom: 32rpx;" class="btn-roll">
-			排位调整
-		</view>
-
-		<view class="" v-if="reActive == 0" @click="show_classes=true" style="width: auto;">
-			<view class="ui-p">
-				<view class="visit-item">
-					<view class="visit-item-left">
-						选择班级
-					</view>
-					<view  class="btn-roll ui-plr" style="width: auto;" v-if="chooseClassName">
-						{{ chooseClassName }}
-					</view>
-				</view>
-			</view>
-			
-		</view>
-		<view class="" v-if="reActive==0">
-			<view class="ranked" v-if="chooseClassName">
-				<view v-for="(item,index) in list" :key="index" class="ranked-item">
-					<view @click="reActive == 1 ?itemClick(item1):Comment(item1)" v-for="(item1,index1) in item.nodes"
-						:key="item1.id" class="ranked-item-tr">
-						<!-- <image style="width: 90rpx;height: 90rpx;" src="@/static/image/female.png" mode=""></image> -->
-						<view :class="active.indexOf(item1.id) == -1 ? '' :'active'" style="width: 90%;text-align: center;background-color: #fff;
-					border-radius: 5px;">
-							{{item1.title}}
-						</view>
-					</view>
-				</view>
-			</view>
-			<view class="platform" v-if="chooseClassName">
-				<view class="ranked-radio">
-
-				</view>
-				<view class="platform-text">
-					讲台
-				</view>
-				<view class="platform-color">
-
-				</view>
-			</view>
-		</view>
-		<view class="" v-else>
-			<view class="ranked" >
-				<view v-for="(item,index) in selfClassList" :key="index" class="ranked-item">
-					<view @click="reActive == 1 ?itemClick(item1):Comment(item1)" v-for="(item1,index1) in item.nodes"
-						:key="item1.id" class="ranked-item-tr">
-						<!-- <image style="width: 90rpx;height: 90rpx;" src="@/static/image/female.png" mode=""></image> -->
-						<view :class="active.indexOf(item1.id) == -1 ? '' :'active'" style="width: 90%;text-align: center;background-color: #fff;
-					border-radius: 5px;">
-							{{item1.title}}
-						</view>
-					</view>
-				</view>
-			</view>
-			<view class="platform" >
-				<view class="ranked-radio">
-			
-				</view>
-				<view class="platform-text">
-					讲台
-				</view>
-				<view class="platform-color">
-			
-				</view>
-			</view>
-		</view>
-
-		<uni-popup ref="popup" background-color="transparent">
-			<view style="padding: 0;" class="popup-content"
-				:class="{ 'popup-height': type === 'left' || type === 'right' }">
-				<StuDraggable @change='change' :list.sync='selfClassList' />
-			</view>
-		</uni-popup>
-		<uni-popup @change="popChange" ref="CommentPopup" background-color="transparent">
-			<view style="padding: 32rpx;width: 700rpx;" class="popup-content"
-				:class="{ 'popup-height': type === 'left' || type === 'right' }">
-				<view class="pop-title">
-					<image style="width: 40rpx;height: 40rpx;margin-right: 10rpx;" src="@/static/image/icon.png"
-						mode=""></image> {{info.title}}
-				</view>
-
-				<view style="margin-top: 32rpx;" class="">
-					<Tag @click='CommentOn' :list='tagList' />
-				</view>
-			</view>
-		</uni-popup>
-		<u-picker :show="show_classes" @confirm="doChooseClass" :columns="teachList" keyName="class_name" @cancel="show_classes=false"></u-picker>
-		<view class="">
-			<view @click="loginOut()" class="form-btn-content">
-				退出登录
-			</view>
-		</view>
-	</view>
+    <view class="page">
+        <u-popup :show="multiSelect" bgColor="#6e8fafde" mode="top" @close="multiSelect=false" :overlay="false">
+            <view class="ui-p ui-flex ui-flex-align-center" style="justify-content: end;">
+                <view class="ui-mr30">
+                    <text class="f32" style="#9ccbff">请点击选则学生批量点评</text>
+                </view>
+                <view class="ui-flex" style="width: 250px;">
+                    <u-button size="small" @click="setMulti" plain text="取消选择" style="background-color: #0d4980;" class="ui-mr10"></u-button>
+                    <u-button size="small" type="primary" @click="commentMulti()">
+                        <text class="ui-mr10">批量点评</text>
+                        <u-badge :value="activeList.length"></u-badge>
+                    </u-button>
+                </view>
+            </view>
+        </u-popup>
+        
+        <view class="ranked" v-if="chooseClassName">
+            <view v-for="(item,index) in list" :key="index" class="ranked-item">
+                <view @click="Comment(item1)" v-for="(item1,index1) in item.nodes" :key="item1.id"
+                    class="ui-flex-column ranked-item-tr ui-flex-align-center" :class="{active : activeList.includes(item1.id)}">
+                    
+                    <image style="width: 100rpx;height: 100rpx;" :src="'https://zhxy.obs.cn-hz1.ctyun.cn:443/static/student_icon/'+ (index1%7) +'.png'"
+                        mode=""></image>
+                    <view class="stu-tag ui-flex-row ui-mt10">
+                        <view class="stu-tag-add ui-flex-1">72</view>
+                        <view class="stu-tag-sub ui-flex-1">-32</view>
+                    </view>
+                    
+                    <view class="txt-white f28 ui-pt10">
+                        {{item1.title}}
+                    </view>
+                    
+                    <u-badge absolute style="left: 10px;top: 10px;" :value="activeList.indexOf(item1.id) + 1"></u-badge>
+                </view>
+            </view>
+        </view>
+        <view class="platform" v-if="chooseClassName">
+            <view class="ranked-radio"></view>
+            <view class="platform-text txt-white">讲台</view>
+        </view>
+
+        <!-- 切换班级 -->
+        <u-picker :show="show_classes" @confirm="doChooseClass" :columns="teachList" keyName="class_name"
+            @cancel="show_classes=false"></u-picker>
+            
+        <markScore ref="markScore"></markScore>
+
+        <view class="ui-pull-bottom ui-flex-row ui-p" style="background-color: #0000006b;border-top: 1px solid #616161;">
+            <view class="ui-flex-1 ui-flex-row">
+                <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">{{chooseClassName || '加载中...'}}</text>
+                    </view>
+                </view>
+                <view class="ui-flex-column text-center ui-p bottom-btn-item" @click="$pageTo('./studentRankedChange')">
+                    <image src="../../static/uni.png" style="width: 30px;height: 30px;" mode=""></image>
+                    <view style="line-height: 1;">
+                        <text class="txt-white f24">座位调整</text>
+                    </view>
+                </view>
+
+                <view class="ui-flex-column text-center ui-p bottom-btn-item" @click="setMulti">
+                    <image src="../../static/uni.png" style="width: 30px;height: 30px;" mode=""></image>
+                    <view style="line-height: 1;">
+                        <text class="txt-white f24" v-if="multiSelect">取消多选</text>
+                        <text class="txt-white f24" v-else>学生多选</text>
+                    </view>
+                </view>
+            </view>
+            
+            <view class="ui-flex-row">
+                <view class="ui-flex-column text-center ui-p bottom-btn-item">
+                    <image src="../../static/uni.png" style="width: 30px;height: 30px;" mode=""></image>
+                    <view style="line-height: 1;">
+                        <text class="txt-white f24">切换老师</text>
+                    </view>
+                </view>
+                <view class="ui-flex-column text-center ui-p bottom-btn-item">
+                    <image src="../../static/uni.png" style="width: 30px;height: 30px;" mode=""></image>
+                    <view style="line-height: 1;">
+                        <text class="txt-white f24">退出登录</text>
+                    </view>
+                </view>
+            </view>
+        </view>
+    </view>
 </template>
 
 <script>
-	import topBtn from '@/components/topBtn.vue'
-	import StuDraggable from './stuDraggable.vue'
-	import Tag from './tag.vue'
-	import { getStuSchoolIdByStuClassId } from "@/common/api/stu.js"
-	export default {
-		components: {
-			topBtn,
-			StuDraggable,
-			Tag
-		},
-		data() {
-			return {
-				show_classes : false,
-				id: 1,
-				info: {},
-				type: 'center',
-				btnList: ['学生评分', '坐位调整'],
-				reActive: 0,
-				active: [],
-				activeList: [],
-				tagList: [],
-				list: [],
-				teachList :[],
-				chooseClassName : '',
-				chooseClassId : '',
-				selfClassList : [],
-				notSelfClass : true,
-			}
-		},
-		mounted() {
-			// this.id = this.$route.query.id
-			this.id=this.$store.state.teacherInfo.selfclass.id
-			// this.getStudent()
-			this.getClassroomList()
-		},
-		methods: {
-			loginOut(){
-				uni.setStorageSync("token",'')
-				uni.navigateTo({
-					url: "/pages/login/login"
-				})
-			},
-			doChooseClass(val){
-				console.log(val,"val");
-				this.chooseClassId=val.value[0].id
-				this.chooseClassName=val.value[0].class_name
-				this.getStudent()
-				this.show_classes=false
-			},
-			getClassroomList(){
-				let teacher_id=this.$store.state.teacherInfo.id
-				this.$api.sendRequest({
-					url: `/mobile/teacher/teachClasses`,
-					method: "post",
-					data: {
-						teacher_id : teacher_id
-					},
-					success: res => {
-						this.teachList.push(res.data)
-						console.log(this.teachList);
-					}
-				})
-				
-			},
-			itemClick(item) {
-				let val = this.active.indexOf(item.id)
-				if (val == -1) {
-					this.active.push(item.id)
-					this.activeList.push(item)
-				} else {
-					this.active.splice(val, 1)
-					this.activeList.splice(val, 1)
-				}
-				if (this.active.length == 2) {
-
-					this.selfClassList.forEach((item2, index2) => {
-						item2.nodes.forEach((item1, index1) => {
-							let indexVal = this.active.indexOf(item1.id)
-							if (indexVal != -1) {
-
-								this.activeList.forEach(item3 => {
-									if (item3.id != item1.id) {
-										item2.nodes.splice(index1, 1, item3)
-									}
-								})
-
-							}
-						})
-					})
-					this.activeList = []
-					this.active = []
-					let info = {
-						classroom_id: this.id,
-						seat_list: this.selfClassList
-					}
-					this.$api.sendRequest({
-						url: `/mobile/saveSeat`,
-						method: "PUT",
-						data: info,
-						success: res => {
-							uni.showToast({
-								title: res.msg,
-
-							})
-
-						}
-					})
-				}
-			},
-			openPop() {
-				if(!this.notSelfClass){
-					this.type = 'center'
-					this.$refs.popup.open('center')
-				}
-			},
-			Comment(item) {
-				console.log(item,"sgism");
-				//item的id是studentClass的id,需要转换成stu_school_id传到
-				
-				this.$api.sendRequest({
-					url: getStuSchoolIdByStuClassId,
-					data : {
-						stu_class_id : item.id
-					},
-					success: res => {
-						console.log(res,"resrrrrr");
-						
-						
-						let stu_school_id=res.data.stu_school_id
-						uni.navigateTo({
-							url: "/pages/studentTab/studentTab?stu_school_id="+stu_school_id
-						})
-					}
-				})
-			},
-			popChange(val) {
-				if (!val.show) {
-					this.tagList.forEach(item => {
-						item.show = false
-					})
-				}
-			},
-			getStudent() {
-				this.$api.sendRequest({
-					url: `/mobile/getSeat?classroom_id=${this.chooseClassId}`,
-					success: res => {
-						this.list = res.data
-
-					}
-				})
-			},
-			change(list) {
-				console.log("组件传的数据",list);
-				this.selfClassList = list
-				let info = {
-					classroom_id: this.id,
-					seat_list: this.selfClassList
-				}
-				this.$api.sendRequest({
-					url: `/mobile/saveSeat`,
-					method: "PUT",
-					data: info,
-					success: res => {
-						uni.showToast({
-							title: res.msg,
-						})
-					}
-				})
-			},
-			getTagList() {
-				this.$api.sendRequest({
-					url: `/mobile/student/tabs?id=${this.info.id}`,
-					success: res => {
-						res.data.forEach(item => {
-							item.show = false
-						})
-						this.tagList = res.data
-					}
-				})
-			},
-			CommentOn(item, score) {
-
-				let info = {
-					id: this.info.id,
-					tab_id: item.tab_id,
-					score: score
-				}
-				this.$api.sendRequest({
-					url: `/mobile/student/eval`,
-					data: info,
-					success: res => {
-						uni.showToast({
-							title: `${this.info.title} ${item.tab_name} ${item.type == 1 ? '+':'-'} ${score}分`,
-							icon: 'none'
-						})
-
-						this.$refs.CommentPopup.close()
-					}
-				})
-			}
-
-		},
-		watch: {
-			reActive(newVal) {
-				this.active = []
-				this.activeList = []
-				console.log(newVal);
-				if(newVal==1){
-					console.log(this.$store.state.teacherInfo.selfclass,"this.$store.state.teacherInfo.selfclass");
-					if(this.$store.state.teacherInfo.selfclass){
-						let classroom_id=this.$store.state.teacherInfo.selfclass.id
-						// let classroom_id=1
-						this.$api.sendRequest({
-							url: `/mobile/getSeat?classroom_id=${classroom_id}`,
-							success: res => {
-								console.log(res.data);
-								this.selfClassList = res.data
-								this.notSelfClass=false
-							}
-						})
-					}else{
-						this.selfClassList=[]
-						uni.showToast({
-							icon: "none",
-							title: "您不是班主任"
-						})
-					}
-				}
-			}
-		},
-
-	}
+    import markScore from './components/mark-score.vue'
+    
+    import {
+        getStuSchoolIdByStuClassId
+    } from "@/common/api/stu.js"
+    export default {
+        components: {
+            markScore
+        },
+        data() {
+            return {
+                show_classes: false,
+                id: 1,
+                info: {},
+                list: [],
+                teachList: [],
+                chooseClassName: '',
+                chooseClassId: '',
+                
+                activeList : [],
+                multiSelect : false,
+            }
+        },
+        mounted() {
+            // this.id = this.$route.query.id
+            this.id = this.$store.state.teacherInfo.selfclass.id
+            // this.getStudent()
+            this.getClassroomList();
+
+            setTimeout(() => {
+                this.doChooseClass({
+                    value: [{
+                        class_name: "二年级2班",
+                        id: 2
+                    }]
+                })
+            }, 400)
+        },
+        methods: {
+            setMulti(){
+                this.multiSelect = !this.multiSelect;
+                this.activeList = [];
+            },
+            loginOut() {
+                uni.setStorageSync("token", '')
+                uni.navigateTo({
+                    url: "/pages/login/login"
+                })
+            },
+            doChooseClass(val) {
+                console.log(val, "val");
+                this.chooseClassId = val.value[0].id
+                this.chooseClassName = val.value[0].class_name
+                this.getStudent()
+                this.show_classes = false
+            },
+            getClassroomList() {
+                let teacher_id = this.$store.state.teacherInfo.id
+                this.$api.sendRequest({
+                    url: `/mobile/teacher/teachClasses`,
+                    method: "post",
+                    data: {
+                        teacher_id: teacher_id
+                    },
+                    success: res => {
+                        this.teachList.push(res.data)
+                        console.log(this.teachList);
+                    }
+                })
+
+            },
+            // 多选学生点评
+            commentMulti(){
+                this.$refs.markScore.open(1);
+            },
+            Comment(item) {
+                if(this.multiSelect){
+                    let index = this.activeList.indexOf(item.id)
+                    if(index >= 0){
+                        this.activeList.splice(index, 1);
+                    }else{
+                        this.activeList.push(item.id);
+                    }
+                    return;
+                }
+                console.log(item, "sgism");
+                
+                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 => {
+                        console.log(res, "resrrrrr");
+                        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({
+                    url: `/mobile/getSeat?classroom_id=${this.chooseClassId}`,
+                    success: res => {
+                        this.list = res.data
+                    }
+                })
+            },
+            CommentOn(item, score) {
+                let info = {
+                    id: this.info.id,
+                    tab_id: item.tab_id,
+                    score: score
+                }
+                this.$api.sendRequest({
+                    url: `/mobile/student/eval`,
+                    data: info,
+                    success: res => {
+                        uni.showToast({
+                            title: `${this.info.title} ${item.tab_name} ${item.type == 1 ? '+':'-'} ${score}分`,
+                            icon: 'none'
+                        })
+
+                        this.$refs.CommentPopup.close()
+                    }
+                })
+            }
+        }
+    }
 </script>
 
 <style lang="scss" scoped>
-	.form-btn-content {
-		width: 30%;
-		background: #05cca1;
-		height: 72rpx;
-		border-radius: 36rpx;
-		color: #fff;
-		font-size: 32rpx;
-		text-align: center;
-		line-height: 72rpx;
-		margin: 0 auto;
-		position: fixed;
-		bottom: 40rpx;
-		left: 35%;
-		
-	}
-	.platform {
-		display: flex;
-		justify-content: center;
-		align-items: center;
-		position: relative;
-		height: 30rpx;
-		margin-top: 60rpx;
-
-		.platform-color {
-			position: absolute;
-			left: 0;
-			top: 0;
-			height: 60rpx;
-			background-color: rgba(5, 204, 161, 1);
-			width: 10rpx;
-		}
-
-		.platform-text {
-			text-align: center;
-			width: 60%;
-			margin-top: 40rpx;
-
-		}
-	}
-
-	.pop-title {
-		border-bottom: 1px solid #f2f2f2;
-		font-size: 36rpx;
-		padding-bottom: 20rpx;
-		display: flex;
-		align-items: center;
-	}
-
-	.popup-content {
-		border-radius: 10px;
-		box-sizing: border-box;
-		padding: 0 32rpx;
-	}
-
-	.btn-roll {
-		background-color: #fff;
-		border-radius: 25rpx;
-		width: 190rpx;
-		color: #666;
-		height: 60rpx;
-		line-height: 60rpx;
-		text-align: center;
-		margin-left: 32rpx;
-	}
-
-	.ranked {
-		width: 100%;
-
-		text-align: center;
-		font-size: 10px;
-		box-sizing: border-box;
-		display: flex;
-
-		.ranked-item {
-			flex: 1;
-			box-sizing: border-box;
-
-
-
-			.ranked-item-tr {
-				margin-bottom: 16rpx;
-				border-radius: 5px;
-				box-sizing: border-box;
-				width: 100%;
-
-				display: flex;
-				justify-content: center;
-			}
-
-			.ranked-item-tr:last-child {
-				margin-bottom: 0;
-			}
-
-			.active {
-				border: 1px solid #ccc !important;
-				background-color: rgba(5, 204, 161, 1) !important;
-				color: #fff !important;
-				box-sizing: border-box;
-			}
-		}
-
-		.ranked-item:nth-child(2n) {
-			border-right: 1px solid #ccc;
-		}
-
-		.ranked-item:last-child {
-			border-right: 0;
-		}
-
-	}
-
-	.ranked-radio {
-		width: 100px;
-		position: absolute;
-		left: 50%;
-		transform: translate(-50%);
-		top: 0rpx;
-
-		border-bottom: 3px solid rgba(5, 204, 161, 1);
-		border-radius: 50% 50% 0 0;
-	}
-	
-	.visit-item {
-		display: flex;
-		align-items: center;
-	
-		.visit-item-left {
-			width: 120rpx;
-			color: #666;
-		}
-	}
+    .page {
+        background-image: url('https://zhxy.obs.cn-hz1.ctyun.cn:443/static/desk_bg/class_bj.jpg');
+        background-size: 100% 100%;
+        height: 100vh;
+        width: 750rpx;
+    }
+
+    .platform {
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        position: relative;
+        height: 30rpx;
+        margin-top: 60rpx;
+
+        .platform-color {
+            position: absolute;
+            left: 0;
+            top: 0;
+            height: 60rpx;
+            background-color: rgba(5, 204, 161, 1);
+            width: 10rpx;
+        }
+
+        .platform-text {
+            text-align: center;
+            width: 60%;
+            margin-top: 40rpx;
+        }
+    }
+
+    .pop-title {
+        border-bottom: 1px solid #f2f2f2;
+        font-size: 36rpx;
+        padding-bottom: 20rpx;
+        display: flex;
+        align-items: center;
+    }
+
+    .popup-content {
+        border-radius: 10px;
+        box-sizing: border-box;
+        padding: 0 32rpx;
+    }
+
+    .btn-roll {
+        background-color: #fff;
+        border-radius: 25rpx;
+        width: 190rpx;
+        color: #666;
+        height: 60rpx;
+        line-height: 60rpx;
+        text-align: center;
+        margin-left: 32rpx;
+    }
+
+    .ranked {
+        width: 100%;
+
+        text-align: center;
+        font-size: 10px;
+        box-sizing: border-box;
+        display: flex;
+        padding-top: 80rpx;
+
+        .ranked-item {
+            flex: 1;
+            box-sizing: border-box;
+
+            .ranked-item-tr {
+                position: relative;
+                margin-bottom: 26rpx;
+                padding-top: 16rpx;
+                padding-bottom: 16rpx;
+                border-radius: 5px;
+                box-sizing: border-box;
+                width: 100%;
+                cursor: pointer;
+
+                display: flex;
+                justify-content: center;
+            }
+            
+            .ranked-item-tr:last-child {
+                margin-bottom: 0;
+            }
+
+            .active {
+                background: #ffffff85;
+            }
+        }
+
+        .ranked-item:nth-child(1n) {
+            margin-right: 0;
+            margin-left: 10px;
+        }
+
+        .ranked-item:nth-child(2n) {
+            border-right: 1px solid #ccc;
+            padding-right: 10px;
+        }
+
+        .ranked-item:last-child {
+            border-right: 0;
+        }
+
+    }
+
+    .ranked-radio {
+        width: 100px;
+        position: absolute;
+        left: 50%;
+        transform: translate(-50%);
+        top: 0rpx;
+
+        border-bottom: 3px solid rgba(5, 204, 161, 1);
+        border-radius: 50% 50% 0 0;
+    }
+
+    .visit-item {
+        display: flex;
+        align-items: center;
+
+        .visit-item-left {
+            width: 120rpx;
+            color: #666;
+        }
+    }
+
+    .stu-tag {
+        width: 90px;
+        border-radius: 15px;
+        overflow: hidden;
+    }
+
+    .stu-tag-add {
+        background-color: #ecf5ff;
+        color: #3c9cff;
+        border: 1px solid #fff;
+    }
+
+    .stu-tag-sub {
+        background-color: #fef0f0;
+        color: #f56c6c;
+        border: 1px solid #fff;
+        border-left: 0;
+    }
+    .bottom-btn-item{
+        position: relative;
+    }
+    .bottom-btn-item:hover {
+        cursor: pointer;
+        background-color: #ffffff3b;
+        border-radius: 8px;
+    }
 </style>

+ 471 - 0
pages/studentRanked/studentRankedChange.vue

@@ -0,0 +1,471 @@
+<template>
+
+	<view class="">
+		<view style="margin-bottom: 32rpx;" class="">
+			<topBtn :list="btnList" :active.sync='reActive' />
+		</view>
+		<view v-if="reActive == 1" @click="openPop"
+			style="box-sizing: border-box;padding: 0 32rpx;margin-bottom: 32rpx;" class="btn-roll">
+			排位调整
+		</view>
+
+		<view class="" v-if="reActive == 0" @click="show_classes=true" style="width: auto;">
+			<view class="ui-p">
+				<view class="visit-item">
+					<view class="visit-item-left">
+						选择班级
+					</view>
+					<view  class="btn-roll ui-plr" style="width: auto;" v-if="chooseClassName">
+						{{ chooseClassName }}
+					</view>
+				</view>
+			</view>
+			
+		</view>
+		<view class="" v-if="reActive==0">
+			<view class="ranked" v-if="chooseClassName">
+				<view v-for="(item,index) in list" :key="index" class="ranked-item">
+					<view @click="reActive == 1 ?itemClick(item1):Comment(item1)" v-for="(item1,index1) in item.nodes"
+						:key="item1.id" class="ranked-item-tr">
+						<!-- <image style="width: 90rpx;height: 90rpx;" src="@/static/image/female.png" mode=""></image> -->
+						<view :class="active.indexOf(item1.id) == -1 ? '' :'active'" style="width: 90%;text-align: center;background-color: #fff;
+					border-radius: 5px;">
+							{{item1.title}}
+						</view>
+					</view>
+				</view>
+			</view>
+			<view class="platform" v-if="chooseClassName">
+				<view class="ranked-radio">
+
+				</view>
+				<view class="platform-text">
+					讲台
+				</view>
+				<view class="platform-color">
+
+				</view>
+			</view>
+		</view>
+		<view class="" v-else>
+			<view class="ranked" >
+				<view v-for="(item,index) in selfClassList" :key="index" class="ranked-item">
+					<view @click="reActive == 1 ?itemClick(item1):Comment(item1)" v-for="(item1,index1) in item.nodes"
+						:key="item1.id" class="ranked-item-tr">
+						<!-- <image style="width: 90rpx;height: 90rpx;" src="@/static/image/female.png" mode=""></image> -->
+						<view :class="active.indexOf(item1.id) == -1 ? '' :'active'" style="width: 90%;text-align: center;background-color: #fff;
+					border-radius: 5px;">
+							{{item1.title}}
+						</view>
+					</view>
+				</view>
+			</view>
+			<view class="platform" >
+				<view class="ranked-radio">
+			
+				</view>
+				<view class="platform-text">
+					讲台
+				</view>
+				<view class="platform-color">
+			
+				</view>
+			</view>
+		</view>
+
+		<uni-popup ref="popup" background-color="transparent">
+			<view style="padding: 0;" class="popup-content"
+				:class="{ 'popup-height': type === 'left' || type === 'right' }">
+				<StuDraggable @change='change' :list.sync='selfClassList' />
+			</view>
+		</uni-popup>
+		<uni-popup @change="popChange" ref="CommentPopup" background-color="transparent">
+			<view style="padding: 32rpx;width: 700rpx;" class="popup-content"
+				:class="{ 'popup-height': type === 'left' || type === 'right' }">
+				<view class="pop-title">
+					<image style="width: 40rpx;height: 40rpx;margin-right: 10rpx;" src="@/static/image/icon.png"
+						mode=""></image> {{info.title}}
+				</view>
+
+				<view style="margin-top: 32rpx;" class="">
+					<Tag @click='CommentOn' :list='tagList' />
+				</view>
+			</view>
+		</uni-popup>
+		<u-picker :show="show_classes" @confirm="doChooseClass" :columns="teachList" keyName="class_name" @cancel="show_classes=false"></u-picker>
+		<view class="">
+			<view @click="loginOut()" class="form-btn-content">
+				退出登录
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import topBtn from '@/components/topBtn.vue'
+	import StuDraggable from './stuDraggable.vue'
+	import Tag from './tag.vue'
+	import { getStuSchoolIdByStuClassId } from "@/common/api/stu.js"
+	export default {
+		components: {
+			topBtn,
+			StuDraggable,
+			Tag
+		},
+		data() {
+			return {
+				show_classes : false,
+				id: 1,
+				info: {},
+				type: 'center',
+				btnList: ['学生评分', '坐位调整'],
+				reActive: 0,
+				active: [],
+				activeList: [],
+				tagList: [],
+				list: [],
+				teachList :[],
+				chooseClassName : '',
+				chooseClassId : '',
+				selfClassList : [],
+				notSelfClass : true,
+			}
+		},
+		mounted() {
+			// this.id = this.$route.query.id
+			this.id=this.$store.state.teacherInfo.selfclass.id
+			// this.getStudent()
+			this.getClassroomList()
+		},
+		methods: {
+			loginOut(){
+				uni.setStorageSync("token",'')
+				uni.navigateTo({
+					url: "/pages/login/login"
+				})
+			},
+			doChooseClass(val){
+				console.log(val,"val");
+				this.chooseClassId=val.value[0].id
+				this.chooseClassName=val.value[0].class_name
+				this.getStudent()
+				this.show_classes=false
+			},
+			getClassroomList(){
+				let teacher_id=this.$store.state.teacherInfo.id
+				this.$api.sendRequest({
+					url: `/mobile/teacher/teachClasses`,
+					method: "post",
+					data: {
+						teacher_id : teacher_id
+					},
+					success: res => {
+						this.teachList.push(res.data)
+						console.log(this.teachList);
+					}
+				})
+				
+			},
+			itemClick(item) {
+				let val = this.active.indexOf(item.id)
+				if (val == -1) {
+					this.active.push(item.id)
+					this.activeList.push(item)
+				} else {
+					this.active.splice(val, 1)
+					this.activeList.splice(val, 1)
+				}
+				if (this.active.length == 2) {
+
+					this.selfClassList.forEach((item2, index2) => {
+						item2.nodes.forEach((item1, index1) => {
+							let indexVal = this.active.indexOf(item1.id)
+							if (indexVal != -1) {
+
+								this.activeList.forEach(item3 => {
+									if (item3.id != item1.id) {
+										item2.nodes.splice(index1, 1, item3)
+									}
+								})
+
+							}
+						})
+					})
+					this.activeList = []
+					this.active = []
+					let info = {
+						classroom_id: this.id,
+						seat_list: this.selfClassList
+					}
+					this.$api.sendRequest({
+						url: `/mobile/saveSeat`,
+						method: "PUT",
+						data: info,
+						success: res => {
+							uni.showToast({
+								title: res.msg,
+
+							})
+
+						}
+					})
+				}
+			},
+			openPop() {
+				if(!this.notSelfClass){
+					this.type = 'center'
+					this.$refs.popup.open('center')
+				}
+			},
+			Comment(item) {
+				console.log(item,"sgism");
+				//item的id是studentClass的id,需要转换成stu_school_id传到
+				
+				this.$api.sendRequest({
+					url: getStuSchoolIdByStuClassId,
+					data : {
+						stu_class_id : item.id
+					},
+					success: res => {
+						console.log(res,"resrrrrr");
+						
+						
+						let stu_school_id=res.data.stu_school_id
+						uni.navigateTo({
+							url: "/pages/studentTab/studentTab?stu_school_id="+stu_school_id
+						})
+					}
+				})
+			},
+			popChange(val) {
+				if (!val.show) {
+					this.tagList.forEach(item => {
+						item.show = false
+					})
+				}
+			},
+			getStudent() {
+				this.$api.sendRequest({
+					url: `/mobile/getSeat?classroom_id=${this.chooseClassId}`,
+					success: res => {
+						this.list = res.data
+
+					}
+				})
+			},
+			change(list) {
+				console.log("组件传的数据",list);
+				this.selfClassList = list
+				let info = {
+					classroom_id: this.id,
+					seat_list: this.selfClassList
+				}
+				this.$api.sendRequest({
+					url: `/mobile/saveSeat`,
+					method: "PUT",
+					data: info,
+					success: res => {
+						uni.showToast({
+							title: res.msg,
+						})
+					}
+				})
+			},
+			getTagList() {
+				this.$api.sendRequest({
+					url: `/mobile/student/tabs?id=${this.info.id}`,
+					success: res => {
+						res.data.forEach(item => {
+							item.show = false
+						})
+						this.tagList = res.data
+					}
+				})
+			},
+			CommentOn(item, score) {
+
+				let info = {
+					id: this.info.id,
+					tab_id: item.tab_id,
+					score: score
+				}
+				this.$api.sendRequest({
+					url: `/mobile/student/eval`,
+					data: info,
+					success: res => {
+						uni.showToast({
+							title: `${this.info.title} ${item.tab_name} ${item.type == 1 ? '+':'-'} ${score}分`,
+							icon: 'none'
+						})
+
+						this.$refs.CommentPopup.close()
+					}
+				})
+			}
+
+		},
+		watch: {
+			reActive(newVal) {
+				this.active = []
+				this.activeList = []
+				console.log(newVal);
+				if(newVal==1){
+					console.log(this.$store.state.teacherInfo.selfclass,"this.$store.state.teacherInfo.selfclass");
+					if(this.$store.state.teacherInfo.selfclass){
+						let classroom_id=this.$store.state.teacherInfo.selfclass.id
+						// let classroom_id=1
+						this.$api.sendRequest({
+							url: `/mobile/getSeat?classroom_id=${classroom_id}`,
+							success: res => {
+								console.log(res.data);
+								this.selfClassList = res.data
+								this.notSelfClass=false
+							}
+						})
+					}else{
+						this.selfClassList=[]
+						uni.showToast({
+							icon: "none",
+							title: "您不是班主任"
+						})
+					}
+				}
+			}
+		},
+
+	}
+</script>
+
+<style lang="scss" scoped>
+	.form-btn-content {
+		width: 30%;
+		background: #05cca1;
+		height: 72rpx;
+		border-radius: 36rpx;
+		color: #fff;
+		font-size: 32rpx;
+		text-align: center;
+		line-height: 72rpx;
+		margin: 0 auto;
+		position: fixed;
+		bottom: 40rpx;
+		left: 35%;
+		
+	}
+	.platform {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		position: relative;
+		height: 30rpx;
+		margin-top: 60rpx;
+
+		.platform-color {
+			position: absolute;
+			left: 0;
+			top: 0;
+			height: 60rpx;
+			background-color: rgba(5, 204, 161, 1);
+			width: 10rpx;
+		}
+
+		.platform-text {
+			text-align: center;
+			width: 60%;
+			margin-top: 40rpx;
+
+		}
+	}
+
+	.pop-title {
+		border-bottom: 1px solid #f2f2f2;
+		font-size: 36rpx;
+		padding-bottom: 20rpx;
+		display: flex;
+		align-items: center;
+	}
+
+	.popup-content {
+		border-radius: 10px;
+		box-sizing: border-box;
+		padding: 0 32rpx;
+	}
+
+	.btn-roll {
+		background-color: #fff;
+		border-radius: 25rpx;
+		width: 190rpx;
+		color: #666;
+		height: 60rpx;
+		line-height: 60rpx;
+		text-align: center;
+		margin-left: 32rpx;
+	}
+
+	.ranked {
+		width: 100%;
+
+		text-align: center;
+		font-size: 10px;
+		box-sizing: border-box;
+		display: flex;
+
+		.ranked-item {
+			flex: 1;
+			box-sizing: border-box;
+
+
+
+			.ranked-item-tr {
+				margin-bottom: 16rpx;
+				border-radius: 5px;
+				box-sizing: border-box;
+				width: 100%;
+
+				display: flex;
+				justify-content: center;
+			}
+
+			.ranked-item-tr:last-child {
+				margin-bottom: 0;
+			}
+
+			.active {
+				border: 1px solid #ccc !important;
+				background-color: rgba(5, 204, 161, 1) !important;
+				color: #fff !important;
+				box-sizing: border-box;
+			}
+		}
+
+		.ranked-item:nth-child(2n) {
+			border-right: 1px solid #ccc;
+		}
+
+		.ranked-item:last-child {
+			border-right: 0;
+		}
+
+	}
+
+	.ranked-radio {
+		width: 100px;
+		position: absolute;
+		left: 50%;
+		transform: translate(-50%);
+		top: 0rpx;
+
+		border-bottom: 3px solid rgba(5, 204, 161, 1);
+		border-radius: 50% 50% 0 0;
+	}
+	
+	.visit-item {
+		display: flex;
+		align-items: center;
+	
+		.visit-item-left {
+			width: 120rpx;
+			color: #666;
+		}
+	}
+</style>

+ 1 - 1
template.h5.html

@@ -4,7 +4,7 @@
 		<meta charset="utf-8">
 		<meta http-equiv="X-UA-Compatible" content="IE=edge">
 		<script  src="https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.1/alipayjsapi.inc.min.js"></script>
-		<script src="@/static/js/echarts.min.js"></script>
+		<script src="/static/js/echarts.min.js"></script>
 		</head>
 		<script>
       var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||