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

View File

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