dedsudiyu 1 gadu atpakaļ
vecāks
revīzija
2bee98e09d

+ 6 - 0
pages/component/homeConfigurationSlot.vue

@@ -156,6 +156,12 @@
 							url: item.routeUrl,
 						});
 					}
+					console.log('item',item)
+					if (item.route === 'meViolation') { //违规记录
+						uni.navigateTo({
+							url: item.routeUrl,
+						});
+					}
 					if (item.route === 'studentGasBottle') { //气瓶管理
 						uni.navigateTo({
 							url: item.routeUrl,

+ 0 - 7
pages/views/home/studentWorkbench.vue

@@ -6,13 +6,6 @@
 
     <homeConfigurationSlot v-for="(item,index) in homeConfigData" :key="index" :homeConfig="item"></homeConfigurationSlot>
 
-	<view class="big-icon-button-box">
-      <view class="left-box">
-        <img class="left-top-img" @click="goNull" src="@/pages/images/img_bg_cjcx.png">
-        <img class="left-bottom-img" @click="goPage('meViolation')" src="@/pages/images/img_bg_wgjl.png">
-      </view>
-      <img class="right-img" @click="goNull" src="@/pages/images/img_bg_jfmx.png">
-    </view>
     <view class="bottom-max-box">
       <view class="bottom-title" @click="meCertificateClick()">
         <img src="@/pages/images/icon_sy_wdzs.png">

+ 15 - 13
pages/views/mine/mine.vue

@@ -77,11 +77,11 @@
 		studentinfoFacemy,
 		simpleInfo,
 		getSafeWarnList,
-		getMyPointsLogInfo,
 		fingerprintQuantity,
 		fingerprintQueryList,
 		systemAppletLayoutSelect,
-		systemUserProfile
+		systemUserProfile,
+		examPointsRecordGetMyPointsLogInfo
 	} from '@/pages/api/index.js'
 	import {
 		getMineConfig
@@ -142,7 +142,9 @@
 			this.systemAppletLayoutSelect();
 			if (uni.getStorageSync('token') && uni.getStorageSync('userId') && uni.getStorageSync('userType')) {
 				this.userType = uni.getStorageSync('userType')
-				//this.studentinfoFacemy();
+				if(this.userType == '2'){
+					this.examPointsRecordGetMyPointsLogInfo();
+				}
 			} else {
 				uni.removeStorageSync('token');
 				uni.removeStorageSync('userId');
@@ -169,6 +171,16 @@
 					this.$set(this, 'mineConfigData', getMineConfig(list));
 				}
 			},
+			//查询学生-信用分/奖励分
+			async examPointsRecordGetMyPointsLogInfo() {
+				const {
+					data
+				} = await examPointsRecordGetMyPointsLogInfo();
+				if (data.code == 200) {
+					this.bonusPoints = data.data.bonusPoints;
+					this.creditScore = data.data.creditScore;
+				}
+			},
 			//学生端-信用分/奖励分/扫一扫按钮
 			goUserPage(type) {
 				let self = this;
@@ -210,16 +222,6 @@
 					this.$set(this, 'pageType', true)
 				}
 			},
-			//获取个人奖励分/信用分
-			async getMyPointsLogInfo() {
-				const {
-					data
-				} = await getMyPointsLogInfo();
-				if (data.code == 200) {
-					this.bonusPoints = data.data.bonusPoints;
-					this.creditScore = data.data.creditScore;
-				}
-			},
 			//获取报警信息列表
 			async getSafeWarnList() {
 				let obj = {

+ 8 - 0
pages_student/api/index.js

@@ -54,4 +54,12 @@ export const exchangePoints  = (data) => {
         method: 'POST',
         data: {...data}
     })
+};
+//违规记录列表
+export const examViolationMyAppList  = (data) => {
+    return apiResquest({
+        url: `/exam/violation/myAppList`,
+        method: 'POST',
+        data: {...data}
+    })
 };

+ 102 - 143
pages_student/views/meViolation/meViolation.vue

@@ -1,154 +1,113 @@
 <!-- 我的违规 -->
 <template>
-    <view id="meViolation">
-        <scroll-view scroll-y @scrolltolower="scrollGet" class="max-list-box">
-            <view class="for-list-box" v-for="(item,index) in dataList" :key="index">
-                <view class="left-box">
-                    <view>违规时间:{{item.createTime}}</view>
-                    <view>{{item.violationContent}}</view>
-                </view>
-                <view class="right-box" :class="{'colorA':item.penaltyType!=0}">线下约谈</view>
-                <img src="@/pages_student/images/icon_wdwg_gd.png" v-if="item.penaltyType==0">
-            </view>
-            <view class="get-null-box" v-if="getData.nullDataType">暂无更多数据</view>
-        </scroll-view>
-    </view>
+	<view id="meViolation">
+		<scroll-view scroll-y @scrolltolower="scrollGet" class="max-list-box">
+			<view class="for-list-box" v-for="(item,index) in dataList" :key="index">
+				<view>违规项:{{item.reason}}</view>
+				<view>违规时间:{{item.createTime}}</view>
+				<view>处理方式:{{item.treatmentMethod}}</view>
+			</view>
+			<view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
+		</scroll-view>
+	</view>
 </template>
 
 <script>
-    import { getViolationList } from '@/api/index.js'
-    export default {
-        data() {
-            return {
-                dataList:[],
-                //列表请求参数
-                getData:{
-                    page:1,
-                    pageSize:20,
-                    getType:true,
-                    nullDataType:true,
-                }
-            }
-        },
-        onLoad() {
+	import {
+		examViolationMyAppList
+	} from '@/pages_student/api/index.js'
+	export default {
+		data() {
+			return {
+				total: 0,
+				dataList: [],
+				getDataType: false,
+				// 查询参数
+				queryParams: {
+					page: 1,
+					pageSize: 10,
+				},
+			}
+		},
+		onLoad() {
 
-        },
-        onShow(){
-            this.clearData();
-            this.getList();
-        },
-        methods: {
-            //去考试
-            goExamList(item){
-				if(item.penaltyType == 0){
-					uni.navigateTo({
-					    url: '/pages_student/workbench/exam/examList?violationId='+encodeURIComponent(JSON.stringify(item.id))
-					});
+		},
+		onShow() {
+			this.getList();
+		},
+		methods: {
+			//滚动加载事件
+			scrollGet() {
+				let self = this;
+				if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
+					this.$set(this, 'getDataType', true);
+				} else {
+					this.queryParams.page += 1;
+					this.$nextTick(() => {
+						this.getList();
+					})
 				}
-            },
-            //清除
-            clearData(){
-                this.infoList = [];
-                this.getData.page = 1;
-                this.getData.getType = true;
-                this.getData.nullDataType = true;
-            },
-            //滚动事件
-            scrollGet(){
-                if(this.getData.getType){
-                    this.getData.page += 1;
-                    this.getList();
-                }
-            },
-            // 查询违规记录列表 (用户端)
-            async getList(){
-                let self = this;
-                let obj = {
-                    pageNum:this.getData.page,
-                    pageSize:this.getData.pageSize,
-                }
-                let {data} = await getViolationList(obj)
-                if(data.code==200){
-                    if(self.getData.page==1){
-                        if(data.rows.length > 0 && data.rows.length == self.getData.pageSize){
-                            self.dataList = data.rows;
-                        }else if(data.rows.length > 0 && data.rows.length != self.getData.pageSize){
-                            self.dataList = data.rows;
-                            self.getData.getType = false;
-                            self.getData.nullDataType = true;
-                        }else{
-                            self.getData.getType = false;
-                            self.getData.nullDataType = true;
-                        }
-                    }else{
-                        if(data.rows.length > 0 && data.rows.length == self.getData.pageSize){
-                            self.dataList = self.dataList.concat(data.rows)
-                        }else if(data.rows.length > 0 && data.rows.length != self.getData.pageSize){
-                            self.dataList = self.dataList.concat(data.rows);
-                            self.getData.getType = false;
-                            self.getData.nullDataType = true;
-                        }else{
-                            self.getData.getType = false;
-                            self.getData.nullDataType = true;
-                        }
-                    }
-                }
-            },
-        }
-    }
+			},
+			//获取数据列表
+			async getList() {
+				let self = this;
+				let obj = JSON.parse(JSON.stringify(this.queryParams));
+				obj.deptId = this.facultyIndex ? this.facultyList[this.facultyIndex].deptId : '';
+				obj.typeId = this.subjectIndex ? this.subjectList[this.subjectIndex].typeId : '';
+				obj.levelId = this.levelIndex ? this.levelList[this.levelIndex].levelId : '';
+				const {
+					data
+				} = await examViolationMyAppList(obj);
+				if (data.code == 200) {
+					if (self.queryParams.page == 1) {
+						this.dataList = data.data.records;
+						this.total = data.data.total;
+						if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
+							this.$set(this, 'getDataType', true);
+						}
+					} else {
+						this.dataList = [...this.dataList, ...data.data.records]
+						this.total = data.data.total;
+						if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
+							this.$set(this, 'getDataType', true);
+						}
+					}
+				}
+			},
+		}
+	}
 </script>
 
 <style lang="stylus" scoped>
