<template>
	<view class="good-page">
		<scroll-view
			class='box-at-home'
			scroll-y="true" 
			refresher-default-style="none"
			@scrolltoupper="toupperTop"
			@scrolltolower="lowerMore">
				<view class='main-box'>
					<view class='box-item' v-for="item in goodsList" :key="item.id" @click="goDetail">
						<view class='item-top'>
							<image :src="item.goodsImage" class='top-img'></image>
							<i class='top-icon'></i>
						</view>
						<view class='item-footer'>
							<view class='footer-des'>{{item.goodsName}}</view>
							<view class='footer-box'>
								<view class='box-num'>
									<view class='num-icon'>¥</view>
									{{item.goodsMoney}}
								</view>
								<view class='box-btn'>可置换</view>
							</view>
							<view class="box-last">100次浏览</view>
						</view>
					</view>
					
				</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
			name:"goodsItem",
			props:{
				goodList:Array,
			},
			data() {
				return {
					
				};
			},
			methods:{
				goDetail:function(item){
					this.Go('uni:/pages/productDetails/productDetails')
					// const {productId}=item
					// this.Go(`uni:/pages/details/details?productId=${productId}`)
					console.log(item,'9655666')
					// this.$emit('godetails', item);
				},
				toupperTop:function(e){
					console.log(e,'到顶了');
				},
				lowerMore:function(e){
					console.log(e,'触底了');
					if(!this.hasNextPage){
						uni.showToast({
							icon: 'none',
							title: '到底了',
						})
						return false;
					} 
					if(this.loadFlag) return;
					this.loadFlag=true,
					this.pageNum=this.pageNum+1
					// this.init();
				},
			}
		}
</script>

<style src='./index.less' lang="less" scoped></style>