HomeView.vue 112 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682
  1. <script setup>
  2. import { ref, reactive, onMounted, watch, nextTick } from "vue";
  3. import { useRoute } from "vue-router";
  4. // VR
  5. import "aframe";
  6. // i18n
  7. import { useI18n } from "vue-i18n";
  8. // Axios
  9. import axios from "axios";
  10. // Moment
  11. import moment from "moment";
  12. // Animate
  13. import "animate.css";
  14. // Swiper
  15. import { Swiper, SwiperSlide } from "swiper/vue";
  16. import { Navigation, Autoplay } from "swiper/modules";
  17. import "swiper/css";
  18. import "swiper/css/navigation";
  19. // Recorder
  20. import Recorder from "recorder-core";
  21. import "recorder-core/src/engine/mp3";
  22. import "recorder-core/src/engine/mp3-engine";
  23. // QR Code
  24. import { QrcodeStream, QrcodeDropZone, QrcodeCapture } from "vue-qrcode-reader";
  25. // Components
  26. import Navbar from "../components/Navbar.vue";
  27. import TicketPurchase from "../components/TicketPurchase.vue";
  28. const { t, locale } = useI18n();
  29. const route = useRoute();
  30. const routeParam = ref(null);
  31. let qrCodeDialog = ref(false);
  32. let qrCodeLoading = ref(true);
  33. let location = ref(""); // 當前位置
  34. // QR Code 掃描
  35. function onDetect(detectedCodes) {
  36. console.log("detectedCodes", detectedCodes);
  37. const url = new URL(detectedCodes[0].rawValue);
  38. location.value = url.searchParams.get("location");
  39. let val;
  40. let lang = getLang();
  41. if (lang === "en") {
  42. switch (location.value) {
  43. case "B1 鼎泰豐":
  44. val = "b1 Din Tai Fung";
  45. break;
  46. case "B1 中環":
  47. val = "b1 Centre";
  48. break;
  49. case "B1 2號電梯":
  50. val = "b1 Elevator No.2";
  51. break;
  52. case "B1 4號電梯":
  53. val = "b1 Elevator No.4";
  54. break;
  55. case "B1 3號電梯":
  56. val = "b1 Elevator No.3";
  57. break;
  58. case "1F 信義環":
  59. val = "1f South Xinyi";
  60. break;
  61. case "1F 3號電梯":
  62. val = "1f Elevator No.3";
  63. break;
  64. case "2F 3號電梯":
  65. val = "2f Elevator No.3";
  66. break;
  67. case "88F 觀景台":
  68. val = "88f Observatory";
  69. break;
  70. case "89F 觀景台":
  71. val = "89f Observatory";
  72. break;
  73. default:
  74. break;
  75. }
  76. } else if (lang === "ch") {
  77. val = location.value;
  78. }
  79. if (location.value && location.value !== "") {
  80. qrCodeDialog.value = false;
  81. messages.value.push({
  82. label: "text",
  83. author: "ai",
  84. body: `${t("current_location")}:${val}`,
  85. });
  86. changeLocation(location.value); // 選擇導覽位置
  87. } else {
  88. qrCodeDialog.value = false;
  89. messages.value.push({
  90. label: "text",
  91. author: "ai",
  92. body: "讀取錯誤,請重新掃描。",
  93. });
  94. }
  95. }
  96. // 判斷 vue-qrcode-reader 是否加載完成
  97. function onInit(capabilities) {
  98. qrCodeLoading.value = false;
  99. }
  100. onMounted(() => {
  101. // 取得當前路由參數
  102. routeParam.value = route.path.replace("/", "");
  103. console.log("網址參數", routeParam.value);
  104. window.addEventListener("resize", handleResize);
  105. });
  106. const userMessage = ref("");
  107. let modules = [Navigation, Autoplay]; // Swiper
  108. // AI 客服回覆訊息
  109. let messages = ref([]);
  110. watch(messages.value, (val) => {
  111. console.log("messages", val);
  112. scrollToBottom();
  113. updateMenuHeight();
  114. });
  115. let ad = ref({}); // 彈跳視窗廣告
  116. let qaQuery = reactive([]);
  117. const chatArea = ref(null); // 對話框
  118. // 滾動到對話框底部
  119. const scrollToBottom = () => {
  120. setTimeout(() => {
  121. // chatArea.value.scrollTop = chatArea.value.scrollHeight;
  122. window.scrollTo({
  123. top: document.body.scrollHeight,
  124. behavior: "smooth", // 平滑滾動
  125. });
  126. }, 100);
  127. // let list = messages.value;
  128. // const item = list[list.length - 1];
  129. // if (item.label === "text") {
  130. // setTimeout(() => {
  131. // chatArea.value.scrollTop = chatArea.value.scrollHeight;
  132. // }, 100);
  133. // }
  134. };
  135. // 對話選項(按鈕)
  136. function setBtnValue(val) {
  137. console.log("value", val);
  138. userMessage.value = val;
  139. sendMessage("text");
  140. }
  141. // 傳送訊息 (如 type="text" 代表為純文字訊息,不需語音回覆)
  142. async function sendMessage(type = "") {
  143. if (userMessage.value === "") {
  144. return;
  145. }
  146. console.log("sendMessage", userMessage.value);
  147. qaQuery.push(userMessage.value);
  148. let url = "https://devbox10.itri-nlp.tw:38125/v1/qa/";
  149. try {
  150. // 使用者訊息
  151. messages.value.push({
  152. label: "text",
  153. body: userMessage.value,
  154. author: "user",
  155. });
  156. userMessage.value = "";
  157. // hideMenu.value = true;
  158. axios
  159. .post(
  160. url,
  161. new URLSearchParams({
  162. query: JSON.stringify(qaQuery), // 使用者問句
  163. language: selectLang.value, // 語系
  164. category: assignCategory.value, // 類別
  165. subtype: assignSubtype.value, // 詳細類別(非必填)
  166. from_loc: "", // 定位點
  167. to_loc: "", // 導覽點
  168. }),
  169. {
  170. headers: {
  171. "Content-Type": "application/x-www-form-urlencoded",
  172. },
  173. }
  174. )
  175. .then((response) => {
  176. // if (showAnchor.value) {
  177. // getVideo(response.data);
  178. // }
  179. // AI 客服回傳訊息
  180. messages.value.push({
  181. label: "text",
  182. author: "ai",
  183. body: response.data.response,
  184. });
  185. console.log("response", response);
  186. if (type !== "text") {
  187. handleTTS(response.data.response); // 取得語音回覆
  188. }
  189. if (response.data.data.length) {
  190. let info = {
  191. buttonList: [], // 按鈕
  192. ticketList: [], // 票券
  193. };
  194. let labelContent;
  195. response.data.data.map((item) => {
  196. if (item.type === "button") {
  197. console.log("按鈕");
  198. info.buttonList.push(item);
  199. labelContent = "ticket";
  200. } else if (item.type === "ticket") {
  201. console.log("票");
  202. info.ticketList.push(item);
  203. labelContent = "ticket";
  204. } else if (item.type === "brand") {
  205. console.log("品牌");
  206. info.ticketList.push(item);
  207. labelContent = "brand";
  208. }
  209. });
  210. console.log("info", info);
  211. console.log("labelContent", labelContent);
  212. setTimeout(() => {
  213. messages.value.push({
  214. label: labelContent,
  215. author: "ai",
  216. body: info,
  217. });
  218. }, 10);
  219. }
  220. })
  221. .catch((error) => {
  222. console.error("Error:", error);
  223. });
  224. console.log("messages.value", messages.value);
  225. } catch (error) {
  226. console.log("error", error);
  227. }
  228. }
  229. // let isTTSVideo = ref(false); // API 是否回傳影片
  230. // let ttsVideo = ref(null); // 影片 dom
  231. // let ttsVideoSrc = ref(""); // 影片路徑
  232. // let videoPause = ref(false); // 暫停按鈕
  233. let hideMenu = ref(false); // 底部選單
  234. let showInput = ref(false); // 輸入框
  235. // 取得 mp4
  236. // async function getVideo(data) {
  237. // console.log("getVideo data", data);
  238. // // let url = `https://cmm.ai:9101/tts?message=${data.response}&type=101`;
  239. // let url = `https://bf18-61-230-0-215.ngrok-free.app/tts?message=${data.response}&type=101`;
  240. // try {
  241. // const response = await axios.post(url);
  242. // console.log("response", response);
  243. // if (response.status === 200) {
  244. // video.value.pause();
  245. // videoPause.value = false;
  246. // // ttsVideoSrc.value = `https://cmm.ai:9101/${response.data.url}`;
  247. // // ttsVideoSrc.value = `https://bf18-61-230-0-215.ngrok-free.app/${response.data.url}`;
  248. // ttsVideoSrc.value = response.data.url;
  249. // await ttsVideo.value.load();
  250. // await ttsVideo.value.play();
  251. // // AI 客服回傳訊息
  252. // // messages.value.splice(-1, 1);
  253. // messages.value.push({
  254. // type: data.type,
  255. // body: data.response,
  256. // author: data.author,
  257. // });
  258. // // isTTSVideo.value = true;
  259. // // 判斷影片是否結束
  260. // const videoPromise = new Promise((resolve, reject) => {
  261. // ttsVideo.value.onended = () => resolve(true);
  262. // });
  263. // const videoCompleted = await videoPromise; // 影片結束
  264. // if (videoCompleted) {
  265. // console.log("影片結束");
  266. // // isTTSVideo.value = false; // 切換為初始影片
  267. // hideAnchorPrologue.value = false; // 切換開場白影片
  268. // }
  269. // console.log("videoCompleted", videoCompleted);
  270. // }
  271. // } catch (error) {
  272. // console.log("error", error);
  273. // }
  274. // }
  275. // 影片暫停/播放
  276. // function handleVideo(isTTS) {
  277. // if (videoPause.value) {
  278. // if (isTTS) {
  279. // ttsVideo.value.play();
  280. // } else {
  281. // video.value.play();
  282. // }
  283. // videoPause.value = false;
  284. // } else {
  285. // if (isTTS) {
  286. // ttsVideo.value.pause();
  287. // } else {
  288. // video.value.pause();
  289. // }
  290. // videoPause.value = true;
  291. // }
  292. // }
  293. function getLang() {
  294. let lang = localStorage.getItem("lang");
  295. let langVal = "";
  296. switch (lang) {
  297. case "zh-tw":
  298. langVal = "ch";
  299. break;
  300. case "en-us":
  301. langVal = "en";
  302. break;
  303. default:
  304. break;
  305. }
  306. return langVal;
  307. }
  308. let showAd = ref(false);
  309. // 取得廣告
  310. async function setAd() {
  311. let lang = getLang();
  312. console.log("lang", lang);
  313. let url = `https://cmm.ai:9101/ad?language=${lang}`;
  314. try {
  315. const response = await axios.get(url);
  316. console.log("Ad response", response);
  317. ad.value = response.data.data.body;
  318. console.log("Ad", ad.value);
  319. } catch (error) {
  320. console.log("error", error);
  321. }
  322. }
  323. let video = ref(null);
  324. function videoPlay() {
  325. video.value.load();
  326. video.value.play();
  327. }
  328. // 底部選單
  329. const menu = ref(null);
  330. const menuHeight = ref(0);
  331. // let isRotate = ref(false);
  332. let isLanguagePage = ref(true);
  333. let selectLang = ref("");
  334. let chatLoading = ref(true);
  335. watch(isLanguagePage, (val) => {
  336. if (!val) {
  337. setTimeout(updateMenuHeight, 500);
  338. }
  339. });
  340. const handleResize = () => {
  341. updateMenuHeight();
  342. };
  343. // 取得底部選單高度
  344. const updateMenuHeight = () => {
  345. nextTick(() => {
  346. if (menu.value) {
  347. menuHeight.value = menu.value.clientHeight;
  348. chatLoading.value = false;
  349. }
  350. });
  351. };
  352. function chooseLang(lang) {
  353. console.log("選擇語言:", lang);
  354. selectLang.value = lang;
  355. isLanguagePage.value = false;
  356. locale.value = lang; // i18n locale
  357. localStorage.setItem("lang", lang);
  358. messages.value.push({
  359. label: "text",
  360. author: "ai",
  361. body: t("prologue"),
  362. });
  363. messages.value.push({
  364. label: "text",
  365. author: "ai",
  366. body: t("service"),
  367. });
  368. // messages.value.push({
  369. // label: "text",
  370. // author: "ai",
  371. // body: "請選擇問題類型:",
  372. // });
  373. // messages.value.push({
  374. // label: "btn-list",
  375. // author: "ai",
  376. // body: "",
  377. // });
  378. setAd();
  379. handleClick();
  380. console.log(" messages.value", messages.value);
  381. setTimeout(() => {
  382. showAd.value = true;
  383. // videoPlay();
  384. }, 500);
  385. }
  386. let assignSubtype = ref("");
  387. let assignCategory = ref("");
  388. let assignCategoryIndex = ref(null);
  389. // 美食伴手禮
  390. let diningList = reactive([
  391. {
  392. value: "特色/高空餐廳",
  393. text: "food_souvenirs_info.signature",
  394. },
  395. {
  396. value: "輕食/CAFÉ",
  397. text: "food_souvenirs_info.light",
  398. },
  399. {
  400. value: "美食街",
  401. text: "food_souvenirs_info.courts",
  402. },
  403. {
  404. value: "伴手禮",
  405. text: "food_souvenirs_info.souvenir",
  406. },
  407. ]);
  408. // 秘境花園觀景台
  409. let observationList = reactive([
  410. {
  411. value: "線上購票",
  412. text: "observatory_info.tickets.title",
  413. },
  414. {
  415. value: "參觀資訊",
  416. text: "observatory_info.visitor.title",
  417. },
  418. // {
  419. // value: "實境景色",
  420. // text: "observatory_info.view",
  421. // },
  422. {
  423. value: "前往秘境花園觀景台",
  424. text: "observatory_info.garden",
  425. },
  426. ]);
  427. // 購物及優惠
  428. let shoppingList = reactive([
  429. {
  430. value: "購物品牌查詢",
  431. text: "shopping_discounts_info.brands.title",
  432. },
  433. {
  434. value: "國際貴賓卡專屬禮遇",
  435. text: "shopping_discounts_info.tourist_card.title",
  436. },
  437. ]);
  438. // 購物品牌查詢
  439. let brandList = reactive([
  440. {
  441. value: "國際珠寶腕錶",
  442. text: "shopping_discounts_info.brands.jewely",
  443. },
  444. {
  445. value: "國際精品",
  446. text: "shopping_discounts_info.brands.boutique",
  447. },
  448. {
  449. value: "美妝保養品",
  450. text: "shopping_discounts_info.brands.skincare",
  451. },
  452. {
  453. value: "流行服飾",
  454. text: "shopping_discounts_info.brands.apparel",
  455. },
  456. {
  457. value: "生活居家/3C",
  458. text: "shopping_discounts_info.brands.lifestyle",
  459. },
  460. {
  461. value: "文化創意",
  462. text: "shopping_discounts_info.brands.cultural",
  463. },
  464. {
  465. value: "特色品牌",
  466. text: "shopping_discounts_info.brands.signature",
  467. },
  468. {
  469. value: "館外店家",
  470. text: "shopping_discounts_info.brands.outside",
  471. },
  472. ]);
  473. // 服務資訊
  474. let serviceList = reactive([
  475. {
  476. title: "service_info.business_hours",
  477. depiction: "service_info.business_hours_1",
  478. },
  479. {
  480. title: "service_info.tax_refund",
  481. depiction: "service_info.tax_refund_1",
  482. },
  483. {
  484. title: "service_info.toilets",
  485. depiction: "service_info.toilets_1",
  486. },
  487. {
  488. title: "service_info.charge",
  489. depiction: "service_info.charge_1",
  490. },
  491. // {
  492. // title: "AI 天燈",
  493. // depiction: "https://cmm.ai/101-postcard/#/skylanternhome",
  494. // },
  495. ]);
  496. // 定位點
  497. let locationList = reactive([
  498. {
  499. location: "B1 鼎泰豐", // 編號 1
  500. navigation: [
  501. {
  502. value: "景觀餐廳櫃台",
  503. text: "high_rise_restaurant_reception",
  504. },
  505. {
  506. value: "ATM",
  507. text: "atm",
  508. },
  509. {
  510. value: "觀景台售票處",
  511. text: "observatory_ticket_office",
  512. },
  513. {
  514. value: "鼎泰豐",
  515. text: "din_tai_fung",
  516. },
  517. {
  518. value: "捷運",
  519. text: "metro_station",
  520. },
  521. {
  522. value: "超市",
  523. text: "supermarket",
  524. },
  525. {
  526. value: "美食街",
  527. text: "food_court",
  528. },
  529. {
  530. value: "退稅/外幣兌換櫃台",
  531. text: "tax_refund_currency_exchange",
  532. },
  533. {
  534. value: "計程車乘車處",
  535. text: "taxi_station",
  536. },
  537. {
  538. value: "無障礙廁所",
  539. text: "accessible_facilities",
  540. },
  541. {
  542. value: "客服(停車折抵)",
  543. text: "service_counter_parking_discount",
  544. },
  545. {
  546. value: "哺乳室",
  547. text: "nursing_room",
  548. },
  549. {
  550. value: "飲水機",
  551. text: "ice_warmed_water_dispenser",
  552. },
  553. {
  554. value: "伴手禮區",
  555. text: "snackable_souvenirs",
  556. },
  557. {
  558. value: "廁所",
  559. text: "restroom",
  560. },
  561. {
  562. value: "置物櫃",
  563. text: "items_and_luggage_storage",
  564. },
  565. ],
  566. // navigation: [
  567. // "景觀餐廳櫃台",
  568. // "ATM",
  569. // "觀景台售票處",
  570. // "鼎泰豐",
  571. // "捷運",
  572. // "超市",
  573. // "美食街",
  574. // "退稅/外幣兌換櫃台",
  575. // "計程車乘車處",
  576. // "無障礙廁所",
  577. // "客服(停車折抵)",
  578. // "哺乳室",
  579. // "飲水機",
  580. // "伴手禮區",
  581. // "廁所",
  582. // "置物櫃",
  583. // ],
  584. },
  585. {
  586. location: "B1 中環", // 編號 2
  587. navigation: [
  588. {
  589. value: "景觀餐廳櫃台",
  590. text: "high_rise_restaurant_reception",
  591. },
  592. {
  593. value: "ATM",
  594. text: "atm",
  595. },
  596. {
  597. value: "觀景台售票處",
  598. text: "observatory_ticket_office",
  599. },
  600. {
  601. value: "美食街",
  602. text: "food_court",
  603. },
  604. {
  605. value: "伴手禮區",
  606. text: "snackable_souvenirs",
  607. },
  608. {
  609. value: "鼎泰豐",
  610. text: "din_tai_fung",
  611. },
  612. {
  613. value: "捷運",
  614. text: "metro_station",
  615. },
  616. {
  617. value: "超市",
  618. text: "supermarket",
  619. },
  620. {
  621. value: "計程車乘車處",
  622. text: "taxi_station",
  623. },
  624. {
  625. value: "無障礙廁所",
  626. text: "accessible_facilities",
  627. },
  628. ],
  629. // navigation: [
  630. // "景觀餐廳櫃台",
  631. // "ATM",
  632. // "觀景台售票處",
  633. // "美食街",
  634. // "伴手禮區",
  635. // "鼎泰豐",
  636. // "捷運",
  637. // "超市",
  638. // "計程車乘車處",
  639. // "無障礙廁所",
  640. // ],
  641. },
  642. {
  643. location: "B1 2號電梯", // 編號 3
  644. navigation: [
  645. {
  646. value: "景觀餐廳櫃台",
  647. text: "high_rise_restaurant_reception",
  648. },
  649. {
  650. value: "ATM",
  651. text: "atm",
  652. },
  653. {
  654. value: "觀景台售票處",
  655. text: "observatory_ticket_office",
  656. },
  657. {
  658. value: "客服(退稅櫃台/外幣兌換)",
  659. text: "tax_refund_currency_exchange",
  660. },
  661. {
  662. value: "計程車乘車處",
  663. text: "taxi_station",
  664. },
  665. {
  666. value: "無障礙廁所",
  667. text: "accessible_facilities",
  668. },
  669. {
  670. value: "超市",
  671. text: "supermarket",
  672. },
  673. {
  674. value: "鼎泰豐",
  675. text: "din_tai_fung",
  676. },
  677. {
  678. value: "捷運",
  679. text: "metro_station",
  680. },
  681. {
  682. value: "伴手禮區",
  683. text: "snackable_souvenirs",
  684. },
  685. {
  686. value: "廁所",
  687. text: "restroom",
  688. },
  689. {
  690. value: "置物櫃",
  691. text: "items_and_luggage_storage",
  692. },
  693. {
  694. value: "美食街",
  695. text: "food_court",
  696. },
  697. {
  698. value: "客服(停車折抵)",
  699. text: "service_counter_parking_discount",
  700. },
  701. {
  702. value: "哺乳室",
  703. text: "nursing_room",
  704. },
  705. {
  706. value: "飲水機",
  707. text: "ice_warmed_water_dispenser",
  708. },
  709. {
  710. value: "廁所",
  711. text: "restroom",
  712. },
  713. ],
  714. // navigation: [
  715. // "景觀餐廳櫃台",
  716. // "ATM",
  717. // "觀景台售票處",
  718. // "客服(退稅櫃台/外幣兌換)",
  719. // "計程車乘車處",
  720. // "無障礙廁所",
  721. // "超市",
  722. // "鼎泰豐",
  723. // "捷運",
  724. // "伴手禮區",
  725. // "廁所",
  726. // "置物櫃",
  727. // "美食街",
  728. // "客服(停車折抵)",
  729. // "哺乳室",
  730. // "飲水機",
  731. // "廁所",
  732. // ],
  733. },
  734. {
  735. location: "B1 4號電梯", // 編號 4
  736. navigation: [
  737. {
  738. value: "景觀餐廳櫃台",
  739. text: "high_rise_restaurant_reception",
  740. },
  741. {
  742. value: "ATM",
  743. text: "atm",
  744. },
  745. {
  746. value: "觀景台售票處",
  747. text: "observatory_ticket_office",
  748. },
  749. {
  750. value: "廁所",
  751. text: "restroom",
  752. },
  753. {
  754. value: "置物櫃",
  755. text: "items_and_luggage_storage",
  756. },
  757. {
  758. value: "客服(停車折抵)",
  759. text: "service_counter_parking_discount",
  760. },
  761. {
  762. value: "哺乳室",
  763. text: "nursing_room",
  764. },
  765. {
  766. value: "飲水機",
  767. text: "ice_warmed_water_dispenser",
  768. },
  769. {
  770. value: "退稅/外幣兌換櫃台",
  771. text: "tax_refund_currency_exchange",
  772. },
  773. {
  774. value: "計程車乘車處",
  775. text: "taxi_station",
  776. },
  777. {
  778. value: "無障礙廁所",
  779. text: "accessible_facilities",
  780. },
  781. {
  782. value: "伴手禮區",
  783. text: "snackable_souvenirs",
  784. },
  785. {
  786. value: "捷運",
  787. text: "metro_station",
  788. },
  789. {
  790. value: "鼎泰豐",
  791. text: "din_tai_fung",
  792. },
  793. {
  794. value: "美食街",
  795. text: "food_court",
  796. },
  797. {
  798. value: "超市",
  799. text: "supermarket",
  800. },
  801. ],
  802. // navigation: [
  803. // "景觀餐廳櫃台",
  804. // "ATM",
  805. // "觀景台售票處",
  806. // "廁所",
  807. // "置物櫃",
  808. // "客服(停車折抵)",
  809. // "哺乳室",
  810. // "飲水機",
  811. // "退稅/外幣兌換櫃台",
  812. // "計程車乘車處",
  813. // "無障礙廁所",
  814. // "伴手禮區",
  815. // "捷運",
  816. // "鼎泰豐",
  817. // "美食街",
  818. // "超市",
  819. // ],
  820. },
  821. {
  822. location: "B1 3號電梯", // 編號 5
  823. navigation: [
  824. {
  825. value: "景觀餐廳櫃台",
  826. text: "high_rise_restaurant_reception",
  827. },
  828. {
  829. value: "ATM",
  830. text: "atm",
  831. },
  832. {
  833. value: "觀景台售票處",
  834. text: "observatory_ticket_office",
  835. },
  836. {
  837. value: "廁所",
  838. text: "restroom",
  839. },
  840. {
  841. value: "無障礙廁所",
  842. text: "accessible_facilities",
  843. },
  844. {
  845. value: "計程車乘車處",
  846. text: "taxi_station",
  847. },
  848. {
  849. value: "客服(退稅櫃台/外幣兌換)",
  850. text: "tax_refund_currency_exchange",
  851. },
  852. {
  853. value: "飲水機",
  854. text: "ice_warmed_water_dispenser",
  855. },
  856. {
  857. value: "哺乳室",
  858. text: "nursing_room",
  859. },
  860. {
  861. value: "置物櫃",
  862. text: "items_and_luggage_storage",
  863. },
  864. {
  865. value: "客服(停車折抵)",
  866. text: "service_counter_parking_discount",
  867. },
  868. {
  869. value: "美食街",
  870. text: "food_court",
  871. },
  872. {
  873. value: "伴手禮區",
  874. text: "snackable_souvenirs",
  875. },
  876. {
  877. value: "鼎泰豐",
  878. text: "din_tai_fung",
  879. },
  880. {
  881. value: "捷運",
  882. text: "metro_station",
  883. },
  884. {
  885. value: "超市",
  886. text: "supermarket",
  887. },
  888. ],
  889. // navigation: [
  890. // "景觀餐廳櫃台",
  891. // "ATM",
  892. // "觀景台售票處",
  893. // "廁所",
  894. // "無障礙廁所",
  895. // "計程車乘車處",
  896. // "客服(退稅櫃台/外幣兌換)",
  897. // "飲水機",
  898. // "哺乳室",
  899. // "置物櫃",
  900. // "客服(停車折抵)",
  901. // "美食街",
  902. // "伴手禮區",
  903. // "鼎泰豐",
  904. // "捷運",
  905. // "超市",
  906. // ],
  907. },
  908. {
  909. location: "1F 信義環", // 編號 6
  910. navigation: [
  911. {
  912. value: "景觀餐廳櫃台",
  913. text: "high_rise_restaurant_reception",
  914. },
  915. {
  916. value: "ATM",
  917. text: "atm",
  918. },
  919. {
  920. value: "觀景台售票處",
  921. text: "observatory_ticket_office",
  922. },
  923. {
  924. value: "廁所",
  925. text: "restroom",
  926. },
  927. {
  928. value: "ATM",
  929. text: "atm",
  930. },
  931. {
  932. value: "置物櫃",
  933. text: "items_and_luggage_storage",
  934. },
  935. {
  936. value: "飲水機",
  937. text: "ice_warmed_water_dispenser",
  938. },
  939. {
  940. value: "無障礙廁所",
  941. text: "accessible_facilities",
  942. },
  943. {
  944. value: "哺乳室",
  945. text: "nursing_room",
  946. },
  947. {
  948. value: "客服(停車折抵)",
  949. text: "service_counter_parking_discount",
  950. },
  951. {
  952. value: "退稅/外幣兌換櫃台",
  953. text: "tax_refund_currency_exchange",
  954. },
  955. {
  956. value: "伴手禮區",
  957. text: "snackable_souvenirs",
  958. },
  959. {
  960. value: "美食街",
  961. text: "food_court",
  962. },
  963. {
  964. value: "捷運",
  965. text: "metro_station",
  966. },
  967. {
  968. value: "鼎泰豐",
  969. text: "din_tai_fung",
  970. },
  971. {
  972. value: "超市",
  973. text: "supermarket",
  974. },
  975. ],
  976. // navigation: [
  977. // "景觀餐廳櫃台",
  978. // "ATM",
  979. // "觀景台售票處",
  980. // "廁所",
  981. // "ATM",
  982. // "置物櫃",
  983. // "飲水機",
  984. // "無障礙廁所",
  985. // "哺乳室",
  986. // "客服(停車折抵)",
  987. // "退稅/外幣兌換櫃台",
  988. // "伴手禮區",
  989. // "美食街",
  990. // "捷運",
  991. // "鼎泰豐",
  992. // "超市",
  993. // ],
  994. },
  995. {
  996. location: "1F 3號電梯", // 編號 7
  997. navigation: [
  998. {
  999. value: "景觀餐廳櫃台",
  1000. text: "high_rise_restaurant_reception",
  1001. },
  1002. {
  1003. value: "ATM",
  1004. text: "atm",
  1005. },
  1006. {
  1007. value: "觀景台售票處",
  1008. text: "observatory_ticket_office",
  1009. },
  1010. {
  1011. value: "廁所",
  1012. text: "restroom",
  1013. },
  1014. {
  1015. value: "置物櫃",
  1016. text: "items_and_luggage_storage",
  1017. },
  1018. {
  1019. value: "飲水機",
  1020. text: "ice_warmed_water_dispenser",
  1021. },
  1022. {
  1023. value: "無障礙廁所",
  1024. text: "accessible_facilities",
  1025. },
  1026. {
  1027. value: "哺乳室",
  1028. text: "nursing_room",
  1029. },
  1030. {
  1031. value: "客服(停車折抵)",
  1032. text: "service_counter_parking_discount",
  1033. },
  1034. {
  1035. value: "退稅/外幣兌換櫃台",
  1036. text: "tax_refund_currency_exchange",
  1037. },
  1038. {
  1039. value: "計程車乘車處",
  1040. text: "taxi_station",
  1041. },
  1042. {
  1043. value: "美食街",
  1044. text: "food_court",
  1045. },
  1046. {
  1047. value: "超市",
  1048. text: "supermarket",
  1049. },
  1050. {
  1051. value: "捷運",
  1052. text: "metro_station",
  1053. },
  1054. {
  1055. value: "伴手禮區",
  1056. text: "snackable_souvenirs",
  1057. },
  1058. ],
  1059. // navigation: [
  1060. // "景觀餐廳櫃台",
  1061. // "ATM",
  1062. // "觀景台售票處",
  1063. // "廁所",
  1064. // "置物櫃",
  1065. // "飲水機",
  1066. // "無障礙廁所",
  1067. // "哺乳室",
  1068. // "客服(停車折抵)",
  1069. // "退稅/外幣兌換櫃台",
  1070. // "計程車乘車處",
  1071. // "美食街",
  1072. // "超市",
  1073. // "捷運",
  1074. // "伴手禮區",
  1075. // ],
  1076. },
  1077. {
  1078. location: "2F 3號電梯", // 編號 8
  1079. navigation: [
  1080. {
  1081. value: "景觀餐廳櫃台",
  1082. text: "high_rise_restaurant_reception",
  1083. },
  1084. {
  1085. value: "ATM",
  1086. text: "atm",
  1087. },
  1088. {
  1089. value: "觀景台售票處",
  1090. text: "observatory_ticket_office",
  1091. },
  1092. {
  1093. value: "廁所",
  1094. text: "restroom",
  1095. },
  1096. {
  1097. value: "置物櫃",
  1098. text: "items_and_luggage_storage",
  1099. },
  1100. {
  1101. value: "飲水機",
  1102. text: "ice_warmed_water_dispenser",
  1103. },
  1104. {
  1105. value: "無障礙廁所",
  1106. text: "accessible_facilities",
  1107. },
  1108. {
  1109. value: "哺乳室",
  1110. text: "nursing_room",
  1111. },
  1112. {
  1113. value: "計程車乘車處",
  1114. text: "taxi_station",
  1115. },
  1116. {
  1117. value: "退稅/外幣兌換櫃台",
  1118. text: "tax_refund_currency_exchange",
  1119. },
  1120. {
  1121. value: "客服(停車折抵)",
  1122. text: "service_counter_parking_discount",
  1123. },
  1124. ],
  1125. // navigation: [
  1126. // "景觀餐廳櫃台",
  1127. // "ATM",
  1128. // "觀景台售票處",
  1129. // "廁所",
  1130. // "置物櫃",
  1131. // "飲水機",
  1132. // "無障礙廁所",
  1133. // "哺乳室",
  1134. // "計程車乘車處",
  1135. // "退稅/外幣兌換櫃台",
  1136. // "客服(停車折抵)",
  1137. // ],
  1138. },
  1139. {
  1140. location: "89F 觀景台", // 編號 9
  1141. navigation: [
  1142. {
  1143. value: "景觀餐廳櫃台",
  1144. text: "high_rise_restaurant_reception",
  1145. },
  1146. {
  1147. value: "ATM",
  1148. text: "atm",
  1149. },
  1150. {
  1151. value: "客服",
  1152. text: "service_counter",
  1153. },
  1154. {
  1155. value: "91F戶外區",
  1156. text: "91f_outdoor_area",
  1157. },
  1158. {
  1159. value: "廁所",
  1160. text: "restroom",
  1161. },
  1162. {
  1163. value: "101F排隊處",
  1164. text: "101f_queue_area",
  1165. },
  1166. ],
  1167. // navigation: [
  1168. // "景觀餐廳櫃台",
  1169. // "ATM",
  1170. // "客服",
  1171. // "91F戶外區",
  1172. // "廁所",
  1173. // "101F排隊處",
  1174. // ],
  1175. },
  1176. {
  1177. location: "88F 觀景台", // 編號 10
  1178. navigation: [
  1179. {
  1180. value: "景觀餐廳櫃台",
  1181. text: "high_rise_restaurant_reception",
  1182. },
  1183. {
  1184. value: "ATM",
  1185. text: "atm",
  1186. },
  1187. {
  1188. value: "廁所",
  1189. text: "restroom",
  1190. },
  1191. {
  1192. value: "飲水機",
  1193. text: "ice_warmed_water_dispenser",
  1194. },
  1195. {
  1196. value: "哺乳室",
  1197. text: "nursing_room",
  1198. },
  1199. ],
  1200. // navigation: ["景觀餐廳櫃台", "ATM", "廁所", "飲水機", "哺乳室"],
  1201. },
  1202. ]);
  1203. // 平面圖
  1204. let mapList = reactive([
  1205. {
  1206. title: "B1 平面圖",
  1207. },
  1208. {
  1209. title: "1F 平面圖",
  1210. },
  1211. {
  1212. title: "2F 平面圖",
  1213. },
  1214. ]);
  1215. let assignLocation = ref("當前位置"); // 指定定位點
  1216. let assignNavigationList = ref(null); // 指定導覽點列表
  1217. // let assignLocationFloor = ref(null); // 指定定位點樓層
  1218. // let assignNavigation = ref(null); // 指定導覽點
  1219. // let navigationBtn = reactive(["B1", "1F", "2F", "4F", "5F", "89F", "91F"]);
  1220. let arVideo = ref(null);
  1221. let arVideoDialog = ref(false);
  1222. // 取得 AR 導覽影片
  1223. async function getArviews(route, text, type = "") {
  1224. let url;
  1225. let lang = getLang();
  1226. console.log("text >>>", text);
  1227. if (type === "garden") {
  1228. console.log("route", route);
  1229. let start;
  1230. // if (route === "B1 鼎泰豐旁 數位屏幕") {
  1231. // start = "B1 鼎泰豐";
  1232. // } else if (route === "B1 松智藍梯梯廳") {
  1233. // start = "B1 3號電梯";
  1234. // }
  1235. switch (route) {
  1236. case "B1 鼎泰豐旁 數位屏幕":
  1237. start = "B1 鼎泰豐";
  1238. break;
  1239. case "B1 中環WOW屏幕":
  1240. start = "B1 中環";
  1241. break;
  1242. case "B1 信義橘梯梯廳":
  1243. start = "B1 2號電梯";
  1244. break;
  1245. case "B1 信義綠梯梯廳":
  1246. start = "B1 4號電梯";
  1247. break;
  1248. case "B1 松智藍梯梯廳":
  1249. start = "B1 3號電梯";
  1250. break;
  1251. case "1F 信義綠梯出入口":
  1252. start = "1F 信義環";
  1253. break;
  1254. case "1F 松智梯廳":
  1255. start = "1F 3號電梯";
  1256. break;
  1257. case "2F 松智藍梯梯廳":
  1258. start = "2F 3號電梯";
  1259. break;
  1260. default:
  1261. break;
  1262. }
  1263. url = `https://cmm.ai:9101/arviews?language=${lang}&start=${start}&end=觀景台售票處`;
  1264. } else {
  1265. url = `https://cmm.ai:9101/arviews?language=${lang}&start=${assignLocation.value}&end=${route}`;
  1266. }
  1267. console.log("url", url);
  1268. messages.value.push({
  1269. label: "text",
  1270. author: "ai",
  1271. body: text,
  1272. });
  1273. try {
  1274. const response = await axios.get(url);
  1275. console.log("AR 導覽影片", response);
  1276. messages.value.push({
  1277. label: "ar_views",
  1278. author: "ai",
  1279. body: response.data,
  1280. });
  1281. } catch (error) {
  1282. console.log("error", error);
  1283. }
  1284. }
  1285. // 取得定位點 & 導覽點
  1286. function changeLocation(item) {
  1287. assignLocation.value = item;
  1288. console.log("定位點:", item);
  1289. let assign = locationList.filter((e) => e.location === item);
  1290. console.log("assign", assign);
  1291. assignNavigationList.value = assign[0].navigation;
  1292. // assignLocation.value = item.location;
  1293. // assignNavigationList.value = item.navigation;
  1294. console.log("assignNavigationList.value", assignNavigationList.value);
  1295. messages.value.push({
  1296. label: "text",
  1297. author: "ai",
  1298. body: t("select_navigation_location"),
  1299. });
  1300. messages.value.push({
  1301. label: "navigation",
  1302. author: "ai",
  1303. body: assignNavigationList.value,
  1304. });
  1305. }
  1306. // 顯示平面圖
  1307. function assignMapImg(item) {
  1308. console.log("顯示平面圖 item", item);
  1309. let name;
  1310. if (item.title === "B1 平面圖") {
  1311. name = "All_b1";
  1312. } else if (item.title === "1F 平面圖") {
  1313. name = "All_1";
  1314. } else if (item.title === "2F 平面圖") {
  1315. name = "All_2";
  1316. }
  1317. messages.value.push({
  1318. label: "map_img",
  1319. author: "ai",
  1320. body: name,
  1321. });
  1322. }
  1323. // 動態引入視頻文件
  1324. const videoSources = ref([]); // 開場白影片(中)
  1325. const videoSourcesEn = ref([]); // 開場白影片(英)
  1326. const videoMuteSources = ref([]); // 點頭影片(靜音)
  1327. const videoSpeakSources = ref([]); // 動嘴型影片
  1328. const loadVideoSources = async () => {
  1329. // 本地端影片路徑
  1330. // const start1 = await import("@/assets/video/start_1.mp4");
  1331. // const start2 = await import("@/assets/video/start_2.mp4");
  1332. // const mute_1 = await import("@/assets/video/mute_1.mp4");
  1333. // const mute_2 = await import("@/assets/video/mute_2.mp4");
  1334. // const speak_1 = await import("@/assets/video/speak_1.mp4");
  1335. // const speak_2 = await import("@/assets/video/speak_2.mp4");
  1336. // videoSpeakSources.value = [speak_1.default, speak_2.default];
  1337. videoSources.value = [
  1338. "https://cmm.ai/101-ai-chatbot-new/video/start_1.mp4",
  1339. "https://cmm.ai/101-ai-chatbot-new/video/start_2.mp4",
  1340. ];
  1341. videoSourcesEn.value = [
  1342. "https://cmm.ai/101-ai-chatbot-new/video/start_en_1.mp4",
  1343. "https://cmm.ai/101-ai-chatbot-new/video/start_en_2.mp4",
  1344. ];
  1345. videoMuteSources.value = [
  1346. "https://cmm.ai/101-ai-chatbot-new/video/mute_1.mp4",
  1347. "https://cmm.ai/101-ai-chatbot-new/video/mute_2.mp4",
  1348. ];
  1349. videoSpeakSources.value = [
  1350. "https://cmm.ai/101-ai-chatbot-new/video/speak_1.mp4",
  1351. "https://cmm.ai/101-ai-chatbot-new/video/speak_2.mp4",
  1352. ];
  1353. };
  1354. let videoSrc = ref("");
  1355. let hideAnchorPrologue = ref(false); // 顯示開場白 or 點頭影片
  1356. let videoIndex = ref(null); // 影片編號
  1357. // 選擇類別
  1358. async function selectCategory(value, index) {
  1359. assignCategory.value = value;
  1360. assignCategoryIndex.value = index;
  1361. console.log("selectCategory index", assignCategoryIndex.value);
  1362. console.log("selectCategory value", assignCategory.value);
  1363. if (value === "叫出真人客服") {
  1364. showAnchor.value = true;
  1365. if (currentAudio.value && isAudioPlaying.value) {
  1366. // currentAudio.value.addEventListener("ended", onAudioEnded); // 監聽音訊播放結束
  1367. // setTimeout(() => {
  1368. // video.value.play();
  1369. // }, 0);
  1370. // return;
  1371. handleVoice("pause"); // 暫停音訊
  1372. }
  1373. // 隨機取得影片路徑
  1374. await loadVideoSources();
  1375. // 主播開場白只顯示一次
  1376. if (!hideAnchorPrologue.value) {
  1377. let lang = getLang();
  1378. let sources;
  1379. if (lang === "ch") {
  1380. sources = videoSources.value;
  1381. } else if (lang === "en") {
  1382. sources = videoSourcesEn.value;
  1383. }
  1384. const randomIndex = Math.floor(Math.random() * sources.length);
  1385. videoSrc.value = sources[randomIndex];
  1386. hideAnchorPrologue.value = true;
  1387. videoIndex.value = randomIndex + 1;
  1388. // const randomIndex = Math.floor(Math.random() * videoSources.value.length);
  1389. // videoSrc.value = videoSources.value[randomIndex];
  1390. // hideAnchorPrologue.value = true;
  1391. // videoIndex.value = randomIndex + 1;
  1392. } else {
  1393. const randomIndex = Math.floor(
  1394. Math.random() * videoMuteSources.value.length
  1395. );
  1396. videoSrc.value = videoMuteSources.value[randomIndex];
  1397. videoIndex.value = randomIndex + 1;
  1398. }
  1399. // 播放影片
  1400. setTimeout(() => {
  1401. videoPlay();
  1402. }, 0);
  1403. // const randomIndex = Math.floor(Math.random() * videoSources.value.length);
  1404. // videoSrc.value = videoSources.value[randomIndex];
  1405. }
  1406. // else if (value === "隱藏真人客服") {
  1407. // showAnchor.value = false;
  1408. // video.value.pause();
  1409. // menuList[0][0].text = "customer_show";
  1410. // menuList[0][0].value = "叫出真人客服";
  1411. // }
  1412. else if (value === "秘境花園觀景台") {
  1413. messages.value.push({
  1414. label: "text",
  1415. author: "ai",
  1416. body: t("observatory_info.tickets.purchase"),
  1417. });
  1418. messages.value.push({
  1419. label: "observation_deck",
  1420. author: "ai",
  1421. body: observationList,
  1422. });
  1423. } else if (value === "位置導引") {
  1424. messages.value.push({
  1425. label: "text",
  1426. author: "ai",
  1427. body: t("qr_code_scan_prompt"),
  1428. });
  1429. // messages.value.push({
  1430. // label: "map_img",
  1431. // author: "ai",
  1432. // body: mapList,
  1433. // });
  1434. messages.value.push({
  1435. label: "location",
  1436. author: "ai",
  1437. body: locationList,
  1438. });
  1439. } else if (value === "美食/伴手禮") {
  1440. getAd("美食伴手禮");
  1441. messages.value.push({
  1442. label: "text",
  1443. author: "ai",
  1444. body: t("food_souvenirs_info.searching"),
  1445. });
  1446. messages.value.push({
  1447. label: "dining",
  1448. author: "ai",
  1449. body: diningList,
  1450. });
  1451. } else if (value === "購物及優惠") {
  1452. getAd("購物及優惠");
  1453. messages.value.push({
  1454. label: "shopping",
  1455. author: "ai",
  1456. body: shoppingList,
  1457. });
  1458. } else if (value === "服務資訊") {
  1459. messages.value.push({
  1460. label: "text",
  1461. author: "ai",
  1462. body: t("service_info.inquiry_prompt"),
  1463. });
  1464. messages.value.push({
  1465. label: "service",
  1466. author: "ai",
  1467. body: serviceList,
  1468. });
  1469. }
  1470. }
  1471. let secondaryAd = ref({}); // 隨機廣告
  1472. let secondaryAdShow = ref(false);
  1473. // 取得隨機廣告 (美食伴手禮/購物及優惠)
  1474. async function getAd(type) {
  1475. let lang = getLang();
  1476. let url = `https://cmm.ai:9101/ad/${type}?language=${lang}`;
  1477. try {
  1478. const response = await axios.get(url);
  1479. console.log("response", response);
  1480. secondaryAd.value = response.data.data;
  1481. // secondaryAdShow.value = true; // 取消蓋版廣告
  1482. messages.value.push({
  1483. label: "brand",
  1484. author: "ai",
  1485. body: [
  1486. {
  1487. info: response.data.data,
  1488. },
  1489. ],
  1490. });
  1491. } catch (error) {
  1492. console.log("error", error);
  1493. }
  1494. }
  1495. // 服務資訊回覆
  1496. function handleService(title, depiction) {
  1497. messages.value.push({
  1498. label: "text",
  1499. author: "user",
  1500. body: title,
  1501. });
  1502. if (title !== "AI 天燈") {
  1503. messages.value.push({
  1504. label: "text",
  1505. author: "ai",
  1506. body: depiction,
  1507. });
  1508. } else {
  1509. window.location.href = depiction;
  1510. // window.open(depiction, "_blank"); // 另開天燈頁面
  1511. }
  1512. }
  1513. // 參觀資訊回覆
  1514. function handleVisit(title, depiction) {
  1515. messages.value.push({
  1516. label: "text",
  1517. author: "user",
  1518. body: title,
  1519. });
  1520. messages.value.push({
  1521. label: "text",
  1522. author: "ai",
  1523. body: depiction,
  1524. });
  1525. }
  1526. // 計算使用次數
  1527. async function handleClick() {
  1528. let url = "https://cmm.ai:9101/click";
  1529. try {
  1530. const response = await axios.get(url);
  1531. console.log("Click", response);
  1532. } catch (error) {
  1533. console.log("error", error);
  1534. }
  1535. }
  1536. let langList = reactive([
  1537. {
  1538. lang: "中文",
  1539. value: "zh-tw",
  1540. },
  1541. {
  1542. lang: "English",
  1543. value: "en-us",
  1544. },
  1545. // {
  1546. // lang: "日本語",
  1547. // value: "ja-jp",
  1548. // },
  1549. // {
  1550. // lang: "한국어",
  1551. // value: "ko-kr",
  1552. // },
  1553. ]);
  1554. const btnList = reactive([
  1555. {
  1556. title: "observation_deck",
  1557. value: "秘境花園觀景台",
  1558. },
  1559. {
  1560. title: "location_guide",
  1561. value: "位置導引",
  1562. },
  1563. {
  1564. title: "food_souvenirs",
  1565. value: "美食伴手禮",
  1566. },
  1567. {
  1568. title: "shopping_discounts",
  1569. value: "購物及優惠",
  1570. },
  1571. {
  1572. title: "service_information",
  1573. value: "服務資訊",
  1574. },
  1575. ]);
  1576. function getImageUrl(name) {
  1577. return new URL(`../assets/img/icon/${name}`, import.meta.url).href;
  1578. }
  1579. let showAnchor = ref(false); // AI 主播影片
  1580. let videoContent = ref(null); // 主播影片區塊
  1581. // 動態更改主播區塊位置
  1582. // watch(showAnchor, () => {
  1583. // console.log("showAnchor", showAnchor.value);
  1584. // nextTick(() => {
  1585. // changeAnchorTop();
  1586. // });
  1587. // });
  1588. // watch(hideMenu, () => {
  1589. // nextTick(() => {
  1590. // changeAnchorTop();
  1591. // });
  1592. // });
  1593. // function changeAnchorTop() {
  1594. // const menuOffsetTop = menu.value.offsetTop;
  1595. // videoContent.value.style.top = `${menuOffsetTop - 170}px`;
  1596. // }
  1597. const menuList = reactive([
  1598. [
  1599. {
  1600. imgSrc: "素材-05.png",
  1601. text: "customer_show",
  1602. value: "叫出真人客服",
  1603. },
  1604. { imgSrc: "素材-06.png", text: "service_information", value: "服務資訊" },
  1605. { imgSrc: "素材-07.png", text: "shopping_discounts", value: "購物及優惠" },
  1606. ],
  1607. [
  1608. {
  1609. imgSrc: "素材-08.png",
  1610. text: "observation_deck",
  1611. value: "秘境花園觀景台",
  1612. },
  1613. { imgSrc: "素材-09.png", text: "food_souvenirs", value: "美食/伴手禮" },
  1614. { imgSrc: "素材-10.png", text: "location_guide", value: "位置導引" },
  1615. ],
  1616. ]);
  1617. // 美食伴手禮 or 購物及優惠類別篩選
  1618. async function findBrand(value) {
  1619. console.log("findBrand", value);
  1620. if (value === "館外店家") {
  1621. value = "館外";
  1622. }
  1623. let lang = getLang();
  1624. let url = `https://cmm.ai:9101/find_brand?keyword=${value}&language=${lang}`;
  1625. try {
  1626. const response = await axios.get(url);
  1627. console.log("response", response);
  1628. // response.data.data.map(
  1629. // (item) => (item.info.tags = JSON.parse(item.info.tags))
  1630. // );
  1631. messages.value.push({
  1632. label: "brand",
  1633. author: "ai",
  1634. body: response.data.data,
  1635. });
  1636. assignCategoryIndex.value = null;
  1637. assignCategory.value = "";
  1638. // messages.value.push({
  1639. // label: "text",
  1640. // author: "ai",
  1641. // body: "請選擇問題類型:",
  1642. // });
  1643. // messages.value.push({
  1644. // label: "btn-list",
  1645. // author: "ai",
  1646. // body: "",
  1647. // });
  1648. } catch (error) {
  1649. console.log("error", error);
  1650. }
  1651. }
  1652. // 處理電話格式
  1653. // function getPhoneNumber(phoneString) {
  1654. // const parts = phoneString.split("\n");
  1655. // return parts[1];
  1656. // }
  1657. // 取得線上購票
  1658. async function getStaticTickets(type) {
  1659. let url = `https://cmm.ai:9101/static_tickets?is_Chinese=${type}`;
  1660. let info = {
  1661. buttonList: [], // 按鈕
  1662. ticketList: [], // 票券
  1663. };
  1664. try {
  1665. const response = await axios.get(url);
  1666. console.log("線上購票", response.data.result);
  1667. response.data.result.map((item) => info.ticketList.push(item));
  1668. console.log("info", info);
  1669. messages.value.push({
  1670. label: "ticket",
  1671. author: "ai",
  1672. body: info,
  1673. });
  1674. } catch (error) {
  1675. console.log("error", error);
  1676. }
  1677. }
  1678. // 秘境花園觀景台對話
  1679. function handleObservationDialog(value) {
  1680. console.log("value", value);
  1681. if (value === "線上購票") {
  1682. messages.value.push({
  1683. label: "text",
  1684. author: "ai",
  1685. body: t("observatory_info.tickets.id_card"),
  1686. });
  1687. messages.value.push({
  1688. label: "check",
  1689. author: "ai",
  1690. body: [
  1691. {
  1692. value: "是",
  1693. text: "observatory_info.tickets.yes",
  1694. },
  1695. {
  1696. value: "否",
  1697. text: "observatory_info.tickets.no",
  1698. },
  1699. ],
  1700. });
  1701. } else if (value === "是" || value === "否") {
  1702. if (value === "是") {
  1703. getStaticTickets("1");
  1704. } else if (value === "否") {
  1705. getStaticTickets("0");
  1706. }
  1707. messages.value.push({
  1708. label: "text",
  1709. author: "ai",
  1710. body: t("observatory_info.tickets.ticket_type"),
  1711. });
  1712. } else if (value === "參觀資訊") {
  1713. messages.value.push({
  1714. label: "text",
  1715. author: "ai",
  1716. body: t("observatory_info.visitor.question"),
  1717. });
  1718. messages.value.push({
  1719. label: "text",
  1720. author: "ai",
  1721. body: t("observatory_info.visitor.faq"),
  1722. });
  1723. messages.value.push({
  1724. label: "visit",
  1725. author: "ai",
  1726. body: visitList,
  1727. });
  1728. } else if (value === "實境景色") {
  1729. // window.location.href = "https://www.youtube.com/watch?v=RVV00FZbeH0";
  1730. window.open("https://www.youtube.com/watch?v=RVV00FZbeH0", "_blank"); // 另開頁面
  1731. } else if (value === "前往秘境花園觀景台") {
  1732. messages.value.push({
  1733. label: "text",
  1734. author: "ai",
  1735. body: t("select_location"),
  1736. });
  1737. messages.value.push({
  1738. label: "garden_route",
  1739. author: "ai",
  1740. body: [
  1741. "B1 鼎泰豐旁 數位屏幕",
  1742. "B1 中環WOW屏幕",
  1743. "B1 信義橘梯梯廳",
  1744. "B1 信義綠梯梯廳",
  1745. "B1 松智藍梯梯廳",
  1746. "1F 信義綠梯出入口",
  1747. "1F 松智梯廳",
  1748. "2F 松智藍梯梯廳",
  1749. ],
  1750. });
  1751. }
  1752. }
  1753. // 購物及優惠對話
  1754. function handleShoppingDialog(value) {
  1755. console.log("value", value);
  1756. if (value === "購物品牌查詢") {
  1757. messages.value.push({
  1758. label: "text",
  1759. author: "ai",
  1760. body: "請選擇品牌類別",
  1761. });
  1762. messages.value.push({
  1763. label: "shopping_brand",
  1764. author: "ai",
  1765. body: brandList,
  1766. });
  1767. } else if (value === "國際貴賓卡專屬禮遇") {
  1768. messages.value.push({
  1769. label: "text",
  1770. author: "user",
  1771. body: "國際貴賓卡專屬禮遇",
  1772. });
  1773. messages.value.push({
  1774. label: "text",
  1775. author: "ai",
  1776. body: t("shopping_discounts_info.tourist_card.content"),
  1777. });
  1778. } else if (value === "參觀資訊") {
  1779. messages.value.push({
  1780. label: "text",
  1781. author: "ai",
  1782. body: t("observatory_info.visitor.question"),
  1783. });
  1784. messages.value.push({
  1785. label: "text",
  1786. author: "ai",
  1787. body: t("observatory_info.visitor.faq"),
  1788. });
  1789. messages.value.push({
  1790. label: "visit",
  1791. author: "ai",
  1792. body: visitList,
  1793. });
  1794. }
  1795. }
  1796. let visitList = reactive([
  1797. {
  1798. title: "observatory_info.visitor.events_q",
  1799. depiction: "observatory_info.visitor.events_a",
  1800. },
  1801. {
  1802. title: "observatory_info.visitor.ball_q",
  1803. depiction: "observatory_info.visitor.ball_a",
  1804. },
  1805. {
  1806. title: "observatory_info.visitor.accessible_q",
  1807. depiction: "observatory_info.visitor.accessible_a",
  1808. },
  1809. ]);
  1810. // 判斷價格是否包含 $ 符號
  1811. function formatPrice(price) {
  1812. if (price === "") {
  1813. return "";
  1814. } else {
  1815. if (price.includes("$")) {
  1816. return price;
  1817. } else {
  1818. return `$${price}`;
  1819. }
  1820. }
  1821. }
  1822. let currentAudio = ref(null); // 當前音訊
  1823. let audioDuration = ref(null); // 音訊秒數
  1824. // 文字轉語音 (TTS)
  1825. async function handleTTS(message) {
  1826. console.log("handleTTS", message);
  1827. let audioLang; // 音訊語言
  1828. let lang = localStorage.getItem("lang");
  1829. console.log("lang", lang);
  1830. switch (lang) {
  1831. case "zh-tw":
  1832. audioLang = "cmn-TW";
  1833. break;
  1834. case "en-us":
  1835. audioLang = "en-US";
  1836. break;
  1837. case "ja-jp":
  1838. audioLang = "ja-JP";
  1839. break;
  1840. case "ko-kr":
  1841. audioLang = "ko-KR";
  1842. break;
  1843. default:
  1844. break;
  1845. }
  1846. // let url = `https://bf18-61-230-0-215.ngrok-free.app/ttsTry/tts_try?message=${message}&type=101`;
  1847. let url = `https://bf18-61-230-0-215.ngrok-free.app/gcp/text-to-speech?language_code=${audioLang}&gender=female`;
  1848. const formData = new FormData();
  1849. formData.append("text", message);
  1850. try {
  1851. const response = await axios.post(url, formData, { responseType: "blob" });
  1852. console.log("TTS response", response);
  1853. const blob = new Blob([response.data], { type: "audio/mp3" });
  1854. const audioUrl = URL.createObjectURL(blob);
  1855. console.log("audioUrl", audioUrl);
  1856. cutVideo();
  1857. // 取得 mp3 音訊秒數
  1858. // audio.addEventListener("loadedmetadata", function () {
  1859. // audioDuration.value = audio.duration;
  1860. // cutVideo();
  1861. // });
  1862. // 暫停當前音訊
  1863. if (currentAudio.value) {
  1864. currentAudio.value.pause();
  1865. currentAudio.value.currentTime = 0;
  1866. }
  1867. // 播放音檔
  1868. currentAudio.value = new Audio(audioUrl);
  1869. } catch (error) {
  1870. console.log("error", error);
  1871. }
  1872. }
  1873. let videoLoading = ref(false);
  1874. let isAudioPlaying = ref(false); // 音訊播放狀態
  1875. // 取得語音回覆 mp4
  1876. async function cutVideo() {
  1877. videoSrc.value = videoSpeakSources.value[videoIndex.value - 1];
  1878. video.value.load(); // 重新讀取影片
  1879. // let duration = Math.floor(audioDuration.value); // 音訊秒數
  1880. // 影片和音訊加載完成後播放
  1881. video.value.oncanplay = () => {
  1882. setTimeout(() => {
  1883. // 監聽音訊播放結束
  1884. currentAudio.value.addEventListener("ended", onAudioEnded);
  1885. // 監聽音訊播放狀態
  1886. currentAudio.value.addEventListener("play", onAudioPlay);
  1887. currentAudio.value.addEventListener("pause", onAudioPause);
  1888. video.value.play(); // 播放影片
  1889. currentAudio.value.currentTime = 0; // 重置時間
  1890. currentAudio.value.play(); // 播放音訊
  1891. isVideoPause.value = true;
  1892. videoLoading.value = false;
  1893. }, 500);
  1894. };
  1895. // video.value.currentTime = 0;
  1896. // video.value.play(); // 播放影片
  1897. // currentAudio.value.play(); // 播放音訊
  1898. // isVideoPause.value = true;
  1899. // videoLoading.value = false;
  1900. // setTimeout(()=>{
  1901. // video.value.play(); // 播放影片
  1902. // },300)
  1903. // // 監聽音訊播放狀態
  1904. // currentAudio.value.addEventListener("play", onAudioPlay);
  1905. // currentAudio.value.addEventListener("pause", onAudioPause);
  1906. // 監聽音訊播放結束
  1907. // currentAudio.value.addEventListener("ended", onAudioEnded);
  1908. // if (video.value.currentTime >= duration) {
  1909. // video.value.pause();
  1910. // }
  1911. }
  1912. // 音訊結束後暫停影片播放
  1913. const onAudioEnded = () => {
  1914. video.value.pause();
  1915. };
  1916. // 判斷音訊是否為播放狀態
  1917. const onAudioPlay = () => {
  1918. isAudioPlaying.value = true;
  1919. console.log("isAudioPlaying.value", isAudioPlaying.value);
  1920. };
  1921. const onAudioPause = () => {
  1922. isAudioPlaying.value = false;
  1923. console.log("isAudioPlaying.value", isAudioPlaying.value);
  1924. };
  1925. const audioURL = ref(null);
  1926. const audioFile = ref(null); // 音訊檔案
  1927. let recordTime = ref(0); // 錄音時間
  1928. let isRecording = ref(false); // 錄音狀態
  1929. let timer;
  1930. // 語音轉文字
  1931. async function handleAudioToText() {
  1932. isRecording.value = false;
  1933. let audioLang; // 音訊語言
  1934. let lang = localStorage.getItem("lang");
  1935. console.log("lang", lang);
  1936. switch (lang) {
  1937. case "zh-tw":
  1938. audioLang = "cmn-Hant-TW";
  1939. break;
  1940. case "en-us":
  1941. audioLang = "en-US";
  1942. break;
  1943. case "ja-jp":
  1944. audioLang = "ja-JP";
  1945. break;
  1946. case "ko-kr":
  1947. audioLang = "ko-KR";
  1948. break;
  1949. default:
  1950. break;
  1951. }
  1952. // let url = `http://172.104.93.163:9880/whisper/${audioLang}/`;
  1953. // let url = `https://bf18-61-230-0-215.ngrok-free.app/whisper/${audioLang}/`;
  1954. let url = `https://bf18-61-230-0-215.ngrok-free.app/gcp/speech-to-text?language_code=${audioLang}`;
  1955. const formData = new FormData();
  1956. formData.append("file", audioFile.value);
  1957. try {
  1958. console.log("audioFile.value", audioFile.value);
  1959. const response = await axios.post(url, formData);
  1960. console.log("語音轉文字 response", response);
  1961. // showAnchor.value = false; // 關閉主播視窗
  1962. userMessage.value = response.data[0];
  1963. // handleTTS(userMessage.value); // 取得語音回覆
  1964. if (response.data[0] && response.data[0] !== "") {
  1965. sendMessage(); // 傳送使用者訊息
  1966. } else {
  1967. if (showAnchor.value) {
  1968. alert("語音辨識有誤,請重新錄製。");
  1969. videoLoading.value = false;
  1970. return;
  1971. } else {
  1972. messages.value.push({
  1973. label: "text",
  1974. author: "user",
  1975. body: "語音辨識有誤,請重新錄製。",
  1976. });
  1977. }
  1978. }
  1979. } catch (error) {
  1980. console.log("error", error);
  1981. }
  1982. }
  1983. // 語音轉文字 (使用 recorder-core 錄音)
  1984. let rec, wave;
  1985. // 調用 open 請求錄音權限
  1986. let recOpen = function (success) {
  1987. rec = Recorder({
  1988. type: "mp3",
  1989. sampleRate: 16000,
  1990. bitRate: 16,
  1991. onProcess: function (
  1992. buffers,
  1993. powerLevel,
  1994. bufferDuration,
  1995. bufferSampleRate,
  1996. newBufferIdx,
  1997. asyncEnd
  1998. ) {
  1999. wave &&
  2000. wave.input(buffers[buffers.length - 1], powerLevel, bufferSampleRate);
  2001. },
  2002. });
  2003. rec.open(
  2004. function () {
  2005. if (Recorder.WaveView) wave = Recorder.WaveView({ elem: ".recwave" });
  2006. success && success();
  2007. },
  2008. function (msg, isUserNotAllow) {
  2009. // 使用者未授權或不支援
  2010. console.log((isUserNotAllow ? "UserNotAllow," : "") + "無法錄音:" + msg);
  2011. }
  2012. );
  2013. };
  2014. /** 開始錄音 **/
  2015. function recStart() {
  2016. togglePause("pause"); // 暫停影片音訊
  2017. // 需先呼叫 recOpen() 開啟錄音後才能調用 start、stop 方法
  2018. console.log("開始錄音");
  2019. recOpen(function () {
  2020. isRecording.value = true;
  2021. // 開始計時
  2022. timer = setInterval(() => {
  2023. recordTime.value += 1;
  2024. }, 1000);
  2025. rec.start();
  2026. });
  2027. }
  2028. /** 結束錄音 **/
  2029. function recStop() {
  2030. videoLoading.value = true;
  2031. rec.stop(
  2032. function (blob, duration) {
  2033. // 利用 URL 產生本地檔案位址,不用時需要 revokeObjectURL
  2034. let localUrl = (window.URL || webkitURL).createObjectURL(blob); // 該 url 只能本地端使用 (例如給 audio.src 進行播放,或是給 a.href download 進行下載)
  2035. console.log(blob, localUrl, "時長:" + duration + "ms");
  2036. // rec.close(); // 釋放錄音資源 (若不釋放系統或瀏覽器將持續提示在錄音中)
  2037. // rec = null;
  2038. // 將 Blob 轉換為 File 對象
  2039. audioFile.value = new File([blob], "recording.mp3", {
  2040. type: "audio/mp3",
  2041. });
  2042. console.log("audioFile", audioFile.value);
  2043. // 自動播放(測試用)
  2044. // const audio = document.createElement("audio");
  2045. // audio.src = localUrl;
  2046. // audio.autoplay = true;
  2047. // audio
  2048. // .play()
  2049. // .then(() => {
  2050. // console.log("Audio is playing automatically.");
  2051. // })
  2052. // .catch((error) => {
  2053. // console.error("Error playing audio:", error);
  2054. // });
  2055. rec.close(); // 釋放錄音資源 (若不釋放系統或瀏覽器將持續提示在錄音中)
  2056. rec = null;
  2057. if (recordTime.value !== 0) {
  2058. handleAudioToText(); // 語音轉文字
  2059. } else {
  2060. isRecording.value = false;
  2061. }
  2062. clearInterval(timer); // 清空計時秒數
  2063. recordTime.value = 0;
  2064. },
  2065. function (msg) {
  2066. console.log("錄音失敗:" + msg);
  2067. rec.close(); // 可以透過 stop 方法的第 3 個參數來自動呼叫 close
  2068. rec = null;
  2069. }
  2070. );
  2071. }
  2072. // 關閉主播視窗 (結束錄音)
  2073. function closeRec() {
  2074. video.value.pause();
  2075. isVideoPause.value = true;
  2076. recordTime.value = 0;
  2077. clearInterval(timer); // 清空計時秒數
  2078. if (isRecording.value) {
  2079. recStop();
  2080. }
  2081. showAnchor.value = false;
  2082. }
  2083. // watch(showAnchor, (val) => {
  2084. // if (val) {
  2085. // isVideoPause.value = true;
  2086. // }
  2087. // });
  2088. let isVideoPause = ref(true);
  2089. // AI 主播影片播放 & 暫停
  2090. function togglePause(val) {
  2091. if (val === "pause") {
  2092. // video.value.pause();
  2093. isVideoPause.value = false;
  2094. if (video.value) {
  2095. video.value.pause();
  2096. }
  2097. if (currentAudio.value) {
  2098. currentAudio.value.pause(); // 暫停音訊
  2099. }
  2100. } else {
  2101. // video.value.play();
  2102. isVideoPause.value = true;
  2103. if (video.value) {
  2104. video.value.play();
  2105. }
  2106. if (currentAudio.value) {
  2107. currentAudio.value.play(); // 播放音訊
  2108. currentAudio.value.addEventListener("ended", onAudioEnded);
  2109. }
  2110. }
  2111. }
  2112. // 語音暫停
  2113. function handleVoice(state) {
  2114. if (currentAudio.value) {
  2115. if (state === "pause") {
  2116. currentAudio.value.pause();
  2117. isVideoPause.value = false;
  2118. } else {
  2119. currentAudio.value.play();
  2120. isVideoPause.value = true;
  2121. }
  2122. }
  2123. }
  2124. </script>
  2125. <template>
  2126. <Navbar v-if="!isLanguagePage" />
  2127. <div v-if="isLanguagePage" class="lang-content">
  2128. <div class="btn-list">
  2129. <button
  2130. v-for="(item, index) in langList"
  2131. :key="index"
  2132. @click="chooseLang(item.value)"
  2133. class="main-btn"
  2134. >
  2135. {{ item.lang }}
  2136. </button>
  2137. </div>
  2138. </div>
  2139. <div v-else-if="!isLanguagePage && !showAnchor" class="main-containar">
  2140. <!-- <div class="video-content">
  2141. <video
  2142. ref="video"
  2143. preload
  2144. playsinline
  2145. :style="{ opacity: !isTTSVideo ? '1' : '0' }"
  2146. >
  2147. <source src="../assets/video/start_1.mp4" type="video/mp4" />
  2148. Your browser does not support the video tag.
  2149. </video>
  2150. <video
  2151. ref="ttsVideo"
  2152. preload
  2153. playsinline
  2154. :style="{ opacity: isTTSVideo ? '1' : '0' }"
  2155. >
  2156. <source :src="ttsVideoSrc" type="video/mp4" />
  2157. Your browser does not support the video tag.
  2158. </video>
  2159. <button @click="handleVideo(isTTSVideo)" class="control-btn">
  2160. <img v-if="!videoPause" src="../assets/img/pause-button.png" alt="" />
  2161. <img v-else src="../assets/img/play-button.png" alt="" />
  2162. </button>
  2163. </div> -->
  2164. <!-- <Navbar /> -->
  2165. <div v-if="chatLoading" class="d-flex justify-center pt-5">
  2166. <v-progress-circular color="primary" indeterminate></v-progress-circular>
  2167. </div>
  2168. <div
  2169. v-else
  2170. class="chat-content"
  2171. :class="{ 'hide-menu': hideMenu }"
  2172. :style="{ paddingBottom: !hideMenu ? menuHeight + 'px' : '50px' }"
  2173. >
  2174. <!-- <div class="headline">
  2175. <h1>{{ t("title") }}</h1>
  2176. <button @click="isRotate = !isRotate">
  2177. <img
  2178. :class="{ rotate: isRotate }"
  2179. src="../assets/img/angles-up-solid.svg"
  2180. alt=""
  2181. />
  2182. </button>
  2183. </div> -->
  2184. <!-- 購票介面 -->
  2185. <TicketPurchase />
  2186. <router-link
  2187. to="/brand-search"
  2188. style="color: #fff; text-decoration: none"
  2189. class="ps-3"
  2190. >館外品牌測試頁面</router-link
  2191. >
  2192. <!-- 語音暫停按鈕 -->
  2193. <div v-if="currentAudio" class="voice-btn">
  2194. <button v-if="isAudioPlaying" @click="togglePause('pause')">
  2195. <img src="../assets/img/pause-button.png" alt="" />
  2196. <p>語音</p>
  2197. </button>
  2198. <button v-else @click="togglePause('play')">
  2199. <img src="../assets/img/play-button.png" alt="" />
  2200. <p>語音</p>
  2201. </button>
  2202. </div>
  2203. <section
  2204. ref="chatArea"
  2205. class="chat-area"
  2206. :class="{ 'hide-menu': hideMenu }"
  2207. >
  2208. <div v-for="message in messages" class="message-content">
  2209. <p
  2210. v-if="message.label === 'text'"
  2211. class="message animate__animated"
  2212. :class="{
  2213. 'message-out': message.author === 'user',
  2214. 'message-in': message.author !== 'user',
  2215. animate__fadeInRight: message.author === 'user',
  2216. animate__fadeInLeft: message.author !== 'user',
  2217. }"
  2218. v-html="message.body"
  2219. ></p>
  2220. <!-- 問題類別 -->
  2221. <!-- <div v-else-if="message.label === 'btn-list'">
  2222. <ul class="btn-list">
  2223. <li v-for="(btn, index) in btnList">
  2224. <button
  2225. :class="{ active: index === assignCategoryIndex }"
  2226. @click="selectCategory(btn.value, index)"
  2227. >
  2228. {{ t(`${btn.title}`) }}
  2229. </button>
  2230. </li>
  2231. </ul>
  2232. </div> -->
  2233. <!-- 秘境花園觀景台 -->
  2234. <div v-else-if="message.label === 'observation_deck'">
  2235. <swiper
  2236. :slidesPerView="'auto'"
  2237. :spaceBetween="20"
  2238. :modules="modules"
  2239. class="btn-swiper"
  2240. >
  2241. <swiper-slide v-for="item in message.body">
  2242. <div class="btn-container">
  2243. <button @click="handleObservationDialog(item.value)">
  2244. {{ t(item.text) }}
  2245. </button>
  2246. </div>
  2247. </swiper-slide>
  2248. </swiper>
  2249. </div>
  2250. <!-- 確認按鈕 -->
  2251. <div v-else-if="message.label === 'check'">
  2252. <swiper
  2253. :slidesPerView="'auto'"
  2254. :spaceBetween="20"
  2255. :modules="modules"
  2256. class="btn-swiper"
  2257. >
  2258. <swiper-slide v-for="item in message.body">
  2259. <div class="btn-container">
  2260. <button @click="handleObservationDialog(item.value)">
  2261. {{ t(item.text) }}
  2262. </button>
  2263. </div>
  2264. </swiper-slide>
  2265. </swiper>
  2266. </div>
  2267. <!-- 參觀資訊 -->
  2268. <div v-else-if="message.label === 'visit'">
  2269. <swiper
  2270. :slidesPerView="'auto'"
  2271. :spaceBetween="20"
  2272. :modules="modules"
  2273. class="btn-swiper"
  2274. >
  2275. <swiper-slide v-for="item in message.body">
  2276. <div class="btn-container">
  2277. <button
  2278. @click="handleVisit(t(item.title), t(item.depiction))"
  2279. >
  2280. {{ t(item.title) }}
  2281. </button>
  2282. </div>
  2283. </swiper-slide>
  2284. </swiper>
  2285. </div>
  2286. <!-- 位置導引 (定位點) -->
  2287. <div v-else-if="message.label === 'location'">
  2288. <!-- <v-select
  2289. @update:modelValue="changeLocation"
  2290. v-model="assignLocation"
  2291. label="當前位置"
  2292. :items="locationList"
  2293. item-title="location"
  2294. item-value="location"
  2295. variant="outlined"
  2296. density="comfortable"
  2297. hide-details
  2298. color="primary"
  2299. class="mt-5 me-15"
  2300. :menu-props="{ maxHeight: '155px' }"
  2301. ></v-select> -->
  2302. <!-- 掃描 QR Code -->
  2303. <v-btn @click="qrCodeDialog = true" color="primary" class="mt-5">
  2304. {{ t("tap_to_start_scan") }}
  2305. </v-btn>
  2306. <v-dialog v-model="qrCodeDialog" width="auto">
  2307. <v-card max-width="400">
  2308. <v-card-text>
  2309. <div v-if="qrCodeLoading" class="d-flex justify-center pt-5">
  2310. <v-progress-circular
  2311. color="primary"
  2312. indeterminate
  2313. ></v-progress-circular>
  2314. </div>
  2315. <qrcode-stream
  2316. v-show="!qrCodeLoading"
  2317. @detect="onDetect"
  2318. @camera-on="onInit"
  2319. ></qrcode-stream>
  2320. </v-card-text>
  2321. <template v-slot:actions>
  2322. <v-btn
  2323. class="ms-auto"
  2324. text="關閉"
  2325. @click="qrCodeDialog = false"
  2326. ></v-btn>
  2327. </template>
  2328. </v-card>
  2329. </v-dialog>
  2330. <!-- <div class="d-flex">
  2331. <v-menu location="top">
  2332. <template v-slot:activator="{ props }">
  2333. <v-btn class="mt-5 py-2" color="primary" dark v-bind="props">
  2334. <p class="me-2">{{ assignLocation }}</p>
  2335. <svg
  2336. xmlns="http://www.w3.org/2000/svg"
  2337. width="18"
  2338. height="18"
  2339. fill="currentColor"
  2340. class="bi bi-caret-down-fill pt-1"
  2341. viewBox="0 0 16 16"
  2342. >
  2343. <path
  2344. d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"
  2345. />
  2346. </svg>
  2347. </v-btn>
  2348. </template>
  2349. <v-list style="max-height: 155px; overflow-y: auto">
  2350. <v-list-item
  2351. v-for="(item, index) in locationList"
  2352. :key="index"
  2353. >
  2354. <v-list-item-title @click="changeLocation(item)">
  2355. {{ index + 1 }}. {{ item.location }}
  2356. </v-list-item-title>
  2357. </v-list-item>
  2358. </v-list>
  2359. </v-menu>
  2360. <v-menu location="top">
  2361. <template v-slot:activator="{ props }">
  2362. <v-btn
  2363. class="ms-5 mt-5 py-2"
  2364. color="primary"
  2365. dark
  2366. v-bind="props"
  2367. >
  2368. <p class="me-2">查看平面圖</p>
  2369. <svg
  2370. xmlns="http://www.w3.org/2000/svg"
  2371. width="18"
  2372. height="18"
  2373. fill="currentColor"
  2374. class="bi bi-caret-down-fill pt-1"
  2375. viewBox="0 0 16 16"
  2376. >
  2377. <path
  2378. d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"
  2379. />
  2380. </svg>
  2381. </v-btn>
  2382. </template>
  2383. <v-list style="max-height: 155px; overflow-y: auto">
  2384. <v-list-item v-for="(item, index) in mapList" :key="index">
  2385. <v-list-item-title @click="assignMapImg(item)">
  2386. {{ item.title }}
  2387. </v-list-item-title>
  2388. </v-list-item>
  2389. </v-list>
  2390. </v-menu>
  2391. </div> -->
  2392. </div>
  2393. <!-- 定位點平面圖 -->
  2394. <!-- <div v-else-if="message.label === 'map_img'" class="mt-5">
  2395. <img
  2396. class="map-img"
  2397. :class="{ 'show-anchor': showAnchor }"
  2398. :src="`../src/assets/img/map/${message.body}.webp`"
  2399. alt=""
  2400. />
  2401. </div> -->
  2402. <!-- 位置導引 (導覽點) -->
  2403. <div v-else-if="message.label === 'navigation'">
  2404. <!-- <v-select
  2405. @update:modelValue="changeLocation"
  2406. v-model="assignNavigation"
  2407. label="導覽位置"
  2408. :items="assignNavigationList"
  2409. variant="solo"
  2410. hide-details
  2411. class="bg-white mt-4"
  2412. ></v-select> -->
  2413. <swiper
  2414. :slidesPerView="'auto'"
  2415. :spaceBetween="20"
  2416. :modules="modules"
  2417. class="btn-swiper"
  2418. >
  2419. <swiper-slide v-for="item in message.body">
  2420. <div class="btn-container">
  2421. <button
  2422. @click="
  2423. getArviews(item.value, t(`navigation.${item.text}`))
  2424. "
  2425. >
  2426. {{ t(`navigation.${item.text}`) }}
  2427. </button>
  2428. </div>
  2429. </swiper-slide>
  2430. </swiper>
  2431. </div>
  2432. <!-- 秘境花園觀景台 -->
  2433. <div v-else-if="message.label === 'garden_route'">
  2434. <!-- <v-select
  2435. @update:modelValue="changeLocation"
  2436. v-model="assignNavigation"
  2437. label="導覽位置"
  2438. :items="assignNavigationList"
  2439. variant="solo"
  2440. hide-details
  2441. class="bg-white mt-4"
  2442. ></v-select> -->
  2443. <swiper
  2444. :slidesPerView="'auto'"
  2445. :spaceBetween="20"
  2446. :modules="modules"
  2447. class="btn-swiper"
  2448. >
  2449. <swiper-slide v-for="item in message.body">
  2450. <div class="btn-container">
  2451. <button @click="getArviews(item, item, 'garden')">
  2452. {{ item }}
  2453. </button>
  2454. </div>
  2455. </swiper-slide>
  2456. </swiper>
  2457. </div>
  2458. <!-- AR 導覽影片 -->
  2459. <div v-else-if="message.label === 'ar_views'">
  2460. <div
  2461. class="message animate__animated"
  2462. :class="{
  2463. 'message-out': message.author === 'user',
  2464. 'message-in': message.author !== 'user',
  2465. animate__fadeInRight: message.author === 'user',
  2466. animate__fadeInLeft: message.author !== 'user',
  2467. }"
  2468. >
  2469. <p v-html="message.body.words"></p>
  2470. <button @click="arVideoDialog = true" class="ar-link my-3">
  2471. 進行 AR 導覽
  2472. </button>
  2473. <v-dialog v-model="arVideoDialog" width="auto">
  2474. <v-card class="ar-card">
  2475. <v-card-title class="mt-3"> AR 導覽 </v-card-title>
  2476. <v-card-text class="pa-0">
  2477. <a-scene>
  2478. <a-assets>
  2479. <video
  2480. id="vr-video"
  2481. ref="arVideo"
  2482. :src="message.body.url"
  2483. autoplay
  2484. crossorigin="anonymous"
  2485. ecrossorigin="anonymous"
  2486. ></video>
  2487. </a-assets>
  2488. <a-sky src="#vr-video"></a-sky>
  2489. </a-scene>
  2490. </v-card-text>
  2491. <template v-slot:actions>
  2492. <v-btn
  2493. class="ms-auto"
  2494. text="關閉"
  2495. @click="arVideoDialog = false"
  2496. ></v-btn>
  2497. </template>
  2498. </v-card>
  2499. </v-dialog>
  2500. </div>
  2501. </div>
  2502. <!-- 美食伴手禮 -->
  2503. <div v-else-if="message.label === 'dining'">
  2504. <!-- <ul class="btn-options">
  2505. <li v-for="item in message.body">
  2506. <button @click="findBrand(item.value)">
  2507. {{ t(item.text) }}
  2508. </button>
  2509. </li>
  2510. </ul> -->
  2511. <swiper
  2512. :slidesPerView="'auto'"
  2513. :spaceBetween="20"
  2514. :modules="modules"
  2515. class="btn-swiper"
  2516. >
  2517. <swiper-slide v-for="item in message.body">
  2518. <div class="btn-container">
  2519. <button @click="findBrand(item.value)">
  2520. {{ t(item.text) }}
  2521. </button>
  2522. </div>
  2523. </swiper-slide>
  2524. </swiper>
  2525. </div>
  2526. <!-- 購物及優惠 -->
  2527. <div v-else-if="message.label === 'shopping'">
  2528. <!-- <ul class="btn-options">
  2529. <li v-for="item in message.body">
  2530. <button @click="handleShoppingDialog(item.value)">
  2531. {{ t(item.text) }}
  2532. </button>
  2533. </li>
  2534. </ul> -->
  2535. <swiper
  2536. :slidesPerView="'auto'"
  2537. :spaceBetween="20"
  2538. :modules="modules"
  2539. class="btn-swiper"
  2540. >
  2541. <swiper-slide v-for="item in message.body">
  2542. <div class="btn-container">
  2543. <button @click="handleShoppingDialog(item.value)">
  2544. {{ t(item.text) }}
  2545. </button>
  2546. </div>
  2547. </swiper-slide>
  2548. </swiper>
  2549. </div>
  2550. <!-- 購物品牌查詢 -->
  2551. <div v-else-if="message.label === 'shopping_brand'">
  2552. <!-- <ul class="btn-options">
  2553. <li v-for="item in message.body">
  2554. <button @click="findBrand(item.value)">
  2555. {{ item.value }}
  2556. </button>
  2557. </li>
  2558. </ul> -->
  2559. <swiper
  2560. :slidesPerView="'auto'"
  2561. :spaceBetween="20"
  2562. :modules="modules"
  2563. class="btn-swiper"
  2564. >
  2565. <swiper-slide v-for="item in message.body">
  2566. <div class="btn-container">
  2567. <button @click="findBrand(item.value)">
  2568. {{ t(item.text) }}
  2569. </button>
  2570. </div>
  2571. </swiper-slide>
  2572. </swiper>
  2573. </div>
  2574. <!-- 服務資訊 (常見問題) -->
  2575. <div v-else-if="message.label === 'service'">
  2576. <swiper
  2577. :slidesPerView="'auto'"
  2578. :spaceBetween="20"
  2579. :modules="modules"
  2580. class="btn-swiper"
  2581. >
  2582. <swiper-slide v-for="item in message.body">
  2583. <div class="btn-container">
  2584. <button
  2585. @click="handleService(t(item.title), t(item.depiction))"
  2586. >
  2587. {{ t(item.title) }}
  2588. </button>
  2589. </div>
  2590. </swiper-slide>
  2591. </swiper>
  2592. </div>
  2593. <!-- 推薦資訊 -->
  2594. <div v-else-if="message.label === 'ticket'" class="ticket-item">
  2595. <!-- 按鈕 -->
  2596. <swiper
  2597. v-if="message.body.buttonList.length"
  2598. :slidesPerView="'auto'"
  2599. :spaceBetween="20"
  2600. :modules="modules"
  2601. class="btn-swiper"
  2602. :style="{
  2603. marginBottom: message.body.ticketList.length ? '35px' : '0px',
  2604. }"
  2605. >
  2606. <swiper-slide v-for="item in message.body.buttonList">
  2607. <div class="btn-container">
  2608. <button @click="setBtnValue(item.info.value)">
  2609. {{ item.info.key }}
  2610. </button>
  2611. </div>
  2612. </swiper-slide>
  2613. </swiper>
  2614. <!-- 票券 -->
  2615. <swiper
  2616. v-if="message.body.ticketList.length"
  2617. :slidesPerView="1"
  2618. :navigation="true"
  2619. :modules="modules"
  2620. class="ticket-slide"
  2621. >
  2622. <swiper-slide v-for="item in message.body.ticketList">
  2623. <div class="slide-item">
  2624. <img
  2625. class="cover-img"
  2626. :src="item.info.img || item.info.cover_img"
  2627. alt=""
  2628. />
  2629. <section>
  2630. <h3 class="title">
  2631. {{ item.info.name || item.info.title }}
  2632. </h3>
  2633. <div class="price-info">
  2634. <span>{{ item.info.floor || item.info.price }}</span>
  2635. <div class="link-btn">
  2636. <a
  2637. :href="item.info.website_url || item.info.url"
  2638. target="_blank"
  2639. >
  2640. {{ t("ctaGoUrl") }}
  2641. </a>
  2642. </div>
  2643. </div>
  2644. <p class="description">
  2645. {{ item.info.content || item.info.description }}
  2646. </p>
  2647. </section>
  2648. </div>
  2649. </swiper-slide>
  2650. </swiper>
  2651. </div>
  2652. <!-- 品牌資訊 -->
  2653. <div v-else-if="message.label === 'brand'" class="ticket-item">
  2654. <!-- 按鈕 -->
  2655. <swiper
  2656. v-if="message.body.buttonList?.length"
  2657. :slidesPerView="'auto'"
  2658. :spaceBetween="20"
  2659. :modules="modules"
  2660. class="btn-swiper"
  2661. :style="{
  2662. marginBottom: message.body.ticketList.length ? '35px' : '0px',
  2663. }"
  2664. >
  2665. <swiper-slide v-for="item in message.body.buttonList">
  2666. <div class="btn-container">
  2667. <button @click="setBtnValue(item.info.value)">
  2668. {{ item.info.key }}
  2669. </button>
  2670. </div>
  2671. </swiper-slide>
  2672. </swiper>
  2673. <!-- 票券 -->
  2674. <swiper
  2675. v-if="message.body.ticketList?.length"
  2676. :slidesPerView="1"
  2677. :navigation="true"
  2678. :modules="modules"
  2679. class="ticket-slide"
  2680. >
  2681. <swiper-slide v-for="item in message.body.ticketList">
  2682. <div class="slide-item">
  2683. <img
  2684. class="cover-img aa"
  2685. :src="item.info.img || item.info.cover_img"
  2686. alt=""
  2687. />
  2688. <section>
  2689. <h3 class="title">
  2690. {{ item.info.name || item.info.title }}
  2691. </h3>
  2692. <div class="price-info">
  2693. <span>{{ item.info.floor || item.info.price }}</span>
  2694. <div class="link-btn">
  2695. <a :href="item.info.url" target="_blank">
  2696. {{ t("ctaGoUrl") }}
  2697. </a>
  2698. </div>
  2699. </div>
  2700. <p class="description">
  2701. {{ item.info.content || item.info.description }}
  2702. </p>
  2703. </section>
  2704. </div>
  2705. </swiper-slide>
  2706. </swiper>
  2707. <!-- 美食/伴手禮 -->
  2708. <swiper
  2709. v-if="message.body.length"
  2710. :slidesPerView="1"
  2711. :navigation="true"
  2712. :modules="modules"
  2713. class="ticket-slide"
  2714. >
  2715. <swiper-slide v-for="item in message.body">
  2716. <div class="slide-item">
  2717. <img
  2718. class="cover-img"
  2719. :src="item.info.img || item.info.cover_img"
  2720. alt=""
  2721. />
  2722. <section>
  2723. <h3 class="title">
  2724. {{ item.info.name || item.info.title }}
  2725. </h3>
  2726. <div
  2727. v-if="item.info.phone !== ''"
  2728. class="d-flex align-center mt-3 mb-5"
  2729. >
  2730. <img
  2731. src="../assets/img/phone-solid.svg"
  2732. width="15"
  2733. alt=""
  2734. />
  2735. <p class="ms-2">
  2736. {{ item.info.phone }}
  2737. </p>
  2738. </div>
  2739. <div class="price-info">
  2740. <span>{{ item.info.floor || item.info.price }}</span>
  2741. <div class="link-btn">
  2742. <a :href="item.info.url" target="_blank">
  2743. {{ t("ctaGoUrl") }}
  2744. </a>
  2745. </div>
  2746. </div>
  2747. <p class="description">
  2748. {{ item.info.content || item.info.description }}
  2749. </p>
  2750. </section>
  2751. </div>
  2752. </swiper-slide>
  2753. </swiper>
  2754. <!-- <swiper
  2755. v-if="message.body.length"
  2756. :slidesPerView="'auto'"
  2757. :spaceBetween="20"
  2758. :modules="modules"
  2759. >
  2760. <swiper-slide v-for="item in message.body">
  2761. <img
  2762. class="cover-img"
  2763. :src="item.info.img || item.info.cover_img"
  2764. alt=""
  2765. />
  2766. <section>
  2767. <h3 class="title">{{ item.info.name || item.info.title }}</h3>
  2768. <div
  2769. v-if="item.info.phone !== ''"
  2770. class="d-flex align-center mt-3 mb-5"
  2771. >
  2772. <img
  2773. src="../assets/img/phone-solid.svg"
  2774. width="15"
  2775. alt=""
  2776. />
  2777. <p class="ms-2">
  2778. {{ getPhoneNumber(item.info.phone) }}
  2779. </p>
  2780. </div>
  2781. <div class="price-info">
  2782. <span>{{ item.info.floor || item.info.price }}</span>
  2783. <div class="link-btn">
  2784. <a :href="item.info.url" target="_blank">
  2785. {{ t("ctaGoUrl") }}
  2786. </a>
  2787. </div>
  2788. </div>
  2789. <p class="description">
  2790. {{ item.info.content || item.info.description }}
  2791. </p>
  2792. </section>
  2793. </swiper-slide>
  2794. </swiper> -->
  2795. </div>
  2796. <!-- 推薦資訊 -->
  2797. <div v-else-if="message.label === 'recommend'" class="recommend-item">
  2798. <img class="cover-img" :src="message.body.cover_img" alt="" />
  2799. <section>
  2800. <h3 class="title">{{ message.body.title }}</h3>
  2801. <p class="description">{{ message.body.description }}</p>
  2802. <div class="link-btn">
  2803. <a
  2804. :href="message.body.store_info_url || message.body.url"
  2805. target="_blank"
  2806. >
  2807. {{ t("ctaBuyNow") }}
  2808. </a>
  2809. <a :href="message.body.website_url" target="_blank"> 官網 </a>
  2810. </div>
  2811. <p class="date">{{ message.body.date }} 限時搶購</p>
  2812. </section>
  2813. </div>
  2814. <!-- 店家資訊 -->
  2815. <div v-else-if="message.label === 'store'" class="store-item">
  2816. <p class="headline">店家資訊</p>
  2817. <div class="cover-img">
  2818. <img :src="message.body.cover_img" alt="" />
  2819. <h3 class="title">{{ message.body.title }}</h3>
  2820. </div>
  2821. <section>
  2822. <div class="info">
  2823. <p>
  2824. <img
  2825. src="../assets/img/location-dot-solid.svg"
  2826. width="15"
  2827. alt=""
  2828. />
  2829. {{ message.body.location }}
  2830. </p>
  2831. <p>
  2832. <img src="../assets/img/phone-solid.svg" width="15" alt="" />
  2833. {{ message.body.contact }}
  2834. </p>
  2835. </div>
  2836. <p class="description">{{ message.body.description }}</p>
  2837. </section>
  2838. </div>
  2839. <!-- 套票資訊 -->
  2840. <div v-else-if="message.label === 'ticket'" class="ticket-item">
  2841. <img class="cover-img" :src="message.body.cover_img" alt="" />
  2842. <section>
  2843. <h3 class="title">{{ message.body.title }}</h3>
  2844. <div class="link-btn">
  2845. <a :href="message.body.store_info_url" target="_blank">
  2846. 線上預約
  2847. </a>
  2848. </div>
  2849. <p class="description">{{ message.body.description }}</p>
  2850. <span class="price-item">{{ message.body.price }}</span>
  2851. </section>
  2852. </div>
  2853. </div>
  2854. <!-- 對話輸入框 -->
  2855. <!-- <form
  2856. @submit.prevent="sendMessage('out')"
  2857. class="chat-inputs"
  2858. :class="{ 'd-none': !hideMenu }"
  2859. >
  2860. <button @click="hideMenu = false" class="menu-btn">
  2861. <img src="../assets/img/icon/素材-02.png" alt="" width="50" />
  2862. </button>
  2863. <input
  2864. v-model="userMessage"
  2865. type="text"
  2866. placeholder="Type a message..."
  2867. />
  2868. <button type="submit" class="submit">
  2869. <img width="20" src="../assets/img/paper-plane-solid.svg" alt="" />
  2870. </button>
  2871. </form> -->
  2872. </section>
  2873. <!-- 廣告輪播 -->
  2874. <!-- <div class="slider-content">
  2875. <swiper
  2876. :slidesPerView="1"
  2877. :autoplay="{
  2878. delay: 5000,
  2879. disableOnInteraction: false,
  2880. }"
  2881. :modules="modules"
  2882. >
  2883. <swiper-slide>
  2884. <img src="../assets/img/banner-1.jpg" alt="" />
  2885. </swiper-slide>
  2886. <swiper-slide>
  2887. <img src="../assets/img/banner-2.jpg" alt="" />
  2888. </swiper-slide>
  2889. </swiper>
  2890. </div> -->
  2891. <!-- AI 主播影片 -->
  2892. <!-- <div
  2893. ref="videoContent"
  2894. v-show="showAnchor"
  2895. class="video-content"
  2896. :class="{ 'video-down': hideMenu }"
  2897. >
  2898. <div v-show="!isTTSVideo">
  2899. <video ref="video" preload playsinline>
  2900. <source src="../assets/video/start_1.mp4" type="video/mp4" />
  2901. Your browser does not support the video tag.
  2902. </video>
  2903. </div>
  2904. <div v-show="isTTSVideo">
  2905. <video ref="ttsVideo" preload playsinline>
  2906. <source :src="ttsVideoSrc" type="video/mp4" />
  2907. Your browser does not support the video tag.
  2908. </video>
  2909. </div>
  2910. </div> -->
  2911. </div>
  2912. <!-- 底部選單 -->
  2913. <div ref="menu" class="menu">
  2914. <!-- AI 主播影片 -->
  2915. <!-- <div
  2916. v-show="showAnchor"
  2917. class="video-content"
  2918. :class="{ 'video-down': hideMenu }"
  2919. >
  2920. <div v-show="!isTTSVideo">
  2921. <video ref="video" preload playsinline>
  2922. <source src="../assets/video/start_1.mp4" type="video/mp4" />
  2923. Your browser does not support the video tag.
  2924. </video>
  2925. </div>
  2926. <div v-show="isTTSVideo">
  2927. <video ref="ttsVideo" preload playsinline>
  2928. <source
  2929. :src="`https://bf18-61-230-0-215.ngrok-free.app/${ttsVideoSrc}`"
  2930. type="video/mp4"
  2931. />
  2932. Your browser does not support the video tag.
  2933. </video>
  2934. </div>
  2935. </div> -->
  2936. <div class="menu-table" :class="{ 'hide-table': hideMenu }">
  2937. <table class="mt-3">
  2938. <tbody>
  2939. <tr v-for="(row, rowIndex) in menuList" :key="rowIndex">
  2940. <td v-for="(item, itemIndex) in row" :key="itemIndex">
  2941. <button @click="selectCategory(item.value, itemIndex)">
  2942. <img :src="getImageUrl(item.imgSrc)" alt="" class="icon" />
  2943. <p>{{ t(`${item.text}`) }}</p>
  2944. </button>
  2945. </td>
  2946. </tr>
  2947. </tbody>
  2948. </table>
  2949. </div>
  2950. <!-- <table class="mt-3">
  2951. <tbody>
  2952. <tr v-for="(row, rowIndex) in menuList" :key="rowIndex">
  2953. <td v-for="(item, itemIndex) in row" :key="itemIndex">
  2954. <button @click="selectCategory(item.value, itemIndex)">
  2955. <img :src="getImageUrl(item.imgSrc)" alt="" class="icon" />
  2956. <p>{{ t(`${item.text}`) }}</p>
  2957. </button>
  2958. </td>
  2959. </tr>
  2960. </tbody>
  2961. </table> -->
  2962. <div class="d-flex align-center position-relative">
  2963. <div class="position-absolute">
  2964. <button
  2965. v-if="!showInput"
  2966. @click="
  2967. hideMenu = true;
  2968. showInput = true;
  2969. "
  2970. class="ms-3 pt-1"
  2971. >
  2972. <img src="../assets/img/icon/素材-04.png" alt="" width="35" />
  2973. </button>
  2974. <button
  2975. v-else
  2976. @click="
  2977. hideMenu = false;
  2978. showInput = false;
  2979. "
  2980. >
  2981. <img
  2982. src="../assets/img/icon/素材-02.png"
  2983. alt=""
  2984. width="50"
  2985. class="pt-2"
  2986. />
  2987. </button>
  2988. </div>
  2989. <div class="w-100 d-flex align-center justify-center">
  2990. <button
  2991. v-if="!showInput"
  2992. @click="
  2993. hideMenu = true;
  2994. showInput = true;
  2995. "
  2996. class="d-flex align-center question-btn"
  2997. >
  2998. <img
  2999. class="me-2"
  3000. src="../assets/img/icon/素材-03.png"
  3001. alt=""
  3002. width="45"
  3003. />
  3004. {{ t("question") }}
  3005. </button>
  3006. <!-- 對話輸入框 -->
  3007. <form
  3008. v-else
  3009. @submit.prevent="sendMessage('text')"
  3010. class="chat-inputs"
  3011. :class="{ 'd-none': !showInput }"
  3012. >
  3013. <!-- <button @click="hideMenu = false" class="menu-btn">
  3014. <img src="../assets/img/icon/素材-02.png" alt="" width="50" />
  3015. </button> -->
  3016. <input
  3017. v-model="userMessage"
  3018. type="text"
  3019. placeholder="Type a message..."
  3020. />
  3021. <button type="submit" class="submit">
  3022. <img
  3023. width="20"
  3024. src="../assets/img/paper-plane-solid.svg"
  3025. alt=""
  3026. />
  3027. </button>
  3028. </form>
  3029. </div>
  3030. </div>
  3031. </div>
  3032. </div>
  3033. <!-- AI 主播語音轉文字 -->
  3034. <div v-else class="anchor-voice">
  3035. <div v-show="showAnchor" class="video-content">
  3036. <div>
  3037. <video ref="video" preload playsinline>
  3038. <source :src="videoSrc" type="video/mp4" />
  3039. <!-- <source src="../assets/video/start_1.mp4" type="video/mp4" /> -->
  3040. Your browser does not support the video tag.
  3041. </video>
  3042. <div v-if="videoLoading" class="video-progress">
  3043. <v-progress-circular
  3044. color="primary"
  3045. indeterminate
  3046. ></v-progress-circular>
  3047. </div>
  3048. </div>
  3049. <!-- <div v-show="isTTSVideo">
  3050. <video ref="ttsVideo" preload playsinline>
  3051. <source
  3052. :src="` ${ttsVideoSrc}`"
  3053. type="video/mp4"
  3054. />
  3055. Your browser does not support the video tag.
  3056. </video>
  3057. </div> -->
  3058. </div>
  3059. <div class="control-item">
  3060. <!-- <p class="text-center">連接中…</p> -->
  3061. <div class="d-flex flex-column align-center">
  3062. <audio v-if="audioURL" :src="audioURL" controls></audio>
  3063. <!-- <p
  3064. v-if="!isRecording"
  3065. class="mb-3 text-center"
  3066. v-html="t('system_construction')"
  3067. ></p> -->
  3068. <p v-if="!isRecording" class="mb-3">點選以進行錄音</p>
  3069. <p v-else class="mb-3">錄音中:{{ recordTime }} 秒</p>
  3070. <!-- 錄音按鈕 -->
  3071. <v-btn
  3072. v-if="!isRecording"
  3073. @click="recStart"
  3074. icon="mdi-circle"
  3075. size="large"
  3076. >
  3077. <v-icon icon="mdi-circle" color="red" size="large"></v-icon>
  3078. </v-btn>
  3079. <v-btn
  3080. v-else
  3081. @click="recStop"
  3082. icon="mdi-circle"
  3083. size="large"
  3084. color="success"
  3085. >
  3086. <v-icon icon="mdi-square" size="large"></v-icon>
  3087. </v-btn>
  3088. </div>
  3089. <div class="d-flex justify-space-between mt-3 mx-10">
  3090. <!-- 暫停按鈕 -->
  3091. <v-btn
  3092. v-if="isVideoPause"
  3093. @click="togglePause('pause')"
  3094. icon="mdi-pause"
  3095. size="large"
  3096. color="grey-darken-3"
  3097. ></v-btn>
  3098. <v-btn
  3099. v-else
  3100. @click="togglePause('play')"
  3101. icon="mdi-play"
  3102. size="large"
  3103. color="grey-darken-3"
  3104. ></v-btn>
  3105. <!-- 關閉按鈕 -->
  3106. <v-btn
  3107. @click="closeRec()"
  3108. icon="mdi-close-thick"
  3109. size="large"
  3110. color="red"
  3111. ></v-btn>
  3112. </div>
  3113. </div>
  3114. </div>
  3115. <!-- 主要廣告 -->
  3116. <v-dialog v-model="showAd">
  3117. <div class="ad-content">
  3118. <button @click="showAd = false" class="close-btn">
  3119. <svg
  3120. xmlns="http://www.w3.org/2000/svg"
  3121. width="28"
  3122. height="28"
  3123. fill="currentColor"
  3124. class="bi bi-x-circle"
  3125. viewBox="0 0 16 16"
  3126. >
  3127. <path
  3128. d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"
  3129. />
  3130. <path
  3131. d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708"
  3132. />
  3133. </svg>
  3134. </button>
  3135. <img class="cover-img" :src="ad.cover_img" alt="" />
  3136. <section>
  3137. <h2 class="title">{{ ad.title }}</h2>
  3138. <span></span>
  3139. <p v-html="ad.description"></p>
  3140. <div v-if="ad.included.length" class="product">
  3141. <p>訂單內含商品</p>
  3142. <ul>
  3143. <li v-for="(product, index) in ad.included" :key="index">
  3144. {{ product }}
  3145. </li>
  3146. </ul>
  3147. </div>
  3148. <div v-if="ad.branch.length" class="branch">
  3149. <p>分店資訊</p>
  3150. <ul>
  3151. <li v-for="(name, index) in ad.branch" :key="index">
  3152. {{ name }}
  3153. </li>
  3154. </ul>
  3155. </div>
  3156. <!-- <p class="date">{{ item.body.date }}</p> -->
  3157. <span v-if="ad.location !== ''" class="info justify-end">
  3158. <svg
  3159. xmlns="http://www.w3.org/2000/svg"
  3160. width="20"
  3161. height="20"
  3162. viewBox="0 0 384 512"
  3163. >
  3164. <path
  3165. d="M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"
  3166. />
  3167. </svg>
  3168. <p>{{ ad.location }}</p>
  3169. </span>
  3170. </section>
  3171. </div>
  3172. </v-dialog>
  3173. <!-- 隨機廣告 -->
  3174. <v-dialog v-model="secondaryAdShow">
  3175. <div class="ad-content">
  3176. <button @click="secondaryAdShow = false" class="close-btn">
  3177. <svg
  3178. xmlns="http://www.w3.org/2000/svg"
  3179. width="28"
  3180. height="28"
  3181. fill="currentColor"
  3182. class="bi bi-x-circle"
  3183. viewBox="0 0 16 16"
  3184. >
  3185. <path
  3186. d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"
  3187. />
  3188. <path
  3189. d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708"
  3190. />
  3191. </svg>
  3192. </button>
  3193. <img class="cover-img" :src="secondaryAd.img" alt="" />
  3194. <section>
  3195. <h2 class="title">{{ secondaryAd.name }}</h2>
  3196. <span class="price">
  3197. <p>{{ formatPrice(secondaryAd.price) }}</p>
  3198. <a :href="secondaryAd.url">前往官網</a>
  3199. </span>
  3200. <p class="mb-5" v-html="secondaryAd.content"></p>
  3201. <span v-if="secondaryAd.phone !== ''" class="info">
  3202. <img
  3203. src="../assets/img/phone-solid.svg"
  3204. width="15"
  3205. alt=""
  3206. style="
  3207. filter: invert(50%) sepia(21%) saturate(1061%) hue-rotate(348deg)
  3208. brightness(96%) contrast(92%);
  3209. "
  3210. />
  3211. <p class="ms-1">{{ secondaryAd.phone }}</p>
  3212. </span>
  3213. <span v-if="secondaryAd.address !== ''" class="info">
  3214. <svg
  3215. xmlns="http://www.w3.org/2000/svg"
  3216. width="20"
  3217. height="20"
  3218. viewBox="0 0 384 512"
  3219. class="mt-1"
  3220. >
  3221. <path
  3222. d="M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"
  3223. />
  3224. </svg>
  3225. <p>{{ secondaryAd.address }}</p>
  3226. </span>
  3227. </section>
  3228. </div>
  3229. </v-dialog>
  3230. <!-- <div
  3231. v-show="showAd"
  3232. v-for="(item, index) in ad"
  3233. :key="index"
  3234. class="ad-content"
  3235. >
  3236. <div>
  3237. <button @click="showAd = false" class="close-btn">
  3238. <svg
  3239. xmlns="http://www.w3.org/2000/svg"
  3240. width="28"
  3241. height="28"
  3242. fill="currentColor"
  3243. class="bi bi-x-circle"
  3244. viewBox="0 0 16 16"
  3245. >
  3246. <path
  3247. d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"
  3248. />
  3249. <path
  3250. d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708"
  3251. />
  3252. </svg>
  3253. </button>
  3254. <img class="cover-img" :src="item.body.cover_img" alt="" />
  3255. <section>
  3256. <h2 class="title">{{ item.body.title }}</h2>
  3257. <span></span>
  3258. <p>
  3259. {{ item.body.description }}
  3260. </p>
  3261. <div v-if="item.body.included.length" class="product">
  3262. <p>訂單內含商品</p>
  3263. <ul>
  3264. <li v-for="(product, index) in item.body.included" :key="index">
  3265. {{ product }}
  3266. </li>
  3267. </ul>
  3268. </div>
  3269. <div v-if="item.body.branch.length" class="branch">
  3270. <p>分店資訊</p>
  3271. <ul>
  3272. <li v-for="(name, index) in item.body.branch" :key="index">
  3273. {{ name }}
  3274. </li>
  3275. </ul>
  3276. </div>
  3277. <span v-if="item.body.location !== ''" class="map">
  3278. <svg
  3279. xmlns="http://www.w3.org/2000/svg"
  3280. width="20"
  3281. height="20"
  3282. viewBox="0 0 384 512"
  3283. >
  3284. <path
  3285. d="M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"
  3286. />
  3287. </svg>
  3288. <p>{{ item.body.location }}</p>
  3289. </span>
  3290. </section>
  3291. </div>
  3292. </div> -->
  3293. </template>
  3294. <style lang="scss">
  3295. .main-btn {
  3296. padding: 16px 70px;
  3297. font-size: 22px;
  3298. font-weight: 600;
  3299. border: none;
  3300. border-radius: 100px;
  3301. letter-spacing: 2px;
  3302. color: white;
  3303. background-color: var(--main-color);
  3304. cursor: pointer;
  3305. transition: all 0.3s;
  3306. &:hover {
  3307. background-color: #c19c75;
  3308. }
  3309. }
  3310. .lang-content {
  3311. width: 100%;
  3312. height: 100vh;
  3313. padding: 0 20vw;
  3314. display: flex;
  3315. align-items: center;
  3316. justify-content: center;
  3317. background-color: rgba(0, 0, 0, 0.6);
  3318. background-blend-mode: multiply;
  3319. background-image: url("@/assets/img/banner.jpg");
  3320. background-size: cover;
  3321. background-position: center center;
  3322. .main-btn {
  3323. margin-bottom: 40px;
  3324. &:last-child {
  3325. margin-bottom: 0;
  3326. }
  3327. }
  3328. .btn-list {
  3329. max-width: 400px;
  3330. display: flex;
  3331. flex-direction: column;
  3332. }
  3333. }
  3334. .main-containar {
  3335. width: 100%;
  3336. background-color: var(--sub-color);
  3337. // height: 150vh;
  3338. // min-height: -webkit-fill-available;
  3339. // display: flex;
  3340. // flex-direction: column;
  3341. // padding-bottom: 70vh;
  3342. // min-height: 100%;
  3343. // overflow-x: hidden;
  3344. // overflow-y: scroll;
  3345. .video-content {
  3346. width: 25vw;
  3347. position: absolute;
  3348. right: -5px;
  3349. top: -45vw;
  3350. @media (max-width: 360px) {
  3351. width: 22vw;
  3352. top: -40vw;
  3353. }
  3354. video {
  3355. // position: fixed;
  3356. // top: 50px;
  3357. // left: 0;
  3358. // right: 0;
  3359. // z-index: 10;
  3360. width: 100%;
  3361. height: auto;
  3362. }
  3363. .control-btn {
  3364. width: 33px;
  3365. height: 33px;
  3366. display: flex;
  3367. align-items: center;
  3368. justify-content: center;
  3369. position: absolute;
  3370. z-index: 50;
  3371. top: 70px;
  3372. right: 7px;
  3373. background: var(--main-color);
  3374. border: none;
  3375. border-radius: 100px;
  3376. img {
  3377. width: 25px;
  3378. filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(93deg)
  3379. brightness(103%) contrast(103%); // 改成白色
  3380. }
  3381. }
  3382. }
  3383. .chat-content {
  3384. width: 100%;
  3385. position: relative;
  3386. z-index: 200;
  3387. letter-spacing: 1px;
  3388. background-color: var(--sub-color);
  3389. &.hide-menu {
  3390. min-height: 90vh;
  3391. }
  3392. .headline {
  3393. display: flex;
  3394. align-items: center;
  3395. justify-content: space-between;
  3396. padding: 10px 25px;
  3397. border-radius: 15px 15px 0 0;
  3398. background-color: var(--main-color);
  3399. h1 {
  3400. font-size: 1.125rem;
  3401. font-weight: 500;
  3402. color: white;
  3403. @media (max-width: 375px) {
  3404. font-size: 0.875rem;
  3405. }
  3406. }
  3407. button {
  3408. padding-top: 3px;
  3409. display: flex;
  3410. align-items: center;
  3411. border: none;
  3412. background-color: transparent;
  3413. cursor: pointer;
  3414. img {
  3415. width: 25px;
  3416. height: 20px;
  3417. transition: all 0.3s;
  3418. transform: rotate(0deg);
  3419. &.rotate {
  3420. transform: rotate(180deg);
  3421. }
  3422. }
  3423. }
  3424. }
  3425. .chat-area {
  3426. // display: flex;
  3427. // flex-direction: column;
  3428. min-height: 60vh;
  3429. background: var(--sub-color);
  3430. padding: 0.5em 1em 1.5em;
  3431. .btn-list {
  3432. margin-top: 20px;
  3433. display: flex;
  3434. flex-wrap: wrap;
  3435. list-style: none;
  3436. button {
  3437. margin-right: 15px;
  3438. margin-bottom: 15px;
  3439. padding: 5px 15px;
  3440. color: white;
  3441. border: 2px solid white;
  3442. letter-spacing: 2px;
  3443. font-weight: bold;
  3444. text-shadow: 1px 1px 1px #939393;
  3445. &.active {
  3446. color: var(--sub-color);
  3447. background-color: white;
  3448. text-shadow: none;
  3449. }
  3450. }
  3451. }
  3452. }
  3453. .message-content {
  3454. display: flex;
  3455. flex-direction: column;
  3456. // margin-top: 20px;
  3457. .message {
  3458. max-width: 45%;
  3459. border-radius: 20px;
  3460. padding: 0.8em 1.2em;
  3461. white-space: pre-line;
  3462. &:first-child {
  3463. margin-top: 0;
  3464. }
  3465. @media (max-width: 600px) {
  3466. max-width: 75%;
  3467. font-size: 0.875em;
  3468. }
  3469. &.message-out {
  3470. margin-left: auto;
  3471. background: var(--bg-grey);
  3472. color: white;
  3473. }
  3474. &.message-in {
  3475. margin-right: auto;
  3476. background: #f1f0f0;
  3477. color: black;
  3478. }
  3479. &.message-in,
  3480. &.message-out {
  3481. margin-top: 20px;
  3482. }
  3483. }
  3484. }
  3485. .branch {
  3486. ul,
  3487. li,
  3488. p {
  3489. margin: 10px 0;
  3490. font-size: 14px;
  3491. }
  3492. }
  3493. .recommend-item {
  3494. width: 350px;
  3495. border-radius: 10px;
  3496. background-color: white;
  3497. }
  3498. .recommend-item,
  3499. .ticket-item {
  3500. .cover-img {
  3501. width: 100%;
  3502. height: 22.5vh;
  3503. object-fit: contain;
  3504. overflow: hidden;
  3505. border-radius: 10px 10px 0 0;
  3506. }
  3507. section {
  3508. padding: 15px 25px;
  3509. letter-spacing: 1px;
  3510. .title {
  3511. margin-bottom: 0;
  3512. font-weight: 600;
  3513. font-size: 1.25rem;
  3514. text-align: left;
  3515. // 超過則省略
  3516. overflow: hidden;
  3517. text-overflow: ellipsis;
  3518. display: -webkit-box;
  3519. -webkit-line-clamp: 1;
  3520. -webkit-box-orient: vertical;
  3521. line-break: after-white-space;
  3522. }
  3523. .description {
  3524. line-height: 1.8;
  3525. // text-align: justify;
  3526. font-size: 0.875rem;
  3527. }
  3528. .date {
  3529. color: #646464;
  3530. font-size: 0.875rem;
  3531. text-align: center;
  3532. }
  3533. }
  3534. .link-btn {
  3535. display: flex;
  3536. justify-content: center;
  3537. a {
  3538. display: block;
  3539. width: 100%;
  3540. max-width: 200px;
  3541. margin: 25px 3px;
  3542. padding: 8px;
  3543. text-align: center;
  3544. border-radius: 20px;
  3545. color: white;
  3546. background-color: var(--main-color);
  3547. text-decoration: none;
  3548. transition: all 0.3s;
  3549. &:hover {
  3550. opacity: 0.8;
  3551. }
  3552. }
  3553. }
  3554. }
  3555. .store-item {
  3556. width: 350px;
  3557. .cover-img {
  3558. position: relative;
  3559. margin-bottom: -5px;
  3560. img {
  3561. width: 100%;
  3562. height: 200px;
  3563. object-fit: cover;
  3564. }
  3565. .title {
  3566. position: absolute;
  3567. top: 50%;
  3568. left: 50%;
  3569. transform: translate(-50%, -50%);
  3570. color: white;
  3571. font-size: 1.25rem;
  3572. letter-spacing: 2px;
  3573. text-shadow: 2px 2px 4px #333;
  3574. }
  3575. }
  3576. .headline {
  3577. color: white;
  3578. justify-content: center;
  3579. }
  3580. section {
  3581. padding: 20px;
  3582. letter-spacing: 1px;
  3583. border-radius: 0 0 10px 10px;
  3584. background-color: white;
  3585. .info {
  3586. margin-bottom: 15px;
  3587. p {
  3588. display: flex;
  3589. align-items: center;
  3590. img {
  3591. margin-right: 10px;
  3592. }
  3593. &:last-child {
  3594. margin-top: 3px;
  3595. }
  3596. }
  3597. }
  3598. }
  3599. }
  3600. .ticket-item {
  3601. width: 100%;
  3602. margin-top: 20px;
  3603. h3 {
  3604. margin-bottom: 10px;
  3605. text-align: center;
  3606. }
  3607. .ticket-slide {
  3608. width: 80%;
  3609. position: relative;
  3610. .slide-item {
  3611. max-width: 60vw;
  3612. border-radius: 10px;
  3613. background-color: white;
  3614. }
  3615. .swiper-button-prev {
  3616. display: none;
  3617. }
  3618. }
  3619. .title,
  3620. .description {
  3621. // 超過則省略
  3622. overflow: hidden;
  3623. text-overflow: ellipsis;
  3624. display: -webkit-box;
  3625. // -webkit-line-clamp: 3;
  3626. -webkit-box-orient: vertical;
  3627. line-break: after-white-space;
  3628. }
  3629. .title {
  3630. -webkit-line-clamp: 3;
  3631. }
  3632. .description {
  3633. -webkit-line-clamp: 5;
  3634. }
  3635. section {
  3636. margin-top: -6px;
  3637. border-radius: 0 0 10px 10px;
  3638. background-color: white;
  3639. .link-btn {
  3640. a {
  3641. max-width: 150px;
  3642. margin: 0;
  3643. padding: 8px 12px;
  3644. font-size: 0.75rem;
  3645. }
  3646. }
  3647. .price-item {
  3648. display: block;
  3649. margin-top: 10px;
  3650. text-align: end;
  3651. }
  3652. .price-info {
  3653. margin: 20px 0;
  3654. display: flex;
  3655. align-items: center;
  3656. justify-content: space-between;
  3657. @media (max-width: 575px) {
  3658. font-size: 0.875rem;
  3659. // flex-direction: column;
  3660. // align-items: start;
  3661. }
  3662. span {
  3663. display: block;
  3664. margin: 10px 0;
  3665. padding-right: 5px;
  3666. font-size: 1rem;
  3667. font-weight: 600;
  3668. color: var(--main-color);
  3669. }
  3670. }
  3671. }
  3672. }
  3673. }
  3674. }
  3675. .btn-options {
  3676. // max-width: 85%;
  3677. margin-top: 15px;
  3678. display: flex;
  3679. flex-wrap: wrap;
  3680. list-style: none;
  3681. li {
  3682. margin-top: 15px;
  3683. margin-right: 20px;
  3684. button {
  3685. display: block;
  3686. width: 100%;
  3687. padding: 8px 16px;
  3688. border-radius: 5px;
  3689. color: white;
  3690. border: none;
  3691. background-color: var(--main-color);
  3692. letter-spacing: 2px;
  3693. transition: all 0.3s;
  3694. font-size: 0.875rem;
  3695. &:hover {
  3696. opacity: 0.8;
  3697. }
  3698. }
  3699. }
  3700. }
  3701. .btn-swiper {
  3702. .swiper-slide {
  3703. width: auto;
  3704. // max-width: 185px;
  3705. .btn-container {
  3706. display: flex;
  3707. justify-content: center;
  3708. button {
  3709. display: block;
  3710. width: 100%;
  3711. padding: 10px 20px;
  3712. border-radius: 5px;
  3713. color: white;
  3714. border: none;
  3715. background-color: var(--main-color);
  3716. letter-spacing: 2px;
  3717. transition: all 0.3s;
  3718. font-size: 0.875rem;
  3719. &:hover {
  3720. opacity: 0.8;
  3721. }
  3722. }
  3723. }
  3724. }
  3725. }
  3726. .ad-content {
  3727. // width: 90%;
  3728. max-height: 95vh;
  3729. padding: 35px;
  3730. overflow-y: auto;
  3731. // position: absolute;
  3732. // z-index: 500;
  3733. border-radius: 10px;
  3734. background-color: #fff;
  3735. // box-shadow: 2px 2px 14px #5f5f5f;
  3736. .close-btn {
  3737. position: absolute;
  3738. top: 7px;
  3739. right: 5px;
  3740. border: none;
  3741. background-color: transparent;
  3742. transition: all 0.3s;
  3743. cursor: pointer;
  3744. svg {
  3745. filter: invert(57%) sepia(45%) saturate(391%) hue-rotate(350deg)
  3746. brightness(93%) contrast(84%);
  3747. }
  3748. &:hover {
  3749. opacity: 0.8;
  3750. }
  3751. }
  3752. .ar-link {
  3753. display: flex;
  3754. justify-content: center;
  3755. }
  3756. section {
  3757. p {
  3758. // padding: 0 10px;
  3759. line-height: 1.7;
  3760. letter-spacing: 2px;
  3761. }
  3762. .title {
  3763. margin: 15px auto;
  3764. color: var(--main-color);
  3765. font-weight: 600;
  3766. font-size: 1.375em;
  3767. text-align: center;
  3768. letter-spacing: 2px;
  3769. }
  3770. .product,
  3771. .branch {
  3772. margin-top: 20px;
  3773. background-color: #f1e9dc;
  3774. p {
  3775. padding: 10px 0;
  3776. font-weight: 500;
  3777. font-size: 0.875em;
  3778. text-align: center;
  3779. border-bottom: 2px solid #fff;
  3780. }
  3781. ul {
  3782. padding: 10px;
  3783. list-style: none;
  3784. li {
  3785. padding-bottom: 5px;
  3786. letter-spacing: 1px;
  3787. font-weight: 500;
  3788. font-size: 0.875em;
  3789. }
  3790. }
  3791. }
  3792. .date {
  3793. margin: 20px 0;
  3794. text-align: center;
  3795. }
  3796. .info {
  3797. display: flex;
  3798. align-items: center;
  3799. margin-top: 5px;
  3800. p {
  3801. padding-left: 10px;
  3802. letter-spacing: 2px;
  3803. // font-weight: 500;
  3804. // color: var(--main-color);
  3805. }
  3806. svg {
  3807. filter: invert(57%) sepia(45%) saturate(391%) hue-rotate(350deg)
  3808. brightness(93%) contrast(84%);
  3809. }
  3810. }
  3811. }
  3812. .cover-img {
  3813. width: 100%;
  3814. max-height: 250px;
  3815. object-fit: cover;
  3816. }
  3817. .price {
  3818. display: flex;
  3819. flex-wrap: wrap;
  3820. align-items: center;
  3821. justify-content: space-between;
  3822. margin: 10px 0;
  3823. p {
  3824. font-size: 1.25rem;
  3825. font-weight: 500;
  3826. color: var(--main-color);
  3827. }
  3828. a {
  3829. max-width: 150px;
  3830. margin: 10px 0;
  3831. padding: 8px 25px;
  3832. display: inline-block;
  3833. text-decoration: none;
  3834. text-align: center;
  3835. border-radius: 20px;
  3836. letter-spacing: 1px;
  3837. color: white;
  3838. background-color: var(--main-color);
  3839. }
  3840. }
  3841. }
  3842. .slider-content {
  3843. width: 100%;
  3844. img {
  3845. width: 100%;
  3846. margin-bottom: -5px;
  3847. }
  3848. }
  3849. .branch {
  3850. margin-top: 30px;
  3851. ul {
  3852. padding: 0;
  3853. list-style: none;
  3854. li {
  3855. letter-spacing: 1px;
  3856. }
  3857. }
  3858. }
  3859. .video-progress {
  3860. position: absolute;
  3861. left: 50%;
  3862. top: 40%;
  3863. transform: translate(-50%, -50%);
  3864. }
  3865. .dialog-content {
  3866. position: absolute;
  3867. top: 60px;
  3868. left: 0;
  3869. z-index: 100;
  3870. }
  3871. .vr-content {
  3872. width: 700px;
  3873. height: 700px;
  3874. }
  3875. .ar-link {
  3876. display: inline-block;
  3877. padding: 7px 17px;
  3878. color: #fff;
  3879. background-color: var(--main-color);
  3880. border-radius: 5px;
  3881. text-decoration: none;
  3882. }
  3883. .ar-card {
  3884. width: 85vw;
  3885. height: 100vh;
  3886. .v-card-title {
  3887. text-align: center;
  3888. }
  3889. #vr-video {
  3890. height: 77vh;
  3891. }
  3892. }
  3893. .btn-swiper {
  3894. margin-top: 20px;
  3895. }
  3896. .v-expansion-panel-text {
  3897. font-size: 0.875rem;
  3898. line-height: 1.7;
  3899. }
  3900. // 對話輸入框
  3901. .chat-inputs {
  3902. width: 100%;
  3903. display: flex;
  3904. padding: 10px 20px;
  3905. background-color: white;
  3906. input {
  3907. width: 100%;
  3908. border: none;
  3909. margin-left: 2rem;
  3910. &:focus-visible {
  3911. outline: none;
  3912. }
  3913. }
  3914. .menu-btn {
  3915. position: absolute;
  3916. top: 2px;
  3917. left: 0;
  3918. }
  3919. button.submit {
  3920. border: none;
  3921. background: white;
  3922. cursor: pointer;
  3923. &:hover {
  3924. img {
  3925. opacity: 0.8;
  3926. }
  3927. }
  3928. img {
  3929. padding-top: 5px;
  3930. transition: all 0.3s;
  3931. filter: invert(75%) sepia(20%) saturate(459%) hue-rotate(360deg)
  3932. brightness(100%) contrast(85%);
  3933. }
  3934. }
  3935. ::placeholder {
  3936. font-size: 1rem;
  3937. font-weight: 500;
  3938. color: var(--sub-color);
  3939. opacity: 1; /* Firefox */
  3940. }
  3941. ::-ms-input-placeholder {
  3942. /* Edge 12 -18 */
  3943. color: var(--sub-color);
  3944. }
  3945. }
  3946. // 底部選單
  3947. .menu {
  3948. position: fixed;
  3949. z-index: 300;
  3950. left: 0;
  3951. bottom: 0px;
  3952. right: 0;
  3953. color: var(--text-color);
  3954. background-color: white;
  3955. &.hide-menu table {
  3956. height: 0;
  3957. z-index: -1;
  3958. }
  3959. .icon {
  3960. width: 80px;
  3961. @media (max-width: 414px) {
  3962. width: 60px;
  3963. }
  3964. @media (max-width: 375px) {
  3965. width: 45px;
  3966. }
  3967. }
  3968. .menu-table {
  3969. height: 100%;
  3970. transition: all 0.3s;
  3971. &.hide-table {
  3972. height: 0;
  3973. table {
  3974. display: none;
  3975. height: 0;
  3976. }
  3977. }
  3978. table {
  3979. width: 95%;
  3980. height: 100%;
  3981. margin: auto;
  3982. border-collapse: collapse;
  3983. position: relative;
  3984. transition: all 0.3s;
  3985. &::before,
  3986. &::after {
  3987. content: "";
  3988. display: inline-block;
  3989. width: 10px;
  3990. height: 100%;
  3991. background-color: #fff;
  3992. position: absolute;
  3993. bottom: 0%;
  3994. @media (max-width: 390px) {
  3995. width: 8px;
  3996. }
  3997. }
  3998. &::before {
  3999. left: -5px;
  4000. }
  4001. &::after {
  4002. right: -5px;
  4003. }
  4004. tr {
  4005. td {
  4006. width: 50px;
  4007. padding: 1rem 0;
  4008. text-align: center;
  4009. border: 1px solid #ccc;
  4010. @media (max-width: 414px) {
  4011. width: 100px;
  4012. padding: 1rem 0;
  4013. }
  4014. @media (max-width: 390px) {
  4015. padding: 0.5rem 0;
  4016. }
  4017. p {
  4018. padding: 0 0.3rem;
  4019. letter-spacing: 0.03rem;
  4020. @media (max-width: 430px) {
  4021. // width: 115px;
  4022. font-size: 0.875rem;
  4023. }
  4024. }
  4025. }
  4026. &:first-child {
  4027. td {
  4028. border-top: 0px solid transparent;
  4029. }
  4030. }
  4031. &:last-child {
  4032. td {
  4033. border-bottom: 0px solid transparent;
  4034. }
  4035. }
  4036. }
  4037. }
  4038. }
  4039. .question-btn {
  4040. color: var(--main-color);
  4041. font-size: 1.25rem;
  4042. font-weight: 500;
  4043. letter-spacing: 0.1rem;
  4044. @media (max-width: 414px) {
  4045. font-size: 1rem;
  4046. }
  4047. }
  4048. }
  4049. .anchor-voice {
  4050. height: 94vh;
  4051. color: white;
  4052. background-color: black;
  4053. .video-content {
  4054. height: 70vh;
  4055. overflow: hidden;
  4056. @media (max-width: 375px) {
  4057. height: 65vh;
  4058. }
  4059. video {
  4060. width: 100%;
  4061. @media (max-width: 375px) {
  4062. margin-top: -50px;
  4063. }
  4064. }
  4065. }
  4066. .control-item {
  4067. display: flex;
  4068. flex-direction: column;
  4069. justify-content: center;
  4070. height: 24vh;
  4071. @media (max-width: 375px) {
  4072. height: 29vh;
  4073. }
  4074. }
  4075. // .v-btn.v-btn--density-default {
  4076. // height: 55px !important;
  4077. // }
  4078. }
  4079. .map-img {
  4080. max-width: 100%;
  4081. &.show-anchor {
  4082. max-width: 70%;
  4083. }
  4084. }
  4085. .voice-btn {
  4086. position: fixed;
  4087. right: 5px;
  4088. top: 55px;
  4089. z-index: 100;
  4090. button {
  4091. display: flex;
  4092. align-items: center;
  4093. img {
  4094. width: 22px;
  4095. filter: invert(49%) sepia(66%) saturate(368%) hue-rotate(348deg)
  4096. brightness(91%) contrast(92%);
  4097. }
  4098. p {
  4099. margin-left: 5px;
  4100. font-size: 0.85rem;
  4101. color: var(--main-color);
  4102. }
  4103. }
  4104. }
  4105. .v-btn {
  4106. // &.v-btn--density-default {
  4107. // height: auto !important;
  4108. // }
  4109. p {
  4110. font-size: 0.875rem;
  4111. }
  4112. }
  4113. .v-field__outline {
  4114. --v-field-border-width: 0 !important;
  4115. }
  4116. .swiper {
  4117. // width: 300px;
  4118. margin-left: 0;
  4119. }
  4120. .a-modal {
  4121. position: relative !important;
  4122. top: 50% !important;
  4123. z-index: 15000 !important;
  4124. }
  4125. html.a-fullscreen {
  4126. position: relative !important;
  4127. }
  4128. a-video-controls {
  4129. position: absolute;
  4130. bottom: 20px;
  4131. left: 50%;
  4132. transform: translateX(-50%);
  4133. }
  4134. .fc-direction-ltr {
  4135. height: 500px;
  4136. }
  4137. .fc {
  4138. .fc-scrollgrid,
  4139. .fc-scrollgrid table,
  4140. .fc-daygrid-body {
  4141. height: 94%;
  4142. width: 100% !important;
  4143. }
  4144. .fc-toolbar.fc-header-toolbar {
  4145. padding: 5px;
  4146. margin-bottom: 0;
  4147. letter-spacing: 1px;
  4148. background-color: #f2f2f2;
  4149. border-radius: 5px 5px 0 0;
  4150. }
  4151. .fc-toolbar-title {
  4152. font-size: 1.125em;
  4153. }
  4154. .fc-day-past {
  4155. &.fc-day-other {
  4156. a {
  4157. text-decoration: none;
  4158. }
  4159. }
  4160. a {
  4161. color: #cccccc;
  4162. text-decoration: line-through;
  4163. }
  4164. }
  4165. .fc-button .fc-icon {
  4166. color: #969696;
  4167. font-size: 1em !important;
  4168. vertical-align: baseline !important;
  4169. }
  4170. .fc-icon-chevron-left::before {
  4171. content: "<";
  4172. }
  4173. .fc-icon-chevron-right::before {
  4174. content: ">";
  4175. }
  4176. .fc-button-primary {
  4177. border: none;
  4178. background-color: transparent;
  4179. &:hover,
  4180. &:focus,
  4181. &:not(:disabled):active:focus {
  4182. box-shadow: none;
  4183. background-color: transparent;
  4184. }
  4185. &:disabled {
  4186. display: none;
  4187. }
  4188. }
  4189. .fc-daygrid-day-top {
  4190. justify-content: center;
  4191. }
  4192. .fc-day-today.fc-daygrid-day,
  4193. .fc-day-future.fc-daygrid-day {
  4194. cursor: pointer;
  4195. }
  4196. }
  4197. </style>