<template>
    <view>
        <sudoku ref="sudoku" :sa_awardid="sa_awardid" :shareuserid="shareuserid" />
    </view>
</template>

<script>
import sudoku from "./modules/sudoku"
export default {
    components: { sudoku },
    data() {
        return {
            sa_awardid: 0,
            shareuserid: 0,
            detail: {},
        }
    },
    onLoad(options) {
        console.log("options", options)
        this.sa_awardid = options.sa_awardid || 0;
        this.shareuserid = options.userid || 0;
        uni.setNavigationBarTitle({
            title: '活动抽奖'
        });
    },
    onShow() {
        this.$Http.basic({
            "id": 20240514101502,
            "content": {
                "sa_awardid": this.sa_awardid,
            }
        }).then(res => {
            console.log("抽奖详情", res)
            if (this.cutoff(res.msg)) return;
            this.detail = res.data;
            this.$refs.sudoku.init();
        })
    }, methods: {
        getSheraDate() {
            let detail = this.detail;;
            return {
                title: detail.name, // 标题
                path: "/store/lottery/shareable?sa_awardid=" + detail.sa_awardid + '&shareuserid=' + uni.getStorageSync('userMsg').userid, // 分享路径
                imageUrl: ""// 分享图
            };
        }
    },
    onShareAppMessage() {
        return this.getSheraDate()
    },
    onShareTimeline() {
        return this.getSheraDate()
    }
}
</script>

<style lang="scss" scoped></style>