sq_list_tel.vue 4.1 KB
<template>
	<view class="wrap_box">
		<!-- <uParse v-if="datas" :content="datas"></uParse> -->
		<view class="sq_list">
			<view class="sq_li" v-for="(item,index) in datas" @click="$service.jump" :data-url="'/pagesStu/sq_xq_tel/sq_xq_tel?id='+item.id">
				<view class="sq_type">{{item.status_type==1?'整天申请':'时段申请'}}</view>
				<view class="sq_time">{{item.start_time}}</view>
				<view class="sq_time1">
					<view class="">
						申请时间:{{item.create_time}}
					</view>
					<view v-if="item.examine==1">
						待审核
					</view>
					<view v-else-if="item.examine==2">
						审核通过
					</view>
					<view v-else>
						未通过
					</view>
				</view>
			</view>
			<u-empty v-if="datas.length==0"
							mode="data"
							text="暂无数据"
							icon="/static/images/tch/img_blank.png"
			>
			</u-empty>
		</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:[],
				page:1
			}
		},
		computed: {
		...mapState(['hasLogin', 'forcedLogin', 'userName', 'userinfo','nowtime']),
		},
		onLoad(e) {
			that=this
			that.options=e||{}
			console.log(e)
			that.onRetry()
			// that.getdata()
		},
		onShow() {
			
		},
		methods: {
			// ...mapMutations(['wxshouquan','login']),
			test(){},
			onRetry(){
				that.page=1
				that.getdata()
			},
			getdata(){
				
				var datas={
					page: that.page,
					limit:20
				}
				var jkurl='/my/nophone'
				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) {
						that.htmlReset = 0
						var datas = res.data
						console.log(typeof datas)
				
						if (typeof datas == 'string') {
							datas = JSON.parse(datas)
						}
						console.log(res)
						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.htmlReset = 1
					that.btnkg = 0
					// that.$refs.htmlLoading.htmlReset_fuc(1)
					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;
}
.sq_list{
	width: 100%;
	padding: 30rpx;
	.sq_li{
		width: 100%;
		padding: 20rpx 30rpx;
		background: #fff;
		border-radius: 12rpx;
		box-shadow: 0px 8rpx 18rpx 3rpx rgba(68,128,255,0.0600);
		&+.sq_li{
			margin-top: 20rpx;
		}
		.sq_type{
			font-size: 32rpx;
			color: #333;
			font-weight: bold;
			
			display: flex;
			align-items: center;
			&:before{
				content: '';
				display: block;
				width: 8rpx;
				height: 30rpx;
				background: #2D81FF;
				margin-right: 10rpx;
			}
		}
		.sq_time{
			font-size: 28rpx;
			color: #333;
			margin-top: 20rpx;
		}
		.sq_time1{
			margin-top: 20rpx;
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-size: 26rpx;
			color: #999;
		}
	}
}
</style>