作者 mxd

考勤积分

@@ -461,7 +461,8 @@ @@ -461,7 +461,8 @@
461 "path": "tch_kq/tch_kq", 461 "path": "tch_kq/tch_kq",
462 "style": { 462 "style": {
463 "navigationBarTitleText": "考勤积分", 463 "navigationBarTitleText": "考勤积分",
464 - "enablePullDownRefresh": false 464 + "enablePullDownRefresh": false,
  465 + "navigationStyle": "custom"
465 } 466 }
466 467
467 }, { 468 }, {
1 <template> 1 <template>
2 <view class="wrap_box"> 2 <view class="wrap_box">
3 - <!-- <uParse v-if="datas" :content="datas"></uParse> -->  
4 - <view class="kq_box">  
5 - <view class="kq_bg dis_flex aic ju_c">  
6 - <image class="kq_bgimg" src="/static/images/tbbj.png" mode="widthFix"></image>  
7 - <view class="">  
8 - <text>{{allnum}}</text>分  
9 - </view>  
10 - </view>  
11 - <view class="kq_list_box">  
12 - <view class="kq_list">  
13 - <view v-for="(item,index) in datas" class="kq_li">  
14 - <view class="kq_li_d1 dis_flex aic ju_b">  
15 - <view class="">{{item.title}}</view>  
16 - <view class="kq_li_num">-{{item.class_num}}</view>  
17 - </view>  
18 - <view class="kq_li_d2 dis_flex aic ju_b">  
19 - <view class="user_name oh1">学员:{{item.uid}}</view>  
20 - <view class="kq_li_num">{{item.deduct_time}}</view>  
21 - </view> </view>  
22 - </view>  
23 - </view> 3 + <CustomReturn title="考勤积分" color="#fff" :bgColor="bgColor">
  4 +
  5 + </CustomReturn>
  6 + <view class="bg-img">
  7 + <image src="/static/imagesV2/tch_index/bg1.png" mode="aspectFill"></image>
24 </view> 8 </view>
25 9
26 - <!-- 阻止滑动 -->  
27 - <!-- <view @touchmove.stop.prevent='test'></view> --> 10 + <PaddingTopB>
  11 + <view class="main">
  12 + <view class="head">
  13 + <view class="head-label">
  14 + 班级考勤积分(分)
  15 + </view>
  16 + <view class="head-content">
  17 + {{allnum}}
  18 + </view>
  19 + </view>
  20 +
  21 + <view class="list">
  22 + <view class="item" v-for="(item,index) in datas" :key="index">
  23 + <view class="item-cell">
  24 + <view class="title">
  25 + {{item.title}}
  26 + </view>
  27 + <view class="value">
  28 + -{{item.class_num}}
  29 + </view>
  30 + </view>
  31 + <view class="item-cell">
  32 + <view class="name">
  33 + 学员:{{item.uid}}
  34 + </view>
  35 + <view>
  36 + {{item.deduct_time}}
  37 + </view>
  38 + </view>
  39 + </view>
  40 + </view>
  41 +
  42 + </view>
  43 +
  44 +
  45 + </PaddingTopB>
28 </view> 46 </view>
29 </template> 47 </template>
30 48
@@ -34,19 +52,33 @@ @@ -34,19 +52,33 @@
34 mapState, 52 mapState,
35 mapMutations 53 mapMutations
36 } from 'vuex' 54 } from 'vuex'
  55 + import CustomReturn from "@/components/CustomReturn/index.vue"
  56 + import PaddingTopB from "@/components/PaddingTopB/index.vue"