-    #meViolation{
-        height:100%;
-        width:100%;
-        display flex
-        .max-list-box{
-            flex:1;
-            overflow: scroll
-            .for-list-box{
-                background #fff
-                border-top:1rpx solid #E0E0E0;
-                display flex
-                .left-box{
-                    flex:1;
-                    view:nth-child(1){
-                        line-height:22rpx;
-                        font-size:22rpx;
-                        margin:21rpx 0 0 19rpx;
-                        color: #666
-                    }
-                    view:nth-child(2){
-                        line-height:29rpx;
-                        font-size:29rpx;
-                        margin:27rpx 0 0 19rpx;
-                        color: #333
+	#meViolation {
+		height: 100%;
+		display flex;
+		flex-direction column;
+
+		.max-list-box {
+			flex: 1;
+			overflow-y: scroll;
+
+			.for-list-box {
+				background #fff;
+				border-top: 1rpx solid #E0E0E0;
+				padding: 20rpx;
+
+				view {
+					display: block;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					white-space: nowrap;
+				}
+			}
+
 
-                    }
-                }
-                .right-box{
-                    line-height:120rpx;
-                    width:140rpx;
-                    color:#0183FA;
-                    text-align: right
-                    margin-right:20rpx;
-                }
-                .colorA{
-                    color:#999;
-                    margin-right:60rpx;
-                }
-                img{
-                    height:20rpx;
-                    width:20rpx;
-                    margin:51rpx 20rpx 50rpx 0;
-                }
-            }
-            .get-null-box{
-                height:100rpx;
-                line-height:100rpx;
-                color:#999;
-                text-align center
-            }
-        }
-    }
-</style>
+			.get-data-null-p {
+				text-align: center;
+				line-height: 80rpx;
+				padding-bottom: 40px;
+				color: #999;
+			}
+		}
+	}
+</style>

+ 1 - 1
utils/homeConfig.js

@@ -141,7 +141,7 @@ let routeDataList = [
 		name: "违规记录",
 		limits:"",
 		route: "meViolation",
-		routeUrl: "/pages_student/views/workbench/meViolation",
+		routeUrl: "/pages_student/views/meViolation/meViolation",
 		img: require('@/images/commonality/img_bg_wgjl.png'),
 		buttonType:"page",
 	},