<template>
	<view class="container">
		<goods-style goodsStyleType="rush2" :goodslistData="goodslist"></goods-style>
	</view>
</template>

<script>
	import App from '@/common/js/app.js'
	import goodsStyle from '@/components/page/pageComponents/goodsStyle.vue'
	export default {
		data() {
			return {
				goodslist: []
			}
		},
		props: {
			goods_type: {
				type: String,
				default: function() {
					return ""
				}
			},
			goods_id: {
				type: String,
				default: function() {
					return ""
				}
			}
		},
		components:{
			goodsStyle
		},
		mounted() {
			this.getRecommendGoods()
		},
		methods: {
			getRecommendGoods() {
				let _this = this;
				App._post_form('&do=getRecommendGoods', {
					type: _this.goods_type,
					id: _this.goods_id
				}, res => {
					_this.setData({
						goodslist: res.data,
					});
					this.$emit('recommendGoodNoOff',res.data);
				}, false, () => {})
			},

			navgateto(goods) {
				let _this = this,
					pages = getCurrentPages(),
					currentPage = pages[pages.length - 1],
					navType = currentPage.route === 'pages/subPages/goods/index' ? 'rediRect' : 'navigate';
				App.navigationTo({
					url: `pages/subPages/goods/index?goods_id=${goods['id']}&goodsType=${goods['type']}`,
					navType: navType
				})
			}
		}
	}
</script>

<style lang="scss" scoped>


</style>
