123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324 |
- <template>
- <div class="box">
- <div class="footerbox">
- <div class="topbox">
- {{$t('register.WELCOME')}}
- </div>
- <div class="taps_footerbox">
- <el-input class="inputbox" v-model="from.email" :placeholder="$t('register.Address')"></el-input>
- <div class="red-t">*</div>
- </div>
- <div class="taps_footerbox">
- <el-input class="inputbox" v-model="from.password" show-password :placeholder="$t('register.Password')"></el-input>
- <div class="red-t">*</div>
- </div>
- <div class="taps_footerbox">
- <el-input class="inputbox" v-model="from.confirmPassword" show-password :placeholder="$t('register.Confirm')"></el-input>
- <div class="red-t">*</div>
- </div>
- <div class="taps_footerbox">
- <el-input class="inputbox" v-model="from.name" :placeholder="$t('register.Fullname')"></el-input>
-
- </div>
- <div class="taps_footerbox">
- <el-input class="inputbox" v-model="from.company" :placeholder="$t('register.Company')"></el-input>
-
- </div>
- <div class="taps_footerbox">
- <el-select v-model="from.country" :placeholder="$t('register.Country')">
- <el-option
- v-for="item in regionList"
- :key="item.en"
- :label="item.en"
- :value="item.en">
- </el-option>
- </el-select>
- </div>
- <div class="taps_footerbox">
- <el-select v-model="from.accountType" :placeholder="$t('register.Account')">
- <el-option
- v-for="item in accountTypeList"
- :key="item.name"
- :label="item.name"
- :value="item.name">
- </el-option>
- </el-select>
- </div>
- <el-button class="buttonbox_taps" type="primary" v-loading.fullscreen.lock="fullscreenLoading" @click="postRegister">{{$t('register.Agree')}}</el-button>
- </div>
- <div class="rightbox">
- <div class="rightcenterbox">
- <div class="rightcenterbox_f">
-
- {{$t('button.contactUs')}}
- </div>
- <div class="rightcenterbox_b">
- <p>{{$t('bottomBar.Tel')}} {{$t('taps.Telnum')}}</p>
- <p>{{$t('bottomBar.Email')}} {{$t('taps.Emailnum')}}</p>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import region from '@/js/region'
- export default {
- components: {
- },
- name: 'register',
- data () {
- return {
- fullscreenLoading: false,
- langShow: this.$util.localeStorage(),
- checked: true,
- checkedp: true,
- regionList: [],
- from: {
- accountType: '',
- company: '',
- confirmPassword: '',
- country: '',
- email: '',
- name: '',
- password: '',
- country: ''
- },
- accountTypeList: [{
- name: 'Industry',
- nameCn: '工业客户'
- }, {
- name: 'Academic',
- nameCn: '科研客户'
- }, {
- name: 'Distributor',
- nameCn: '经销商'
- }]
- }
- },
- methods: {
- postRegister () {
- if (this.verification()) {
- this.fullscreenLoading = true;
- this.$api.post('auth/register', this.from).then((res) => {
- if (res.code == 0) {
- this.fullscreenLoading = false;
- this.$message({
- message: this.$t('message.registration'),
- type: 'success'
- })
- this.$router.push({
- name: 'registration'
- })
- } else if (res.code == 226) {
- this.$message(this.$t('message.alreadyExists'))
- this.fullscreenLoading = false;
- } else if (res.code == 407) {
- this.$message(this.$t('message.hasFailed'))
- this.fullscreenLoading = false;
- } else {
- this.$message(res.msg)
- this.fullscreenLoading = false;
- }
- })
-
- }
- },
- verification () {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if (!this.from.email) {
- this.$message.error(this.$t('register.Address') + this.$t('register.Cannot'))
- return false
- } else if (!this.$util.isEmail(this.from.email)) {
- this.$message.error(this.$t('input.email') + this.$t('message.email'))
- return false
- } else if (!this.from.password) {
- this.$message.error(this.$t('register.Password') + this.$t('register.Cannot'))
- return false
- } else if (!this.$util.passwordValid(this.from.password)) {
- this.$message.error(this.$t('register.kinds'))
- return false
- } else if (this.from.password !== this.from.confirmPassword) {
- this.$message.error(this.$t('register.inconsistent'))
- return false
- } else {
- return true
- }
- }
- },
- mounted () {
- },
- created () {
- this.regionList = region
- }
- }
- </script>
- <style lang="scss" scoped>
- @media screen and (min-width: 751px) and (max-width: 9999px) {
- .box{
- overflow: hidden;
- margin-bottom: 3rem;
- }
- .footerbox{
- width: 40%;
- float: left;
- margin-left: 2rem;
- margin-top: 1.8rem;
- margin-right: 8rem;
- .topbox{
- margin-bottom: 1.8rem;
- font-size: 1.4rem;
- color: #005BAB;
- font-weight: 600;
- text-align: center;
- }
- .taps_footerbox /deep/{
- position: relative;
- margin-bottom: 0.8rem;
- .el-select{
- width: 100%;
- }
- .inputbox{
- width: 100%;
- }
- .red-t{
- font-size: 1.5rem;
- color: #E52323;
- position: absolute;
- top: 40%;
- left: -1rem;
- }
- }
- .buttonbox_taps{
- font-size: 16px;
- width: 100%;
- background: #0166b4;
- height: 3rem;
- padding: 0;
- margin-top: 1rem;
- }
- }
- .register_box{
- margin-top: 0.6rem;
- }
- .rightbox{
- width: 30%;
- float: left;
- .rightcenterbox{
- width: 100%;
- margin-top: 5.2rem;
- border: 1px solid #DBDBDB;
- .rightcenterbox_f{
- height: 3rem;
- font-size: 1.2rem;
- font-weight: 700;
- color: #313131;
- background: #F5F5F5;
- line-height: 3rem;
- text-indent: 1rem;
- }
- .rightcenterbox_b{
- font-size: 1rem;
- padding: 1rem;
- }
- }
- }
- .rightcenterbox_b>p:nth-of-type(1){
- margin-top: 0;
- }
- .rightcenterbox_b>p{
- margin-top: 1rem;
- color: #6f6f6f;
- }
- }
- @media screen and (min-width: 0px) and (max-width: 750px) {
- .box{
- overflow: hidden;
- // margin-bottom: 3rem;
- }
- .footerbox{
- width: 90%;
- margin: 0 auto;
- // overflow: hidden;
- background: #ffffff;
- .topbox{
- margin-bottom: 0.24rem;
- font-size: 0.2rem;
- color: #005BAB;
- font-weight: 600;
- text-align: center;
- }
- .taps_footerbox /deep/{
- position: relative;
- margin-bottom: 0.16rem;
- .el-select{
- width: 100%;
- }
- .inputbox{
- width: 100%;
- }
- .red-t{
- font-size: 0.2rem;
- color: #E52323;
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- left: -0.1rem;
- }
- }
- .buttonbox_taps{
- font-size: 0.16rem;
- width: 100%;
- background: #0166b4;
- height: 0.42rem;
- padding: 0;
- margin-top: 0.2rem;
- }
- }
- .register_box{
- margin-top: 0.1rem;
- }
- .rightbox{
- display: none;
- }
- }
- </style>
|