Commit 740b465b authored by agping's avatar agping

微信邀请注册

parent 8eb5589a
<template> <template>
<div> <div>
<div class="register-con"> <div class="register-con">
<img :src="bgImage" class="zhuce-img"> <img :src="bgImage" class="zhuce-img pointer-click-item">
<div class="register-body"> <div class="register-body">
<div class="div-phone li-item"> <div class="div-phone li-item">
<span class="register-span"> <span class="register-span">
手机号码 手机号码
</span> </span>
<input type="text" id="phone" class="infos" placeholder="请输入号码"> <input type="text" id="phone" class="infos" placeholder="请输入号码" v-model.trim="phone">
</div> </div>
<div class="div-ranks li-item"> <div class="div-ranks li-item">
<input type="number" id="ranks" class="infos1" placeholder="请输入验证码"> <input type="number" id="ranks" class="infos1" placeholder="请输入验证码" v-model.trim="code">
<a class="send1">获取验证码</a> <a href="javascript:;" class="send1" @click="getCode" v-show="!isGetCode">获取验证码</a>
<a href="javascript:;" class="send1" v-show="isGetCode">{{countSecond}}</a>
</div> </div>
<div class="register-div"> <div class="register-div">
<img class="zc_nor_button" :src="yueduImage"> <img class="zc_nor_button" :src="yueduImage" v-show="!isGetImg" @click="isGetImg=!isGetImg">
<img class="zc_nor_button" :src="noyueduImage" v-show="isGetImg" @click="isGetImg=!isGetImg">
<router-link to="/agreement" class='a-link'> <router-link to="/agreement" class='a-link'>
我已阅读 我已阅读
<span> <span>
...@@ -26,7 +30,11 @@ ...@@ -26,7 +30,11 @@
</div> </div>
<div class="div-conform"> <div class="div-conform">
<a class="conform">提交</a> <a href="javascript:;" @click="submitOk" v-show="!isSaving" class="conform flex-center">提交</a>
<a href="javascript:;" v-show="isSaving" class="conform flex-center">提交中</a>
<!--<a class="conform">提交</a>-->
</div> </div>
<div class="clear"></div> <div class="clear"></div>
<div class="qr-code-area"> <div class="qr-code-area">
...@@ -52,46 +60,93 @@ ...@@ -52,46 +60,93 @@
yueduImage, yueduImage,
noyueduImage, noyueduImage,
qrCodeImg, qrCodeImg,
isGetCode: false,
countSecond: 60,
phone: '',
code: '',
isSaving: false,
isGetImg:false,
}), }),
created() { created() {
let _this = this; let _this = this;
_this.common.duringRequest({ _this.common.duringRequest({
'urlStr': '/api/userVerify',
startAction() {
_this.isSaving = true;
},
endAction() {
_this.isSaving = false;
}
}); });
}, },
mounted() { mounted() {
let _this = this; let _this = this;
}, },
methods: { methods: {
getCode() { getCode() {
let _this = this; let _this = this;
_this.isGetCode = true;
_this.axios({
method: 'post',
url: '/api/sendCode',
responseType: 'json',
data: {
'device_id': _this.$route.query.device_id,
'phone': _this.phone,
}
})
.then(function(response) {
if(response.data.code == 200 && response.data.data) {
layer.tipsX('验证码已发送,请注意查收');
} else {
layer.tipsX(response.data.msg);
}
})
.catch(function(error) {
layer.tipsX(error);
});
//点击发送验证码的同时已经开始计时
let _timer = setInterval(function(){
if(_this.countSecond <= 1){
clearInterval(_timer);
_this.isGetCode = false;
}else{
_this.countSecond -= 1;
}
},1000);
}, },
submitOk() { submitOk() {
let _this = this; let _this = this;
if(_this.common.isMobile(_this.phone)) { if(_this.common.isMobile(_this.phone)){
if(_this.isGetImg){
layer.tipsX('你还未阅读《同联商业服务协议》');
};
_this.axios({ _this.axios({
method: 'post', method: 'post',
url: '/admin/member/checkInvite', url: '/api/userVerify',
responseType: 'json', responseType: 'json',
data: { data: {
'userid': _this.$route.query.userid, 'phone': _this.phone,
'phone': _this.phone, 'device_id':_this.$route.query.device_id,
'code': _this.code 'code': _this.code,
} 'wx_union_id': _this.$route.query.wx_union_id,
}) 'referrer_id': _this.$route.query.referrer_id,
.then(function(response) { 'referrer_source':_this.$route.query.referrer_source,
if(response.data.code === 200 && response.data.data) { }
layer.tipsX('注册成功'); })
} else { .then(function(response) {
layer.tipsX(response.data.message); if(response.data.code == 200 && response.data.data) {
} layer.tipsX('注册成功');
}) } else {
.catch(function(error) { layer.tipsX(response.data.msg);
layer.tipsX(error); }
}); })
} else { .catch(function(error) {
layer.tipsX(error);
});
}else{
layer.tipsX('手机号码格式不正确'); layer.tipsX('手机号码格式不正确');
} }
} }
...@@ -227,6 +282,8 @@ input::-webkit-input-placeholder{ ...@@ -227,6 +282,8 @@ input::-webkit-input-placeholder{
} }
.div-conform a{ .div-conform a{
color: #FFFFFF; color: #FFFFFF;
border-radius: 0.35rem;
} }
#btn{ #btn{
background: none; background: none;
......
...@@ -47,7 +47,10 @@ ...@@ -47,7 +47,10 @@
'path': '/inviteRegister', 'path': '/inviteRegister',
'nameCustom': '邀请注册', 'nameCustom': '邀请注册',
'query': { 'query': {
// 'id':'160', 'device_id':'0',
'wx_union_id':'0',
'referrer_id':'160',
'referrer_source':'10',
} }
}, },
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment