thc_my_pf.vue 5.7 KB
<template>
	<view class="wrap_box">
		<view class="head">
			<view class="head-bg">
				<image src="/static/imagesV2/tch_index/bg2.png"></image>
			</view>
			
			<view class="head-box">
				<view class="head-item">
					<view class="head-item_content">
						{{all_star}}
					</view>
					<view class="head-item_label">
						班主任评分(分)
					</view>
				</view>
				<view class="head-line">
					
				</view>
				<view class="head-item">
					<view class="head-item_content">
						{{total}}
					</view>
					<view class="head-item_label">
						评价人数(人)
					</view>
				</view>
			</view>
			
		</view>
		
		
		<view class="card" v-for="(item,index) in datas" :key="index">
			<view class="cell">
				<view class="cell-label">
					专业能力(答疑、讲解、课堂组织能力)
				</view>
				<view class="cell-rate">
					<u-rate 
						:count="rate.count"
						:activeColor="rate.activeColor"
						:inactiveColor="rate.inactiveColor"
						:value="item.star_o" 
						readonly>
					</u-rate>
					<text class="cell-rate_text">
						{{item.star_o>7?'优秀':item.star_o>5?'良好':'一般'}}
					</text>
				</view>
			</view>
			
			<view class="cell">
				<view class="cell-label">
					负责任程度
				</view>
				<view class="cell-rate">
					<u-rate 
						:count="rate.count"
						:activeColor="rate.activeColor"
						:inactiveColor="rate.inactiveColor"
						:value="item.star" 
						readonly>
					</u-rate>
					<text class="cell-rate_text">
						{{item.star>7?'优秀':item.star>5?'良好':'一般'}}
					</text>
				</view>
			</view>
			
			
			<view class="cell">
				<view class="cell-content">
					<text class="label">其他评价及建议:</text>
					{{item.content}}
				</view>
			</view>
			
		</view>
		
	</view>
</template>

<script>
	import Vue from 'vue'
	import {
		mapState,
		mapMutations
	} from 'vuex'
	var that 
	export default {
		data() {
			return {
				options:'',
				datas:[
					{
						fz:2,
						zy:3
					},
					{
						fz:8,
						zy:9
					},
					{
						fz:5,
						zy:6
					},
					{
						fz:7,
						zy:7
					},
				],
				allnum:'',
				page:1,
				all_star:0,
				total:0,
				rate: {
					count: 10,
					activeColor: '#FC7D01',
					inactiveColor: '#D8D8D8'
				}
			}
		},
		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="/content/list"
				var datas={
					page:that.page,
				}
				// 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)
						}
						that.all_star=datas.all_star||0
						that.total=datas.total||0
						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: 25rpx;
	min-height: 100vh;
	// #ifdef H5
	min-height: calc(100vh - 44px);
	// #endif
	background: #F8F8F8;
}

.head {
	position: relative;
	height: 200rpx;
	
	.head-bg {
		width: 100%;
		height: 100%;
	}
	&-box {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		display: flex;
		align-items: center;
	}
	&-item {
		flex: 1;
		text-align: center;
		&_label {
			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
		}
		&_content {
			font-size: 48rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #FFFFFF;
		}
	}
	&-line {
		background: #F2F2F2;
		opacity: 0.2;
		width: 1px;
		height: 50rpx;
	}
}

.card {
	background: #fff;
	border-radius: 20rpx;
	padding: 30rpx;
	margin-top: 20rpx;
	.cell {
		& + .cell {
			margin-top: 20rpx;
		}
		&-label {
			font-size: 24rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #323232;
		}
		&-rate {
			margin-top: 20rpx;
			display: flex;
			align-items: center;
			&_text {
				font-size: 24rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #FC5101;
				margin-left: 40rpx;
			}
		}
		&-content {
			background: #F5F6F8;
			border-radius: 20rpx;
			padding: 20rpx;
			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #323232;
			.label {
				color: #979797;
			}
		}
	}
	
}


</style>