register.vue 9.18 KB

<template>
	<div>
		<modal-simple-comp :visible="modalSimpleVisiable" :show-confirm="false" :icon="modalIcon" :content="modalContent" :confirm="modalCallback" :overlay="closeModal" :close="closeModal"></modal-simple-comp>
		<modal-comp :visible="modalVisiable" :show-confirm="false" :icon="modalIcon" :content="modalContent" :confirm="modalCallback" :overlay="modalCallback"></modal-comp>
		<!-- 会员协议 -->
		<modal-protocol-comp :visible="modalProtocolVisiable" :overlay="closeModal" :close="closeModal"></modal-protocol-comp>
		<div class="ebg"></div>
		<div class="content" v-if="!oneAccountCenterOff">
			<div class="top-space"></div>
			<div class="step">
				<img v-if="type == 1" src="@/assets/images/register/register-step-1.png">
				<img v-if="type == 2" src="@/assets/images/register/register-step-2.png">
			</div>
			<div class="box">
				<!-- 手机验证 -->
				<div v-if="type == 1" class="login">

					<div class="login-tit">
						<img v-if="locale == 'zh'" src="@/assets/images/login/login-tit-zh.png">
						<img v-if="locale == 'tc'" src="@/assets/images/login/login-tit-tc.png">
						<img v-if="locale == 'en'" class="img-en" src="@/assets/images/login/login-tit-en.png">
					</div>
					<div class="login-tit2">{{$t('register.title')}}</div>
					<div class="gird-g form">
						<!-- <div class="pure-u-1 form-item">
							<div class="ipt-wrap">
								<img class="down-arrow" src="@/assets/images/reservation/re-down-arrow.png" alt="">
								<select class="ipt" v-model="mobileNoType">
									<option v-for="(item,index) in mobileOptions" :key="index" :value="item.type">{{item.name}}</option>
								</select>
							</div>
						</div> -->
						<div class="pure-u-1 form-item">
							<div class="ipt-wrap">

								<div class="region-tel ipt-wrap">
									<img class="down-arrow" src="@/assets/images/reservation/re-down-arrow.png" alt="">
									<el-select class="ipt" v-model="mobileNoType">
										<el-option v-for="(item,index) in mobileOptions" :key="index" :value="item.type" :label="item.areaCode">{{item.areaCode}}</el-option>
									</el-select>
								</div>

								<div class="ipt ipt2" :class="{err : errorTips.p1.length > 0}">
									<input :placeholder="mobileTip.placeHolder" class="ipt-tel" type="text" v-model="registerForm.mobileNo">
								</div>
							</div>
							<div class="validator" v-if="errorTips.p1.length > 0 ">
								<img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p1}}
							</div>
						</div>

						<div class="pure-u-1 form-item" v-if="registerCheck.showImageCode">
							<div class="ipt-wrap">
								<input :placeholder="$t('login.verifyPlaceholder')" class="ipt ipt-verify" :class="{err : errorTips.p3.length > 0}" type="text" v-model="registerForm.imageValue">
								<div class="ipt verify-btn pointer vcode" @click="handlerRefreshImageVcode">
									<img :src="values.imageBase64">
								</div>
							</div>
							<div class="validator" v-if="errorTips.p3.length > 0 ">
								<img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p3}}
							</div>
						</div>
						<div class="pure-u-1 form-item">
							<div class="ipt-wrap">
								<div class="ipt ipt2" :class="{err : errorTips.p2.length > 0}">
									<input :placeholder="$t('register.verifyCodePlaceholder')" class="ipt-code" type="text" v-model="registerForm.opt">
									<div v-if="times.remain == 0" class="veri-btn pointer" @click="handlerStdSendOTP">{{$t('register.verifyCodeGet')}}</div>
									<div v-else class="veri-btn-default">{{times.tip}}</div>
								</div>
							</div>
							<div class="validator" v-if="errorTips.p2.length > 0 ">
								<img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p2}}
							</div>
						</div>
					</div>

					<div class="login-protocol pointer" @click="registerCheck.agreeProtocol = !registerCheck.agreeProtocol">
						<img v-if="!registerCheck.agreeProtocol" class="check" src="@/assets/images/login/uncheck.png">
						<img v-if="registerCheck.agreeProtocol" class="check" src="@/assets/images/login/check.png"> {{$t('login.agree')}} &nbsp;
						<span @click="onProtocolHandler()" class="protocol pointer">{{$t('login.protocol')}}</span>
					</div>
					<div @click="onSubmitHandler()" class="login-submit pointer flex-center" :class="{disabled: registerDisabled}">
						<van-loading v-if="loading" />
						<span>{{$t('register.register')}}</span>
					</div>
				</div>
				<!-- 输入密码 -->
				<div v-if="type == 2" class="login">
					<!-- <div class="login-tit">
						<img v-if="locale == 'zh'" src="@/assets/images/login/login-tit-zh.png">
						<img v-if="locale == 'tc'" src="@/assets/images/login/login-tit-tc.png">
						<img v-if="locale == 'en'" class="img-en" src="@/assets/images/login/login-tit-en.png">
					</div> -->
					<div class="login-tit2">{{$t('register.title2')}}</div>
					<div class="gird-g form">
						<div class="pure-u-1 form-item">
							<div class="label">
								<img src="@/assets/images/register/icon-register-lock.png"> {{$t('register.newPassword')}}
							</div>
							<div class="ipt-wrap">
								<input :placeholder="$t('register.newPasswordPlaceholder')" class="ipt" :class="{err : errorTips.p4.length > 0}" type="password" v-model="values.password">
							</div>
							<div class="validator" v-if="errorTips.p4.length > 0 ">
								<img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p4}}
							</div>
						</div>
						<div class="pure-u-1 form-item">
							<div class="label">
								<img src="@/assets/images/register/icon-register-lock.png"> {{$t('register.newPasswordSure')}}
							</div>
							<div class="ipt-wrap">
								<input :placeholder="$t('register.newPasswordSurePlaceholder')" class="ipt" :class="{err : errorTips.p5.length > 0}" type="password" v-model="values.passwordRepeat">
							</div>
							<div class="validator" v-if="errorTips.p5.length > 0 ">
								<img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p5}}
							</div>
						</div>
					</div>
					<div @click="onRegisterHandler()" class="login-submit pointer flex-center" :class="{disabled: submitDisabled}">
						<van-loading v-if="loading" />
						<span>{{$t('register.sure')}}</span>
					</div>
				</div>
			</div>
		</div>

		<div class="content" v-else>
			<div class="top-space"></div>
			<div class="box">
				<!-- 手机验证 -->
				<div class="login">

					<div class="gird-g form">
						<div class="pure-u-1 form-item">

							<div class="label">
								<img src="@/assets/images/register/icon-register-phone.png"> {{mobileTip.name}}
							</div>
							<div class="ipt-wrap">
								<div class="region-tel ipt-wrap">
									<img class="down-arrow" src="@/assets/images/reservation/re-down-arrow.png" alt="">
									<el-select class="ipt" v-model="mobileNoType">
										<el-option v-for="(item,index) in mobileOptions" :key="index" :value="item.type" :label="item.areaCode">{{item.areaCode}}</el-option>
									</el-select>
								</div>

								<div class="ipt ipt2" :class="{err : errorTips.p1.length > 0}">
									<input :placeholder="mobileTip.placeHolder" class="ipt-tel" type="text" v-model="registerForm.mobileNo">
								</div>
							</div>
							<div class="validator" v-if="errorTips.p1.length > 0 ">
								<img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p1}}
							</div>
						</div>

						<div class="pure-u-1 form-item">
							<div class="label">
								<img src="@/assets/images/register/icon-register-lock.png"> {{$t('register.newPassword')}}
							</div>
							<div class="ipt-wrap">
								<input :placeholder="$t('register.newPasswordPlaceholder')" class="ipt" :class="{err : errorTips.p4.length > 0}" type="password" v-model="values.password">
							</div>
							<div class="validator" v-if="errorTips.p4.length > 0 ">
								<img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p4}}
							</div>
						</div>
						<div class="pure-u-1 form-item">
							<div class="label">
								<img src="@/assets/images/register/icon-register-lock.png"> {{$t('register.newPasswordSure')}}
							</div>
							<div class="ipt-wrap">
								<input :placeholder="$t('register.newPasswordSurePlaceholder')" class="ipt" :class="{err : errorTips.p5.length > 0}" type="password" v-model="values.passwordRepeat">
							</div>
							<div class="validator" v-if="errorTips.p5.length > 0 ">
								<img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p5}}
							</div>
						</div>

					</div>

					<div class="login-protocol pointer" @click="registerCheck.agreeProtocol = !registerCheck.agreeProtocol">
						<img v-if="!registerCheck.agreeProtocol" class="check" src="@/assets/images/login/uncheck.png">
						<img v-if="registerCheck.agreeProtocol" class="check" src="@/assets/images/login/check.png"> {{$t('login.agree')}} &nbsp;
						<span @click="onProtocolHandler()" class="protocol pointer">{{$t('login.protocol')}}</span>
					</div>
					<div @click="registerV2Handler()" class="login-submit pointer flex-center" :class="{disabled: registerDisabledV2}">
						<van-loading v-if="loading" />
						<span>{{$t('register.register')}}</span>
					</div>
				</div>

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

<script src="./register.js"></script>
<style lang="scss" scoped>
@import "./register.scss";
</style>