保誠-保戶業務員媒合平台
Tomas
2021-12-15 0b35f2321cd1ea6fea2ef4e0854ad2c0461ee97a
refactor: AgentDetail
修改1個檔案
44 ■■■■■ 已變更過的檔案
PAMapp/pages/agentInfo/_agentNo.vue 44 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/agentInfo/_agentNo.vue
@@ -189,11 +189,14 @@
import { Context } from '@nuxt/types';
import { namespace } from 'nuxt-property-decorator';
import { Vue, Component } from 'vue-property-decorator';
import { getConsultantDetail } from '~/assets/ts/api/consultant';
import { Role } from '~/assets/ts//models/enum/Role';
import myConsultantService from '~/assets/ts/services/my-consultant.service';
import { AgentInfo } from '~/assets/ts/models/agent-info.model';
import { hideReviews } from '~/assets/ts/const/hide-reviews';
import { Role } from '~/assets/ts//models/enum/Role';
const roleStorage = namespace('localStorage');
@Component
export default class AgentInfoComponent extends Vue {
  @roleStorage.Getter currentRole!:string|null;
@@ -204,20 +207,21 @@
  fieldInfoTitle = '';
  fieldInfoDesc = '';
  hideReviews = hideReviews ;
  async asyncData(context: Context) {
    const agentNo = context.route.params.agentNo;
    let agentInfo = {};
    await getConsultantDetail(agentNo).then((res) => agentInfo = res.data )
    return {
      agentInfo
    }
  }
  //////////////////////////////////////////////////////////////////////
  get agentName(): string {
    return `${this.agentInfo.name}(${this.agentInfo.role})`;
  }
  alertAddSuccess() {
  async asyncData(context: Context) {
    const agentNo = context.route.params.agentNo;
    return {
      agentInfo: await myConsultantService.getConsultantDetail(agentNo).then((res) => res)
    }
  }
  alertAddSuccess(): void {
      this.isAlertAddSuccess = true;
  }
@@ -236,24 +240,6 @@
  }
}
interface AgentInfo {
  name            : string;
  agentNo         : string;
  role            : string;
  img             : string;
  avgScore        : number;
  title           : string;
  phoneNumber     : string;
  serveArea       : string;
  companyAddress  : string;
  seniority       : string;
  suitability     : number;
  evaluation      : number;
  expertise       : string[];
  concept         : string;
  experiences     : string[];
  awards          : string;
}
</script>
<style lang="scss">