<template>
	<view class="se-p-20">
		<view class="se-p-20 se-bgc-white se-br-20 se-mb-20" v-for="(items,indexs) in list" :key="indexs" @click="onDetail(items)">
			<view class="se-flex se-flex-h">
				<image class="se-a-80 se-br-p-50 se-w-80" style="min-width: 80rpx;" :src="items.image" mode="aspectFill"></image>
				<view class="se-flex se-flex-v se-ml-30">
					<text class="se-fs-28 se-c-black">{{items.title}}</text>
					<view class="se-flex se-flex-ai-c se-pt-10">
						<text class="se-c-red se-fs-30 se-fw-6">{{items.price}}元</text>
						<text class="se-c-66 se-fs-22 se-ml-20">{{items.address}}</text>
					</view>
				</view>
			</view>
			<view class="se-c-black se-fs-26 se-lh-40 se-pt-20">
				<!-- 三层复试，中空挑高，厅出大阳台，使用率超高，天越翔园 {{items.title}}-->
				<uv-parse :content="items.details"></uv-parse>
			</view>
			<view class="se-br-10 se-py-20">
				<image class="se-br-10 se-w-p-100 se-h-360" :src="items.image" mode=""></image>
				<!-- <video class="se-br-10 se-w-p-100 se-h-360" src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4" controls></video> -->
			</view>
			<!-- <view class="se-bgc-f5 se-br-10 se-py-20 se-px-10 se-c-black se-fs-24 se-flex se-flex-ai-c">
				<image class="se-a-30 se-br-p-50" src="../../static/image/6588.png" mode=""></image>
				<text class="se-ml-10 se-fw-6">程敏</text>
			</view> -->
		</view>
		<view class="se-pos-fixed se-pos-rc" style="right: 30rpx;">
			<image @click="onNavigator()" class="se-a-150" src="@/static/image/discover.png" mode=""></image>
		</view>
	</view>
</template>

<script>
	import { commonIndexFindPageList,commonIndexFindDetail,getInfo } from "@/common/api.js"
	export default{
		data(){
			return{
				classId:null,
				pageNo:1,
				pageSize:10,
				list:[]
			}
		},
		mounted() {
			this.onCommonIndexFindPageList()
		},
		onPullDownRefresh() {
			let that = this
			that.pageNo =  1
			that.list = []
			that.onCommonIndexFindPageList()
		},
		onReachBottom() {
			let that = this
			that.pageNo = that.pageNo + 1
			that.onCommonIndexFindPageList()
		},
		methods:{
			onDetail(event){
				uni.navigateTo({
					url:"/pages/discover-detail/index?id="+event.id
				})
			},
			onNavigator(){
				let token =  uni.getStorageSync('token');
				if(!token){
					uni.navigateTo({
						url:"/pages/auth/index"
					})
					return ;
				}
				getInfo({}).then(result=>{
					uni.navigateTo({
						url:"/pages_subpack/release/index"
					})
				}).catch(err=>{
					
				})
			},
			onCommonIndexFindPageList(){
				let that = this
				let params={
					classId:that.classId,
					pageNo:that.pageNo,
					pageSize:that.pageSize
				}
				commonIndexFindPageList(params).then((response) => {
					console.info("responseindexsindexsindexs",response.result.records)
					
					console.info('response.resultindexsindexsindexs',response.result.records)
					that.list = that.list.concat(response.result.records) 
				}).catch((error) =>{
					
				})
			},
		}
	}
</script>

<style>
	page{
		background-color: #f5f5f5;
	}
</style>