소스 검색

no message

lansir 1 년 전
부모
커밋
6f0c6d2dd6
5개의 변경된 파일551개의 추가작업 그리고 291개의 파일을 삭제
  1. 213 207
      common/js/http.js
  2. 300 0
      components/ui/ui-page-list.vue
  3. 2 1
      pages.json
  4. 35 82
      pages/studentRanked/components/mark-score-list.vue
  5. 1 1
      pages/studentRanked/studentRanked.vue

+ 213 - 207
common/js/http.js

@@ -38,229 +38,235 @@ const app_type_name = 'APP';
 // #endif
 
 export default {
-	sendRequest(params) {
-		if (!Config.baseUrl) {
-			uni.showToast({
-				title: '未配置请求域名',
-				'icon': 'none',
-				duration: 10000
-			});
-			return;
-		}
+    sendRequest(params) {
+        if (!Config.baseUrl) {
+            uni.showToast({
+                title: '未配置请求域名',
+                'icon': 'none',
+                duration: 10000
+            });
+            return;
+        }
 
-		var method = '' // 请求方式
-		
-		let baseUrl=""
-		
-		// localStorage.setItem("env","ywxk")
-		if(process.env.NODE_ENV === 'production'){
-			Config.baseUrl=Config.schoolBaseData.baseUrl
-		}else{
-			//开发环境读配置
-			if(Config.isLocal==2){
-				Config.baseUrl='http://125.124.170.221:8000'
-				// Config.baseUrl='http://zhxy.com'
-			}else{
-				// Config.baseUrl='http://zhxy.com'
-				Config.baseUrl='http://125.124.170.221:8000'
-			}
-		}
-		
-		
-		
-		var url = Config.baseUrl + params.url // 请求路径
-		
+        if (params.confirm) {
+            return uni.showModal({
+                title: params.confirm.title,
+                content: params.confirm.message,
+                success: res => {
+                    if (res.confirm) {
+                        delete params.confirm;
+                        this.sendRequest(params);
+                    }
+                }
+            })
+        }
+
+        var method = '' // 请求方式
+        let baseUrl = ""
 
-		var data = {};
+        // localStorage.setItem("env","ywxk")
+        if (process.env.NODE_ENV === 'production') {
+            Config.baseUrl = Config.schoolBaseData.baseUrl
+        } else {
+            //开发环境读配置
+            if (Config.isLocal == 2) {
+                Config.baseUrl = 'http://125.124.170.221:8000'
+                // Config.baseUrl='http://zhxy.com'
+            } else {
+                // Config.baseUrl='http://zhxy.com'
+                Config.baseUrl = 'http://125.124.170.221:8000'
+            }
+        }
 
-		if (params.method) {
+        var url = Config.baseUrl + params.url // 请求路径
 
-			method = params.method
-		} else if (params.data != undefined) {
+        var data = {};
 
-			method = 'POST'
-		} else {
+        if (params.method) {
+            method = params.method
+        } else if (params.data != undefined) {
+            method = 'POST'
+        } else {
+            method = 'GET'
+        }
 
-			method = 'GET'
-		}
+        // token
+        if (uni.getStorageSync('token')) data.token = uni.getStorageSync('token');
 
-		// token
-		if (uni.getStorageSync('token')) data.token = uni.getStorageSync('token');
+        // 门店id
+        if (uni.getStorageSync('store_info')) data.store_id = uni.getStorageSync('store_info').store_id;
 
-		// 门店id
-		if (uni.getStorageSync('store_info')) data.store_id = uni.getStorageSync('store_info').store_id;
+        // 参数
+        if (params.data != undefined) Object.assign(data, params.data);
 
-		// 参数
-		if (params.data != undefined) Object.assign(data, params.data);
+        if (params.async === false) {
+            console.log("zheli lema");
+            //同步
+            return new Promise((resolve, reject) => {
+                uni.request({
+                    url: url,
+                    method: method,
+                    data: data,
+                    header: params.header || {
+                        // 'Accept': 'application/json',
+                        'content-type': 'application/json',
+                        Authorization: uni.getStorageSync('token') ? uni.getStorageSync('token') :
+                            'zhxy'
+                    },
+                    dataType: params.dataType || 'json',
+                    responseType: params.responseType || 'text',
+                    success: (res) => {
+                        console.log(res, "success res");
+                        // try {
+                        // 	res.data = JSON.parse(res.data);
+                        // } catch (e) {
+                        // 	//TODO handle the exception
+                        // 	console.log('api error:', e);
+                        // }
+                        if (res.data.code == -3 && store.state.siteState > 0) {
+                            store.commit('setSiteState', -3)
+                            Util.redirectTo('/pages_tool/storeclose/storeclose', {}, 'reLaunch');
+                            return;
+                        }
+                        if (res.data.refreshtoken) {
+                            uni.setStorage({
+                                key: 'token',
+                                data: res.data.refreshtoken
+                            });
+                        }
 
-		if (params.async === false) {
-			console.log("zheli lema");
-			//同步
-			return new Promise((resolve, reject) => {
-				uni.request({
-					url: url,
-					method: method,
-					data: data,
-					header: params.header || {
-						// 'Accept': 'application/json',
-						'content-type': 'application/json',
-						Authorization: uni.getStorageSync('token') ? uni.getStorageSync('token') :
-							'zhxy'
-					},
-					dataType: params.dataType || 'json',
-					responseType: params.responseType || 'text',
-					success: (res) => {
-						console.log(res, "success res");
-						// try {
-						// 	res.data = JSON.parse(res.data);
-						// } catch (e) {
-						// 	//TODO handle the exception
-						// 	console.log('api error:', e);
-						// }
-						if (res.data.code == -3 && store.state.siteState > 0) {
-							store.commit('setSiteState', -3)
-							Util.redirectTo('/pages_tool/storeclose/storeclose', {}, 'reLaunch');
-							return;
-						}
-						if (res.data.refreshtoken) {
-							uni.setStorage({
-								key: 'token',
-								data: res.data.refreshtoken
-							});
-						}
-						
-						if (res.data.code == -10009 || res.data.code == -10010) {
-							uni.removeStorage({
-								key: 'token'
-							})
-						}
-						// resolve(res.data)
-						console.log(res.data,"res.data");
-						if(res.data.code==200 || res.data.code==403){
-							//typeof params.success == 'function' && params.success(res.data);
-							resolve(res.data)
-						} else {
-							uni.showToast({
-								title: res.data.msg+url,
-								'icon': 'none',
-								duration: 3000
-							})
-						}
-					},
-					fail: (res) => {
-						if (res.errMsg && res.errMsg == 'request:fail url not in domain list') {
-							uni.showToast({
-								title: Config.baseUrl + '不在request 合法域名列表中',
-								'icon': 'none',
-								duration: 10000
-							});
-							return;
-						}
+                        if (res.data.code == -10009 || res.data.code == -10010) {
+                            uni.removeStorage({
+                                key: 'token'
+                            })
+                        }
+                        // resolve(res.data)
+                        console.log(res.data, "res.data");
+                        if (res.data.code == 200 || res.data.code == 403) {
+                            //typeof params.success == 'function' && params.success(res.data);
+                            resolve(res.data)
+                        } else {
+                            uni.showToast({
+                                title: res.data.msg + url,
+                                'icon': 'none',
+                                duration: 3000
+                            })
+                        }
+                    },
+                    fail: (res) => {
+                        if (res.errMsg && res.errMsg == 'request:fail url not in domain list') {
+                            uni.showToast({
+                                title: Config.baseUrl + '不在request 合法域名列表中',
+                                'icon': 'none',
+                                duration: 10000
+                            });
+                            return;
+                        }
+
+                        reject(res);
+                    },
+                    complete: (res) => {
+                        console.log(res, "complete complete");
+                        if ((res.errMsg && res.errMsg != "request:ok") || (res.statusCode && [200,
+                                500
+                            ].indexOf(res.statusCode) == -1)) {
+                            uni.showToast({
+                                title: Config.baseUrl + '请求失败',
+                                'icon': 'none',
+                                duration: 10000
+                            })
+                            return;
+                        }
+                    }
+                });
+            });
+        } else {
+            //异步
+            params.showLoading && uni.showLoading({
+                title: '加载中'
+            });
+            // console.log("token是什么", url,uni.getStorageSync('token'));
+
+            uni.request({
+                url: url,
+                method: method,
+                data: data,
+                header: params.header || {
+                    // 'Accept': 'application/json',
+                    'content-type': 'application/json',
+                    Authorization: uni.getStorageSync('token') ? uni.getStorageSync('token') : 'zhxy'
+                },
+                dataType: params.dataType || 'json',
+                responseType: params.responseType || 'text',
+                success: (res) => {
+                    // try {
+                    // 	res.data = JSON.parse(res.data);
+                    // } catch (e) {
+                    // 	//TODO handle the exception
+                    // 	console.log('api error:', e);
+                    // }
+                    if (res.data.code == -3 && store.state.siteState > 0) {
+                        store.commit('setSiteState', -3)
+                        Util.redirectTo('/pages_tool/storeclose/storeclose', {}, 'reLaunch');
+                        return;
+                    }
+                    if (res.data.refreshtoken) {
+                        uni.setStorage({
+                            key: 'token',
+                            data: res.data.refreshtoken
+                        });
+                    }
+                    if (res.data.code == -10009 || res.data.code == -10010) {
+                        uni.removeStorage({
+                            key: 'token'
+                        })
+                    }
 
-						reject(res);
-					},
-					complete: (res) => {
-						console.log(res, "complete complete");
-						if ((res.errMsg && res.errMsg != "request:ok") || (res.statusCode && [200,
-								500
-							].indexOf(res.statusCode) == -1)) {
-							uni.showToast({
-								title: Config.baseUrl + '请求失败',
-								'icon': 'none',
-								duration: 10000
-							})
-							return;
-						}
-					}
-				});
-			});
-		} else {
-			//异步
-			uni.showLoading({
-				title: '加载中'
-			});
-			console.log("token是什么",uni.getStorageSync('token'));
-			
-			uni.request({
-				url: url,
-				method: method,
-				data: data,
-				header: params.header || {
-					// 'Accept': 'application/json',
-					'content-type': 'application/json',
-					Authorization: uni.getStorageSync('token') ? uni.getStorageSync('token') : 'zhxy'
-				},
-				dataType: params.dataType || 'json',
-				responseType: params.responseType || 'text',
-				success: (res) => {
-					// try {
-					// 	res.data = JSON.parse(res.data);
-					// } catch (e) {
-					// 	//TODO handle the exception
-					// 	console.log('api error:', e);
-					// }
-					if (res.data.code == -3 && store.state.siteState > 0) {
-						store.commit('setSiteState', -3)
-						Util.redirectTo('/pages_tool/storeclose/storeclose', {}, 'reLaunch');
-						return;
-					}
-					if (res.data.refreshtoken) {
-						uni.setStorage({
-							key: 'token',
-							data: res.data.refreshtoken
-						});
-					}
-					if (res.data.code == -10009 || res.data.code == -10010) {
-						uni.removeStorage({
-							key: 'token'
-						})
-					}
-                    
-                    if(res.data.code == 401){
+                    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);
 
-					} else {
-						uni.showToast({
-							title: res.data.msg ,
-							'icon': 'none',
-							duration: 3000
-						})
-					}
-					uni.hideLoading();
-				},
-				fail: (res) => {
-					if (res.errMsg && res.errMsg == 'request:fail url not in domain list') {
-						uni.showToast({
-							title: Config.baseUrl + '不在request 合法域名列表中',
-							'icon': 'none',
-							duration: 10000
-						});
-						return;
-					}
-					typeof params.fail == 'function' && params.fail(res);
+                    if (res.data.code == 200 || res.data.code == 403) {
+                        typeof params.success == 'function' && params.success(res.data);
 
-					uni.hideLoading();
-				},
-				complete: (res) => {
-					if ((res.errMsg && res.errMsg != "request:ok") || (res.statusCode && [200, 500].indexOf(
-							res.statusCode) == -1)) {
-						uni.showToast({
-							title: Config.baseUrl + '请求失败',
-							'icon': 'none',
-							duration: 10000
-						})
-						return;
-					}
-					typeof params.complete == 'function' && params.complete(res);
-				}
-			});
-		}
-	}
+                    } else {
+                        uni.showToast({
+                            title: res.data.msg,
+                            'icon': 'none',
+                            duration: 3000
+                        })
+                    }
+                    uni.hideLoading();
+                },
+                fail: (res) => {
+                    if (res.errMsg && res.errMsg == 'request:fail url not in domain list') {
+                        uni.showToast({
+                            title: Config.baseUrl + '不在request 合法域名列表中',
+                            'icon': 'none',
+                            duration: 10000
+                        });
+                        return;
+                    }
+                    typeof params.fail == 'function' && params.fail(res);
+                    params.fail && params.fail(res.data);
+                    uni.hideLoading();
+                },
+                complete: (res) => {
+                    if ((res.errMsg && res.errMsg != "request:ok") || (res.statusCode && [200, 500].indexOf(
+                            res.statusCode) == -1)) {
+                        uni.showToast({
+                            title: Config.baseUrl + '请求失败',
+                            'icon': 'none',
+                            duration: 10000
+                        })
+                        return;
+                    }
+                    typeof params.complete == 'function' && params.complete(res);
+                }
+            });
+        }
+    }
 }

