提交 13ea2d77 编写于 作者: Yuanzhao.dai's avatar Yuanzhao.dai

Merge branch 'dev-stage2-20191125' of...

Merge branch 'dev-stage2-20191125' of http://192.168.110.53/com.pica.cloud.foundation.frontend/year-end-activitiy into dev-stage2-20191125
......@@ -89,8 +89,26 @@
},
mounted(){
document.querySelector('body').setAttribute('style', 'background: #FE9A51;');
this.checkCache();
},
methods: {
// 校验用户浏览器是否有登录缓存,此缓存为纯前端缓存,与token之类的无关
checkCache(){
const mobilePhoneCache = window.localStorage.getItem('mobilePhone');
const statusCache = window.localStorage.getItem('status');
let status = 'false';
// 如果有缓存则是第二次进入,就要显示已领取,也就是false
if(mobilePhoneCache && statusCache){
window.localStorage.setItem('status', status);
this.$router.push({
name: 'shareResult',
query: {
status
}
})
}
// 如果没有缓存,则停留当前页面
},
// 点击刷新验证码
getCaptcha(){
getCaptchaGet().then(res=>{
......@@ -107,6 +125,11 @@
if(this.mobilePhone=='' || this.mobilePhone.length!=11){
this.$toast('请输入正确的手机号');
return;
}
// 校验图形验证码
if(this.captchaAnswer==''){
this.$toast('请输入图形验证码');
return;
}
if(this.authCode==''){
this.$toast('请输入短信验证码');
......@@ -121,8 +144,12 @@
taskId,
activityId
}).then(res=>{
// res.data true 登记成功 、 false 登记失败
if(res.code=='000000'){
// res.data true 登记成功 、 false 登记失败
// 将手机号和状态存入浏览器缓存,用户再次进来就能直接进入领取结果页面
// 注意,如果清除微信或者浏览器缓存,则将停留在当前这个页面并且再次填写手机号以做登录
window.localStorage.setItem('mobilePhone', mobilePhone);
window.localStorage.setItem('status', res.data);
this.$router.push({
name: 'shareResult',
query: {
......@@ -146,8 +173,6 @@
return;
}
// this.notSend = false;
const { mobilePhone, flag, captchaToken, captchaAnswer } = this;
getAuthCode({mobilePhone, flag, captchaToken, captchaAnswer}).then(res=>{
// 发送成功
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册