<template>
    <div class="container jfBaseSize" v-cloak style="min-height: 100vh">
        <div class="list">
            <div class="clearfix">
                <p>累计扫码积分</p>
                <p>{{result.TotalRewardJf}}</p>
            </div>
            <div class="clearfix">
                <p>累计核算积分</p>
                <p>{{result.TotalImportJf}}</p>
            </div>
            <div class="clearfix">
                <p>可用积分</p>
                <p>{{result.RemaindExchangeJf}}</p>
            </div>
            <div class="clearfix">
                <p>已用积分</p>
                <p>{{result.HaveExchangeJf}}</p>
            </div>
            <button class="store" @click="goShop">积分商城</button>
          
        </div>
          <ReturnHome ref="returnhome"></ReturnHome>
    </div>
</template>
<script>
    import channelHelper from "@/assets/js/channelHelper";
    import ReturnHome from "@/components/channel/temp001/ReturnHome";
    export default {
        name: "JfCompReg",
        components: {ReturnHome},
        provide(){       
            return{           
                goPage:this.goPage       
            }   
        },
        props: ["comp", "cfg", "selectedPage"],
        data() {
            return {
                result: {
                    //累计扫码积分
                    TotalRewardJf: '',
                    //累计核算积分
                    TotalImportJf: '',
                    //可用积分
                    RemaindExchangeJf: '',
                    //已用积分
                    HaveExchangeJf: ''
                }
            };
        },
        methods: {
            goPage(pagetype){
                this.$parent.changeSelectedPage(pagetype);
            },
            goShop() {
                window.open('/shop?eno=' + this.sup8.context.enterpriseno);
            },
        },
        watch: {},
        mounted() {
            channelHelper.GetKeymanJf({
                EnterpriseNo: this.sup8.context.enterpriseno,
                UserToken: channelHelper.GetUserToken()
            }, (res) => {
                if (res.flag) {
                    this.result = res.data;
                }
            });
        }
    };
</script>
<style scoped>
    .list {
        width: 100%;
    }

    .list > div {
        width: 90%;
        height: 50px;
        line-height: 50px;
        margin: 0 auto;
        border-bottom: 1px solid #c4c4c4;
        color: #333333;
        font-size: 14px;
    }

    .list > div > p:nth-of-type(1) {
        float: left;
    }

    .list > div > p:nth-of-type(2) {
        float: right;
    }

    .store {
        display: block;
        width: 90%;
        background: #3b8afc;
        margin: 40px auto 0;
        height: 40px;
        border: none;
        border-radius: 5px;
        font-size: 16px;
        color: #fff;
        letter-spacing: 2px;
    }

    .clearfix:before {
        content: '';
        display: table;
    }

    .clearfix:after {
        content: '';
        display: table;
        clear: both;
    }
</style>

