<template>
	<view class="success">
		<image src="../static/images/bmcg.png"></image>
		<view class="tip">报名成功</view>
		<view class="tips">您已成功报名该活动，请耐心等待主办方审核。预计1-3个工作日内审核完成，点击“<navigator url="/match/activity/activity" hover-class="none" class="mine">我报名的活动</navigator>”查看结果</view>
		<button open-type="share" class="share">分享活动</button>
		<navigator url="/pages/index/index" open-type="switchTab" hover-class="none" class="backhome">返回首页</navigator>
	</view>
</template>

<script>
const req = require('../../utils/request.js');
const api = require('../../utils/api.js');
const util = require('../../utils/util.js');
const app = getApp();
import mpHtml from "../../components/mp-html/components/mp-html/mp-html";
export default {
	components: {
		mpHtml,
	},
	data() {
		return {
			options: {},
			detail: {}
		};
	},
	onLoad(options) {
		uni.showShareMenu({
			withShareTicket: true,
			menus: ['shareAppMessage', 'shareTimeline']
		});
		this.options = options;
	},
	onShow() {
		this.getData(true);
	},
	onReachBottom: function() {
	},
	onShareAppMessage: function() {
		return {
			title: this.detail.title,
			imageUrl:this.detail.pic,
			path: '/match/activityDetail/activityDetail?id=' + this.detail.id
		};
	},
	onShareTimeline() {
		return {
			title: this.detail.title,
			image: this.detail.pic,
			query: '/match/activityDetail/activityDetail?id=' + this.detail.id
		};
	},
	methods: {
		getData(isShow){
			req.getRequest('/api/match/detail',{id: this.options.id},res => {
				this.detail = res;
				this.isShow = true;
			},isShow);
		},
	}
};
</script>

<style>
	@import "./success.css";
</style>
