From 20b87b7eab9c600e2445548c4306ea1b8b37b275 Mon Sep 17 00:00:00 2001
From: HelenHuang <LinHuang@pollex.com.tw>
Date: 星期一, 06 十二月 2021 12:29:50 +0800
Subject: [PATCH] update#131467: [滿意度評分功能]-客戶進行滿意度評分API串接

---
 PAMapp/store/index.ts |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/PAMapp/store/index.ts b/PAMapp/store/index.ts
index 9092dfb..a117eb2 100644
--- a/PAMapp/store/index.ts
+++ b/PAMapp/store/index.ts
@@ -1,8 +1,10 @@
 import { Module, VuexModule, Mutation, Action } from 'vuex-module-decorators'
-import { ClientInfo, getMyAppointmentList } from '~/assets/ts/api/appointment';
+import { ClientInfo, getMyAppointmentList, getMyReviewLog } from '~/assets/ts/api/appointment';
 // import * as consultant from '~/assets/ts/api/consultant';
-import { Consultants,recommend,AgentOfStrictQuery, getFavoriteConsultant, addFavoriteConsultant, deleteConsultant, strictQuery } from '~/assets/ts/api/consultant';
+import { recommend, AgentOfStrictQuery, getFavoriteConsultant, addFavoriteConsultant, deleteConsultant, strictQuery } from '~/assets/ts/api/consultant';
+import { Consultants } from '~/assets/ts/models/consultant.model';
 import { isLogin } from '~/assets/ts/auth';
+import { AppointmentLog } from '~/assets/ts/models/appointment.model';
 import { getFavoriteFromStorage, setFavoriteToStorage } from '~/assets/ts/storageConsultant';
 
 @Module
@@ -12,6 +14,8 @@
     myConsultantList: Consultants[] = [];
 
     myAppointmentList: ClientInfo[] = [];
+
+    myAppointmentReviewLogList: AppointmentLog[] = [];
 
     @Mutation updateRecommend(data: Consultants[]) {
         this.recommendList = data;
@@ -27,6 +31,10 @@
 
     @Mutation updateMyAppointmentList(data: ClientInfo[]) {
         this.myAppointmentList = data;
+    }
+
+    @Mutation updateMyAppointmentReviewLog(data: AppointmentLog[]) {
+        this.myAppointmentReviewLogList = data;
     }
 
     @Action storeRecommendList() {
@@ -103,6 +111,13 @@
         });
     }
 
+    @Action
+    storeMyAppointmentReviewLog() {
+        getMyReviewLog().then((data) => {
+            this.context.commit('updateMyAppointmentReviewLog', data);
+        });
+    }
+
     @Action updateMyAppointment(myAppointment: ClientInfo) {
         const data = this.myAppointmentList.filter(item => item.id !== myAppointment.id);
         data.unshift(myAppointment);

--
Gitblit v1.8.0