<template>
	<view class="page-app theme-light main-green font-1">
		<su-navbar color="var(--ui-BG-Main)" title="详情" statusBar></su-navbar>
		
		<card :order="item"></card>
		
		<s-menu-tools />
		<s-auth-modal />
	</view>
</template>

<script>
	import card from '@/pages/trend/detail/components/card.vue';
	import TrendApi from '@/sheep/api/worker/trend'; 
	import sheep from '@/sheep';
	export default { 
		components: {
			card,
		},
		props: {
			
		},
		data() {
			return {
				id: 0,
				item: {},
			}
		},
		// 分享小程序
		onShareAppMessage(res) {
			return {
				title: this.shareInfo.title,
				path: this.shareInfo.path,
				imageUrl: this.shareInfo.image,
			};
		},
		onShareTimeline() {
			return {
				title: this.shareInfo.title,
				path: this.shareInfo.path,
				imageUrl: this.shareInfo.image,
			}
		},
		onLoad(options) {
			this.id = options.id;
			this.getDetail();
		},
		computed: {
			userInfo: {
			    get() {
			      return sheep.$store('user').userInfo;
			    },
			},
			shareInfo() {
				return sheep.$platform.share.getShareInfo();
			},
		},
		methods: {
			getDetail() {
				TrendApi.getTrend(this.id).then(res => {
					this.item = res.data;
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.page-app {
		background-color: #fff;
		padding-bottom: 140rpx;
		height: calc(100vh);
		padding-bottom: env(safe-area-inset-bottom);
	}
	
</style>