PageSourceSearch

https://tholiday.thsrc.com.tw/_nuxt/7OBXbFH2.js

js thsrc.com.tw collected 2026-10-01 10:27:26 UTC 5,606 bytes, 1 lines download raw bytes

1import{_ as N}from"./9UgEpUU5.js";import{_ as v}from"./E8aAkRUs.js";import{_ as U}from"./Bkc_N48g.js";import{_ as Y}from"./BCA-upJL.js";import{_ as F}from"./CEYDrOBe.js";import{_ as $}from"./CgG5gLEW.js";import{_ as w,Z as O,G as P,ap as T,B,E as f}from"./GUc3Dg8m.js";import Q from"./DM3qQ3n8.js";import V from"./Ceyy6F1X.js";import{s as j}from"./BZulFkc9.js";import{d as G}from"./B8eWkC2M.js";import{u as D}from"./CiHrMODY.js";import{M as g,N as L,W as I,F as r,H as i,G as c,L as k,_ as p,P as m,a8 as b}from"./DNhs_Rnl.js";import"./CbTTm0nf.js";import"./B6BsBu6P.js";const E="人氣",S={PRICE:"主題頁-Sort-Price-BTN",STATION:"主題頁-Sort-地區排序-BTN"},q=G({mixins:[j],components:{IconSortAsc:Q,IconSortDesc:V},data:()=>({theme:{title:"",products:[],metaTitle:null,metaDescription:null,bannerImage:null},isFetching:!0}),async asyncData({$resources:t,$404:e,$router:n}){let o,u;const R=n.currentRoute.value.params.slug,C=([o,u]=B(()=>t.products.themes.list()),o=await o,u(),o);try{const{id:a}=C.find(y=>y.slug===R);if(!a)throw new Error("Product theme not founds");const s=([o,u]=B(()=>t.products.themes.show({id:a})),o=await o,u(),o),_=s.metaTitle||s.title||"",d=s.metaDescription||s.description||"",h=(s==null?void 0:s.bannerImage)||"";return D({title:_,meta:[{name:"description",content:d},{property:"og:site_name",content:"高鐵假期"},{property:"og:title",content:_},{property:"og:description",content:d},{property:"og:image",content:h}]}),{isFetching:!1,theme:s}}catch(a){console.log(a),e()}},computed:{normalProducts(){return this.theme.products.filter(({tag:t})=>t!==E)},popularProducts(){return this.theme.products.filter(({tag:t})=>t===E)},products(){return{popularProducts:this.popularProducts,normalProducts:this.normalProducts}},productsSortByPrice(){const t={};return Object.keys(this.products).forEach(e=>{t[e]=P(T(this.products[e]),"price")}),t},productsSortByDestination(){const t={};return Object.keys(this.products).forEach(e=>{t[e]=P(T(this.products[e]),n=>Number(n.destination.id))}),t},sortedProducts(){let t={};switch(this.sortByFromQuery){case this.PRODUCT_SORT_BY.STATION_DESC:t=O(this.productsSortByDestination,e=>f(T(e)));break;case this.PRODUCT_SORT_BY.STATION_ASC:t=this.productsSortByDestination;break;case this.PRODUCT_SORT_BY.PRICE_DESC:t=O(this.productsSortByPrice,e=>f(T(e)));break;default:t=this.productsSortByPrice;break}return[...t.popularProducts,...t.normalProducts]},trackInfo(){return{[this.PRODUCT_SORT_BY.STATION_DESC]:{event:S.STATION,label:"從南到北"},[this.PRODUCT_SORT_BY.STATION_ASC]:{event:S.STATION,label:"從北到南"},[this.PRODUCT_SORT_BY.PRICE_DESC]:{event:S.PRICE,label:"價格高到低"},[this.PRODUCT_SORT_BY.PRICE_ASC]:{event:S.PRICE,label:"價格低到高"}}}},methods:{changeSortBy(t){if(t===this.sortByFromQuery)return;this.track(t);const e=this.$router.currentRoute.query;this.$router.replace({query:{...e,sort:t}})},track(t){const{event:e,label:n}=this.trackInfo[t];this.$analytics.track({event:e,label:n})},trackProduct(t){this.$analytics.track({event:"主題頁-行程",label:t})}},mounted(){var t;if(this.theme){const e=this.theme.metaTitle||this.theme.title||"",n=this.theme.metaDescription||this.theme.description||"",o=((t=this.theme)==null?void 0:t.bannerImage)||"";D({title:e,meta:[{name:"description",content:n},{property:"og:site_name",content:"高鐵假期"},{property:"og:title",content:e},{property:"og:description",content:n},{property:"og:image",content:o}]})}}},"$Cze3RZiN1n"),z={class:"mb-6 md:mb-20"},H={key:1,class:"flex space-x-2 mb-4 md:justify-end"},Z={class:"grid gap-4 md:grid-cols-2 md:gap-x-6 lg:grid-cols-3"},J={key:0,class:"lg:grid lg:grid-cols-12 lg:gap-6"},K={class:"lg:col-span-10 lg:col-start-2"};function M(t,e,n,o,u,R){const C=N,a=I("icon-sort-desc"),s=I("icon-sort-asc"),_=v,d=U,h=Y,y=F,A=$;return r(),g(A,{"page-data":t.theme,"is-fetching":t.isFetching},{default:L(()=>[i("div",z,[t.isFetching?(r(),g(C,{key:0,class:"mb-4"})):(r(),c("div",H,[i("button",{class:k(["btn btn-outline flex-grow md:flex-grow-0",{active:[t.PRODUCT_SORT_BY.PRICE_ASC,t.PRODUCT_SORT_BY.PRICE_DESC].includes(t.sortByFromQuery)}]),onClick:e[0]||(e[0]=l=>t.changeSortBy(t.sortByFromQuery===t.PRODUCT_SORT_BY.PRICE_ASC?t.PRODUCT_SORT_BY.PRICE_DESC:t.PRODUCT_SORT_BY.PRICE_ASC))},[t.sortByFromQuery===t.PRODUCT_SORT_BY.PRICE_DESC?(r(),c(p,{key:0},[e[2]||(e[2]=i("span",null,"價格高到低",-1)),m(a,{class:"ml-2 -mr-3"})],64)):(r(),c(p,{key:1},[e[3]||(e[3]=i("span",null,"價格低到高",-1)),m(s,{class:"ml-2 -mr-3"})],64))],2),i("button",{class:k(["btn btn-outline flex-grow md:flex-grow-0",{active:[t.PRODUCT_SORT_BY.STATION_ASC,t.PRODUCT_SORT_BY.STATION_DESC].includes(t.sortByFromQuery)}]),onClick:e[1]||(e[1]=l=>t.changeSortBy(t.sortByFromQuery===t.PRODUCT_SORT_BY.STATION_ASC?t.PRODUCT_SORT_BY.STATION_DESC:t.PRODUCT_SORT_BY.STATION_ASC))},[t.sortByFromQuery===t.PRODUCT_SORT_BY.STATION_DESC?(r(),c(p,{key:0},[e[4]||(e[4]=i("span",null,"從南到北",-1)),m(a,{class:"ml-2 -mr-3"})],64)):(r(),c(p,{key:1},[e[5]||(e[5]=i("span",null,"從北到南",-1)),m(s,{class:"ml-2 -mr-3"})],64))],2)])),i("div",Z,[t.isFetching?(r(),c(p,{key:0},b(3,l=>m(_,{key:l})),64)):(r(!0),c(p,{key:1},b(t.sortedProducts,l=>(r(),g(d,{key:l.id,product:l,onClick:W=>t.trackProduct(l.title)},null,8,["product","onClick"]))),128))])]),(r(),c("div",J,[i("div",K,[m(h,{title:"注意事項",class:"notice-title mb-5 md:mb-10"}),m(y,{class:"p-4 bg-gray-lighter md:p-8",content:t.theme.notice},null,8,["content"])])]))]),_:1},8,["page-data","is-fetching"])}const dt=w(q,[["render",M],["__scopeId","data-v-9346bdfe"]]);export{dt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.