<template>
  <q-dialog v-model="isShow" persistent>
    <q-card flat class="light-shadow q-pa-md">
        <q-card-section>
        <div class="text-h6 text-weight-bold">登錄提示</div>
        </q-card-section>
        <q-card-section>
            <div class="text-center">
                <img src="../../assets/img/nonedata/auth.png" width="267">
                <div class="q-mt-lg text-grey-8">
                    你還沒有登錄哦，登錄或註冊後可以享受更多權益
                </div>
            </div>
        </q-card-section>
        <q-card-actions align="right">
            <q-btn flat label="前往註冊" color="primary" class="q-px-lg" @click="goRegist" />
            <q-btn unelevated label="立即登錄" color="primary" class="q-px-lg" @click="goLogin" />
        </q-card-actions>
    </q-card>
  </q-dialog>
  
</template>

<script>
export default {
    data() {
        return {
            isShow:true
        }
    },
    created() {
        try {
            let u = localStorage.getItem("b2bUser")
            if(u){
                u=JSON.parse(u)
                if(u.token){
                    this.isShow=false
                }
            }
        } catch (error) {
            
        }
    },
    methods: {
        goLogin(){
            this.CommonJump('/login', {r:encodeURIComponent(location.href)});
        },
        goRegist(){
            this.CommonJump('/login', {r:encodeURIComponent(location.href),t:1});
        }
    },
}
</script>

<style>

</style>