作者 mxd

考勤积分

... ... @@ -461,7 +461,8 @@
"path": "tch_kq/tch_kq",
"style": {
"navigationBarTitleText": "考勤积分",
"enablePullDownRefresh": false
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
... ...
<template>
<view class="wrap_box">
<!-- <uParse v-if="datas" :content="datas"></uParse> -->
<view class="kq_box">
<view class="kq_bg dis_flex aic ju_c">
<image class="kq_bgimg" src="/static/images/tbbj.png" mode="widthFix"></image>
<view class="">
<text>{{allnum}}</text>分
</view>
</view>
<view class="kq_list_box">
<view class="kq_list">
<view v-for="(item,index) in datas" class="kq_li">
<view class="kq_li_d1 dis_flex aic ju_b">
<view class="">{{item.title}}</view>
<view class="kq_li_num">-{{item.class_num}}</view>
</view>
<view class="kq_li_d2 dis_flex aic ju_b">
<view class="user_name oh1">学员:{{item.uid}}</view>
<view class="kq_li_num">{{item.deduct_time}}</view>
</view> </view>
</view>
</view>
<CustomReturn title="考勤积分" color="#fff" :bgColor="bgColor">
</CustomReturn>
<view class="bg-img">
<image src="/static/imagesV2/tch_index/bg1.png" mode="aspectFill"></image>
</view>
<!-- 阻止滑动 -->
<!-- <view @touchmove.stop.prevent='test'></view> -->
<PaddingTopB>
<view class="main">
<view class="head">
<view class="head-label">
班级考勤积分(分)
</view>
<view class="head-content">
{{allnum}}
</view>
</view>
<view class="list">
<view class="item" v-for="(item,index) in datas" :key="index">
<view class="item-cell">
<view class="title">
{{item.title}}
</view>
<view class="value">
-{{item.class_num}}
</view>
</view>
<view class="item-cell">
<view class="name">
学员:{{item.uid}}
</view>
<view>
{{item.deduct_time}}
</view>
</view>
</view>
</view>
</view>
</PaddingTopB>
</view>
</template>
... ... @@ -34,19 +52,33 @@
mapState,
mapMutations
} from 'vuex'
import CustomReturn from "@/components/CustomReturn/index.vue"
import PaddingTopB from "@/components/PaddingTopB/index.vue"
var that
export default {
components: {
CustomReturn,
PaddingTopB
},
data() {
return {
bgColor: 'transparent',
options:'',
datas:'',
allnum:'',
datas:'',
allnum:'',
page:1
}
},
computed: {
...mapState(['hasLogin', 'forcedLogin', 'userName', 'userinfo','nowtime']),
},
onPageScroll(e) {
if(e.scrollTop > 0 ) {
this.bgColor = '#3384fc'
}else {
this.bgColor = 'transparent'
}
},
onLoad(e) {
that=this
that.options=e||{}
... ... @@ -56,83 +88,83 @@
},
onShow() {
that.onRetry()
},
onReachBottom() {
that.getdata()
},
onReachBottom() {
that.getdata()
},
methods: {
// ...mapMutations(['wxshouquan','login']),
test(){},
onRetry(){
that.page=1
that.datas = []
that.getdata()
},
getdata() {
var jkurl="/teacher/credith"
//类型1、成绩变化 2、思想动态 3、生活
var datas={
id:that.options.id,
page:that.page,
type:that.active
}
// if(that.data_last == true){
// return
// }
if (that.btnkg == 1) {
return
} else {
that.btnkg = 1
}
var page_now=that.page
that.$service.P_post(jkurl, datas).then(res => {
that.btnkg = 0
console.log(res)
if (res.code == 1) {
var datas = res.data
console.log(typeof datas)
if (typeof datas == 'string') {
datas = JSON.parse(datas)
}
if (page_now == 1) {
that.datas = datas.data
} else {
if (datas.data.length == 0) {
that.data_last = true
return
}
that.data_last = false
that.datas = that.datas.concat(datas.data)
}
that.allnum=datas.allnum
that.page++
} else {
if (res.msg) {
uni.showToast({
icon: 'none',
title: res.msg
})
} else {
uni.showToast({
icon: 'none',
title: '操作失败'
})
}
}
}).catch(e => {
that.btnkg = 0
console.log(e)
uni.showToast({
icon: 'none',
title: '操作失败'
})
})
onRetry(){
that.page=1
that.datas = []
that.getdata()
},
getdata() {
var jkurl="/teacher/credith"
//类型1、成绩变化 2、思想动态 3、生活
var datas={
id:that.options.id,
page:that.page,
type:that.active
}
// if(that.data_last == true){
// return
// }
if (that.btnkg == 1) {
return
} else {
that.btnkg = 1
}
var page_now=that.page
that.$service.P_post(jkurl, datas).then(res => {
that.btnkg = 0
console.log(res)
if (res.code == 1) {
var datas = res.data
console.log(typeof datas)
if (typeof datas == 'string') {
datas = JSON.parse(datas)
}
if (page_now == 1) {
that.datas = datas.data
} else {
if (datas.data.length == 0) {
that.data_last = true
return
}
that.data_last = false
that.datas = that.datas.concat(datas.data)
}
that.allnum=datas.allnum
that.page++
} else {
if (res.msg) {
uni.showToast({
icon: 'none',
title: res.msg
})
} else {
uni.showToast({
icon: 'none',
title: '操作失败'
})
}
}
}).catch(e => {
that.btnkg = 0
console.log(e)
uni.showToast({
icon: 'none',
title: '操作失败'
})
})
},
getimg(img){
return service.getimg(img)
... ... @@ -163,78 +195,79 @@
<style lang="scss" scoped>
.wrap_box{
width: 100%;
// padding: 30rpx;
min-height: 100vh;
// #ifdef H5
min-height: calc(100vh - 44px);
// #endif
background: #F8F8F8;
}
.kq_box{
width: 100%;
position: relative;
.kq_bg{
position: relative;
width: 100%;
height: 250rpx;
font-size: 32rpx;
color: #fff;
.kq_bgimg{
position: absolute;
top: 0;
z-index: 1;
width: 100%;
height: 250rpx;
font-size: 32rpx;
color: #fff;
}
view{
position: relative;
top: -40rpx;
z-index: 2;
text{
font-size: 72rpx;
font-weight: bold;
}
}
}
}
.kq_list_box{
width: 100%;
padding: 30rpx;
.kq_list{
width: 100%;
background: #fff;
border-radius: 10rpx;
.kq_li{
width: 100%;
padding: 28rpx;
min-height: 150rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
&+.kq_li{
border-top: 1px solid #f8f8f8;
}
.kq_li_d1{
font-size: 32rpx;
color: #545D71;
.user_name{
max-width: 330rpx;
line-height: 36rpx;
height: 36rpx;
}
.kq_li_num{
color: #FF9000;
}
}
.kq_li_d2{
font-size: 28rpx;
color: #A9B1C0;
}
}
}
// padding: 30rpx;
min-height: 100vh;
// #ifdef H5
min-height: calc(100vh - 44px);
// #endif
background: #f3f4f6;
}
.bg-img {
height: 504rpx;
position: absolute;
width: 100%;
}
.main {
width: 100%;
padding: 25rpx;
box-sizing: border-box;
}
.head {
font-family: PingFang SC;
color: #FFFFFF;
margin-top: 50rpx;
&-label {
font-size: 30rpx;
font-weight: 500;
}
&-content {
font-size: 60rpx;
font-weight: bold;
margin-top: 20rpx;
}
}
.list {
padding: 0 30rpx;
border-radius: 20rpx;
background-color: #fff;
margin-top: 30rpx;
.item {
border-bottom: 1px solid #FAFBFA;
padding: 30rpx 0;
&:last-child {
border: 0;
}
&-cell {
display: flex;
align-items: center;
font-family: PingFang SC;
justify-content: space-between;
margin-bottom: 20rpx;
&:last-child {
margin-bottom: 0;
}
.title {
font-size: 30rpx;
font-weight: 500;
color: #323232;
}
.value {
font-size: 30rpx;
font-weight: 500;
color: #FC5101;
}
.name {
font-size: 26rpx;
font-weight: 500;
color: #979797;
}
.time {
font-size: 24rpx;
font-weight: 400;
color: #979797;
}
}
}
}
</style>
... ...