policy-change-contact.vue 6.52 KB

<template>
  <div class="policy-change-contact">
    <!-- 该input用于防止chrome自动填充 -->
    <input type="password" style="display: none;" />
    <auth @onLogin="userLogin" @onLogout="userLogout" :checkProfile="true" ref="auth" :tipModel="'m2'"></auth>
    <modal-comp :visible="modalVisiable" :show-confirm="false" :icon="modalIcon" :content="modalContent" :confirm="modalCallback" :overlay="modalCallback"></modal-comp>
    <template v-if="showForm">
      <policy-head-list :multiSelectable="true" @onSelect="handlePolicySelect"></policy-head-list>

      <div class="container border" v-if="selectedPolicies.length > 0 && data">
        <!-- 表单 -->
        <div class="form">
          <!-- 1 -->
          <div class="form-item">
            <div class="label">
              <div class="icon"><img src="@/assets/images/policy-change-contact/icon-pcc-phone.png"></div>{{$t('policyChangeContact.phone')}}
            </div>

            <div class="gird-g ipt-gird">
              <div class="pure-u-1 pure-u-md-6-24 ipt-gird-item">
                <div class="ipt-wrap-linear">
                  <div class="down-arrow"></div>
                  <div class="cont">
                    <el-select class="ipt" v-model="data.mobileAreaCode" :placeholder="$t('policyChangeContact.form.InternationalArea')">
                      <el-option v-for="(item, index) in nationsPhoneCodeList" :key="index" :label="item.n" :value="item.n"></el-option>
                    </el-select>
                  </div>
                </div>
                <div class="validator" v-if="errorTips.e1.length > 0">
                  <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e1}}
                </div>
              </div>

              <div class="pure-u-1 pure-u-md-8-24 ipt-gird-item">
                <div class="ipt-wrap-linear">
                  <input class="ipt mail-ipt" :class="{err : errorTips.e1.length > 0}" type="text" v-model="data.mobile" autocomplete="new-password" :placeholder="$t('policyChangeContact.form.Mobile')">
                </div>
                <div class="validator" v-if="errorTips.e1.length > 0">
                  <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e1}}
                </div>
              </div>
            </div>
          </div>

          <!-- 2 -->
          <div class="form-item">
            <div class="label">
              <div class="icon"><img src="@/assets/images/policy-change-contact/icon-pcc-location.png"></div>{{$t('policyChangeContact.address')}}
            </div>
            <div class="gird-g ipt-gird">
              <div class="pure-u-1 pure-u-md-6-24 ipt-gird-item">
                <div class="ipt-wrap-linear">
                  <div class="down-arrow"></div>
                  <div class="cont">
                    <el-select class="ipt" v-model="data.countryId" :placeholder="$t('policyChangeContact.form.Nation')">
                      <el-option v-for="(item, index) in nationsList" :key="index" :label="item.n" :value="item.v"></el-option>
                    </el-select>
                  </div>
                </div>
                <div class="validator" v-if="errorTips.e2.length > 0">
                  <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e2}}
                </div>
              </div>

              <!-- <div class="pure-u-1 pure-u-md-6-24 ipt-gird-item">
                <div class="ipt-wrap-linear">
                  <input class="ipt" type="text" :class="{err : errorTips.e2.length > 0}" v-model="data.address" autocomplete="new-password" :placeholder="$t('policyChangeContact.form.District')">
                </div>
                <div class="validator" v-if="errorTips.e2.length > 0">
                  <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e6}}
                </div>
              </div>

                    <div class="pure-u-1 pure-u-md-6-24 ipt-gird-item">
                <div class="ipt-wrap-linear">
                  <input class="ipt" type="text" :class="{err : errorTips.e2.length > 0}" v-model="data.address" autocomplete="new-password" :placeholder="$t('policyChangeContact.form.District')">
                </div>
                <div class="validator" v-if="errorTips.e2.length > 0">
                  <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e6}}
                </div>
              </div> -->

              <div class="pure-u-1 pure-u-md-18-24 ipt-gird-item">
                <div class="ipt-wrap-linear">
                  <input class="ipt" type="text" :class="{err : errorTips.e2.length > 0}" v-model="data.address" autocomplete="new-password" :placeholder="$t('policyChangeContact.form.Address')">
                </div>
                <div class="validator" v-if="errorTips.e2.length > 0">
                  <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e2}}
                </div>
              </div>

            </div>
          </div>

          <!-- 3 -->
          <div class="form-item">
            <div class="label">
              <div class="icon"><img src="@/assets/images/policy-change-contact/icon-pcc-mail.png"></div>{{$t('policyChangeContact.email')}}
            </div>
            <div class="gird-g ipt-gird">
              <div class="pure-u-1 ipt-gird-item">
                <div class="pure-u-1 pure-u-md-12-24 ipt-wrap-linear">
                  <input class="ipt" type="text" :class="{err : errorTips.e3.length > 0}" v-model="data.email" autocomplete="new-password" :placeholder="$t('policyChangeContact.form.Mail')">
                </div>
                <div class="validator" v-if="errorTips.e3.length > 0">
                  <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e3}}
                </div>
              </div>
            </div>

          </div>
          <div class="agree" @click="checked1 = !checked1">
            <img v-if="!checked1" class="check-icon pointer" src="@/assets/images/reservation/un-check.png">
            <img v-else class="check-icon pointer" src="@/assets/images/reservation/check.png">
            <span>{{$t("policyChangeContact.checkTips")}}</span>
          </div>

          <div class="submit-btn" @click="updateContactsHandler" :class="{disabled: submitBtnDisabled}">
            <van-loading v-if="loading" />
            <span>{{$t('policyChangeContact.submit')}}</span>
          </div>
        </div>

      </div>
    </template>
  </div>
</template>

<script src="./policy-change-contact.js"></script>
<style lang="scss" scoped>
@import "./policy-change-contact.scss";
</style>