<template>
	<view>
		<view class="list">
			<view class="search">
				<u-search placeholder="搜索商品名称" v-model="param.customerName" @search="refresh()" :animation="true" actionText="取消" @clear="refresh()"></u-search>
			</view>
			<view class="item">
				<view class="title">广西京东自营店南宁分店</view>
				<image src="../../static/news.jpg" mode="widthFix" class="pic"></image>
				<view class="con">
					<view class="productName">八角茴香（未磨）（可食用）</view>
					<view class="spec">50吨</view>
					<view class="price">￥50000</view>
					<view class=""></view>
				</view>
			</view>
		</view>
		<view class="mfooter">
			<view class="flex">
				<view class="f"><button class="btn" @click="save()">市场</button></view>
				<view class="f"><button class="btn" @click="save()">购物车</button></view>
				<view class="f"><button class="btn" @click="save()">订单列表</button></view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			list: [],
			param: { pageNum: 1, pageSize: 10, orderByColumn: 'createTime', isAsc: 'desc' },
			loadMore: true
		};
	},
	onLoad(e) {
		//this.getData();
	},
	methods: {
		getData() {
			this.http.request({
				url: this.http.urls.help_list,
				data: this.param,
				loading: 'false',
				success: res => {
					this.loadMore = res.data.pages > this.param.pageNum ? true : false;
				}
			});
		},
		detail(item) {
			uni.navigateTo({
				url: '/pages/help/detail?id=' + item.id
			});
		},
		//刷新数据
		refresh() {
			this.loadMore = true;
			this.param.pageNum = 1;
			this.list = [];
			this.getData();
		}
	},
	//下拉刷新
	onPullDownRefresh() {
		setTimeout(() => {
			this.refresh();
			uni.stopPullDownRefresh();
		}, 1000);
	},
	//上拉加载
	onReachBottom() {
		if (this.loadMore) {
			this.param.pageNum++;
			this.getData();
		}
	}
};
</script>

<style>
.list {
	padding: 10px;
	.item {
	}
}
</style>
