PageSourceSearch

https://www.tkbgo.com.tw/tkbgo/toBookDetail.C98UsnNF.js

js tkbgo.com.tw collected 2026-10-05 11:45:17 UTC 15,786 bytes, 1 lines download raw bytes

1import{E as Se}from"./el-input-number.BP1-IugT.js";import{y as Ce,_ as Ue,B as Ie,p as Te,c as ne,G as Pe,F as Ae,u as Le,C as Ne,v as Ee,d as ie,b as M,H as K,q as I,I as Me}from"./entry.CGgvWIq9.js";import{d as re}from"./delay.2S0BUUWF.js";import{f as te}from"./formattedNumber.GbaUbX0a.js";import{_ as qe}from"./logo_linepay_h.C_fLLKwU.js";import{B as Fe}from"./Breadcrumb.If6JY9f_.js";import{_ as Oe}from"./BookButton.DTwi_v8H.js";import{_ as je}from"./ButtonFavorite.DrbaYT1U.js";import{_ as ce}from"./CollapseButtonS3.B0cNHWkM.js";import{B as Re}from"./BookSwiper.BXj2wxcU.js";import{_ as Ge}from"./TitleSection.YrRREoqr.js";import{B as He}from"./BookTagsGroup.oMKEOt8G.js";import{a as c,r as Y,ay as de,az as ue,ae as he,E as f,F as i,G as e,a1 as g,$ as u,X as x,Y as q,av as F,_ as y,aA as ze,u as t,aB as Ye,a3 as k,P as pe,b as oe,i as Xe,aq as ve,A as Ze,w as Je,V as Ke,ag as p,Z as me,ao as Qe,ap as We}from"./swiper-vue.-M1go58E.js";import{_ as et}from"./DefaultXlModal.BLfKnLaa.js";import{Y as tt}from"./YoutubeVideoPlayer.D6YPa7Cj.js";/* empty css                 */import"./el-breadcrumb.BxF5wXK6.js";import"./BookItemCard.DxwUAMHz.js";import"./YoutubeVideoPlayer.vue.BpWlrYgJ.js";const ot={class:"select-none"},at={class:"main_image relative flex h-full items-center bg-base-50"},st={key:0,class:"book_video"},lt={class:"play"},nt=["src"],it={key:1,class:"read-book"},rt=["src"],ct={class:"read-book"},dt=["src"],ut=e("div",{class:"swiper-button-prev image_prev"},null,-1),vt=e("div",{class:"swiper-button-next image_next"},null,-1),mt={class:"imageThumbs h-full cursor-pointer bg-white p-3"},ht={class:"thumbnail"},pt=["src"],_t={class:"thumbnail"},ft=["src"],bt={class:"m-1 flex h-12 items-center text-left text-xl tracking-widest md:text-2xl"},gt={key:0,class:"video"},kt={key:1,class:"img-box"},wt=["src"],yt={class:"img-box"},xt=["src"],$t=e("div",{class:"rec-modal-btn-prev"},null,-1),Bt=e("div",{class:"rec-modal-btn-next"},null,-1),Vt={__name:"BookThumbsSwiper",props:{haveVideoUrlData:{type:Object,default:()=>{}},noVideoUrlData:{type:Object,default:()=>{}}},setup(d){const _=c(0),T=c(""),O=c(!1),m=c(null),r=Y({modules:[de,ue],slidesPerView:"auto",spaceBetween:15,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}}),P=Y({modules:[ue],slidesPerView:"auto"}),X=c(null),Q=n=>{X.value=n,oe(_,()=>{n.slideTo(_.value)})},l=n=>{oe(_,()=>{n.slideTo(_.value)})},A=Y({modules:[de],spaceBetween:15,slidesPerView:1,navigation:{nextEl:".rec-modal-btn-next",prevEl:".rec-modal-btn-prev"}}),w=n=>{O.value=!0,_.value=n},j=async()=>{var n,$,E;m.value!==null&&((n=m==null?void 0:m.value[_.value])==null||n.replay(),($=m==null?void 0:m.value[_.value])==null||$.mute(),T.value=await((E=m==null?void 0:m.value[_.value])==null?void 0:E.getTitle())??"")},D=()=>{m.value!==null&&(m==null||m.value.forEach(n=>n==null?void 0:n.pause()))};let L=Y({});const N=n=>{L=n,L.slideTo(_.value),oe(_,()=>{D(),j(),L.slideTo(_.value)})},G=n=>{_.value=n.activeIndex};return(n,$)=>{const E=he("font-awesome-icon"),S=ze,H=Ye,W=Ce;return i(),f("div",ot,[e("div",at,[g(H,{modules:t(r).modules,"slides-per-view":t(r).slidesPerView,"space-between":t(r).spaceBetween,navigation:t(r).navigation,thumbs:{swiper:t(X)},class:"bookMainSlider",onSwiper:l},{default:u(()=>[d.haveVideoUrlData.data.length>0&&d.haveVideoUrlData.type==="video"?(i(!0),f(q,{key:0},F(d.haveVideoUrlData.data,(v,h)=>(i(),y(S,{key:h,onClick:Z=>w(h)},{default:u(()=>[h===0?(i(),f("div",st,[e("div",lt,[g(E,{class:"play-icon",icon:["fas","play"]}),e("img",{src:v},null,8,nt)])])):(i(),f("div",it,[e("img",{src:v},null,8,rt)]))]),_:2},1032,["onClick"]))),128)):x("",!0),d.noVideoUrlData.data.length>0&&d.noVideoUrlData.type==="noVideo"?(i(!0),f(q,{key:1},F(d.noVideoUrlData.data,(v,h)=>(i(),y(S,{key:h,onClick:Z=>w(h)},{default:u(()=>[e("div",ct,[e("img",{src:v},null,8,dt)])]),_:2},1032,["onClick"]))),128)):x("",!0),ut,vt]),_:1},8,["modules","slides-per-view","space-between","navigation","thumbs"])]),e("div",mt,[g(H,{modules:t(P).modules,"slides-per-view":t(P).slidesPerView,"space-between":t(P).spaceBetween,class:"bookThumbsSwiper",onSwiper:Q},{default:u(()=>[d.haveVideoUrlData.data.length>0&&d.haveVideoUrlData.type==="video"?(i(!0),f(q,{key:0},F(d.haveVideoUrlData.data,(v,h)=>(i(),y(S,{key:h},{default:u(()=>[e("div",ht,[e("img",{src:v},null,8,pt)])]),_:2},1024))),128)):x("",!0),d.noVideoUrlData.data.length>0?(i(!0),f(q,{key:1},F(d.noVideoUrlData.data,(v,h)=>(i(),y(S,{key:h},{default:u(()=>[e("div",_t,[e("img",{src:v},null,8,ft)])]),_:2},1024))),128)):x("",!0)]),_:1},8,["modules","slides-per-view","space-between"])]),g(et,{modelValue:t(O),"onUpdate:modelValue":$[0]||($[0]=v=>pe(O)?O.value=v:null),class:"book-dialog h-full overflow-clip md:h-[800px]","is-header":!0,onOpen:j,onClose:D},{header:u(()=>[e("div",bt,k(t(T)),1)]),content:u(()=>[g(W,null,{default:u(()=>[g(H,{class:"modal-slider",modules:t(A).modules,"slides-per-view":t(A).slidesPerView,"space-between":t(A).spaceBetween,navigation:t(A).navigation,onSwiper:N,onSlideChange:G},{default:u(()=>[d.haveVideoUrlData.data.length>0&&d.haveVideoUrlData.type==="video"?(i(!0),f(q,{key:0},F(d.haveVideoUrlData.data,(v,h)=>(i(),y(S,{key:h},{default:u(()=>[h===0?(i(),f("div",gt,[g(tt,{ref_for:!0,ref_key:"youtube",ref:m,src:d.haveVideoUrlData.video},null,8,["src"])])):(i(),f("div",kt,[e("img",{class:"img-item",src:v},null,8,wt)]))]),_:2},1024))),128)):x("",!0),d.noVideoUrlData.data.length>0&&d.noVideoUrlData.type==="noVideo"?(i(!0),f(q,{key:1},F(d.noVideoUrlData.data,(v,h)=>(i(),y(S,{key:h,onClick:Z=>w(v)},{default:u(()=>[e("div",yt,[e("img",{class:"img-item",src:v},null,8,xt)])]),_:2},1032,["onClick"]))),128)):x("",!0),$t,Bt]),_:1},8,["modules","slides-per-view","space-between","navigation"])]),_:1})]),_:1},8,["modelValue"])])}}},V=d=>(Qe("data-v-56cd9b99"),d=d(),We(),d),Dt={class:"container my-7"},St={class:"container"},Ct={class:"mb-8 flex flex-wrap gap-4 lg:flex-nowrap lg:gap-0"},Ut={class:"h-full w-full max-w-full border border-solid border-base-200 lg:mr-10 lg:min-w-[550px]"},It={class:"flex flex-[1_1_0] basis-full flex-col justify-between lg:w-[calc(100%_-_600px)]"},Tt={class:"leading-7"},Pt={class:"mb-1 font-bold"},At=V(()=>e("hr",{class:"mb-6 mt-3 h-px border-0 bg-base-200"},null,-1)),Lt=V(()=>e("br",null,null,-1)),Nt=V(()=>e("br",null,null,-1)),Et=V(()=>e("br",null,null,-1)),Mt={key:0,class:"my-1 text-2xl font-bold text-danger-600"},qt={key:1,class:"my-1 text-2xl font-bold text-danger-600"},Ft={class:"my-2 flex items-center gap-2"},Ot=V(()=>e("span",{class:"text-base-400"},"數量",-1)),jt={class:"flex gap-1"},Rt={class:"my-2 flex items-center gap-2"},Gt=V(()=>e("div",{class:"mt-auto bg-base-100 px-5 py-3 font-bold"},[e("div",null,"| 取貨資料"),e("div",null,"配送地區:台灣(不含離島)"),e("div",null,[p(" 付款方式:信用卡、 "),e("img",{class:"h-3",src:qe,alt:"LINE Pay",title:"LINE Pay"})])],-1)),Ht={class:"recommend_block"},zt={class:"container"}
1,Yt={class:"mb-8","data-nosnippet":""},Xt={class:"mb-6"},Zt={class:"container"},Jt={class:"mb-6"},Kt=V(()=>e("hr",{class:"mb-6 h-px border-0 bg-base-200"},null,-1)),Qt={class:"content_block mb-8"},Wt=V(()=>e("div",{class:"mb-3 border-l-2 border-solid pl-2 text-xl font-bold text-primary-500"}," 內容 ",-1)),eo=["innerHTML"],to={class:"content_block mb-8"},oo=V(()=>e("div",{class:"mb-3 border-l-2 border-solid pl-2 text-xl font-bold text-primary-500"}," 目錄 ",-1)),ao=["innerHTML"],so={__name:"toBookDetail",async setup(d){let _,T;const O=Ie().public.siteURL,m=Te(),r=c(null);r.value=m.query.id;const P=c(!0),X=Xe("scrollTo"),{updateCartStatus:Q}=Me(),l=c({}),A=c(""),w=c({}),j=c({type:"noVideo",data:[]}),D=c({type:"video",video:"",data:[]});if(!r.value)throw ne({statusCode:404,statusMessage:"查無此頁",fatal:!0});const L=async o=>{P.value=!0;const{data:a,error:s}=await M("/api/bookshop/book-products/bookProductId",{query:{bookProductId:o}});if(s.value)throw ne({statusCode:s.value.statusCode,statusMessage:s.value.data.data.message,fatal:!0});l.value=a.value.data.bookProducts,A.value=a.value.data.bookProducts.content,w.value=a.value.data.categoryBreadCrumbs;const{promoteVideoUrl:b,coverImageUrl:C,contentImageUrls:R}=a.value.data.bookProducts,z=[C,...R];b?(j.value.data=[],D.value.data=z,D.value.video=b):(j.value.data=z,D.value.data=[],D.value.video=""),P.value=!1};[_,T]=ve(()=>L(r.value)),await _,T();const N=c(0),G=c([]),n=c(0),$=async o=>{const{isLogin:a}=K();if(a)try{const{data:s,refresh:b}=await M("/api/shoppingCart/booksList");if(s.value.data==null){G.value=0,n.value=0;return}await b(),G.value=s.value.data.books;const C=G.value.find(R=>R.bookId===parseInt(o));C?n.value=C.amount:n.value=0}catch(s){console.error("API錯誤:2.x.x 取得登入會員購物車書籍列表",s)}};[_,T]=ve(()=>$(r.value,n.value)),await _,T();const E=Pe(),S=async()=>{const o=K(),{isLogin:a}=o;if(!a){I.warning("請先登入"),await re(1e3),E.value=!0;return}await $(r.value,n.value),n.value===0||n.value<l.value.stock?H(r.value,N.value):I({type:"warning",message:"已超過庫存上限"})},H=async(o,a)=>{try{const{data:s}=await M("/api/bookshop/bookAdding",{method:"post",query:{bookId:o,amount:a}});s.value&&(I({type:"success",message:"成功加入購物車!"}),await Q())}catch(s){console.error("API錯誤:2.x.x 書籍加入會員購物車",s)}},W=async o=>{try{const{data:a,refresh:s}=await M("/api/bookshop/favoriteBook",{method:"get",query:{bookId:o}});return{res:a,refresh:s}}catch{console.error("API錯誤:2.x.x 依書籍 ID 判斷是否為會員最愛")}},v=c(!1),h=async o=>{const a=K(),{isLogin:s}=a;if(!s){v.value=!1;return}try{const{res:b,refresh:C}=await W(o);await C(),v.value=b.value.data}catch(b){console.error("error 是否為會員最愛資料",b)}},Z=async o=>{try{const{data:a,execute:s}=await M("/api/bookshop/favoriteBook",{method:"post",query:{bookId:o}});return{res:a,execute:s}}catch{console.error("API錯誤:2.x.x 將書籍加入會員帳戶中的我的最愛")}},_e=async o=>{try{const{data:a,execute:s}=await M("/api/bookshop/favoriteBook",{method:"delete",query:{bookId:o}});return{res:a,execute:s}}catch{console.error("API錯誤:2.x.x 將書籍從會員帳戶中的我的最愛移除")}},ae=c({}),J=Y([]),fe=async o=>{if(o)try{const{res:a,execute:s}=await Z(r.value);Object.assign(ae.value,a.value),await s();const b=I({type:"success",message:"收藏商品成功"});J.push(b)}catch{console.error("加入收藏書籍執行錯誤!")}else try{const{res:a,execute:s}=await _e(r.value);Object.assign(ae.value,a.value),await s();const b=I({type:"success",message:"已移除此收藏商品"});J.push(b)}catch{console.error("移除收藏書籍執行錯誤!")}},be=async o=>{try{const{data:a,error:s}=await M("/api/bookshop/notify-book",{method:"post",query:{bookId:o}});if(s.value&&s.value.statusCode===409){I({type:"warning",message:"書籍已加入通知"});return}a.value&&I({type:"success",message:"追蹤商品成功"})}catch{console.error("API錯誤:2.x.x 會員加入書籍至貨到通知")}},ge=async()=>{const o=K(),{isLogin:a}=o;if(!a){I.warning("請先登入"),await re(1e3),E.value=!0;return}be(r.value)};Ze(async()=>{await L(r.value),await $(r.value,n.value)}),Ae(async o=>{J.forEach(a=>a.close()),J.length=0,N.value=0,B.value={0:!0,1:!0},r.value=o.query.id,await L(r.value),await h(r.value),await $(r.value,n.value),X(0)});const ee=c(null);Je(()=>{r.value=m.query.id,h(r.value);const o=w.value;o&&o.parent?ee.value=[{name:"首頁",path:"/book/toBookIndex"},{name:o.parent.name,path:`/book/toBookList?category_id=${o.parent.id}`},{name:o.name}]:o&&(ee.value=[{name:"首頁",path:"/book/toBookIndex"},{name:o.name}])});function ke(o){return[90,80,70,60,50,40,30,20,10].includes(o)?`${o/10}`:`${o}`}const we=c(null),ye=c(null),xe=c(null),$e=c(null),B=c({0:!0,1:!0}),Be=c(!0),Ve=c(!0),se=o=>{for(const a in B.value)parseInt(a)===o&&(B.value[o]=!B.value[o])},De=o=>[1346,1347,1348].includes(o)?`/zone/literacy/listTag/toList?tag_id=${o}&sort_id=book`:`/zone/literacy/listTag/toList?sub_tag_id=${o}&sort_id=book`;return Le({link:[{rel:"canonical",href:()=>`${O}/book/toBookDetail?id=${r.value}`}]}),Ne({title:()=>`${l.value.title}|${w.value.parent?w.value.parent.name:""}|${w.value.name}-購書城`,ogTitle:()=>`${l.value.title}|${w.value.parent?w.value.parent.name:""}|${w.value.name}-購書城`,description:()=>`書名:${l.value.title}`,ogDescription:()=>`書名:${l.value.title}`,ogImage:()=>`${l.value.coverImageUrl}`}),(o,a)=>{var R,z,le;const s=Se,b=he("font-awesome-icon"),C=Ee;return i(),f("div",null,[Ke((i(),f("div",null,[e("nav",Dt,[g(Fe,{content:t(ee)},null,8,["content"])]),e("div",St,[e("div",Ct,[e("div",Ut,[g(Vt,{"have-video-url-data":t(D),"no-video-url-data":t(j)},null,8,["have-video-url-data","no-video-url-data"])]),e("div",It,[e("div",Tt,[e("h2",Pt,k(t(l).title),1),At,e("div",null,[p(" 作者:"+k(t(l).authors.join("、")),1),Lt,p("ISBN:"+k(t(l).isbn),1),Nt,p(" 出版日期:"+k(t(l).publishDate),1),Et,e("div",null,[p(" 定價:"),e("span",null,"$"+k(("formattedNumber"in o?o.formattedNumber:t(te))(t(l).listPrice)),1)]),((R=t(l).discount)==null?void 0:R.type)==="PERCENTAGE"&&((z=t(l).discount)==null?void 0:z.value)!==100?(i(),f("div",Mt,[p(" 優惠價:"),e("span",null,k(ke(t(l).discount.value))+"折",1),p(" $"),e("span",null,k(("formattedNumber"in o?o.formattedNumber:t(te))(t(l).sellPrice)),1)])):((le=t(l).discount)==null?void 0:le.type)==="VALUE"?(i(),f("div",qt,[p(" 優惠價:$"),e("span",null,k(("formattedNumber"in o?o.formattedNumber:t(te))(t(l).sellPrice)),1)])):x("",!0)])]),e("div",Ft,[Ot,(i(),y(s,{key:t(r),modelValue:t(N),"onUpdate:modelValue":a[0]||(a[0]=U=>
1pe(N)?N.value=U:null),class:"numSize",min:t(l).stock?1:0,max:t(l).stock},null,8,["modelValue","min","max"])),e("p",jt,[p(" 剩餘庫存"),e("span",null,k(t(l).stock),1),p("本 ")])]),e("div",Rt,[t(l).stock!==0?(i(),y(ie,{key:0,padding:"p-0",width:"max-w-[290px] w-full",margin:"m-0",height:"h-8",onClick:S},{default:u(()=>[p("加入購物車")]),_:1})):x("",!0),t(l).stock===0?(i(),y(ie,{key:1,padding:"p-0",width:"max-w-[290px] w-full",margin:"m-0",height:"h-8",onClick:a[1]||(a[1]=U=>ge(t(r).value))},{default:u(()=>[p("補貨中,貨到通知我")]),_:1})):x("",!0),g(je,{"is-text":!1,padding:"p-0",height:"h-8",width:"max-w-8 w-full",class:"font-bold","is-favorite":t(v),onAddFavorite:fe},null,8,["is-favorite"])]),Gt])])]),e("div",Ht,[e("div",zt,[e("div",Yt,[e("h3",Xt,[g(b,{class:"mr-1",icon:["fas","book"]}),p("推薦書籍")]),g(Re,{"prev-id":"recommend-pre","next-id":"recommend-next","book-detail-data":t(l).recommendedBooks},null,8,["book-detail-data"])])])]),e("div",Zt,[e("h3",Jt,[g(b,{class:"mr-1",icon:["fas","book"]}),p("書籍內容")]),Kt,e("div",Qt,[Wt,e("div",{ref_key:"toggleBox0",ref:we,class:me({toggle_box:t(B)[0]})},[e("div",{ref_key:"contents0",ref:ye,class:"asyncData"},[e("div",{class:"cover-style",innerHTML:t(A)},null,8,eo)],512)],2),t(Be)?(i(),y(ce,{key:0,"is-show-icon":t(B)[0],onClick:a[2]||(a[2]=U=>se(0))},{default:u(()=>
1[p(k(t(B)[0]?"閱讀更多":"收合內容"),1)]),_:1},8,["is-show-icon"])):x("",!0)]),e("div",to,[oo,e("div",{ref_key:"toggleBox1",ref:xe,class:me({toggle_box:t(B)[1]})},[e("div",{ref_key:"contents1",ref:$e,class:"asyncData"},[e("div",{innerHTML:t(l).contentTable},null,8,ao)],512)],2),t(Ve)?(i(),y(ce,{key:0,"is-show-icon":t(B)[1],onClick:a[3]||(a[3]=U=>se(1))},{default:u(()=>[p(k(t(B)[1]?"閱讀更多":"收合內容"),1)]),_:1},8,["is-show-icon"])):x("",!0)]),g(He,null,{ClassGroupSecondTitle:u(()=>[g(Ge,{class:"mb-1"},{default:u(()=>[p("探索更多")]),_:1})]),ExploreGroup:u(()=>[(i(!0),f(q,null,F(t(l).tags,U=>(i(),y(Oe,{key:U.id,url:De(U.id)},{default:u(()=>[p("# "+k(U.name),1)]),_:2},1032,["url"]))),128))]),_:1})])])),[[C,t(P)]])])}}},Bo=Ue(so,[["__scopeId","data-v-56cd9b99"]]);export{Bo 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.