fix:落地页清除localStorage

This commit is contained in:
wangsongsole 2022-10-25 17:51:29 +08:00
parent 2200a87200
commit 147941d0c5
1 changed files with 23 additions and 21 deletions

View File

@ -17,11 +17,12 @@
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/modelPop.js"></script> <script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/modelPop.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/vConsole/3.4.1/vconsole.min.js"></script> <script src="https://cdn.bootcdn.net/ajax/libs/vConsole/3.4.1/vconsole.min.js"></script>
<style> <style>
input{ input {
color: var(--placeholderColor); color: var(--placeholderColor);
} }
input::placeholder { input::placeholder {
color: var(--placeholderColor); color: var(--placeholderColor);
} }
</style> </style>
</head> </head>
@ -45,14 +46,14 @@
</div> </div>
<div class="center" id="center"> <div class="center" id="center">
<img :src="middleImg" style="position: absolute;z-index: 1;" id="center_img"> <img :src="middleImg" style="position: absolute;z-index: 1;" id="center_img">
<input class="key" :maxlength="16" v-if="[3,4].includes(pageType)" :style="bindInputStyle" <input class="key" :maxlength="16" v-if="[3,4].includes(pageType)" :style="bindInputStyle"
placeholder="请输入兑换码" v-model="key" /> placeholder="请输入兑换码" v-model="key" />
<input class="code" :maxlength="5" v-if="[3,4].includes(pageType)" :style="bindInputStyle" <input class="code" :maxlength="5" v-if="[3,4].includes(pageType)" :style="bindInputStyle"
placeholder="请输入验证码" v-model="code" /> placeholder="请输入验证码" v-model="code" />
<input class="key" :maxlength="11" v-if="[1,8].includes(pageType)" :style="bindInputStyle" <input class="key" :maxlength="11" v-if="[1,8].includes(pageType)" :style="bindInputStyle"
placeholder="请输入手机号" v-model="key" /> placeholder="请输入手机号" v-model="key" />
<input class="code" :maxlength="6" v-if="[1,8].includes(pageType)" :style="bindInputStyle" <input class="code" :maxlength="6" v-if="[1,8].includes(pageType)" :style="bindInputStyle"
placeholder="请输入验证码" v-model="code" /> placeholder="请输入验证码" v-model="code" />
<img src="#" alt="" class="codeimg" v-if="[3,4].includes(pageType)" id="captcha_img" <img src="#" alt="" class="codeimg" v-if="[3,4].includes(pageType)" id="captcha_img"
@ -146,7 +147,7 @@
if (keyCode) { if (keyCode) {
let data = { let data = {
key: keyCode, key: keyCode,
theme_type:this.pageType theme_type: this.pageType
} }
req.axiosPost('/key/loginFromLink', data).then(res => { req.axiosPost('/key/loginFromLink', data).then(res => {
if (res.code == 200) { if (res.code == 200) {
@ -175,7 +176,7 @@
self.ftcolor = res.data[keyName].land.font_color; self.ftcolor = res.data[keyName].land.font_color;
self.topImg = res.data[keyName].land.top_image; self.topImg = res.data[keyName].land.top_image;
self.middleImg = res.data[keyName].land.middle_image; self.middleImg = res.data[keyName].land.middle_image;
if(this.pageType==8){ if (this.pageType == 8) {
self.middleImg = res.data[keyName].land.white_image; self.middleImg = res.data[keyName].land.white_image;
} }
self.describe = res.data[keyName].land.describe; self.describe = res.data[keyName].land.describe;
@ -191,11 +192,12 @@
center.style.height = img.clientHeight + "px"; center.style.height = img.clientHeight + "px";
} }
}) })
localStorage.clear()
}, },
computed:{ computed: {
bindInputStyle() { bindInputStyle () {
return { return {
'--placeholderColor': this.ftcolor, '--placeholderColor': this.ftcolor,
} }
}, },
}, },
@ -246,7 +248,7 @@
"key": this.key, "key": this.key,
"code": this.code, "code": this.code,
"code_unique_str": sessionStorage.getItem('unique_str'), "code_unique_str": sessionStorage.getItem('unique_str'),
"theme_type":this.pageType "theme_type": this.pageType
} }
req.axiosPost('/key/login', data).then(res => { req.axiosPost('/key/login', data).then(res => {
setTimeout(() => { setTimeout(() => {
@ -292,7 +294,7 @@
let data = { let data = {
"code_unique_str": res.headers['unique-str'], "code_unique_str": res.headers['unique-str'],
"key": item, "key": item,
"theme_type":this.pageType "theme_type": this.pageType
} }
let wait = await req.axiosPost('/key/loginFromMobileKey', data).then(res => { let wait = await req.axiosPost('/key/loginFromMobileKey', data).then(res => {
if (res.code == 200) { if (res.code == 200) {
@ -313,12 +315,12 @@
this.openDialog('正在加载商品...'); this.openDialog('正在加载商品...');
localStorage.setItem('entryLink', window.location.href);//存储起始页链接 localStorage.setItem('entryLink', window.location.href);//存储起始页链接
setTimeout(() => { setTimeout(() => {
if (this.pageType === 4 || this.pageType === 8) { if (this.pageType === 4 || this.pageType === 8) {
window.location.href = './coupon/couponCollection.html'; window.location.href = './coupon/couponCollection.html';
} else { } else {
window.location.href = './homepage.html'; window.location.href = './homepage.html';
} }
}, 1000); }, 1000);
} else { } else {
self.openErrorDialog(self.tiptext); self.openErrorDialog(self.tiptext);
} }
@ -353,7 +355,7 @@
}, },
watch: { watch: {
key (val) { key (val) {
this.disabled = Boolean(!([1,8].includes(this.pageType)&& val.length == 11)); this.disabled = Boolean(!([1, 8].includes(this.pageType) && val.length == 11));
} }
} }
}); });