+ 300 - 0
components/ui/ui-page-list.vue

@@ -0,0 +1,300 @@
+<template>
+    <view class="page-list">
+        <slot></slot>
+        
+        <u-no-network v-if="offNetwork" @connected="tryAgain" @retry="tryAgain"></u-no-network>
+        
+		<template v-else>
+			<view class="text-center ui-flex ui-flex-align-center ui-flex-center" v-if="isLoad && !silent" style="height: 50px;">
+                <u-loading-icon size="40"></u-loading-icon>
+			</view>
+					
+			<view v-if="!isLoad && showPageText">
+				<view v-if="showType == 2">
+					<slot name="empty">
+						<u-empty text="当前记录为空" iconSize="160" textSize="32" mode="data" show></u-empty>
+                        <!-- <text>当前记录为空</text> -->
+					</slot>
+				</view>
+
+				<view v-if="showType == 3" @click="next()" class="ui-flex ui-flex-align-center ui-flex-center" style="height: 50px;">
+					<text class="u-tips-color f16 text-center">点击继续加载信息</text>
+				</view>
+				<slot name="info">
+					<view v-if="showType == 4" class="ui-flex ui-flex-align-center ui-flex-center" style="height: 50px;">
+						<text class="u-tips-color f16 text-center">显示{{((page || 1)-1) * size + 1}}到{{page * size}},共{{total}}记录</text>
+					</view>
+				</slot>
+			</view>
+		</template>
+		
+    </view>
+</template>
+
+<script>
+	const globalData = getApp().globalData;
+	
+    export default {
+        props : {
+            url : String,
+            showPageText : {
+                type : Boolean,
+                default : true
+            },
+            start : {
+                type : Boolean,
+                default : true
+            },
+            method : {
+                type : String,
+                default : 'POST'
+            },
+            refreshRate : {     //多少秒自动刷新页面
+                type : Number,
+                default : null
+            },
+            params : {
+                type: Object,
+                default: function () {
+                    return {}
+                }
+            },
+            value : {
+                type: Array,
+                default: function () {
+                    return []
+                }
+            },
+			format : {
+				type : Function,
+				default : function(){
+					return function(){}
+				}
+			}
+			
+        },
+        data : function(){
+            return {
+				init : false,
+                // url : '',
+                // params : {},
+                size : 10,
+                page : 0,
+                // rows : [],
+                total : 0,
+                isLoad : false,
+				silent : false,
+                // lastTime : 0,
+				
+                lazyLoadPage : null,
+				showCount : 0,
+				offNetwork : false,
+            }
+        },
+        created : function(){
+            this.start && this.url && this.get();
+        },
+        computed: {
+            showType : function(){
+                // console.log('来计算');
+// 				if(this.isLoad){
+// 					return 1;	//加载中
+// 				}
+
+                if(this.total == 0 && this.page == 1){
+                    return 2;	//记录空
+                }
+
+                if(this.total/this.size > this.page){
+                    return 3;	//点击继续
+                }
+
+                if(this.page){
+                    return 4;	//全完成
+                }
+            }
+        },
+		//#ifndef H5
+        onShow() { // mp-vue执行
+			if(this.showCount){
+				this.view_show();
+			}
+			this.showCount ++
+		},
+		//#endif
+		//#ifdef H5
+		activated : function(){ // web-vue执行
+			// console.log('web-vue执行')
+			this.view_show();
+        },
+		//#endif
+        methods : {
+			view_show : function(){
+				// console.log('我来了')
+				var time = Date.parse(new Date())/1000;
+				var fresh = false;
+				this.lastTime = this.lastTime || time;
+				if(this.lastTime && this.refreshRate && time - this.lastTime > this.refreshRate){
+				    if(this.lastTime){
+				        this.fresh(Object.assign(
+				            this.params,
+				            {$silent : true}
+				        ));
+				        // this.fresh({
+				        //     ...this.params,
+				        //     ...{$silent : true}
+				        // });
+				    }
+				    this.lastTime = time;
+				    fresh = true;
+				}
+				
+				
+				if(!fresh && this.lazyLoadPage !== null){
+				    this.get(null, Object.assign(
+				        this.params,
+				        {page : this.lazyLoadPage, $silent : true}
+				    ), (res)=>{
+				        this.lazyLoadPage = null;
+				    })
+				
+				    // this.get(null, {...this.params, ...{page : this.lazyLoadPage, $silent : true}}, (res)=>{
+				    //     this.lazyLoadPage = null;
+				    // })
+				}
+			},
+			
+            intoItem : function(index, $pageTo, data){ //进入了这个条目,算出属于第几页,返回的时候需要重新加载此页
+				console.log(data)
+                this.lazyLoadPage = Math.ceil( (index + 1) / this.size);
+				if($pageTo){
+                    this.$nextTick(()=>{
+						this.$pageTo($pageTo, data);
+					})
+                }
+            },
+            next : function(fn){
+                if(this.size * this.page >= this.total){
+                    return;
+                }
+                if(this.isLoad){ return; }
+                var params = this.params;
+                params.page = params.page ? params.page + 1 : 1;
+                this.get(this.url, params, fn);
+            },
+            fresh : function(params, url, fn){
+                url = url || this.url;
+                params = params || this.params;
+
+                this.size = params.size || this.size;
+                if(!params.$silent){
+                    this.$emit('input', []);
+                    this.total = 0;
+                }
+                this.get(url, params, fn);
+
+            },
+			tryAgain : function(){
+				this.offNetwork = false;
+				this.isLoad = true;
+				setTimeout(() => {
+					this.fresh(null, null, this._again_data_fn)
+				}, 300)
+			},
+            get : function(url, params, fn){
+				this.init = true;
+                url = url || this.url;
+                params = params || this.params;
+
+                if(params.$silent){
+					this.silent = true;
+                    delete params.$silent;
+                }else{
+					this.silent = false;
+                    this.isLoad = true;
+                }
+				
+				this._again_data_fn = fn;
+
+                // this.get.CancelDo && this.get.CancelDo.cancel('Operation canceled by the user.');
+                // this.get.CancelDo = axios.CancelToken.source();
+                // params.cancelToken = this.get.CancelDo.token;
+				
+				// console.log('检查网路');
+				uni.getNetworkType({
+					success : res => {
+						// console.log(res);
+						if(res.networkType == "none"){
+							this.$emit('input', []);
+							uni.stopPullDownRefresh();
+							this.offNetwork = true;
+						}else{
+							this.offNetwork = false;
+						}
+					}
+				})
+                
+                this.$api.sendRequest({
+                    url: url,
+                    method: this.method,
+                    data: params,
+                    success: res => {
+                        this.dataCallBack(url, params, fn, res.data)
+                    },
+                    fail : (res) => {
+                    	this.isLoad = false;
+                    }
+                })
+            },
+            dataCallBack(url, params, fn, res){
+                Object.assign(this.params, params);
+                
+                res.size = res.size || res.per_page;
+                res.page = res.page || res.current_page;
+                res.rows = res.rows || res.data;
+                
+                this.isLoad = false;
+                this.$emit('onget', res);
+                
+                this.params.page = ~~res.page;
+                
+                this.page = ~~res.page;
+                this.size = ~~res.size;
+                this.total = ~~res.total;
+                
+                // 局部条目更新 self.page 会变成是当前页
+                if(this.lazyLoadPage && res.rows.length){  //静默去更新下一页
+                    if(this.size * this.page < this.total){
+                        this.get(url, Object.assign(params, {page : ++params.page, $silent : true}))
+                    }
+                }else{
+                    this.value.splice((this.page - 1) * this.size);
+                }
+                
+                this.format(res.rows)
+                
+                var index = (this.page - 1) * this.size;
+                var len = res.rows.length;
+                for (var i = 0; i < len; i++) {
+                    if(this.value[index + i]){
+                        this.value.splice(index + i, 1, res.rows[i]);
+                    }else{
+                        this.value.push(res.rows[i]);
+                    }
+                }
+                this.$emit('input', this.value);
+                
+                fn && fn(res);
+            }
+        }
+    }
+</script>
+
+<style>
+	.page-list{
+		/* margin-top: 15px; */
+		margin-bottom: 15px;
+		border-top: 1px solid transparent;
+		border-bottom: 1px solid transparent;
+	}
+</style>

