<template>
	<view class="centent">
		<view class="main-top">
			<image :src="$getimg('jq-bg.jpg')" mode="" class="top-pos"></image>
		</view>
		<view class="main">
			<view class="mainlist">
				<view class="libox" v-for="(el, ind) in zslist" @click="$getpage('./public?id='+el.id)">
					<view class="liboxtop"
						:style="{background:el.typeImg == '' || el.typeImg == null? 'url(https://cs.tour-ma.com/r/cms/www/m/changshu/noimg.png) center no-repeat' : 'url(' + $geturl(el.typeImg) + ') center no-repeat'}">
					</view>
					<view class="liboxbot">
						<view class="name">{{ el.title}}</view>
						<!-- <view class="title1 text_overflow_2" v-html="el.txt"></view> -->
						
					</view>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	var web = require('@/components/utils/request.js');
	import back from '@/components/html/back.vue';
	export default {
		components: {
			back
		},
		data() {
			return {
				id: 93, //节庆活动
				info: {
					color: true
				},
				istop: false,
				nowdata: {},
				zslist: [],
				first: 0,
				count: 50,
				xwwfind: 0,
				
			}
		},
		onReachBottom() {
			this.first += 50;
			this.getDatalist();
		},
		onPageScroll(e) {
			if (e.scrollTop > this.lmtop) {
				this.istop = true;
			}
			if (e.scrollTop < this.lmtop) {
				this.istop = false;
			}
		},
		
		mounted() {
			this.getData();
			this.getDatalist();
		},
		methods: {
			ckxwwfind(ind) {
				this.xwwfind = ind;
				 this.getDatalist();
			},
			navto(id) {
				uni.navigateTo({
					url: url
				})
			},
			getData() {
				var url = '/json/channel_get.jspx?id=' + this.id;
				var para = {};
				var that = this;
				web.httpGejqr(that, url, para, function(res) {
					if (res.statusCode == 200) {
						that.nowdata = res.data;
					} else {
						uni.showToast({
							title: '查询失败'
						});
					}
				})
			},
			getDatalist() {
				uni.showToast({
					title: '加载中...',
					icon: "loading",
					duration: 100000
				});
				var url = '/json/content_list.jspx?channelIds=' + this.id + '&first=' + this.first + '&count=' + this
					.count;
				var para = {};
				var that = this;
				web.httpGejqr(that, url, para, function(res) {
					uni.hideToast();
					if (res.statusCode == 200) {
						if (res.data.length == 0) {
							return
						}
						var json = [];
						that.zslist=[];
						 json=res.data;
							for (var i = 0; i < json.length; i++) {
								that.zslist.push(json[i]);
							}
					} else {
						uni.showToast({
							title: '查询失败'
						});
					}
				})
			},
			toOther() {
				uni.navigateToMiniProgram({
					appId: 'wx8ece732cc3a87e0f',
					path: 'pages/index/index',
					envVersion: 'release',
					extraData: {},
					success(res) {
						console.log("chenggong");
					},
					fail(e) {
						console.log(e);
					}
				})
			}

		}
	}
</script>

<style lang="scss">
	.centent {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		width: 750upx;
		overflow-y: scroll;
		position: relative;
		background: #F5F5F5;
		// background: #274B6D;

		.main-top {
			width: 750rpx;
			height: 330rpx;
			position: relative;
		
			.top-pos {
				width: 100%;
				height: 100%;
			}
		
		}

		.follm {
			position: absolute;
			left: 0rpx;
			top: 14rpx;
		}

		.toplm {
			position: fixed;
			top: 0;
			left: 0;
			background: #F2F2F2;
			height: 80rpx;
			z-index: 9;
		}

		
		
		.main {
			padding: 4% 4%;
		}


		.mainlist .libox {
			margin-bottom: 7%;
			// border-radius: 20upx;
			overflow: hidden;
			// box-shadow: 0upx 0upx 15upx 10upx #eee;
			background: #fff;
		}

		.libox .name {
			color: #333333;
			font-weight: 500;
			font-size: 38upx;
			display: flex;
			align-items: center;
			padding: 28rpx;
			justify-content: center;
		}


		.libox .liboxtop {
			width: 100%;
			height: 370upx;
			position: relative;
			background-size: 100% 100%;
			object-fit: cover;
			margin: 0rpx auto ;
			// border-radius: 14rpx;
		}

		.liboxtop .xing {
			position: absolute;
			top: 15upx;
			left: 35upx;
			overflow: hidden;
		}

		.liboxtop .xing .img {
			width: 148upx;
			height: 26upx;
		}


		.liboxbot .title1 {
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 400;
			opacity: 0.8;
			margin: 28rpx;
		}

	


	}
</style>
