<template>
	<view class="dropshipping">
		<view class="searchTop">
			<u-search placeholder="搜索商品" shape="round" height="56rpx" style="width: 270rpx;" :showAction="false" ></u-search>
			<view :class="['filter-item',{act:activeId === item.value}]" v-for="item in filterList" :key="item.value" @clear="getData" @click="filterClick(item)" >
				<text class="filter-name">{{item.name}}</text>
				<u-icon name="arrow-down-fill" size="10"></u-icon>
			</view>
		</view>
		<mescroll-body @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
		<view class="detail">
			<view class="goodsBox"v-for="(item,index) in 10">
				<image src="https://wx1.sinaimg.cn/large/006zUvE2gy1hs8ubk0i3ij30iu0iu40b.jpg" mode="scaleToFill"></image>
				<text class="goodsName">商品名称</text>
				<view class="bottom">
					<text class="goodsPrice">0.60</text>
					<text class="sales">销量470,000+</text>
				</view>
			</view>
		</view>	
		</mescroll-body> 
	</view>
</template>

<script>
	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
	export default {
		mixins: [MescrollMixin], //使用mixin
		data(){
			return{
				searchKeyword:"",
				filterList:[
					{name:"综合",value:0},
					{name:"价格",value:1},
					{name:"筛选",value:2},
				],
				activeId:0,
				dataList:[],
				searchForm: {
					//页码
					pageNum: 1,
					//每页多少条
					pageSize: 4,
					// 筛选 1 综合 2销量  es修改后只使用于物料
					sortType: 1,
					// 商品名称
					goodsName:'',
					// 店铺id
					flagshipShopId: '1',
					// 最低价格
					bottomPrice:'',
					// 最高价格
					topPrice:'',
					// 价格排序
					priceOrderFlag:'',
				},
				scrollTop: 636,
			}
		},
		methods:{
			filterClick(item){
				this.activeId = item.value
			},
			upCallback(page){
				let pageNum = page.num;
				let pageSize = page.size;
				
			}
		}
	}
</script>

<style lang="scss">
	.dropshipping{
		min-height: 100vh;
		background: #FFFFFF;
		border-radius: 20rpx 20rpx 0rpx 0rpx;
		
		.searchTop{
			width: 750rpx;
			height: 92rpx;
			display: flex;
			align-items: center;
			box-sizing: border-box;
			padding: 36rpx;
			.filter-item{
				width: 124rpx;
				height: 56rpx;
				border-radius: 12rpx;
				background: #F8FAFB;
				font-size: 28rpx;
				color: #868A9B;
				display: flex;
				justify-content: space-between;
				align-items: center;
				box-sizing: border-box;
				padding: 0 18rpx;
				margin-left: 8rpx ;
				&.act{
					color: #222222;
					background: #EDEEEF;
					font-weight: 600;
				}
			}
		}
		.detail{
			padding: 8rpx 36rpx 0 36rpx;
			display: flex;
			justify-content: space-around;
			flex-wrap: wrap;
		}
		.goodsBox{
			width: 328rpx;
			height: 422rpx;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			margin-bottom: 22rpx;
			box-sizing: border-box;
			>image{
				width: 328rpx;
				height: 320rpx;
				
			}
			.goodsName{
				font-weight: 500;
				font-size: 32rpx;
				box-sizing: border-box;
			}
			.bottom{
				height: 42rpx;
				position: relative;
				box-sizing: border-box;
				.goodsPrice{
					font-family: OPPOSans, OPPOSans;
					font-weight: bold;
					font-size: 32rpx;
					color: #FF0000;
					position: absolute;
					left: 0;
					bottom: 0;
					&::before{
						content: "¥";
						font-size: 24rpx;
						color: #FF3C26;
					}
				}
				.sales{
					font-weight: 400;
					font-size: 24rpx;
					color: #666666;
					position: absolute;
					right: 0;
					bottom: 0;
				}
			}
			
		}
	}
</style>