SyuanYu 7 kuukautta sitten
vanhempi
commit
0949a942ff
5 muutettua tiedostoa jossa 66 lisäystä ja 22 poistoa
  1. 43 3
      src/components/Chat.vue
  2. 2 1
      src/language/en.json
  3. 17 16
      src/language/ja.json
  4. 2 1
      src/language/ko.json
  5. 2 1
      src/language/zh.json

+ 43 - 3
src/components/Chat.vue

@@ -393,6 +393,8 @@ function onLanguageChange(lang) {
     chooseLang("zh-tw");
   } else if (lang === "English") {
     chooseLang("en-us");
+  } else if (lang === "日本語") {
+    chooseLang("ja-jp");
   }
 
   // 清空音訊
@@ -2303,6 +2305,39 @@ async function messageSaveMp3(question, answer, data) {
   }
 }
 
+// 設定票券
+function setInfo(data) {
+  let info = {
+    buttonList: [], // 按鈕
+    ticketList: [], // 票券
+  };
+  let labelContent;
+
+  data.map((item) => {
+    if (item.type === "button") {
+      console.log("按鈕");
+      info.buttonList.push(item);
+      labelContent = "ticket";
+    } else if (item.type === "ticket") {
+      console.log("票");
+      info.ticketList.push(item);
+      labelContent = "ticket";
+    } else if (item.type === "brand") {
+      console.log("品牌");
+      info.ticketList.push(item);
+      labelContent = "brand";
+    }
+  });
+
+  setTimeout(() => {
+    messages.value.push({
+      label: labelContent,
+      author: "ai",
+      body: info,
+    });
+  }, 10);
+}
+
 async function getVideoCache(messages) {
   let lang = getLang();
 
@@ -2312,6 +2347,11 @@ async function getVideoCache(messages) {
     const response = await axios.post(url);
     console.log("response", response);
     console.log("response.status", response.status);
+
+    if (response.data.data.length) {
+      setInfo(response.data.data);
+    }
+
     if (response.data.state === 200) {
       videoCacheData.value = response.data.message[0];
       console.log("videoCacheData.value", videoCacheData.value);
@@ -2439,8 +2479,8 @@ async function messageNotInCache(question, answer) {
       <!-- 語言選單 -->
       <div class="lang-select">
         <v-select
-          label="切換語言"
-          :items="['中文', 'English']"
+          :label="`${t('select_language')}`"
+          :items="['中文', 'English', '日本語']"
           variant="solo"
           @update:modelValue="onLanguageChange"
         ></v-select>
@@ -4517,6 +4557,6 @@ async function messageNotInCache(question, answer) {
   z-index: 100;
   bottom: 15px;
   right: 20px;
-  width: 130px;
+  width: 150px;
 }
 </style>

+ 2 - 1
src/language/en.json

@@ -2,6 +2,7 @@
   "title": "Artificial intelligence customer service",
   "prologue": "Hello, welcome to use the Taipei 101 Intelligent Customer Service System.",
   "service": "How may I help you?",
+  "select_language": "Select Language",
   "cta_buy": "Buy now",
   "cta_url": "Go now",
   "customer_show": "AI Customer Service",
@@ -12,7 +13,7 @@
   "shopping_discounts": "Shopping and Discounts",
   "service_information": "Service Information",
   "what_around": "What is around?",
-  "type_message": "Type a message ...",
+  "type_message": "Type a message",
   "ar_tour": "AR navigation",
   "select_location": "Please select you location for AR navigation",
   "question": "Click me to ask a question",

+ 17 - 16
src/language/ja.json

@@ -2,6 +2,7 @@
   "title": "AIインテリジェントカスタマーサービス",
   "prologue": "こんにちは、台北101インテリジェントカスタマーサービスシステムをご利用いただき、ようこそ。",
   "service": "どうすればお手伝いできますか?",
+  "select_language": "言語を選択",
   "cta_buy": "すぐに購入する",
   "cta_url": "すぐに行く",
   "customer_show": "AIインテリジェントカスタマーサービス",
@@ -11,26 +12,26 @@
   "food_souvenirs": "グルメ/お土産",
   "shopping_discounts": "ショッピングと特典",
   "service_information": "サービス情報",
-  "what_around": "附近有什麼?",
-  "type_message": "請輸入訊息 ...",
+  "what_around": "近くのお店は?",
+  "type_message": "メッセージを入力してください",
   "ar_tour": "ARナビを利用",
   "select_location": "あなたの現在地を選んで、ARナビを利用します。",
   "question": "質問するにはここをクリック",
-  "qr_code_scan_prompt": "請掃描 QR Code 取得當前位置",
-  "tap_to_start_scan": "點我開啟掃描",
-  "current_location": "當前位置",
-  "view_floor_plan": "查看平面圖",
-  "select_navigation_location": "請選擇導覽位置",
-  "b1_floor_plan": "B1 平面圖",
-  "1f_floor_plan": "1F 平面圖",
-  "2f_floor_plan": "2F 平面圖",
-  "system_construction": "系統建置中,<br />關閉語音輸入功能。",
-  "tap_to_record": "點選以進行錄音",
-  "close": "閉",
-  "recording": "音中",
+  "qr_code_scan_prompt": "QRコードをスキャンして現在位置を取得してください",
+  "tap_to_start_scan": "タップしてスキャンを開始",
+  "current_location": "現在の位置",
+  "view_floor_plan": "フロアマップを見る",
+  "select_navigation_location": "ナビゲーションの場所を選択してください",
+  "b1_floor_plan": "B1 フロアマップ",
+  "1f_floor_plan": "1F フロアマップ",
+  "2f_floor_plan": "2F フロアマップ",
+  "system_construction": "システム構築中、<br />音声入力機能を無効にします。",
+  "tap_to_record": "タップして録音を開始",
+  "close": "閉じる",
+  "recording": "音中",
   "second": "秒",
-  "stop_recording": "對話完畢後,請按下停止按鈕結束錄音",
-  "speech_error": "語音辨識有誤,請重新錄製。",
+  "stop_recording": "会話終了後、停止ボタンを押して録音を終了してください",
+  "speech_error": "音声認識に誤りがあります。もう一度録音してください。",
   "service_info": {
     "title": "サービス情報",
     "inquiry_prompt": "サービス情報を選択<br>下のメッセージボックスにご質問を入力してください。",

+ 2 - 1
src/language/ko.json

@@ -2,6 +2,7 @@
   "title": "AI 지능 고객 서비스",
   "prologue": "안녕하세요. 타이베이 101 지능형 고객 서비스 시스템을 이용해 주셔서 환영합니다.",
   "service": "어떻게 도와드릴까요?",
+  "select_language": "언어 선택",
   "cta_buy": "바로 구매",
   "cta_url": "즉시 이동",
   "customer_show": "실제 고객 상담원",
@@ -12,7 +13,7 @@
   "shopping_discounts": "쇼핑 및 혜택",
   "service_information": "서비스 정보",
   "what_around": "附近有什麼?",
-  "type_message": "請輸入訊息 ...",
+  "type_message": "請輸入訊息",
   "ar_tour": "進行 AR 導覽",
   "select_location": "請選擇您的位置進行 AR 導覽",
   "question": "질문하려면 클릭하세요",

+ 2 - 1
src/language/zh.json

@@ -2,6 +2,7 @@
   "title": "AI 智能客服",
   "prologue": "您好,歡迎您使用台北101智能客服系統",
   "service": "請問有什麼可以為您服務的呢?",
+  "select_language": "切換語言",
   "cta_buy": "立即購票",
   "cta_url": "立即前往",
   "customer_show": "叫出真人客服",
@@ -12,7 +13,7 @@
   "shopping_discounts": "購物及優惠",
   "service_information": "服務資訊",
   "what_around": "附近有什麼?",
-  "type_message": "請輸入訊息 ...",
+  "type_message": "請輸入訊息",
   "ar_tour": "進行 AR 導覽",
   "select_location": "請選擇您的位置進行 AR 導覽",
   "question": "點我問問題",