From 73a3ebcc1c3a2ded7decf4e30fa35935089bcc3d Mon Sep 17 00:00:00 2001 From: HelenHuang <LinHuang@pollex.com.tw> Date: 星期五, 05 十一月 2021 16:34:18 +0800 Subject: [PATCH] add: 新增(嚴選配對/預約諮詢)共用元件 - 需求問項 --- PAMapp/components/Consultant/ConsultantCard.vue | 144 +++++++++++++++++++++++++++++++++-------------- 1 files changed, 101 insertions(+), 43 deletions(-) diff --git a/PAMapp/components/Consultant/ConsultantCard.vue b/PAMapp/components/Consultant/ConsultantCard.vue index 53ad9ac..88b44c4 100644 --- a/PAMapp/components/Consultant/ConsultantCard.vue +++ b/PAMapp/components/Consultant/ConsultantCard.vue @@ -5,49 +5,100 @@ <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> @@ -55,7 +106,7 @@ <style lang="scss" scoped> .rowStyle { padding: 10px; - background-color: #FFFFFF; + background-color: $PRIMARY_WHITE; margin-bottom: 10px; display: flex; justify-content: space-between; @@ -64,32 +115,24 @@ width: 10px; height: 10px; border-radius: 50px; - background-color: $yellow; + background-color: $YELLOW; margin: auto 0; } - .avator { - width: 50px; - height: 50px; - border-radius: 50px ; - } - - .star { + .satisfaction { font-size: 12px; font-weight: bold; - - &:before { - content: '\2605'; - color: $primaryRed; - 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; @@ -97,24 +140,35 @@ } .delete { - color: $primaryRed; + color: $PRIMARY_RED; font-size: 14px; font-weight: bold; cursor: pointer; } .reservedBtn { - color: $skyBlue; - cursor: auto; + color: $SKY_BLUE; + border-color: $SKY_BLUE; - &:hover { - color: $skyBlue; - border-color: $skyBlue; - background-color: $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 +182,8 @@ justify-content: space-between; } -</style> \ No newline at end of file + .dialogInfo { + font-size: 20px; + } + +</style> -- Gitblit v1.8.0