+ 2 - 1
pages.json

@@ -1,6 +1,7 @@
 {
 	"easycom": {
-		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
+		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue",
+        "^ui-(.*)": "@/components/ui/ui-$1.vue"
 	},
 	"pages": [
 		// pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages

+ 35 - 82
pages/studentRanked/components/mark-score-list.vue

@@ -1,34 +1,26 @@
 <template>
     <el-drawer append-to-body title="点评记录" :visible.sync="show" size="400px" direction="ltr"
         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)" :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;">
-                        </image>
-                    </view>
-                    <!-- <view>{{}}</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>
-                    <!-- <u-badge slot="value" value="+1" plain size="mini" type="success"></u-badge> -->
-                    <!-- <view class="" slot="right-icon">
-                        <i class="el-icon-delete ui-ml30 " style="font-size: 20px;" @click="itemClick(item,index)"></i>
-                    </view> -->
-                </u-cell>
-            </u-swipe-action-item>
-        </u-swipe-action>
-        <view @click="getList" 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>
+        <scroll-view scroll-y style="height: 100%;" @scrolltolower="getNext">
+            <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="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"
+                                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>
+                    </u-cell>
+                </u-swipe-action-item>
+            </u-swipe-action>
+            <ui-page-list ref="reflist" url="/mobile/studentTab/getstudentTabLog" v-model="list" :start="false"></ui-page-list>
+        </scroll-view>
     </el-drawer>
 </template>
 
@@ -47,78 +39,42 @@
         data() {
             return {
                 show: false,
-
-                current_page: 1,
                 list: [],
                 options1: [{
                     text: '撤销',
                     style: {
                         backgroundColor: '#FF0C0C',
                     }
-                }],
-                last_page: 10,
-
-                msgType: 'center',
-                itemInfo: {},
-                index: 0
+                }]
             }
