diff --git a/FrontEnd/components/booking/BookingInfo.vue b/FrontEnd/components/booking/BookingInfo.vue index 5786237..9ae78c0 100644 --- a/FrontEnd/components/booking/BookingInfo.vue +++ b/FrontEnd/components/booking/BookingInfo.vue @@ -122,21 +122,22 @@ import { runInThisContext } from 'vm'; mybookingStatusMap, mypaymentStatusMap, bookingColor, - copyEvent(id) { - var str = document.getElementById(id); - window.getSelection().selectAllChildren(str); - document.execCommand("Copy") - }, + // copyEvent(id) { + // var str = document.getElementById(id); + // window.getSelection().selectAllChildren(str); + // document.execCommand("Copy") + // }, async copy(copyText){ - if (navigator.clipboard == undefined) { - console.log('clipboard is undefined'); - }else{ - window.navigator.clipboard.writeText(copyText); - } + window.navigator.clipboard.writeText(copyText); + // if (navigator.clipboard == undefined) { + // console.log('clipboard is undefined'); + // }else{ + // window.navigator.clipboard.writeText(copyText); + // } } }, updated() { - console.log(this.BookingOrder); + //console.log(this.BookingOrder); }, }; diff --git a/FrontEnd/components/home/CookieUnderModal.vue b/FrontEnd/components/home/CookieUnderModal.vue index 5d32829..65c8401 100644 --- a/FrontEnd/components/home/CookieUnderModal.vue +++ b/FrontEnd/components/home/CookieUnderModal.vue @@ -145,18 +145,46 @@ export default { }; }, created(){ - if(process.client){ - let storeCache = this.$cookies.get("storeCache"); - if(storeCache!=undefined){ - this.isCookieHasBeenClicked = JSON.parse(storeCache); + //this.$cookies.set("storeCache",JSON.stringify(true),1); //一開始先設cookie為顯示 + if(process.client){ //若是在client端 + let storeCache = this.$cookies.get("storeCache"); //取storeCache(false) 有顯示 + if(storeCache == undefined){ + this.isCookieHasBeenClicked = true; } + if(storeCache == true){ + this.isCookieHasBeenClicked = false; + }else{ + this.isCookieHasBeenClicked = true; + } + // if(storeCache == undefined){ // + // this.$cookies.set("storeCache",JSON.stringify(true),1); + + // }else if(storeCache == false){ + // this.$cookies.set("storeCache",JSON.stringify(true),1); + + // }else{ + // this.isCookieHasBeenClicked = JSON.parse(storeCache); + // } + + // if(storeCache != undefined){ + // this.isCookieHasBeenClicked = JSON.parse(storeCache); + // } } }, + watch: { + isCookieHasBeenClicked: { + handler: function () { + if(this.isCookieHasBeenClicked == false){ + this.$cookies.set("storeCache",JSON.stringify(true), 1); + } + }, + }, + }, methods:{ closeCookie(){ - if(process.client){ + console.log(process.client ? true : false); + if(process.client){ //在client端的時候 this.isCookieHasBeenClicked = false; - this.$cookies.set("storeCache",JSON.stringify(false),1); } } }