From 6eb7a5d782155d9d90c73b6e0aa30283a29366aa Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期三, 09 三月 2022 13:51:01 +0800
Subject: [PATCH] fix#136534: 客戶預約顧問收到的簡訊中,未包含時間

---
 PAMapp/components/Interview/InterviewMsg.vue |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/PAMapp/components/Interview/InterviewMsg.vue b/PAMapp/components/Interview/InterviewMsg.vue
index bc76c75..61aaa8d 100644
--- a/PAMapp/components/Interview/InterviewMsg.vue
+++ b/PAMapp/components/Interview/InterviewMsg.vue
@@ -102,11 +102,12 @@
     }
 
     addInterview() {
+      const message = this.getMessage();
       const appointmentInformation: ToInformAppointment = {
         appointmentId: this.client.id,
         email        : this.client?.email,
         interviewDate: this.interviewTime,
-        message      : this.interviewTxt,
+        message,
         phone        : this.client?.phone,
       };
       appointmentService.informAppointment(appointmentInformation).then((_) => {
@@ -121,6 +122,20 @@
       this.getMyAppointmentList();
     }
 
+    private getMessage(): string {
+      const targetDate = new Date(this.interviewTime);
+      const interviewTime = `${targetDate.getFullYear()}撟�${targetDate.getMonth() + 1}���${targetDate.getDate()}� ${targetDate.getHours()}���${targetDate.getMinutes()}��;
+      let result = '';
+      if(this.loginConsultant.phoneNumber && this.loginConsultant.email) {
+        result = "�憟踝��靽���像����憿批��" + this.loginConsultant.name + "嚗�����������銝膩������蝜�"+"\n" + interviewTime + "\n" +"隞乩����閰梯�Ⅳ/Email嚗�"+"\n" + this.loginConsultant.phoneNumber + "\n" + this.loginConsultant.email + "\n"+"�甇斗���靘選����蝜恬�����"}
+        else if (!this.loginConsultant.phoneNumber && this.loginConsultant.email) {
+            result = "�憟踝��靽���像����憿批��" + this.loginConsultant.name + "嚗�����������銝膩������蝜�"+"\n" + interviewTime + "\n" +"隞乩����mail嚗�"+"\n" + this.loginConsultant.email + "\n"+"�甇斗���靘選����蝜恬�����"
+        } else {
+          result = "�憟踝��靽���像����憿批��" + this.loginConsultant.name + "嚗�����������銝膩������蝜�"+"\n" + interviewTime + "\n" +"隞乩����閰梯�Ⅳ嚗�"+"\n" + this.loginConsultant.phoneNumber + "\n"+"�甇斗���靘選����蝜恬�����"
+        }
+        return result;
+    }
+
     get isBtnDisabled() :Boolean {
       const isFormValid = this.client.phone ? this.interviewTxt && this.interviewTime :this.interviewTxt
       return !isFormValid

--
Gitblit v1.8.0