<template>
	<view v-if="is_data"  :class="['qn-page-' + theme]"><PageDesign :temData="temData" :pageBack="true" :isBackIndex="true"></PageDesign></view>
</template>

<script>
import PageDesign from '@/components/PageDesign/PageDesign.vue';
export default {
	components: {
		PageDesign
	},
	data() {
		return {
			temData: [],
			is_data: false,
			page_id: 18
		};
	},
	watch:{
		 '$store.state.locationObj'(val){
			if(JSON.stringify(val)==='{}'){
				this.getAuthorizeInfo();
				return
			}
			this.getDetailById();
		}
	},
	onLoad(options) {
		if(JSON.stringify(this.$store.state.locationObj)==='{}'){
			this.getAuthorizeInfo();
			return
		}
		this.page_id = parseInt(options.id);
		this.getDetailById();
	},
	// 下拉刷新
	onPullDownRefresh() {
		this.getDetailById();
	},
	methods: {
		//首页
		 getDetailById() {
			this.$u.api.getDetailById(this.page_id).then(({data})=>{
				uni.stopPullDownRefresh();
				this.is_data = true;
				this.temData = data;
			});
		}
	},
	onShareAppMessage(options) {
		return {
			title: this.$store.state.baseSet.shop,
			path: '/pages/index/index?businessmanId=' + (this.$store.state.userStatus.id||''),
			success: res => {
				console.log(res);
			}
		};
	}
};
</script>

<style></style>
