<template>
    <view>
        <page ref="list" />
    </view>
</template>

<script>
import page from "./modules/page.vue";
export default {
    components: { page },
    data() {
        return {
            id: "",
            detail: {}
        }
    },
    onLoad(options) {
        if (options.id) {
            this.id = options.id - 0;
            setTimeout(() => {
                this.$refs.list.getDetail(this.id).then(detail => {
                    this.detail = detail;
                })
            }, 100)
        }
    },

    methods: {
        getSheraDate() {
            let detail = this.detail
            return {
                title: detail.title, // 标题
                path: "/packageA/advertising/shareable?id=" + detail.sat_sharematerialid, // 分享路径
                imageUrl: this.detail.attinfos.find(v => v.usetype == "avatar").url || ""// 分享图
            };
        }
    },
    onShareAppMessage(res) {
        return this.getSheraDate()
    },
    onShareTimeline() {
        return this.getSheraDate()
    }
}
</script>

<style></style>