首页状态bug修改完成
parent
a5c39ea1f6
commit
ca8fc9a7b2
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
},
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
// }
|
||||
},
|
||||
|
||||
// 退出登录
|
||||
|
|
Loading…
Reference in New Issue