commonEdit.vue 1.54 KB
<!-- 设置用户名 设置姓名 设置邮箱 设置单位 -->
<template>
  <div class="common_container">
    <NafmHeader :title="title" class="header" navClass="nafmii-head-bg3">
      <template slot="right">
        <span class="finish" @click="handleFinish">{{$t('button.finish')}}</span>
      </template>
    </NafmHeader>
    <div class="search">
      <van-field v-model="value" :placeholder="placeholder" clearable />
    </div>
  </div>
</template>
<script>
export default {
  name: 'CommonEdit',
  data() {
    return {
      title: '',
      value: '',
      placeholder: ''
    }
  },
  mounted() {
    const { title, value } = this.$route.query
    this.value = value
    if (title == '设置昵称') {
      this.title = this.$t('title.nickName')
      this.placeholder = this.$t('person.nickNamePlaceholder')
    } else if (title == '设置姓名') {
      this.title = this.$t('title.name')
      this.placeholder = this.$t('person.namePlaceholder')
    } else if (title == '设置邮箱') {
      this.title = this.$t('title.email')
      this.placeholder = this.$t('person.emailPlaceholder')
    } else if (title == '设置单位') {
      this.title = this.$t('title.company')
      this.placeholder = this.$t('person.companyPlaceholder')
    }
  },
  methods: {
    handleFinish() {
      // 调用设置接口
      this.$router.back()
    },
  }
}
</script>
<style lang="less" scoped>
.header .finish {
  font-size: 14px;
}
.search {
  margin: 15px;
  position: relative;
}
/deep/ .van-cell {
  background: #efefef;
  border-radius: 8px;
}
</style>