dedsudiyu 10 月之前
父节点
当前提交
7ff822c8fe
共有 3 个文件被更改,包括 168 次插入0 次删除
  1. 6 0
      pages.json
  2. 8 0
      pages/api/index.js
  3. 154 0
      pages_student/views/meViolation/meViolation.vue

+ 6 - 0
pages.json

@@ -404,6 +404,12 @@
 						"navigationBarTitleText": "我的准入"
 					}
 				},
+				{
+					"path": "views/meViolation/meViolation",//安全准入
+					"style": {
+						"navigationBarTitleText": "违规记录"
+					}
+				},
 				/* 气瓶管理 */
 				{
 					"path": "views/gasBottle/leaveConfirm/amendAir",

+ 8 - 0
pages/api/index.js

@@ -250,4 +250,12 @@ export const gradingControl  = (data) => {
         method: 'POST',
         data: {...data}
     })
+};
+//积分信息
+export const examPointsRecordGetMyPointsLogInfo  = (data) => {
+    return apiResquest({
+        url: `/exam/points/record/getMyPointsLogInfo`,
+        method: 'POST',
+        data: {...data}
+    })
 };

+ 154 - 0
pages_student/views/meViolation/meViolation.vue

@@ -0,0 +1,154 @@
+<!-- 我的违规 -->
+<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>
+</template>
+
+<script>
+    import { getViolationList } from '@/api/index.js'
+    export default {
+        data() {
+            return {
+                dataList:[],
+                //列表请求参数
+                getData:{
+                    page:1,
+                    pageSize:20,
+                    getType:true,
+                    nullDataType:true,
+                }
+            }
+        },
+        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))
+					});
+				}
+            },
+            //清除
+            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;
+                        }
+                    }
+                }
+            },
+        }
+    }
+</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
+
+                    }
+                }
+                .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>