<style lang="scss">
	.order-item{
		background: #fff;
		margin-top: 10px;
		padding: 20px;
		
		.info{
			width: 100%;
			.img{
				image{width: 83px;height: 83px;border-radius: 20rpx;}
			}
			.inner{
				width: calc(100% - 93px);
				margin-left: 10px;
				.title{
					font-size: 14px;
					    color: #4f4f4f;
				}
				.auction{
					margin-top: 5px;
					font-size: 14px;
					color: #9d9d9d;
				}
				.price{
					margin-top: 15px;
					display: inline;
					font-size: 18px;
					color: #fd3938;
				}
			}
		}
		
		.info2{
			padding: 5px 11px;
			background-color: #fff;
			.l1{
				margin-top: 10px;
				font-size: 14px;
			}
		}
	}  
</style>
<template>
	<view  class="app">
		<view class="order-item fx-r" v-for="item in data">
			<view class="info fx-r">
				<view class="img">
					<image :src="item.image" mode="aspectFill"></image>
				</view>
				<view class="inner">
					<view class="title">{{ item.name }}</view>
					<view class="auction">所属场次：{{ item.nickname }}</view>
					<view class="price">￥{{ item.price }}</view>
				</view>
			</view>
			<view class="info2">
				<view class="l1">挂售价格：{{ item.hanging_price }}</view>
				<view class="l1">挂售时间：{{ item.update_time }}</view>
			</view>
		</view>
		
		<view class="loading fx-r fx-ac fx-bc" v-if="!page.isFoot">
			<image src="/static/img/xloading.png"></image>
			<text>正在载入更多...</text>
		</view>
		<view class="loading complete" :hidden="!page.isFoot">已加载全部</view>
	</view>
</template>


<script>
	import {mapState,mapMutations } from 'vuex'
	var cateId = 0;
	var brandId = 0;
	var activeId = "";//限时抢购rush,秒杀专场seckill
	var is_rush = 0;//
	var type = "";
	export default {
	    data() {
	        return {
				data : [],
				page:{
					page:1,
					isLoad:false,
					isFoot:false
				}
	        }
	    },
		/**
		 * 跳转的值
		 * @param {Object} option
		 */
		onLoad(option){
			this.getData(true);
		},
		
		onReachBottom() {
			if(this.page.isFoot || this.page.isLoad) {
				return;
			}
			this.page.page ++;
			this.getData();
		},
		
	    methods: {
			/**
			   * 获取get数据
			*/
			getData:function(isPull = false){
					if (this.page.isLoad) return;
					this.page.isLoad = true;
					if (isPull) {
						uni.showLoading({	title: '获取数据中..'});
					}
					var post = {};
					post.page = this.page.page;
					this
						.request
						.post("auctionMyPro",post)
						.then(res => {
							uni.hideLoading();
							
							uni.hideLoading();
							if (isPull) {
								this.data = res.data.list;
								uni.stopPullDownRefresh();
							} else {
								this.data = this.data.concat(res.data.list);
							}
							this.page.isLoad = false;
							//是否到底
							if (res.data.list.length != res.data.pageSize) {
								this.page.isFoot = true;
							}
							
						})
						.catch(res=>{
							console.log(res);
							uni.hideLoading();
							uni.showModal({title: '系统提示',content: '加载失败，重新点击尝试！',showCancel: false});
						});
				}
	    }
	}
</script>
