浏览代码

no message

lansir 11 月之前
父节点
当前提交
ce82af8277

+ 1 - 1
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "智慧校园桌面",
-    "appid" : "__UNI__0AD3AC0",
+    "appid" : "__UNI__EA9473C",
     "description" : "uni-app 框架示例,一套代码,同时发行到iOS、Android、H5、小程序等多个平台,请使用手机扫码快速体验 uni-app 的强大功能",
     "versionName" : "1.0.0",
     "versionCode" : "100",

+ 57 - 10
pages/login/login.vue

@@ -1,10 +1,32 @@
 <template>
 	<view class="login">
-		<h3 style="margin-top: 100px;">学生评价位置调换系统</h3>
+		<h3 style="margin-top: 100px;" @click="login">学生评价位置调换系统</h3>
 		<div id="self_defined_element" class="self-defined-classname ui-mt40"></div>
 		<view class="intro">
 			请打开钉钉APP扫码登录
 		</view>
+        
+        <uni-popup ref="popup" background-color="#fff" :mask-click="false">
+        	<view style="width: 350rpx;" class="popup-content pop">
+        		<view style="margin-bottom: 24rpx;" class="">
+        			账号
+        		</view>
+        		<view style="margin-bottom: 24rpx;" class="">
+        			<uni-easyinput type="number" v-model="user.mobile" placeholder="请输入账号"
+        				:maxlength="100"></uni-easyinput>
+        		</view>
+        		<view style="margin-bottom: 24rpx;" class="">
+        			密码
+        		</view>
+        		<view style="margin-bottom: 24rpx;" class="">
+        			<uni-easyinput type="password" v-model="user.password" placeholder="请输入账号"
+        				:maxlength="100"></uni-easyinput>
+        		</view>
+        		<u-button @click="submit" type="primary">登录</u-button>
+        		<u-button class="ui-mt20" @click="$refs.popup.close()">关闭</u-button>
+        		<!-- <u-button class="ui-mt20" @click="loadVconsole()">加载/关闭vconsole</u-button> -->
+        	</view>
+        </uni-popup>
 	</view>
 </template>
 
