From 7c291a812e980917bc9f64a3f251f2a08ae7f157 Mon Sep 17 00:00:00 2001 From: Mila <Mila@pollex.com.tw> Date: 星期三, 10 十一月 2021 18:05:34 +0800 Subject: [PATCH] TODO#130020 [快速篩選] API 串接 --- PAMapp/components/Consultant/ConsultantCard.vue | 147 +++++++++++++++++++++++++++++++++++------------- 1 files changed, 106 insertions(+), 41 deletions(-) diff --git a/PAMapp/components/Consultant/ConsultantCard.vue b/PAMapp/components/Consultant/ConsultantCard.vue index 2b7525e..47965a1 100644 --- a/PAMapp/components/Consultant/ConsultantCard.vue +++ b/PAMapp/components/Consultant/ConsultantCard.vue @@ -5,49 +5,107 @@ <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.avgScore }}</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="(expertise, index) in agentInfo.expertise" + :key="index" + >#{{expertise}}</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" + :width="width" + > + <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 { Agents } from '~/plugins/api/home'; +import { Vue, Component, Prop, Emit } from 'nuxt-property-decorator'; +import { Consultants } from '~/assets/ts/api/consultant'; +import { isLogin } from '~/assets/ts/auth'; +import { isMobileDevice } from '~/assets/ts/device'; @Component export default class ConsultantCard extends Vue { - @Prop() agentInfo!: Agents; + @Prop() agentInfo!: Consultants; + isVisibleDialog = false; + width: string = ''; + + 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) { - this.$router.push('/communication/myDemand') + if (this.agentInfo.contactStatus === 'picked') { + isLogin() ? this.$router.push('/questionnaire') : this.$router.push('/login'); + } else { + this.width = isMobileDevice() ? '80%' : ''; + this.isVisibleDialog = true; } - } @Emit('removeAgent') removeAgent() { - return this.agentInfo.id; + return this.agentInfo.agentNo; } } </script> @@ -68,28 +126,20 @@ 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; @@ -105,16 +155,27 @@ .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; @@ -128,4 +189,8 @@ justify-content: space-between; } + .dialogInfo { + font-size: 20px; + } + </style> -- Gitblit v1.8.0