
<template>

    <div class="black-content" show="{{showbanner}}">
        <image src="https://page-cdn.jlsm.yuedu888.cn/public/guide_5214512.gif" @click="share"></image>
    </div>

</template>
<script>

import share from '@service.share';
import { hex_md5 } from "../../api/md5";
import prompt from '@system.prompt'
export default {
    public: {
        callback_url: '',
        sign: ""
    },
    protected: {
        key: 'GmrcN1iO2fSxnlK0',
        showbanner: false,
    },
    computed: {

    },
    onInit() {
        setTimeout(() => {
            let url = `${encodeURIComponent(decodeURIComponent(this.callback_url))}&key=${this.key}`;
            let signs = hex_md5(url);
            if (signs == this.sign) {
                this.showbanner = true;
                this.share();
            } else {
                setTimeout(() => {
                    prompt.showToast({
                        message: '参数错误'
                    })
                }, 3000)

            }
        }, 1000)
    },

    share() {
        share.share({
            shareType: 0,
            title: '->点此关注公众号继续阅读哦<-',
            summary: '->点此关注公众号继续阅读哦<-',
            imagePath: 'https://page-cdn.jlsm.yuedu888.cn/public/read_ke4Exyr1YpRtNXU6.jpeg',
            targetUrl: this.callback_url,
            platforms: ['WEIXIN_CIRCLE'],
            success: function (data) {
                console.log('handling success')
            },
            fail: function (data, code) {
                console.log(`handling fail, failMess=${data},code=${code}`)
            }
        })
    },


}
</script>
<style lang="less">
.black-content {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  image {
    width: 600px;
  }
}
</style>