@@ -17,7 +39,12 @@
 			return {
 				redirectUrl : '',
 				// redirectUrl : 'https://oy-desk.wucits.com',
-				school_id : ''
+				school_id : '',
+                num : 0,
+                user: {
+                	mobile: '15158580014',
+                	password: 'xlg123==='
+                }
 			}
 		},
 		mounted(){
@@ -42,6 +69,32 @@
 			}
 		},
 		methods:{
+            login() {
+            	this.num++
+            	if (this.num >= 10) {
+            		this.$refs.popup.open('center');
+                    this.num = 0
+            	}
+            },
+            submit() {
+            	this.$api.sendRequest({
+            		url: `/mobile/login/passLogin`,
+            		data: this.user,
+            		success: res => {
+            			this.loginCallBack(res.data)
+            			this.$refs.popup.close()
+            
+            		},
+            	})
+            },
+            loginCallBack(teacher){
+                console.log(teacher,"denglu");
+                this.$store.commit("setTeacherInfo",teacher)
+                uni.setStorageSync('token', teacher.token)
+                uni.navigateTo({
+                	url:'/pages/studentRanked/studentRanked'
+                })
+            },
 			doLogin(code){
 				console.log("zhixinglema",this.school_id);
 				this.$api.sendRequest({
@@ -52,14 +105,8 @@
 						school_id : this.school_id
 					},
 					success: res => {
-						console.log(res,code,"denglu");
-						this.$store.commit("setTeacherInfo",res.data.teacher)
-						uni.setStorageSync('token', res.data.teacher.token)
-						uni.navigateTo({
-							url:'/pages/studentRanked/studentRanked'
-						})
-						// window.location.href = this.redirectUrl;
-					},
+                        this.loginCallBack(res.data)
+                    },
 					error: res => {
 				
 					}

+ 2 - 2
pages/studentRanked/components/chart.js

@@ -1,6 +1,6 @@
 import * as echarts from "echarts";
 
-export function chartBar(data) {
+export function chartBar(data, cartoonHeadImg) {
 	let countryColors = [
 		'rgba(224,96,93)',
 		'rgba(231,168,79)',
@@ -32,7 +32,7 @@ export function chartBar(data) {
             height: 40, // 图片高度
             width: 40, // 图片宽度 
             backgroundColor: {
-                image: item.student.student_cartoon_photo, // 图片路径  
+                image: cartoonHeadImg ? item.student.student_cartoon_photo : item.stuSchool.student_photo + '?x-image-process=style/square400' , // 图片路径  
             }
         }
         

+ 9 - 4
pages/studentRanked/components/mark-score-list.vue

@@ -7,15 +7,17 @@
                     :options="options1" @click="itemRemove(item,index)" :show="!!item.show">
                     <u-cell :title="item.student.student_name" @click="itemRemove(item, index)">
                         <view slot="icon" class="ui-mr10">
-                            <image :src="item.stuSchool.student_photo"
+                            <image :src="
+                                cartoonHeadImg ? item.student.student_cartoon_photo :
+                                item.stuSchool.student_photo + '?x-image-process=style/square400'"
                                 style="width: 40px;height: 40px;border-radius: 20px;">
                             </image>
                         </view>
             
                         <text slot="label" class="txt-muted">{{item.created_at}} </text>
-                        <el-tag slot="value" plain
-                            :type="item.studentTab && item.studentTab.type_text == '好评' ? '' : 'danger'">{{item.studentTab && item.studentTab.tab_name}}
-                            {{item.score}}</el-tag>
+                        <el-tag slot="value" plain :type="item.type == 1 ? '' : 'danger'">{{item.studentTab && item.studentTab.tab_name}}
+                            {{item.score}}
+                        </el-tag>
                     </u-cell>
                 </u-swipe-action-item>
             </u-swipe-action>
@@ -31,6 +33,9 @@
                 type: Number | String,
                 default: ""
             },
+            cartoonHeadImg : {
+                default : true,
+            },
             stuList: {
                 type: Array,
                 default: () => []

+ 24 - 11
pages/studentRanked/components/mark-score.vue

@@ -54,11 +54,25 @@
 			</scroll-view>
 
 			<view class="ui-p ui-flex ui-flex-center" style="background-color: #1b63a870;">
-				<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(1)" text="提交点评 +1"></u-button>
-					<u-button class="ui-ml10" size="small" :disabled="!score" type="primary" @click="submit(3)" text="提交点评 +3"></u-button>
+				<view class="ui-flex" style="width: 250px;" v-if="curIndex==0">
+					<u-button size="small" :disabled="!score" type="primary" @click="submit(1)">
+                        <text class="ui-mr10" style="line-height: 1;">提交点评</text>
+                        <u-badge type="primary" bgColor="#007cfb" value="+1" style="line-height: 1;"></u-badge>
+                    </u-button>
+					<u-button class="ui-ml10" size="small" :disabled="!score" type="primary" @click="submit(3)">
+                        <text class="ui-mr10" style="line-height: 1;">提交点评</text>
+                        <u-badge type="primary" bgColor="#007cfb" value="+3" style="line-height: 1;"></u-badge>
+                    </u-button>
+				</view>
+				<view class="ui-flex" style="width: 250px;" v-else>
+					<u-button size="small" :disabled="!score" type="primary" round @click="submit(-1)">
+                        <text class="ui-mr10" style="line-height: 1;">提交点评</text>
+                        <u-badge type="error" value="-1" style="line-height: 1;"></u-badge>
+                    </u-button>
+					<u-button class="ui-ml10" size="small" :disabled="!score" type="primary" round @click="submit(-3)">
+                        <text class="ui-mr10" style="line-height: 1;">提交点评</text>
+                        <u-badge type="error" value="-3" style="line-height: 1;"></u-badge>
+                    </u-button>
 				</view>
 			</view>
 		</view>
@@ -118,9 +132,6 @@
                     }
                 });
                 
-                console.log(custom)
-                
-                
                 return [
                     {
                         id : 0,
@@ -139,14 +150,15 @@
 		methods: {
 			change(e){
 				this.curIndex = e
-                this.getTipList();
+                // this.getTipList();
 			},
             changeCourse(item){
                 this.course_id = item.id;
                 this.course_name = item.name == '全部' ? '' : item.name;
             },
             getTipList() {
-                let typeId = this.curIndex+1;
+                // let typeId = this.curIndex+1;
+                let typeId = 1;
                 if(tabList[typeId]){
                     this.list = tabList[typeId];
                     return;
@@ -220,7 +232,8 @@
 					teacher_id: this.$store.state.teacher_id,
 					stu_school_ids: this.stuList,
 					tab_id: this.itemTab.tab_id,
-					score: this.score
+					score: this.score,
+                    type : this.curIndex+1
 				}
 				this.$api.sendRequest({
 					url: '/mobile/studentTab/geiXueshengTianjiaBiaoqian',

+ 5 - 1
pages/studentRanked/components/random-roll-call.vue

@@ -5,7 +5,7 @@
         <view style="min-height: 250px;" class="ui-flex-center ui-flex-row">
             <view class="text-center user-item" v-for="(item, index) in viewList" :key="item.id" @click="toCheck(item)">
                 <text v-if="!item.isEmpty" class="user-check" :class="[checkList.includes(item.id) ? 'el-icon-success' : 'el-icon-circle-check']"></text>
-                <el-avatar :size="70" :src="item.student_cartoon_photo"></el-avatar>
+                <el-avatar :size="70" :src="cartoonHeadImg ? item.student_cartoon_photo : item.student_photo+'?x-image-process=style/square400'"></el-avatar>
                 <view class="f34 text-center txt-white">{{item.title}}</view>
             </view>
         </view>
@@ -22,6 +22,9 @@
     export default {
         props: {
             list: {},
+            cartoonHeadImg : {
+                default : true,
+            },
         },
         data() {
             return {
@@ -42,6 +45,7 @@
                             isEmpty : true,
                             id: i,
                             student_cartoon_photo: 'https://zhxy.obs.cn-hz1.ctyun.cn/static/student_icon/B6.png',
+                            student_photo: 'https://zhxy.obs.cn-hz1.ctyun.cn/static/student_icon/B6.png',
                             title: '匿名'
                         })
                     }

+ 33 - 22
pages/studentRanked/components/rank-list.vue

@@ -1,12 +1,17 @@
 <template>
-    <el-drawer size='480px' title="排行榜" :visible.sync="show" direction="rtl">
-        <view id="chart-bar" :style="{height:height}" class="">
-
+    <el-drawer size='480px' :visible.sync="show" direction="rtl" destroy-on-close>
+        <view id="chart-bar" ref="chartBar" v-loading="loading" :style="{height:height}" class=""></view>
+        <view slot="title">
+            <text class="ui-mr20">排行榜<!-- {{yearMonth}} --></text>
+            <el-date-picker v-model="yearMonth" value-format="yyyyMM" type="month" placeholder="选择月" @change="change"></el-date-picker>
         </view>
     </el-drawer>
 </template>
 
 <script>
+    import { Loading } from 'element-ui';
+    
+
     import * as echarts from "echarts";
     import {
         chartBar
@@ -15,7 +20,9 @@
         data() {
             return {
                 show: false,
+                loading : false,
                 height : 0,
+                yearMonth : '',
             }
         },
         props: {
@@ -23,40 +30,44 @@
                 type: Number | String,
                 default: ""
             },
+            cartoonHeadImg : {
+                default : true,
+            },
         },
         computed: {},
         methods: {
+            change(){
+                this.getData();
+            },
             open() {
                 this.show = true;
-
+                this.$nextTick(() => {
+                    this.getData();
+                })
+            },
+            getData(){
+                this.loading = true;
+                // this.loadingInstance = Loading.service({
+                //     target : this.$refs.chartBar.$el
+                // });
+                
                 this.$api.sendRequest({
                     url: '/mobile/studentTab/getStudentMonthRank',
                     method: "post",
                     data: {
                         class_id: this.chooseClassId,
+                        year_month : this.yearMonth
                     },
                     success: res => {
-                        let dom = document.getElementById('chart-bar')
+                        // this.loadingInstance.close();
+                        this.loading = false;
                         this.height = `${res.data.length * 60}px`
                         this.$nextTick(() => {
+                            // console.log(this.$refs.chartBar.$el);
+                            const dom = this.$refs.chartBar.$el;
                             this.chart = echarts.init(dom);
-                            const myChart = this.chart;
-                            myChart.clear();
-                            // res.data.forEach((item, index) => {
-                            //     // option.yAxis.axisLabel.rich[index] = {
-                            //     //     height: 40, // 图片高度
-                            //     //     width: 40, // 图片宽度 
-                            //     //     backgroundColor: {
-                            //     //         image: item.student.student_cartoon_photo, // 图片路径  
-                            //     //     }
-                            //     // }
-                            //     if (item.score_total < 0) {
-                            //         option.yAxis.splitArea.areaStyle.color.push('rgba(231,79,176,0.2)')
-                            //     } else {
-                            //         option.yAxis.splitArea.areaStyle.color.push('rgba(0,0,0,0)')
-                            //     }
-                            // })
-                            myChart.setOption(chartBar(res.data));
+                            this.chart.clear();
+                            this.chart.setOption(chartBar(res.data, this.cartoonHeadImg));
                         })
                     }
                 })

+ 36 - 13
pages/studentRanked/studentRanked.vue

@@ -49,12 +49,13 @@
                         'ui-ml10' : !!index%2
                     }"> -->
                 <view @click="toClickStu(stuItem)" v-for="stuItem in column.nodes" :key="stuItem.key"
-                    class="ui-flex-column ranked-item-tr ui-flex-align-center" v-if="stuItem.id || seatMove"
-                    :class="{active : activeList.includes(stuItem.id)}">
-                    <image :src="getLevelIcon(stuItem)" style="width: 130rpx;height: 48rpx;">
-                    </image>
-                    <image style="width: 100rpx;height: 100rpx;margin-top: -20rpx;" :src="stuItem.student_cartoon_photo"
-                        mode=""></image>
+                    class="ui-flex-column ranked-item-tr ui-flex-align-center"
+                    :class="{
+                        active : activeList.includes(stuItem.id),
+                        'ranked-item-hide' : !(stuItem.id || seatMove)
+                    }">
+                    <image class="stu-image" :src="getLevelIcon(stuItem)" style="width: 130rpx;height: 48rpx;"></image>
+                    <image class="stu-image" style="width: 100rpx;height: 100rpx;margin-top: -20rpx; border-radius: 300px; " :src="cartoonHeadImg ? stuItem.student_cartoon_photo : stuItem.student_photo+'?x-image-process=style/square400'" mode=""></image>
                     <view class="stu-tag text-center ui-flex-row ui-mt10">
                         <view class="stu-tag-add ui-flex-1">{{stuItem.plus_score_total}}</view>
                         <view class="stu-tag-sub ui-flex-1">{{stuItem.minus_score_total}}</view>
@@ -74,16 +75,16 @@
 
         <!-- 点评记录 -->
         <!--  :stuList="activeList" -->
-        <markScoreList ref="markScoreList" :chooseClassId="chooseClassId"></markScoreList>
+        <markScoreList ref="markScoreList" :cartoonHeadImg="cartoonHeadImg" :chooseClassId="chooseClassId"></markScoreList>
 
         <!-- 随机点名 -->
-        <randomRollCall ref="randomRollCall" :list="studentList" @comment="randomRollComment"></randomRollCall>
+        <randomRollCall ref="randomRollCall" :cartoonHeadImg="cartoonHeadImg" :list="studentList" @comment="randomRollComment"></randomRollCall>
 
         <!-- 计时器 -->
         <timerClock ref="timerClock"></timerClock>
 
         <!-- 排行榜 -->
-        <rankList ref="rankList" :chooseClassId="chooseClassId"></rankList>
+        <rankList ref="rankList" :cartoonHeadImg="cartoonHeadImg" :chooseClassId="chooseClassId"></rankList>
 
         <view v-if="seatMove" class="ui-pull-bottom ui-p"
             style="background-color: #0000006b;backdrop-filter: blur(4px);border-top: 1px solid #616161;">
@@ -103,7 +104,7 @@
 
                 <el-dropdown trigger="click" @command="doChooseClass">
                     <view-btn-item title="选择班级" src="../../static/jyicon/shubao.png"></view-btn-item>
-                    <el-dropdown-menu slot="dropdown">
+                    <el-dropdown-menu slot="dropdown" :class="{'min-height': classesList.length >= 10}">
                         <el-dropdown-item v-for="(item) in classesList" :key="item.id" :command="item">
                             <text class="ui-mr10">{{item.class_name}}</text>
                             <text v-if="item.id == chooseClassId" class="el-icon-check"></text>
@@ -113,6 +114,8 @@
 
                 <view-btn-item title="点评记录" src="../../static/jyicon/kedan.png"
                     @click="$refs.markScoreList.open()"></view-btn-item>
+                <view-btn-item title="切换头像" src="../../static/jyicon/chengchang.png"
+                    @click="cartoonHeadImg = !cartoonHeadImg"></view-btn-item>
                 <view-btn-item title="座位调整" src="../../static/jyicon/xuewei.png"
                     @click="setSeatMove(true)"></view-btn-item>
                 <view-btn-item :title="multiSelect ? '取消多选' : '学生多选'" src="../../static/jyicon/gerenzhongxin.png"
@@ -172,6 +175,7 @@
                 multiSelect: false,
                 lastTipBatchId: '', // 最后点评的uuid,用于撤销,
                 seatMove: false, //0不调整
+                cartoonHeadImg : true,
             }
         },
         computed: {
@@ -346,10 +350,17 @@
             // 更新座位
             updateStuChange() {
                 let seat_list = this.list.map(item => {
+                    let nodesLen = item.nodes.length;
                     return {
                         id: item.id,
                         title: item.title,
-                        nodes: item.nodes.map(el => {
+                        nodes: item.nodes.filter((el, index) => {
+                            if(el.id){
+                                return true;
+                            }
+                            
+                            return index + 1 < nodesLen;
+                        }).map(el => {
                             return {
                                 id: el.id,
                                 key: el.key,
@@ -358,7 +369,8 @@
                         })
                     }
                 })
-                // console.log(data);
+                // console.log(seat_list);
+                // return;
                 this.$api.sendRequest({
                     url: `/mobile/saveSeat`,
                     method: "PUT",
@@ -458,6 +470,7 @@
                     },
                     success: res => {
                         this.lastTipBatchId = null;
+                        this.getStudent();
                     }
                 })
             }
@@ -544,10 +557,20 @@
         display: flex;
         justify-content: center;
     }
-
+    .ranked-item-tr:hover,
     .active {
         background: #ffffff85;
     }
+    .ranked-item-hide .stu-tag,
+    .ranked-item-hide .stu-image,
+    {
+        opacity: 0;
+    }
+    
+    .min-height {
+        max-height: 400px;
+        overflow-y: scroll;
+    }
 
     .ranked-radio {
         width: 100px;