<template>
<div>

    <common @asynCallBack="asynCallBack"></common>
    <top-header :pageTitle="pageTitle"  :routeName="routeName"  ></top-header>

    <div class="mui-content vongi-spkh-show margin60" v-if="person_popedom.sceneId=='1'">
        <img src="~$project/assets/img/show11.png" />
        <img src="~$project/assets/img/show12.png" />
        <img src="~$project/assets/img/show13.png" />
        <img src="~$project/assets/img/show14.png" />

    </div>
    <div class="mui-content vongi-spkh-show margin60" v-if="person_popedom.sceneId=='2'">
        <img src="~$project/assets/img/show21.png" />
        <img src="~$project/assets/img/show22.png" />
        <img src="~$project/assets/img/show23.png" />
        <img src="~$project/assets/img/show24.png" />

    </div>
    <div class="fyy-footer">
      <div class="bindfyy-btn">
        <button type="submit" class="mui-btn mui-btn-pink"  style="background: #3385FF;border:#3385FF;color: #FFF"   @click="toPay()" v-text="paytext">立即开通</button>
      </div>
    </div>
    <loading :visible="isLoading"></loading>

</div>
</template>


<script>

    import * as API  from '@/apis/Master/live'
    import Common from '$project/components/Common.vue'
    import Loading from '$project/components/Loading.vue'
    import TopHeader from '$project/components/TopHeader.vue'
    import {
        mapGetters,
        mapMutations
    } from 'vuex'
    import {
        currentTimeStamp,
        parseUnixTime
    } from '$project/utils'
    export default {
        name: 'MasterLiveShow',
        components: {
            Common,
            Loading,
            TopHeader
        },
        data() {
            return {
                pageTitle: '产品介绍',
                routeName: "MasterLiveInfo",

                isLoading: false,
                 paytext: "点击购买",
                orderId: null,
                id: this.$route.query.id,

                detail: {
                    order: {},
                    info: null,
                    list: []
                },
            }
        },
        created() {
             //接收参数来实现返回的页面是哪一种
            if (this.$route.query.routeName) {
                this.routeName = this.$route.query.routeName;
            }
        },
        methods:  {

            toPay() {
                this.isLoading = true;

                API.submit({
                    "personId": this.person_data.id,
                    "payPersonId": this.person_data.id,
                    "goodsId":"3",
                }).then(data => {

                    var url = window.location.href.split("#")[0];
                    var param = JSON.stringify(data).replace("{", "").replace("}", "").replace(/\",\"/g, "&").replace(/,\"/g, "&").replace(
                        /:/g, "=").replace(/\":\"/g, "=").replace(/\"/g, "");
                    param = param.replace('=//', '://');
                    window.location = url + "?#/master/live/pay?" + param;

                }).catch(error => {
                    this.isLoading = false;
                    mui.toast(error);
                })


            },asynCallBack(){},
        },
        mounted() {

         },
        destroyed() {

        },
        computed: {
            ...mapGetters({
                openId: 'wx_openid',
                token: 'token',
                person_data: 'person_data',
                person_popedom: 'person_popedom',
            })
        }
    }
</script>

 <style scoped src="$project/assets/css/xpwyfyy.css"></style>
<style src="$project/assets/css/iconfont.css"></style>
<style>
</style>
