tch_kq.vue 4.6 KB
<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>
		</view>
		
		<!-- 阻止滑动 -->
		<!-- <view @touchmove.stop.prevent='test'></view> -->
	</view>
</template>

<script>
	import Vue from 'vue'
	import {
		mapState,
		mapMutations
	} from 'vuex'
	var that 
	export default {
		data() {
			return {
				options:'',
				datas:'',
				allnum:'',
				page:1
			}
		},
		computed: {
		...mapState(['hasLogin', 'forcedLogin', 'userName', 'userinfo','nowtime']),
		},
		onLoad(e) {
			that=this
			that.options=e||{}
			console.log(e)
			
			// that.getdata()
		},
		onShow() {
			that.onRetry()
		},
		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: '操作失败'
					})
				})
			},
			getimg(img){
				return service.getimg(img)
			},
			jump(e) {
				var that = this
				if (that.btnkg == 1) {
					return
				} else {
					that.btnkg = 1
					setTimeout(function() {
						that.btnkg = 0
					}, 2000)
				}
				console.log(e.currentTarget.dataset.type)
				service.jump(e)
			},
			goback(){
			  uni.navigateBack()
			},
			func(){
				// that.$store.commit('setSystem',datas.system)
			}
		}
	}
</script>

<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;
			}
		}
	}
}
</style>