<template>
	<view>
		<product ref="product" :index="index" :item="fetch.product" :control="control" :bottom="bottom" v-if="fetch.product.goods_id"></product>
	</view>
</template>

<script>
import product from "@/pages/dream/view/product.vue";
export default{
	data() {
		return {
			id : '',
			table : '',
			code : '',
			index : -1,
			bottom : {},
			control : {},
			fetch : {
				product: {},
			}
		}
	},
	onLoad(option) {
		this.id = option.id;
		this.table = option.table;
		this.code = option.code;
		this.getData();
	},
	// 重新加载
	onPullDownRefresh: function() {
		this.getData();
	},
	onReachBottom : function() {
		this.$refs.product.getData(2);
	},
	methods:{
		getData: function(id, table) {
			this.Dever.get(this, 'app/collection/?l=api.getProductOne', {code:this.code, product_id:this.id, table:this.table});
		},
	},
	components:{
		product
	}
}
</script>

<style>
</style>
