HomeView.vue 133 KB

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