-        },
-        computed: {
-            showTitle() {
-                if (this.current_page > this.last_page) {
-                    return '没有更多数据了。。。'
-                } else {
-                    return '加载更多'
-                }
-            },
-        },
-        mounted() {
-
         },
         methods: {
             open() {
                 this.show = true;
-                
                 this.list = []
-                this.current_page = 1
-                this.getList()
+                this.$nextTick(() => {
+                    this.getList()
+                })
             },
             getList() {
-                if (this.showTitle == "没有更多数据了。。。") {
-                    return
-                }
-                
-                this.$api.sendRequest({
-                    url: `/mobile/studentTab/getstudentTabLog`,
-                    method: "post",
-                    data: {
-                        page: this.current_page,
-                        class_id: this.chooseClassId,
-                        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
-                        this.list = [...this.list, ...res.data.data]
-
-                    }
+                this.$refs.reflist.fresh({
+                    class_id: this.chooseClassId,
+                    stu_school_id: this.stuList[0]
                 })
             },
-            itemClick(item, index) {
-                this.index = index
-                this.itemInfo = item
-                this.$refs.alertDialog.open('center')
+            getNext(e){
+                this.$refs.reflist.next();
             },
-            dialogConfirm() {
+            itemRemove(item) {
                 this.$api.sendRequest({
+                    confirm : {
+                        title : '确认撤销',
+                        message : '确定要撤销此记录吗?'
+                    },
                     url: `/mobile/studentTab/delstudentTabLog`,
                     method: "post",
                     data: {
-                        tab_log_id: this.itemInfo.id
+                        tab_log_id: item.id
                     },
                     success: res => {
                         console.log("aaaaaaaaaaa");
@@ -130,9 +86,6 @@
                     }
                 })
 
-            },
-            dialogClose() {
-
             }
 
         },

+ 1 - 1
pages/studentRanked/studentRanked.vue

@@ -43,7 +43,7 @@
                     <view @click="toClickStu(stuItem)" v-for="stuItem in column.nodes" :key="stuItem.id"
                         v-if="stuItem.id" class="ui-flex-column ranked-item-tr ui-flex-align-center"
                         :class="{active : activeList.includes(stuItem.id)}">
-                        <image :src="getLevelIcon(stuItem)" mode="widthFix" style="width: 130rpx;height: 48rpx;">
+                        <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>