37 var that 57 var that
38 export default { 58 export default {
  59 + components: {
  60 + CustomReturn,
  61 + PaddingTopB
  62 + },
39 data() { 63 data() {
40 return { 64 return {
  65 + bgColor: 'transparent',
41 options:'', 66 options:'',
42 - datas:'',  
43 - allnum:'', 67 + datas:'',
  68 + allnum:'',
44 page:1 69 page:1
45 } 70 }
46 }, 71 },
47 computed: { 72 computed: {
48 ...mapState(['hasLogin', 'forcedLogin', 'userName', 'userinfo','nowtime']), 73 ...mapState(['hasLogin', 'forcedLogin', 'userName', 'userinfo','nowtime']),
49 }, 74 },
  75 + onPageScroll(e) {
  76 + if(e.scrollTop > 0 ) {
  77 + this.bgColor = '#3384fc'
  78 + }else {
  79 + this.bgColor = 'transparent'
  80 + }
  81 + },
50 onLoad(e) { 82 onLoad(e) {
51 that=this 83 that=this
52 that.options=e||{} 84 that.options=e||{}
@@ -56,83 +88,83 @@ @@ -56,83 +88,83 @@
56 }, 88 },
57 onShow() { 89 onShow() {
58 that.onRetry() 90 that.onRetry()
59 - },  
60 - onReachBottom() {  
61 - that.getdata() 91 + },
  92 + onReachBottom() {
  93 + that.getdata()
62 }, 94 },
63 methods: { 95 methods: {
64 // ...mapMutations(['wxshouquan','login']), 96 // ...mapMutations(['wxshouquan','login']),
65 test(){}, 97 test(){},
66 - onRetry(){  
67 - that.page=1  
68 - that.datas = []  
69 - that.getdata()  
70 - },  
71 - getdata() {  
72 -  
73 - var jkurl="/teacher/credith"  
74 - //类型1、成绩变化 2、思想动态 3、生活  
75 - var datas={  
76 - id:that.options.id,  
77 - page:that.page,  
78 - type:that.active  
79 - }  
80 - // if(that.data_last == true){  
81 - // return  
82 - // }  
83 - if (that.btnkg == 1) {  
84 - return  
85 - } else {  
86 - that.btnkg = 1  
87 - }  
88 - var page_now=that.page  
89 - that.$service.P_post(jkurl, datas).then(res => {  
90 - that.btnkg = 0  
91 - console.log(res)  
92 - if (res.code == 1) {  
93 - var datas = res.data  
94 - console.log(typeof datas)  
95 -  
96 - if (typeof datas == 'string') {  
97 - datas = JSON.parse(datas)  
98 - }  
99 -  
100 - if (page_now == 1) {  
101 -  
102 - that.datas = datas.data  
103 -  
104 - } else {  
105 - if (datas.data.length == 0) {  
106 - that.data_last = true  
107 - return  
108 - }  
109 - that.data_last = false  
110 - that.datas = that.datas.concat(datas.data)  
111 - }  
112 - that.allnum=datas.allnum  
113 - that.page++  
114 -  
115 - } else {  
116 - if (res.msg) {  
117 - uni.showToast({  
118 - icon: 'none',  
119 - title: res.msg  
120 - })  
121 - } else {  
122 - uni.showToast({  
123 - icon: 'none',  
124 - title: '操作失败'  
125 - })  
126 - }  
127 - }  
128 - }).catch(e => {  
129 - that.btnkg = 0  
130 - console.log(e)  
131 - uni.showToast({  
132 - icon: 'none',  
133 - title: '操作失败'  
134 - })  
135 - }) 98 + onRetry(){
  99 + that.page=1
  100 + that.datas = []
  101 + that.getdata()
  102 + },
  103 + getdata() {
  104 +
  105 + var jkurl="/teacher/credith"
  106 + //类型1、成绩变化 2、思想动态 3、生活
  107 + var datas={
  108 + id:that.options.id,
  109 + page:that.page,
  110 + type:that.active
  111 + }
  112 + // if(that.data_last == true){
  113 + // return
  114 + // }
  115 + if (that.btnkg == 1) {
  116 + return
  117 + } else {
  118 + that.btnkg = 1
  119 + }
  120 + var page_now=that.page
  121 + that.$service.P_post(jkurl, datas).then(res => {
  122 + that.btnkg = 0
  123 + console.log(res)
  124 + if (res.code == 1) {
  125 + var datas = res.data
  126 + console.log(typeof datas)
  127 +
  128 + if (typeof datas == 'string') {
  129 + datas = JSON.parse(datas)
  130 + }
  131 +
  132 + if (page_now == 1) {
  133 +
  134 + that.datas = datas.data
  135 +
  136 + } else {
  137 + if (datas.data.length == 0) {
  138 + that.data_last = true
  139 + return
  140 + }
  141 + that.data_last = false
  142 + that.datas = that.datas.concat(datas.data)
  143 + }
  144 + that.allnum=datas.allnum
  145 + that.page++
  146 +
  147 + } else {
  148 + if (res.msg) {
  149 + uni.showToast({
  150 + icon: 'none',
  151 + title: res.msg
  152 + })
  153 + } else {
  154 + uni.showToast({
  155 + icon: 'none',
  156 + title: '操作失败'
  157 + })
  158 + }
  159 + }
  160 + }).catch(e => {
  161 + that.btnkg = 0
  162 + console.log(e)
  163 + uni.showToast({
  164 + icon: 'none',
  165 + title: '操作失败'
  166 + })
  167 + })
136 }, 168 },
137 getimg(img){ 169 getimg(img){
138 return service.getimg(img) 170 return service.getimg(img)
@@ -163,78 +195,79 @@ @@ -163,78 +195,79 @@
163 <style lang="scss" scoped> 195 <style lang="scss" scoped>
164 .wrap_box{ 196 .wrap_box{
165 width: 100%; 197 width: 100%;
166 - // padding: 30rpx;  
167 - min-height: 100vh;  
168 - // #ifdef H5  
169 - min-height: calc(100vh - 44px);  
170 - // #endif  
171 - background: #F8F8F8;  
172 -}  
173 -.kq_box{  
174 - width: 100%;  
175 - position: relative;  
176 - .kq_bg{  
177 - position: relative;  
178 - width: 100%;  
179 - height: 250rpx;  
180 - font-size: 32rpx;  
181 - color: #fff;  
182 - .kq_bgimg{  
183 - position: absolute;  
184 - top: 0;  
185 - z-index: 1;  
186 - width: 100%;  
187 - height: 250rpx;  
188 - font-size: 32rpx;  
189 - color: #fff;  
190 -  
191 -  
192 - }  
193 - view{  
194 - position: relative;  
195 - top: -40rpx;  
196 - z-index: 2;  
197 - text{  
198 - font-size: 72rpx;  
199 - font-weight: bold;  
200 - }  
201 - }  
202 - }  
203 -}  
204 -.kq_list_box{  
205 - width: 100%;  
206 - padding: 30rpx;  
207 - .kq_list{  
208 - width: 100%;  
209 - background: #fff;  
210 - border-radius: 10rpx;  
211 - .kq_li{  
212 - width: 100%;  
213 - padding: 28rpx;  
214 - min-height: 150rpx;  
215 - display: flex;  
216 - flex-direction: column;  
217 - justify-content: space-between;  
218 - &+.kq_li{  
219 - border-top: 1px solid #f8f8f8;  
220 - }  
221 - .kq_li_d1{  
222 - font-size: 32rpx;  
223 - color: #545D71;  
224 - .user_name{  
225 - max-width: 330rpx;  
226 - line-height: 36rpx;  
227 - height: 36rpx;  
228 - }  
229 - .kq_li_num{  
230 - color: #FF9000;  
231 - }  
232 - }  
233 - .kq_li_d2{  
234 - font-size: 28rpx;  
235 - color: #A9B1C0;  
236 - }  
237 - }  
238 - } 198 + // padding: 30rpx;
  199 + min-height: 100vh;
  200 + // #ifdef H5
  201 + min-height: calc(100vh - 44px);
  202 + // #endif
  203 + background: #f3f4f6;
  204 +}
  205 +.bg-img {
  206 + height: 504rpx;
  207 + position: absolute;
  208 + width: 100%;
  209 +}
  210 +.main {
  211 + width: 100%;
  212 + padding: 25rpx;
  213 + box-sizing: border-box;
  214 +}
  215 +.head {
  216 + font-family: PingFang SC;
  217 + color: #FFFFFF;
  218 + margin-top: 50rpx;
  219 + &-label {
  220 + font-size: 30rpx;
  221 + font-weight: 500;
  222 + }
  223 + &-content {
  224 + font-size: 60rpx;
  225 + font-weight: bold;
  226 + margin-top: 20rpx;
  227 + }
  228 +}
  229 +
  230 +.list {
  231 + padding: 0 30rpx;
  232 + border-radius: 20rpx;
  233 + background-color: #fff;
  234 + margin-top: 30rpx;
  235 + .item {
  236 + border-bottom: 1px solid #FAFBFA;
  237 + padding: 30rpx 0;
  238 + &:last-child {
  239 + border: 0;
  240 + }
  241 + &-cell {
  242 + display: flex;
  243 + align-items: center;
  244 + font-family: PingFang SC;
  245 + justify-content: space-between;
  246 + margin-bottom: 20rpx;
  247 + &:last-child {
  248 + margin-bottom: 0;
  249 + }
  250 + .title {
  251 + font-size: 30rpx;
  252 + font-weight: 500;
  253 + color: #323232;
  254 + }
  255 + .value {
  256 + font-size: 30rpx;
  257 + font-weight: 500;
  258 + color: #FC5101;
  259 + }
  260 + .name {
  261 + font-size: 26rpx;
  262 + font-weight: 500;
  263 + color: #979797;
  264 + }
  265 + .time {
  266 + font-size: 24rpx;
  267 + font-weight: 400;
  268 + color: #979797;
  269 + }
  270 + }
  271 + }
239 } 272 }
240 </style> 273 </style>