<template>
	<view>
		<diyC ref="diy" v-if="isDiy" @pullResh="pullResh"></diyC>
	</view>
</template>

<script>
import diyC from './diy/index_mall.vue'
export default {
	data() {
		return {
			isDiy: uni.getStorageSync('is_diy'),
			shareInfo: {}
		}
	},
	components: {
		diyC
	},
	onShow() {
		uni.$on('is_diy', (data) => {
			this.isDiy = data
		})
	},
	onHide() {
		// this.isDiy = -1
	},
	onPullDownRefresh() {
		this.$refs.diy.pullResh();
		// uni.stopPullDownRefresh()
	},
	methods: {
	},
	// onReachBottom: function() {
	// 	if (this.isDiy) {
	// 		this.$refs.diy.onsollBotton()
	// 	}
	// },
	//#ifdef MP
	//发送给朋友
	onShareAppMessage: function (option) {
		console.log(option)
		let groupon = option.target.dataset.groupon;
		let userInfo = this.$Cache.get("USER_INFO", true)
		let that = this;
		return {
			title: groupon.mainTitle,
			imageUrl: groupon.slideshow[0],
			path: `/pages/groupbuying_details/index?id=${groupon.id}&selfTakeId=${that.selfTakeId}&organizerUserId=${that.organizerUserId}&inviteUserId=${userInfo.userId}`,
			success(res) {
				uni.showToast({
					title: '分享成功'
				})
			},
			fail(res) {
				uni.showToast({
					title: '分享失败',
					icon: 'none'
				})
			}
		};
	},
	//分享到朋友圈
	// onShareTimeline() {
	// 	return {
	// 		title: this.shareInfo.title,
	// 		imageUrl: this.shareInfo.img,
	// 	};
	// },
	//#endif
}
</script>

<style></style>
