| | |
| | | <el-col :xs="22" :sm="23"> |
| | | <el-row type="flex"> |
| | | <el-col class="flex_column" :xs="5" :sm="3"> |
| | | <img class="avator" :src="agentInfo.img" alt=""> |
| | | <div class="star">{{agentInfo.satisfaction}}</div> |
| | | </el-col> |
| | | <el-col class="flex_column" :xs="10" :sm="15"> |
| | | <div class="smTxt_bold name">{{agentInfo.name}}</div> |
| | | <div class="tagStyle"> |
| | | <span |
| | | class="tagTxt" |
| | | v-for="(tag, index) in agentInfo.tags" :key="index">#{{tag}}</span> |
| | | <el-avatar |
| | | :size="50" |
| | | :src="agentInfo.img" |
| | | class="cursor--pointer" |
| | | @click.native="$router.push('/agentInfo')" |
| | | ></el-avatar> |
| | | <div class="satisfaction"> |
| | | <i class="icon-star pam-icon icon--yellow satisfaction"></i> |
| | | <span>{{agentInfo.satisfaction}}</span> |
| | | </div> |
| | | <div class="delete" @click="removeAgent">移除</div> |
| | | </el-col> |
| | | <el-col :xs="10" :sm="15"> |
| | | <div class="smTxt_bold name">{{agentInfo.name}}</div> |
| | | <div class="professionals"> |
| | | <span |
| | | class="professionalsTxt" |
| | | v-for="(professional, index) in agentInfo.professionals" |
| | | :key="index" |
| | | >#{{professional}}</span> |
| | | </div> |
| | | <div |
| | | class="delete" |
| | | v-if="agentInfo.contactStatus === 'picked'" |
| | | @click="removeAgent" |
| | | >移除</div> |
| | | </el-col> |
| | | <el-col class="flex_column" :xs="9" :sm="6"> |
| | | <el-button |
| | | class="smTxt_bold outline_btn" |
| | | @click="reserveCommunication" |
| | | :class="{'reservedBtn': agentInfo.reserve}" |
| | | >{{ agentInfo.reserve ? '已預約' : '進行預約'}}</el-button> |
| | | <div class="time">今天 10:00 加入</div> |
| | | :class="agentInfo.contactStatus + 'Btn'" |
| | | >{{ contactTxt }}</el-button> |
| | | <div class="updateTime">{{updateTime}}</div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <Ui-Dialog :isVisible.sync="isVisibleDialog"> |
| | | <h5 class="subTitle text--center mb-30">預約成功</h5> |
| | | <p class="smTxt">今天 10:00</p> |
| | | <div class="dialogInfo"> |
| | | <p>姓名:王聰明</p> |
| | | <p>電話:0912345678</p> |
| | | <p>Email:</p> |
| | | <p>性別 :男性</p> |
| | | <p>年齡:26-30</p> |
| | | <p>職業:一般職業</p> |
| | | <p>需求:保單健檢/規劃、紅利保單相關</p> |
| | | <p>連絡時段一:星期一,星期日 18:00~21:00</p> |
| | | </div> |
| | | </Ui-Dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop, Emit, Watch } from 'nuxt-property-decorator'; |
| | | import { Vue, Component, Prop, Emit } from 'nuxt-property-decorator'; |
| | | import { Agents } from '~/plugins/api/home'; |
| | | |
| | | @Component |
| | | export default class ConsultantCard extends Vue { |
| | | @Prop() agentInfo!: Agents; |
| | | isVisibleDialog = false; |
| | | |
| | | get contactTxt() { |
| | | if (this.agentInfo.contactStatus === 'contacted') { |
| | | return '已聯絡' |
| | | } else if (this.agentInfo.contactStatus === 'reserved') { |
| | | return '已預約' |
| | | } else { |
| | | return '進行預約' |
| | | } |
| | | } |
| | | |
| | | get updateTime() { |
| | | const newDate = new Date(this.agentInfo.updateTime); |
| | | let year = newDate.getFullYear(); |
| | | let month = newDate.getMonth() + 1; |
| | | let date = newDate.getDate(); |
| | | let hours = newDate.getHours(); |
| | | let minutes = newDate.getMinutes(); |
| | | return `${year}/${month}/${date} ${hours} : ${minutes}` |
| | | } |
| | | |
| | | reserveCommunication() { |
| | | if (!this.agentInfo.reserve) { |
| | | if (this.agentInfo.contactStatus === 'picked') { |
| | | this.$router.push('/communication/myDemand') |
| | | } else { |
| | | this.isVisibleDialog = true; |
| | | } |
| | | |
| | | } |
| | | |
| | | @Emit('removeAgent') removeAgent() { |
| | | return this.agentInfo.id; |
| | | return this.agentInfo.agentNo; |
| | | } |
| | | } |
| | | </script> |
| | |
| | | margin: auto 0; |
| | | } |
| | | |
| | | .avator { |
| | | width: 50px; |
| | | height: 50px; |
| | | border-radius: 50px ; |
| | | } |
| | | |
| | | .star { |
| | | .satisfaction { |
| | | font-size: 12px; |
| | | font-weight: bold; |
| | | |
| | | &:before { |
| | | content: '\2605'; |
| | | color: $PRIMARY_RED; |
| | | margin: 5px; |
| | | } |
| | | margin-top: 5px; |
| | | } |
| | | |
| | | .tagStyle { |
| | | .professionals { |
| | | height: 20px; |
| | | overflow: hidden; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | .tagTxt { |
| | | margin: 5px 0 10px 0; |
| | | |
| | | .professionalsTxt { |
| | | font-size: 12px; |
| | | font-weight: bold; |
| | | margin-right: 5px; |
| | |
| | | |
| | | .reservedBtn { |
| | | color: $SKY_BLUE; |
| | | cursor: auto; |
| | | border-color: $SKY_BLUE; |
| | | |
| | | &:hover { |
| | | color: $SKY_BLUE; |
| | | border-color: $SKY_BLUE; |
| | | background-color: $PRIMARY_WHITE; |
| | | &:focus { |
| | | color: $PRIMARY_WHITE; |
| | | background-color: $SKY_BLUE; |
| | | opacity: 0.5; |
| | | } |
| | | } |
| | | |
| | | .time { |
| | | .contactedBtn { |
| | | color: $GREEN; |
| | | border-color: $GREEN; |
| | | |
| | | &:focus { |
| | | color: $PRIMARY_WHITE; |
| | | background-color: $GREEN; |
| | | opacity: 0.5; |
| | | } |
| | | } |
| | | |
| | | .updateTime { |
| | | font-size: 12px; |
| | | font-weight: bold; |
| | | color: #707070; |
| | |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .dialogInfo { |
| | | font-size: 20px; |
| | | } |
| | | |
| | | </style> |