From 19174f56ed411df61f3040c39bf8aa50a64d1d36 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Wed, 9 Apr 2025 14:27:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A4=9A=E8=AF=AD=E7=A7=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.js | 273 ++++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 145 ++++++--------------------- index.js | 16 ++- 3 files changed, 315 insertions(+), 119 deletions(-) create mode 100644 components.js diff --git a/components.js b/components.js new file mode 100644 index 0000000..f128d18 --- /dev/null +++ b/components.js @@ -0,0 +1,273 @@ +/** + * 选项的小图标 + */ +const thumbsUp = + ''; +const thumbsDown = + ''; +const happyFace = + ''; +const NeutralFace = + ''; +const sadFace = + ''; + +var urlParams = new URLSearchParams(window.location.search); +var params = {}; +for (const param of urlParams) { + params[param[0]] = param[1]; +} + +const webList = { + 'default': 'gh', + 'www.asiahighlights.com': 'ah', + 'www.globalhighlights.com': 'gh', +}; + +var hostname = window.location.hostname.toLowerCase(); +var webcode = webList[hostname] || 'gh'; + +var LanGuageCode = [ + { + 'LGC_LGC': '1', + 'LGC_Language': 'English', + title: 'One Minute Feedback - Help Us Serve You Better!', + tips: 'Thank you for completing the Feedback Evaluation. Once submitted the tour guide would not be able to view your comments.', + start: 'Did you enjoy your stay in the {city} area? Your honest feedback is appreciated to help us continually improve our service.', // + reference_no: 'Reference NO.:', + guide_name: "Guide's Name:", + city: 'City:', + questions: [ + 'How satisfied were you with your tour guide?', + 'How about the Driver and Car/Van?', + 'General Experience with:', + 'Would you give Global Highlights permission to use photos taken by your tour guide(s) that contain your picture?', + 'Any other comments that you would like to share with us?', + 'Where is your desired destination for your next trip?', + 'Signature:', + ], + options_text: ['Excellent', 'Very Good', 'Fair', 'Poor', 'Unacceptable'], + judgement_text: ['Yes', 'No'], + btns: { clear: 'Clear', submit: 'Submit & Finish', cancel: 'Cancel' }, + }, + { 'LGC_LGC': '2', 'LGC_Language': 'Chinese', title: '', tips: '', questions: [], options_text: [], judgement_text: [], btns: { clear: '', submit: '', cancel: '' } }, + { + 'LGC_LGC': '3', + 'LGC_Language': 'Japanese', + title: '1分フィードバック - サービス改善のためのご協力をお願いします。', + tips: 'フィードバックのご回答、誠にありがとうございます。ご回答内容はツアーガイドが閲覧することはできませんので、ご安心ください。', + start: '{city}でのご滞在はいかがでしたか?今後のサービス向上のため、率直なご意見をお聞かせください。', // + reference_no: '予約番号:', + guide_name: 'ガイドの名前:', + city: '都市:', + questions: [ + 'ツアーガイドのご対応はいかがでしたか?', + 'ドライバーおよび車両のご利用状況はいかがでしたか?', + '以下の点について、ご感想をお聞かせください。', + 'アーガイドが撮影した写真(お客様が写っているもの)を、chinaHighlightsの広告や宣伝素材として使用することを許可されますか?', + 'その他、ご意見やご要望がございましたら、ご自由にお書きください。', + '次回のご旅行で行きたい目的地はどこですか?', + '署名:', + ], + options_text: ['とてもいい', '良い', '普通', '悪い', '非常に悪い'], + judgement_text: ['はい', 'いいえ'], + btns: { clear: 'クリア', submit: '送信', cancel: 'キャンセル' }, + }, + { + 'LGC_LGC': '4', + 'LGC_Language': 'German', + title: 'Ein-Minuten-Feedback - Helfen Sie uns, Ihnen besser zu dienen!', + tips: 'Vielen Dank, dass Sie das Feedback ausgefüllt haben. Sobald es abgeschickt wurde, kann der Reiseleiter Ihre Kommentare nicht einsehen.', + start: 'Haben Sie Ihren Aufenthalt im Bereich {city} genossen? Ihr ehrliches Feedback hilft uns, unseren Service ständig zu verbessern.', // + reference_no: 'Referenz-Nr.:', + guide_name: 'Name des Reiseleiters:', + city: 'Stadt:', + questions: [ + 'Wie zufrieden waren Sie mit Ihrem Reiseleiter oder Ihrer Reiseleiterin?', + 'Wie war der Fahrer und das Auto/Van?', + 'Allgemeine Erfahrung mit:', + 'Würden Sie Global Highlights die Erlaubnis geben, Fotos zu verwenden, die von Ihrem Reiseleiter gemacht wurden und auf denen Sie abgebildet sind?', + 'Gibt es weitere Kommentare, die Sie mit uns teilen möchten?', + 'Wo liegt Ihr gewünschtes Ziel für Ihre nächste Reise?', + 'Unterschrift:', + ], + options_text: ['Ausgezeichnet', 'Sehr gut', 'Ausreichend', 'Schlecht', 'Inakzeptabel'], + judgement_text: ['Ja', 'Nein'], + btns: { clear: 'Löschen', submit: 'Fertig & Absenden', cancel: 'Abbrechen' }, + }, + { + 'LGC_LGC': '5', + 'LGC_Language': 'French', + title: "Retour d'une Minute - Aidez-nous à Mieux Vous Servir !", + tips: "Merci de compléter l'Évaluation de Retour. Une fois soumise, le guide touristique ne pourra pas voir vos commentaires.", + start: 'Avez-vous apprécié votre séjour dans la région de {city} ? Vos commentaires honnêtes sont appréciés pour nous aider à améliorer continuellement notre service.', // + reference_no: 'Numéro de Référence :', + guide_name: 'Nom du Guide :', + city: 'Ville :', + questions: [ + 'Êtes-vous satisfait(e) de votre guide touristique ?', + "Qu'en est-il du chauffeur et de la voiture/van ?", + 'Expérience générale avec :', + "Donnez-vous à Asia Highlights la permission d'utiliser les photos prises par votre/vos guide(s) contenant votre image ?", + "Avez-vous d'autres commentaires que vous aimeriez partager avec nous ?", + 'Quelle est votre destination souhaitée pour votre prochain voyage ?', + 'Signature :', + ], + options_text: ['Excellent', 'Très bien', 'Moyen', 'Médiocre', 'Inacceptable'], + judgement_text: ['Oui', 'Non'], + btns: { clear: 'Effacer', submit: 'Terminer & Soumettre', cancel: 'Annuler' }, + }, + { + 'LGC_LGC': '6', + 'LGC_Language': 'Spanish', + title: 'Comentarios de Un Minuto - ¡Ayúdenos a Ofrecerle Un Mejor Servicio!', + tips: 'Gracias por completar la Evaluación de Comentarios. Una vez enviada, el guía no podrá ver sus comentarios.', + start: '¿Disfrutó de su estancia en la zona de {city}? Agradecemos sus comentarios sinceros para ayudarnos a mejorar continuamente nuestro servicio.', // + reference_no: 'NO. de Referencia:', + guide_name: 'Nombre de Guía:', + city: 'Ciudad:', + questions: [ + '¿Qué tan satisfecho estaba con su Guía?', + '¿Cómo estaba el Conductor y el Coche/Van?', + 'Experiencia General con:', + '¿Le daría permiso a nuestra agencia para usar fotos tomadas por su(s) guía(s) que contengan su imagen?', + '¿Algún otro comentario que le gustaría compartir con nosotros?', + '¿Cuál es su destino deseado para su próximo viaje?', + 'Firma:', + ], + options_text: ['Excelente', 'Muy Bueno', 'Justo', 'Pobre', 'Inaceptable'], + judgement_text: ['Sí', 'No'], + btns: { clear: 'Limpiar', submit: 'Terminar & Enviar', cancel: 'Cancelar' }, + }, + { + 'LGC_LGC': '7', + 'LGC_Language': 'Russian', + title: 'Обратная связь за одну минуту - Поможет Нам лучше обслуживать Вас!', + tips: 'Благодарим вас за заполнение формы обратной связи. После отправки Ваш гид не сможет просмотреть ваши комментарии. ', + start: 'Понравилось ли вам пребывание в {city}? Мы будем признательны за ваши честные отзывы, которые помогут нам постоянно улучшать наш сервис.', + reference_no: 'Номер запрос:', + guide_name: 'Имя гида', + city: 'Город', + questions: [ + 'Вы довольны работой Вашего гида?', + 'Вы довольны работой Вашего водителя?', + 'Оценка всего тура в целом', + 'Разрешаете ли Вы нам использовать Ваши фотографии на веб-сайте Asia Highlights? ', + 'Есть еще какие-нибудь комментарии, которыми Вы хотели бы поделиться с нами?', + 'Куда бы вы хотели отправиться в свою следующую поездку?', + 'Подпись:', + ], + options_text: ['Отлично', 'Очень хорошо', 'Средне', 'Не оправдало ожиданий', 'Неприемлемо'], + judgement_text: ['Да', 'Нет'], + btns: { clear: 'Ясно', submit: 'Завершить и отправить', cancel: 'Отменить' }, + }, + { + 'LGC_LGC': '8', + 'LGC_Language': 'Italian', + title: 'Feedback in un Minuto – Aiutaci a Servirti Meglio!', + tips: 'Grazie per aver completato la valutazione. Una volta inviato, la guida non potrà visualizzare i tuoi commenti.', + start: 'Ti sei divertito/a durante il tuo soggiorno a {city}? Apprezziamo il tuo feedback onesto per aiutarci a migliorare continuamente il nostro servizio.', + reference_no: 'Numero di riferimento:', + guide_name: 'Nome della guida:', + city: 'Città:', + questions: [ + 'Quanto sei soddisfatto/a della guida locale?', + "Come valuti l'autista e il veicolo (auto/pulmino)?", + 'Esperienza generale con:', + 'Autorizzi Global Highlights a utilizzare foto scattate dalla guida che ti ritraggono?', + 'Altri commenti che vorresti condividere con noi?', + 'Qual è la tua destinazione desiderata per il prossimo viaggio?', + 'Firma:', + ], + options_text: ['Ottimo', 'Molto buono', 'Sodddisfatto', 'Al di sotto delle aspettative', 'Inacettabile'], + judgement_text: ['Sì', 'No'], + btns: { clear: 'Azzera', submit: 'Termina e invia', cancel: 'Annulla' }, + }, +]; +var lanCodeMapped = LanGuageCode.reduce((r, v) => Object.assign(r, { [v.LGC_LGC]: v }), {}); + +var i18n = lanCodeMapped[String(params.l || 1)]; +start_template = i18n.start.replace('{city}', '{{city}}'); +Vue.component('start-eva-text', { + props: ['city'], + template: '

' + start_template + '

', +}); + +const rateList = [ + { name: i18n.options_text[0], value: 5, url: './img/thumbsup.svg', svg: thumbsUp }, + { name: i18n.options_text[1], value: 4, url: './img/happyface.svg', svg: happyFace }, + { name: i18n.options_text[2], value: 3, url: './img/neutralface.svg', svg: NeutralFace }, + { name: i18n.options_text[3], value: 2, url: './img/sadface.svg', svg: sadFace }, + { name: i18n.options_text[4], value: 1, url: './img/thumbsdown.svg', svg: thumbsDown }, +]; +const rateListMapped = rateList.reduce((r, v) => Object.assign(r, { [v.value + '']: v }), {}); +const trueFalseList = [ + { name: i18n.judgement_text[0], value: 1, url: './img/thumbsup.svg', svg: thumbsUp }, + { name: i18n.judgement_text[1], value: 0, url: './img/thumbsdown.svg', svg: thumbsDown }, +]; + +// 定义名为 options-item 的新组件 +Vue.component('options-item', { + props: ['question', 'si', 'qi', 'qitem', 'disabled'], + template: + "
" + + // template: '
' + + '{{selectedRatingText}}' + + '
' + + '' + + '' + + '
' + + '
', + data() { + return { + rateList: rateList, + selectItem: String(this.qitem.rate || (this.disabled ? 0 : 5)), + }; + }, + computed: { + isWideScreen() { + return window.innerWidth >= 768; // Adjust the threshold as needed + }, + selectedRatingText() { + return (rateListMapped[this.selectItem] && rateListMapped[this.selectItem].name) || ''; + }, + }, +}); +Vue.component('options-item-star', { + props: ['question', 'si', 'qi', 'qitem', 'disabled'], + template: + '
' + + '" + + '
' + + '{{selectedRatingText}}' + + '
', + data() { + return { + rateList: rateList, + selectItem: String(this.qitem.rate || (this.disabled ? 0 : 5)), + }; + }, + computed: { + selectedRatingText() { + return (rateListMapped[this.selectItem] && rateListMapped[this.selectItem].name) || ''; + // return rateListMapped[this.selectItem]?.name || ''; + }, + }, +}); +// yes or no +Vue.component('judgment-item', { + props: ['question', 'si', 'qi', 'qitem', 'disabled'], + template: + '
' + + '
' + + '' + + '' + + '
' + + '
', + data() { + return { + rateList: trueFalseList, + }; + }, +}); diff --git a/index.html b/index.html index 375bfce..148299f 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ One Minute Feedback - Help Us Serve You Better! - + @@ -27,13 +27,14 @@ Logo - + Logo -

One Minute Feedback - Help Us Serve You Better!

+ +

-

One Minute Feedback - Help Us Serve You Better!

+

@@ -59,7 +60,7 @@