oneMyCredit.vue 4.0 KB
<template>
	<view class="oneMyCredit">
		<view class="header-all">
			<view class="header-img-wrap">
				<image class="header-img" src="/static/images/tbbj.png" mode="aspectFill"></image>
			</view>
			<view class="header-fen flex">
				{{all_num}}<text>分</text>
			</view>
		</view>
		<view class="statement_text">
			注:低于80分将被无条件退学处理
		</view>
		<view class="learn-credit-wrap area" v-for="(item,index) in datas" :key="index">
			<view class="learn-credit-item flex">
				<view class="learn-credit-left">
					<view class="learn-credit-tit">
						{{item.title}}
					</view>
					<view class="learn-credit-day">
						{{item.deduct_time}}
					</view>
				</view>
				<view class="learn-credit-num">
					-{{item.num}}
				</view>
			</view>
		</view>


	</view>
</template>

<script>
	import Vue from 'vue'
	import {
		mapState,
		mapMutations
	} from 'vuex'
	var that 
	export default {
		data() {
			return {
				all_num: "0", //分数
				datas: []

			}
		},
		onLoad(e) {
			that=this
			that.options=e||{}
			console.log(e)
			
			that.onRetry()
		},
		onShow() {
			
		},
		onReachBottom() {
			that.getdata()
		},
		methods: {
			onRetry(){
				that.page=1
				that.datas = []
				that.getdata()
			},
			getdata() {
			
				var datas = {
					page:that.page,
					limit:20
				}
				var jkurl = '/study/credith'
				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.all_num=datas.all_num
						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: '操作失败'
					})
				})
			},
			
		}
	}
</script>

<style lang="scss" scoped>
	.oneMyCredit {
		position: relative;
	}

	.header-all {
		width: 100%;
		height: 220rpx;
		position: relative;

		.header-img-wrap {
			width: 100%;
			height: 100%;
			position: absolute;
			top: 0;
			left: 0;

			.header-img {
				width: 100%;
				height: 100%;
			}
		}

		.header-fen {
			width: 100%;
			font-size: 72rpx;
			font-family: Arial;
			font-weight: bold;
			color: #FFFFFF;
			justify-content: center;
			align-items: center;
			margin-top: 24rpx;
			position: absolute;
			top: 0;
			left: 0;

			text {
				font-size: 32rpx;
				font-family: Arial;
				font-weight: 500;
				color: #FFFFFF;
			}
		}
	}

	.learn-credit-wrap {
		height: auto;
		border-radius: 10rpx;
		background-color: #fff;

		.learn-credit-item {
			height: 144rpx;
			padding: 0 30rpx;
			justify-content: space-between;
			align-items: center;
			border-bottom: 1px solid #EEEEEE;

			.learn-credit-left {
				.learn-credit-tit {
					height: 32rpx;
					line-height: 32rpx;
					font-size: 32rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #545D71;
					margin-bottom: 28rpx;
				}

				.learn-credit-day {
					height: 26rpx;
					line-height: 26rpx;
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #A9B1C0;
				}
			}

			.learn-credit-num {
				font-size: 32rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #FF9000;
			}
		}
	}

	.learn-credit-wrap:last-child {
		.learn-credit-item{
			border-bottom: none;
		}
	}
	.statement_text{
		width: 100%;
		height: 60rpx;
		padding-left: 30rpx;
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #929399;
	}
</style>