lansir 1 éve
szülő
commit
125b34821c

+ 8 - 0
common/js/http.js

@@ -215,6 +215,14 @@ export default {
 							key: 'token'
 						})
 					}
+                    
+                    if(res.data.code == 401){
+                        uni.setStorageSync("token", '')
+                        uni.reLaunch({
+                            url: "/pages/login/login"
+                        })
+                    }
+                    
 					if (res.data.code == 200 || res.data.code == 403) {
 						typeof params.success == 'function' && params.success(res.data);
 

+ 5 - 2
pages/studentRanked/components/mark-score-list.vue

@@ -3,8 +3,8 @@
         style="backdrop-filter: blur(4px);">
         <u-swipe-action>
             <u-swipe-action-item v-for="(item,index) in list" :key="item.id" class="ui-hover ui-flex-1"
-                :options="options1" @click="itemClick(item,index)">
-                <u-cell :title="item.student.student_name">
+                :options="options1" @click="itemClick(item,index)" :show="!!item.show">
+                <u-cell :title="item.student.student_name" @click="itemClick(item, index)">
                     <view slot="icon" class="ui-mr10">
                         <image :src="item.stuSchool.student_photo"
                             style="width: 40px;height: 40px;border-radius: 20px;">
@@ -97,6 +97,9 @@
                         stu_school_id: this.stuList[0]
                     },
                     success: res => {
+                        res.data.data.forEach(item => {
+                            item.show = false;
+                        })
                         let arr = [...this.list, ...res.data.data]
                         this.current_page++
                         this.last_page = res.data.last_page

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

@@ -32,7 +32,7 @@
                 }" @change="changeCourse"></u-tabs>
 			</view>
 
-			<scroll-view scroll-y style="height: 400px;" show-scrollbar>
+			<scroll-view scroll-y style="height: 240px;" show-scrollbar>
 				<view class="ui-p">
                     <u-grid :col="6" :border="false" style="align-items: baseline;">
                     	<u-grid-item @click="toActive(index,item)" v-for="(item, index) in list" :key="index" class="ui-p"

+ 16 - 10
pages/studentRanked/studentRanked.vue

@@ -177,6 +177,8 @@
             }
         },
         onLoad(){
+            this.getClassroomList();
+            
             let teacher_id = this.teacher.id;
             this.$api.sendRequest({
                 url: `/mobile/teacher/draw`,
@@ -190,11 +192,6 @@
                     
                 }
             })
-        },
-		created() {
-            this.getClassroomList();
-		},
-        mounted() {
         },
         methods: {
             debug() {
@@ -206,10 +203,14 @@
                 })
             },
             getLevelIcon(item) {
+                let url = '//zhxy.obs.cn-hz1.ctyun.cn:443/static/';
+                if(item.score_total == 0){
+                    return url + 'tag_level/0.png'
+                } 
                 let val = ~~((item.score_total) / 10);
                 val = (val <= 0 ? 1 : val);
                 val = (val >= 16 ? 16 : val);
-                return '../../static/level_icon/' + val + '.png';
+                return url + 'tag_level/' + val + '.png';
             },
             // change(e) {
             //     this.type = e == 0 ? 1 : 2
@@ -221,7 +222,7 @@
             },
             loginOut() {
                 uni.setStorageSync("token", '')
-                uni.navigateTo({
+                uni.reLaunch({
                     url: "/pages/login/login"
                 })
             },
@@ -252,7 +253,10 @@
                     data: {
                         teacher_id: teacher_id
                     },
-                    success: res => {
+                    fali : res => {
+                        console.log(res);
+                    },
+                    success: res => {                        
                         this.classesList = res.data;
                         if (res.data.length) {
                             let value = uni.getStorageSync('lastClasses')
@@ -287,7 +291,7 @@
             setSeatMove(value) {
                 if(value){
                     this.setMulti(false);
-                    this.listCopy = uni.$u.deepClone(this.list); 
+                    this.listCopy = uni.$u.deepClone(this.list);
                 }else{
                     this.list = uni.$u.deepClone(this.listCopy); 
                 }
@@ -338,7 +342,9 @@
                     success: res => {
                         uni.showToast({
                             title: res.msg,
-                        })
+                        });
+                        this.seatMove = false;
+                        // this.setSeatMove(true);
                     }
                 })
             },