{#
This file is part of EC-CUBE
Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
http://www.ec-cube.co.jp/
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% extends 'default_frame.twig' %}
{% set body_class = 'registration_page' %}
{% form_theme form 'Form/form_div_layout.twig' %}
{% block stylesheet %}
<style>
.attention-modal {
display: none;
}
.attention-modal.is-active {
display: block;
}
.attention-modal {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 999;
}
.attention-modal-overlay {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.attention-modal .modal-layer-mask {
background-color: rgba(0, 0, 0, 0.3);
width: 100%;
height: 100vh;
z-index: 5;
}
.attention-modal-inner {
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
background: #eee;
border-radius: 6px;
padding: 30px 10px;
text-align: center;
width: 100%;
max-width: 520px;
position: absolute;
z-index: 10;
}
.attention-modal-text {
font-size: 16px;
font-weight: 600;
line-height: 1.6;
margin: 0 0 20px;
}
.attention-modal-text strong {
color: #DE5D50;
}
.checked-attention {
display: inline-block;
font-weight: 300;
margin: 0 0 35px;
}
.checkbox-button-wrap {
text-align: end;
}
.checkbox-button-wrap button {
border-radius: 3px;
border: none;
color: #fff;
display: inline-block;
font-weight: 600;
padding: 15px 25px;
}
.attention-modal-return {
background: #525263;
margin: 0 20px 0 0 ;
}
.attention-modal-move {
background-color: #e28e86;
pointer-events: none;
}
.attention-modal-move.is-move {
background: #DE5D50;
pointer-events: unset;
}
@media screen and (max-width: 480px) {
.attention-modal-inner {
padding: 25px 10px;
width: 95%;
}
.attention-modal-text {
font-size: 14px;
}
.checked-attention {
font-size: 12px;
}
}
</style>
{% endblock stylesheet %}
{% block javascript %}
<script src="//yubinbango.github.io/yubinbango/yubinbango.js" charset="UTF-8"></script>
<script>
validatePostalCode = (postal_codes) =>
{
const validate_postal_code = document.getElementById('entry_postal_code')
let array_postal_code = postal_codes
.replace(/,+$/, '').split(',')
.map((val) => val.replace(/-|\s+/g, ''))
.filter((empty) => {return empty !== ''})
console.log(array_postal_code)
console.log('郵便番号_登録数:' + array_postal_code.length + '件')
matchPostalCode = (input_val) =>
{
document.querySelector('.ec-registerRole__actions').remove()
alert('〒'+input_val+':'+'住⺠票住所が当⾃治体に該当する⽅は本サービスをご利⽤いただけません。')
location.href = '/'
}
changePostalCode = () =>
{
const input_val = validate_postal_code.value.replace(/-/, '')
array_postal_code.some(array_val => {
if(input_val.match(array_val)) {
console.log('該当しました')
matchPostalCode(input_val)
return true
}
console.log('該当はありませんでした')
})
}
validate_postal_code.value ?
changePostalCode() : console.log('郵便番号フォームは未入力の状態です');
validate_postal_code.addEventListener('change', changePostalCode)
}
setAttentionModal = () =>
{
const attention_modal = document.getElementById('attention_modal')
const register_move = document.querySelector('.attention-modal-move')
const register_return = document.querySelector('.attention-modal-return')
let move_checkbox = document.getElementById('checked_attention')
move_checkbox.checked = false
!document.querySelector('.ec-errorMessage') ?
attention_modal.classList.add('is-active') : console.log('モーダル非表示');
move_checkbox.addEventListener('change',() => register_move.classList.toggle('is-move'))
register_move.addEventListener('click',() => attention_modal.remove())
register_return.addEventListener('click',() => {
window.history.length > 2 ?
window.history.back() : location.href = '/';
})
}
document.addEventListener('DOMContentLoaded', () =>
{
const postal_codes = '{{BaseInfo.message}}'
postal_codes ?
validatePostalCode(postal_codes) : console.log('郵便番号データの登録はありません');
!document.getElementById('entry_user_policy_check').checked ?
setAttentionModal() : console.log('モーダル非表示');
})
</script>
{% endblock javascript %}
{% block main %}
<div id="attention_modal" class="attention-modal">
<div class="attention-modal-overlay">
<div class="modal-layer-mask"></div>
<div class="attention-modal-inner">
<p class="attention-modal-text">
住⺠票に記載された⾃治体に寄付をする場合、<br><strong>「お礼の品」を受け取ることはできません。</strong><br><br>
誠に恐れ⼊りますが、<br>本サービスでは<strong>住⺠票住所が当⾃治体に該当する⽅</strong>の<br>
会員登録をお断りさせて頂いております。<br>何卒ご理解のほどよろしくお願いいたします。
</p>
<div class="attention-checkbox">
<input type="checkbox" id="checked_attention" name="checked-attention">
<label for="checked-attention" class="checked-attention">記載事項をご確認の上、会員登録へお進みください</label>
<div class="checkbox-button-wrap">
<button class="attention-modal-return">戻る</button>
<button class="attention-modal-move">会員登録へ進む</button>
</div>
</div>
</div>
</div>
</div>
<div class="ec-registerRole ec-entry-wrap">
<div class="ec-pageHeader">
<h1>{{ '新規会員登録'|trans }}</h1>
</div>
<div class="ec-off1Grid">
<div class="ec-off1Grid__cell">
<h2 class="ec-entry-title">寄付者情報の入力</h2>
<p class="ec-entry-desc">こちらの入力内容は、お申込み時に反映されます。</p>
<form method="post" action="{{ url('entry') }}" novalidate class="h-adr">
<span class="p-country-name" style="display:none;">Japan</span>
{{ form_widget(form._token) }}
<div class="ec-borderedDefs">
<dl>
<dt>
{{ form_label(form.name, 'お名前', { 'label_attr': { 'class': 'ec-label' }}) }}
<p class="emphasis">※控除を受ける方のお名前をご入力ください。</p>
<p class="emphasis">住民票の情報と異なる場合、寄付金控除の対象外となる可能性があります。</p>
</dt>
<dd>
<div class="ec-halfInput{{ has_errors(form.name.name01, form.name.name02) ? ' error'}}">
{{ form_widget(form.name.name01, { 'attr': { 'placeholder': '姓' }}) }}
{{ form_widget(form.name.name02, { 'attr': { 'placeholder': '名' }}) }}
{{ form_errors(form.name.name01) }}
{{ form_errors(form.name.name02) }}
</div>
</dd>
</dl>
<dl>
<dt>
{{ form_label(form.kana, 'お名前(カナ)', { 'label_attr': { 'class': 'ec-label' }}) }}
</dt>
<dd>
<div class="ec-halfInput{{ has_errors(form.kana.kana01, form.kana.kana02) ? ' error'}}">
{{ form_widget(form.kana.kana01, { 'attr': { 'placeholder': 'セイ' }}) }}
{{ form_widget(form.kana.kana02, { 'attr': { 'placeholder': 'メイ' }}) }}
{{ form_errors(form.kana.kana01) }}
{{ form_errors(form.kana.kana02) }}
</div>
</dd>
</dl>
<dl>
<dt>
{{ form_label(form.address, '住所', { 'label_attr': { 'class': 'ec-label' }}) }}
<p class="emphasis">※控除を受ける方の住民票住所をご入力ください。</p>
<p class="emphasis">住民票の情報と異なる場合、寄付金控除の対象外となる可能性があります。</p>
<p class="emphasis">ふるさと納税関連の書類は住民票住所へお届けします。</p>
</dt>
<dd>
<div class="ec-zipInput{{ has_errors(form.postal_code) ? ' error' }}"><span>{{ '〒'|trans }}</span>
{{ form_widget(form.postal_code) }}
<div class="ec-zipInputHelp">
<div class="ec-zipInputHelp__icon">
<div class="ec-icon"><img
src="{{ asset('assets/icon/question-white.svg') }}" alt="">
</div>
</div><a href="https://www.post.japanpost.jp/zipcode/" target="_blank"><span>{{ '郵便番号検索'|trans }}</span></a>
</div>
{{ form_errors(form.postal_code) }}
</div>
<div class="ec-select{{ has_errors(form.address.pref) ? ' error' }}">
{{ form_widget(form.address.pref) }}
{{ form_errors(form.address.pref) }}
</div>
<div class="ec-input{{ has_errors(form.address.addr01) ? ' error' }}">
{{ form_widget(form.address.addr01, { 'attr': { 'placeholder': '市区町村名(例:大阪市北区)' }}) }}
{{ form_errors(form.address.addr01) }}
</div>
<div class="ec-input{{ has_errors(form.address.addr02) ? ' error' }}">
{{ form_widget(form.address.addr02, { 'attr': { 'placeholder': '番地・ビル名(例:西梅田1丁目6-8)' }}) }}
{{ form_errors(form.address.addr02) }}
</div>
</dd>
</dl>
<dl>
<dt>
{{ form_label(form.birth, '生年月日', { 'label_attr': {'class': 'ec-label' }}) }}
<p class="emphasis">※控除を受ける方の生年月日をご入力ください。</p>
</dt>
<dd>
<div class="ec-birth{{ has_errors(form.birth) ? ' error' }}">
{{ form_widget(form.birth.year) }}<span>/</span>
{{ form_widget(form.birth.month) }}<span>/</span>
{{ form_widget(form.birth.day) }}
{{ form_errors(form.birth) }}
</div>
</dd>
</dl>
<dl>
<dt>
{{ form_label(form.sex, '性別', { 'label_attr': { 'class': 'ec-label' }}) }}
</dt>
<dd>
<div class="ec-select{{ has_errors(form.sex) ? ' error' }}">
{{ form_widget(form.sex) }}
{{ form_errors(form.sex) }}
</div>
</dd>
</dl>
<dl>
<dt>
{{ form_label(form.phone_number, '電話番号', { 'label_attr': { 'class': 'ec-label' }}) }}
<p class="emphasis">※携帯電話など日中につながりやすい連絡先をご入力ください。</p>
</dt>
<dd>
<div class="ec-telInput{{ has_errors(form.phone_number) ? ' error' }}">
{{ form_widget(form.phone_number) }}
{{ form_errors(form.phone_number) }}
</div>
</dd>
</dl>
<dl>
<dt>
{{ form_label(form.email, 'メールアドレス', { 'label_attr': { 'class': 'ec-label' }}) }}
<p class="emphasis">※迷惑メールの拒否設定をされている場合、メールが届かない場合があります。</p>
<p class="emphasis">「@cocofuru.jp」を受信できるように設定してください
。</p>
</dt>
<dd>
<div class="ec-input{{ has_errors(form.email.first) ? ' error' }}">
{{ form_widget(form.email.first, { 'attr': { 'placeholder': '例:ec-cube@example.com' }}) }}
{{ form_errors(form.email.first) }}
</div>
<div class="ec-input{{ has_errors(form.email.second) ? ' error' }}">
{{ form_widget(form.email.second, { 'attr': { 'placeholder': '確認のためもう一度入力してください' }}) }}
{{ form_errors(form.email.second) }}
</div>
</dd>
</dl>
<dl>
<dt>
{{ form_label(form.password, 'パスワード', { 'label_attr': {'class': 'ec-label' }}) }}
</dt>
<dd>
<div class="ec-input{{ has_errors(form.password.first) ? ' error' }}">
{{ form_widget(form.password.first, {
'attr': { 'placeholder': '半角英数記号%min%〜%max%文字'|trans({ '%min%': eccube_config.eccube_password_min_len, '%max%': eccube_config.eccube_password_max_len }) },
'type': 'password'
}) }}
{{ form_errors(form.password.first) }}
</div>
<div class="ec-input{{ has_errors(form.password.second) ? ' error' }}">
{{ form_widget(form.password.second, {
'attr': { 'placeholder': '確認のためもう一度入力してください'|trans },
'type': 'password'
}) }}
{{ form_errors(form.password.second) }}
</div>
</dd>
</dl>
{# エンティティ拡張の自動出力 #}
{% for f in form|filter(f => f.vars.eccube_form_options.auto_render) %}
{% if f.vars.eccube_form_options.form_theme %}
{% form_theme f f.vars.eccube_form_options.form_theme %}
{{ form_row(f) }}
{% else %}
<dl>
<dt>
{{ form_label(f) }}
</dt>
<dd>
<div class="{{ f.vars.eccube_form_options.style_class }}{{ has_errors(f) ? ' error' }}">
{{ form_widget(f) }}
{{ form_errors(f) }}
</div>
</dd>
</dl>
{% endif %}
{% endfor %}
</div>
<div class="ec-registerRole__actions">
<div class="ec-off4Grid">
<div class="ec-off4Grid__cell">
<div class="ec-checkbox{{ has_errors(form.user_policy_check) ? ' error' }}">
<label>
{{ form_widget(form.user_policy_check) }}
{{ '<a class="ec-link" href="%url%" target="_blank">利用規約</a>に同意してお進みください'|trans({ '%url%': url('help_agreement') })|raw }}
</label>
{{ form_errors(form.user_policy_check) }}
</div>
<button class="ec-blockBtn--action" type="submit" name="mode" value="confirm">{{ '同意する'|trans }}</button>
<a class="ec-blockBtn--cancel" href="{{ url('homepage') }}">{{ '同意しない'|trans }}</a>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
{% endblock %}