<template>
	<view>
		<Nav title="列表组件演示"></Nav>
		<pagingList ref="likeGoodsList" @getList="getGoodsList">
      <template v-slot:listInfo="{pagingData}">
        <view v-for="item in pagingData">
          <view>商品名称：{{item.good_name}}</view>
          <view>商品价格：{{item.price}}</view>
          <view>商品原价：{{item.original_price}}</view>
          <view>------------------------------------</view>
        </view>
      </template>
    </pagingList>
	</view>
</template>

<script>
	import Black from '@/components/en-utils/en-blank/en-blank'
	import pagingList from '@/components/en-list/en-list'
  import {likeGoods} from "@/api/goods";

	export default {
		components:{
			Black,
      pagingList,
		},
    methods:{
      getGoodsList(page){
          likeGoods({'page':page}).then((res)=>{
            if(res.code===1){
              this.$refs.likeGoodsList.setList(res.data.list,res.data.total)
            }
          })
      }
    }
	}
</script>

<style scoped lang="scss">

</style>
