policy-change-contact.vue 7.43 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>
    <us-tax-form-upload-comp :visible="usTaxFormUploadCompVisible" @close="usTaxFormUploadCompVisible = false" @submit="onUsTaxSubmit" ></us-tax-form-upload-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">

          <!-- 联络电话 -->
          <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')" @change="checkNationsPhoneCode">
                      <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.e4.length > 0">
                  <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e4}}
                </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" 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>

          <!-- 联络地址 -->
          <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')" @change="onChangeNations">
                      <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.e5.length > 0">
                  <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e5}}
                </div>
              </div>

              <!-- 省 -->
              <template v-if="isChina">
                <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.provinceId" :placeholder="$t('policyChangeContact.form.Province')" @change="onChangeProvince">
                        <el-option v-for="(item, index) in provinceList" :key="index" :label="item.n" :value="item.v"></el-option>
                      </el-select>
                    </div>
                  </div>
                  <div class="validator" v-if="errorTips.e6.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">
                    <div class="down-arrow"></div>
                    <div class="cont">
                      <el-select class="ipt" v-model="data.cityId" :placeholder="$t('policyChangeContact.form.City')" @change="checkCity">
                        <el-option v-for="(item, index) in cityList" :key="index" :label="item.n" :value="item.v"></el-option>
                      </el-select>
                    </div>
                  </div>
                  <div class="validator" v-if="errorTips.e7.length > 0">
                    <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e7}}
                  </div>
                </div>
              </template>

              <!-- 地址 -->
              <div class="pure-u-1 ipt-gird-item" :class="{'pure-u-md-18-24':!isChina}">
                <div class="ipt-wrap-linear">
                  <input class="ipt" type="text" 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>

          <!-- email -->
          <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" 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 pointer" @click="onAgreeHandler">
            <img v-if="!data.acceptMessage" class="check-icon" src="@/assets/images/reservation/un-check.png">
            <img v-else class="check-icon" 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>