From cedd1f296cdb1b14cdb4e7d1c5c080e507c7eeb1 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期四, 23 十二月 2021 09:13:30 +0800 Subject: [PATCH] refactor: layouts/default.vue --- PAMapp/components/AddAndReservedBtns.vue | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-) diff --git a/PAMapp/components/AddAndReservedBtns.vue b/PAMapp/components/AddAndReservedBtns.vue index fe0f2e7..fa37c72 100644 --- a/PAMapp/components/AddAndReservedBtns.vue +++ b/PAMapp/components/AddAndReservedBtns.vue @@ -1,7 +1,7 @@ <template> <el-row type="flex" justify="center" :class="cusClass"> <el-button @click="addConsultant(agentInfo)" :disabled="isAdded"> - <span> + 憿批��</span> + <span> {{isAdded ? '撌脣�憿批��' : '+ 憿批��'}}</span> </el-button> <el-button @click="reserveCommunication" @@ -11,26 +11,25 @@ </template> <script lang="ts"> -import { Vue, Component, Prop, Emit, Action, State } from 'nuxt-property-decorator'; -import { Consultants } from '~/assets/ts/api/consultant'; -import { isLogin } from '~/assets/ts/auth'; +import { Vue, Component, Prop, Emit, Action, State, namespace } from 'nuxt-property-decorator'; +import { Consultant } from '~/shared/models/consultant.model'; +const localStorage = namespace('localStorage'); @Component export default class AddAndReservedBtns extends Vue { - @Action addToMyConsultantList!: (consultantToAdd: Consultants) => Promise<boolean> - @State('myConsultantList') myConsultantList!: Consultants[]; - - @Prop() agentInfo!: Consultants; + @Action addToMyConsultantList!: (consultantToAdd: Consultant) => Promise<boolean> + @State('myConsultantList') myConsultantList!: Consultant[]; + @Prop() agentInfo!: Consultant; @Prop() cusClass!: string; isVisiblePopUp = false; - addConsultant(item: Consultants) { + addConsultant(item: Consultant) { this.addToMyConsultantList(item).then(addOk => { addOk && this.openPopUp(); }); } reserveCommunication() { - isLogin() ? this.$router.push(`/questionnaire/${this.agentInfo.agentNo}`) : this.$router.push('/login'); + this.$router.push(`/questionnaire/${this.agentInfo.agentNo}`); } @Emit('openPopUp') openPopUp(popUpTxt: string = '����憿批��') { @@ -42,4 +41,4 @@ ? true : false } } -</script> \ No newline at end of file +</script> -- Gitblit v1.8.0