Browse Source

首頁Cookie按鈕增加判斷、fix訂單內容頁複製按鈕

Dev
Janie 2 years ago
parent
commit
79ab608012
  1. 23
      FrontEnd/components/booking/BookingInfo.vue
  2. 40
      FrontEnd/components/home/CookieUnderModal.vue

23
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);
},
};
</script>

40
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);
}
}
}

Loading…
Cancel
Save