首页状态bug修改完成

master
Lee-1203 2022-03-25 18:56:04 +08:00
parent a5c39ea1f6
commit ca8fc9a7b2
4 changed files with 54 additions and 24 deletions

View File

@ -10,7 +10,7 @@
<p>完善信息立即领取免费咨询卡(1小时)</p>
<span></span>
</div>
<div class="expert-receive expert-receive-01" v-if="consult_amount==1">
<div class="expert-receive expert-receive-01" v-if="consult_amount==1 && !isExpire">
<img src="../../../assets/images/home/expert/notice-02.png">
<p>您已领取一小时免费咨询权益可向专家进行提问</p>
</div>
@ -103,6 +103,7 @@
},
data() {
return {
isExpire: false, //
consult_amount: 0, //
current: 0,
isConfirm: false,
@ -130,6 +131,13 @@
if(JSON.parse(localStorage.getItem("ddEntrance"))){
this.ddEntrance = JSON.parse(localStorage.getItem("ddEntrance"));
}
//
let date2 = new Date();
let dateNumber = '';
dateNumber = dateNumber.concat(date2.getFullYear(),date2.getMonth()+1,date2.getDate());
if(parseInt(dateNumber) > 2022614){
this.isExpire = true;
}
},
mounted() {
this.getBanner();

View File

@ -12,7 +12,7 @@
</div>
</div>
<!-- 领取咨询卡 -->
<div class="index-receive" @click="goPage('/information')" v-if="consult_amount == 0">
<div class="index-receive" @click="goPage('/information')" v-if="consult_amount == 0 && !isExpire">
<img src="../../assets/images/home/index/receive.jpg" />
<span>完善信息立即领取免费咨询卡(1小时)</span>
</div>
@ -139,6 +139,7 @@
expertData: [], //
video: null,
isPaused: true,
isExpire:false, //
};
},
created() {
@ -147,11 +148,20 @@
localStorage.token = JSON.stringify(token);
localStorage.ddEntrance = JSON.stringify('yes');
this.getUserData();
}
}else{
//
this.consult_amount = (JSON.parse(localStorage.getItem("centerUserData"))).consult_amount;
console.log(this.consult_amount,3636)
}
//
let date2 = new Date();
let dateNumber = '';
dateNumber = dateNumber.concat(date2.getFullYear(),date2.getMonth()+1,date2.getDate());
if(parseInt(dateNumber) > 2022614){
this.isExpire = true;
}
},
mounted() {
this.getBanner();
@ -161,8 +171,11 @@
methods: {
//
getUserData() {
let that = this;
this.axios.post(this.HOME + "/api/user/center-info").then(function(res) {
console.log(res.data.data)
//
that.consult_amount = res.data.data.consult_amount;
localStorage.centerUserData = JSON.stringify(res.data.data);
});
},

View File

@ -92,11 +92,6 @@
},
computed: {},
methods: {
getUserData() {
this.axios.post(this.HOME + "/api/user/center-info").then(function(res) {
localStorage.centerUserData = JSON.stringify(res.data.data);
});
},
hideKeyboard() {
//
var that = this;
@ -113,17 +108,8 @@
localStorage.userData = JSON.stringify(res.data.data);
localStorage.token = JSON.stringify(res.data.data.token);
if (res.data.code == 0) {
console.log(res.data.code,'缓存123')
that.getUserData();
if(res.data.data.userType == 1){
that.$router.push('/consultant');
}else{
if(that.source){
window.localStorage.removeItem('source');
that.$router.push('/evaluation/entrance');
}else{
that.$router.push('/index');
}
}
} else {
that.toastText = '验证码错误!';
that.sms_code = '';
@ -137,6 +123,24 @@
console.log(error);
});
},
//
getUserData() {
let that = this;
this.axios.post(this.HOME + "/api/user/center-info").then(function(res) {
that.userData = res.data.data;
localStorage.centerUserData = JSON.stringify(res.data.data);
if(res.data.data.type == 1){
that.$router.push('/consultant');
}else{
if(that.source){
window.localStorage.removeItem('source');
that.$router.push('/evaluation/entrance');
}else{
that.$router.push('/index');
}
}
});
},
handleSubmit() {
this.$emit("input", this.value);

View File

@ -18,7 +18,7 @@
<div class="receive-txt">
<span class="use-btn" v-if="consult_amount == 1">使</span>
<span class="receive-btn" v-if="consult_amount == 0"></span>
<p v-if="consult_amount == 1 && startTime">{{startTime}}-{{endTime}}</p>
<p v-if="consult_amount == 1 && startTime">{{startTime}}-2022.6.14</p>
</div>
</div>
<div class="line" v-if="consult_amount == 1"></div>
@ -175,19 +175,24 @@
//
getDate() {
let starTime = (JSON.parse(localStorage.getItem("centerUserData"))).student.student_first_complete;
console.log(starTime,'111111')
let date = new Date(starTime.replace(/-/g, '/'));
this.startTime = date.getFullYear()+"."+(date.getMonth()+1)+"."+date.getDate(); //
console.log(this.startTime,2222222)
console.log(this.startTime,'2222222')
let date1 = new Date(starTime.replace(/-/g, '/'));
date1.setDate(date.getDate()+7);
this.endTime = date1.getFullYear()+"."+(date1.getMonth()+1)+"."+date1.getDate(); //
//
let date2 = new Date();
if(date1.setDate(date.getDate()+7) <= date2.setDate(date.getDate())){
let dateNumber = '';
dateNumber = dateNumber.concat(date2.getFullYear(),date2.getMonth()+1,date2.getDate());
if(parseInt(dateNumber) > 2022614){
this.isExpire = true;
}
// if(date1.setDate(date.getDate()+7) <= date2.setDate(date.getDate())){
// this.isExpire = true;
// }
},
// 退