Merge branch 'sit-Carl' into sit-Leung

This commit is contained in:
Vion 2022-01-17 19:45:39 +08:00
commit a40446e8c2
2 changed files with 429 additions and 495 deletions

View File

@ -1,8 +1,7 @@
// <!-- -->
<template>
<div class="container rc-full-width">
<Myheader></Myheader>
<div class="rc-top"></div>
<div class="content ts-max-width--460">
<h2 class="rc-beta rc-text--center">账号注册</h2>
@ -117,12 +116,12 @@ export default {
loading:false,
usertitle:true,
gender: '',
inRank:false
inRank:false,
ifpassword:false
};
},
components: {
// Myheader,
Myheader,
},
computed: {
usertel () {
@ -143,19 +142,6 @@ export default {
return ''
}
},
// test () {
// if (this.sms === ""){
// return ''
// }else if(this.sms.length !== 5){
// return ''
// }else {
// return ''
// }
// }
},
components: {
},
mounted(){
},
@ -165,32 +151,26 @@ export default {
//
async usermsg() {
console.log("-----");
//console.log("-----");
let data = await sendMsg(this.tel);
if(data){
console.log(data);
this.captchadata=data.msgNum;
//console.log(data);
//this.captchadata=data.msgNum;
this.tamp=data.tamp;
this.hash=data.hash;
}
},
//
async vadmsg() {
console.log("-----");
let data = await vadatnmsg(this.captchadata,this.hash,this.tamp);
//console.log("-----");
let data = await vadatnmsg(this.sms,this.hash,this.tamp);
if(data){
console.log(data);
if(!data.code==1){
return false
return data;
}
}
},
checkBox(){
console.log(event.target.checked)
//console.log(event.target.checked)
this.usercheckbox=event.target.checked
},
@ -201,7 +181,7 @@ export default {
if(data){
console.log(data);
}
console.log(data);
//console.log(data);
},
//
sendCode () {
@ -242,13 +222,13 @@ export default {
return
}
if(this.sms!==this.captchadata){
this.$message({
type: 'warning',
message: '验证码输入有误请重新输入'
});
return
}
// if(this.sms!==this.captchadata){
// this.$message({
// type: 'warning',
// message: ''
// });
// return
// }
if(this.sms==''){
this.$message({
type: 'warning',
@ -261,7 +241,7 @@ export default {
console.log('----');
this.$message({
type: 'warning',
message: '请先勾选'
message: '请先同意隐私声明和账号使用协议'
});
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
this.$message({
@ -273,30 +253,31 @@ export default {
}
}
else{
let user= JSON.parse(localStorage.getItem("userInfo"));
console.log(this.tel);
let data=await useredit(this.tel);
this.vadmsg();
//let user= JSON.parse(localStorage.getItem("userInfo"));
let data = await this.vadmsg();
if(data.code=="1")
{
data=await useredit(this.tel);
if(data.code=='1'){
let couponId='0000000123';
this.serdiscount(this.tel,couponId);
setTimeout(() => {
this.serdiscount(this.tel,"0000000140");
}, 100);
setTimeout(() => {
this.serdiscount(this.tel,"0000000122");
}, 500);
this.$router.push({
path: "/",
});
return;
}
}
this.$message({
type: 'warning',
message: data.msg
});
if(data){
let couponId='0000000123';
this.serdiscount(user.data.mobile,couponId);
setTimeout(() => {
this.serdiscount(user.data.mobile,"0000000140");
}, 100);
setTimeout(() => {
this.serdiscount(user.data.mobile,"0000000122");
}, 500);
}
return
}

View File

@ -1,7 +1,7 @@
<template>
<div class="container rc-full-width">
<Myheader></Myheader>
<div class="rc-top"></div>
<div class="content ts-max-width--460">
<h2 class="rc-beta rc-text--center">{{ usertitle ? "账号登录" : "" }}</h2>
<!-- Deprecated : No tab switching as no password
@ -15,7 +15,6 @@
>
</div>
-->
<div class="rc-layout-container rc-one-column">
<div class="rc-column">
<input
@ -146,7 +145,7 @@ export default {
swiperData: [
// { index: 1 ,title:''},
// { index: 2 ,title:''},
],
]
};
},
components: {
@ -181,10 +180,8 @@ export default {
}
},
},
components: {},
mounted() {
console.log(this.$route.params);
//console.log(this.$route.params);
},
// watch: function () {
// console.log(this.inRank);
@ -195,16 +192,15 @@ export default {
checkBox(){
console.log(event.target.checked)
this.usercheckbox=event.target.checked
},
//
async usermsg() {
console.log("-----");
//console.log("-----");
let data = await sendMsg(this.tel);
if(data){
console.log(data);
this.captchadata=data.msgNum;
//this.captchadata=data.msgNum;
this.tamp=data.tamp;
this.hash=data.hash;
}
@ -213,16 +209,11 @@ export default {
//
async vadmsg() {
console.log("-----");
let data = await vadatnmsg(this.captchadata,this.hash,this.tamp);
//console.log("-----");
let data = await vadatnmsg(this.sms,this.hash,this.tamp);
if(data){
console.log(data.code);
if(!data.code==1){
return false
return data;
}
}
},
onClickHander(e) {
console.log(e);
@ -239,7 +230,7 @@ export default {
},
//
useredd() {
console.log("---注册账户");
//console.log("---");
this.usertitle = false;
},
@ -287,15 +278,6 @@ export default {
message: '手机号码输入有误'
});
return
}
if(this.sms!==this.captchadata){
this.$message({
type: 'warning',
message: '验证码输入有误请重新输入'
});
return
}
if(this.sms==''){
this.$message({
@ -304,12 +286,11 @@ export default {
});
return
}
console.log(this.usercheckbox);
if(this.usercheckbox==false){
console.log('----');
//console.log('----');
this.$message({
type: 'warning',
message: '请先勾选'
message: '请先同意隐私声明和账号使用协议'
});
if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(this.tel) || this.tel === "") {
this.$message({
@ -321,61 +302,33 @@ export default {
}
}
else{
console.log(this.tel);
let data = await userLongin(this.tel);
console.log(data);
this.vadmsg();
let data=await this.vadmsg();
if(data.code=="1")
{
data = await userLongin(this.tel);
if(data.msg=='SUCCESS'){
this.$message({
type: 'warning',
message: '登录成功'
});
if(data.msg=='SUCCESS'){
this.$router.push({
path: "/",
});
let token=JSON.stringify(data);
this.changeClod({ cloud: token });
}else{
return;
}
}
this.$message({
type: 'warning',
message: data.msg
});
}
return
}
},
// reallR () {
// this.zhud=true
// this.loading=true
// axios.post('https://www.daxunxun.com/users/register', {
// username: this.tel,
// password: this.password
// }).then(res=>{
// this.zhud=false
// this.loading=false
// if (res.data === 2) {
// Toast('')
// } else if (res.data === 0) {
// Toast('')
// } else {
// Toast('')
// }
// })
// }
}},
},
};
</script>
<style lang="less" scoped>
@import url("../../assets/css/global.less");
@import url("../../assets/css/login.less");
</style>