保誠-保戶業務員媒合平台
HelenHuang
2022-01-22 aecb706f3c17eb36076160d27a0db24525da3ca7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<template>
  <div>
    <div class="pam-satisfaction-banner"></div>
    <div class="pam-container">
      <div class="satisfaction-title">
        <span class="mdTxt">滿意度調查</span>
        <span class="ml-10 text--prudential_grey smTxt_bold">共 {{mapUnReviewLogList.length}} 筆</span>
      </div>
      <div class="satisfaction-card" v-for="(item, index) in mapUnReviewLogList" :key="index">
        <div class="satisfaction-card-content">
          <UiAvatar :size="80" :agentNo="item.agentNo"></UiAvatar>
          <div class="satisfaction-card-text">對於顧問
              <span class="text--primary text--bold">{{item.agentName}}</span>
              的整體服務,您給予幾顆星評價?
          </div>
        </div>
        <el-rate v-model="item.score" class="pam-satisfaction-rate mt-10 fix-chrome-click--issue"></el-rate>
      </div>
      <div class="text--center mt-30">
        <el-button type="primary" :disabled="isBtnDisabled">送出</el-button>
      </div>
    </div>
  </div>
</template>
 
<script lang="ts">
import { Vue, Component, Action, State, Watch } from 'nuxt-property-decorator';
import { AppointmentLog } from '~/shared/models/appointment.model';
 
@Component({
  layout: 'home'
})
export default class MySatisfactionList extends Vue {
 
  @State
  unReviewLogList!: AppointmentLog[];
 
  mapUnReviewLogList: AppointmentReviewLog[] = [];
 
  ///////////////////////////////////////////////////////
 
  @Watch('unReviewLogList')
  onUnReviewLogListChange() {
    if (this.unReviewLogList.length) {
      this.mapUnReviewLogList = this.unReviewLogList.map(item => {
        return {
          ...item,
          satisfaction: 0
        }
      })
    }
  }
 
  ///////////////////////////////////////////////////////
 
  get isBtnDisabled() {
    if (this.mapUnReviewLogList.length) {
      return this.mapUnReviewLogList.findIndex(item => item.satisfaction > 0) === -1;
    }
    return false;
  }
}
 
interface AppointmentReviewLog extends AppointmentLog {
  satisfaction: number;
}
</script>
 
<style lang="scss" scoped>
.pam-satisfaction-banner {
    width              : 100%;
    height             : 120px;
    background-size    : cover;
    background-repeat  : no-repeat;
    background-position: center;
    position           : relative;
    background-image   : url('~/assets/images/satisfaction/banner_mob.svg');
}
 
@media (min-width: 768px) {
    .pam-satisfaction-banner {
        height          : 150px;
        background-image: url('~/assets/images/satisfaction/banner_web.svg');
    }
}
 
.pam-container {
    margin: 30px 20px;
}
 
@include desktop {
    .pam-container {
        width : 700px;
        margin: 30px auto;
    }
}
.satisfaction-card {
  margin-top       : 20px;
  .satisfaction-card-content {
    display        : flex;
    flex-direction : row;
    justify-content: space-between;
    .satisfaction-card-text {
      width        : 75%;
      line-height  : 28px;
      align-self: center;
      font-size: 20px;
      padding-left: 10px;
    }
 
    @include desktop {
        justify-content: flex-start;
        .satisfaction-card-text {
          width        : auto;
          padding-left: 30px;
        }
      }
  }
 
}
</style>