|
@@ -214,7 +214,8 @@ export default {
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
onHide() {
|
|
onHide() {
|
|
|
- // clearInterval(c)
|
|
|
|
|
|
|
+ console.log('页面隐藏')
|
|
|
|
|
+ clearInterval(this.timer)
|
|
|
},
|
|
},
|
|
|
filters: {
|
|
filters: {
|
|
|
time(val) {
|
|
time(val) {
|
|
@@ -273,6 +274,7 @@ export default {
|
|
|
this.getDonationInfo();
|
|
this.getDonationInfo();
|
|
|
// this.getBill()
|
|
// this.getBill()
|
|
|
// this.getOrderInfo()
|
|
// this.getOrderInfo()
|
|
|
|
|
+ clearInterval(this.timer)
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
loadDate(id) {
|
|
loadDate(id) {
|
|
@@ -283,16 +285,17 @@ export default {
|
|
|
let data = res.data;
|
|
let data = res.data;
|
|
|
console.log(data, 'loaddata++++++++++');
|
|
console.log(data, 'loaddata++++++++++');
|
|
|
data.info = data.info.replace(/<img /g, '<img style="width:100%"');
|
|
data.info = data.info.replace(/<img /g, '<img style="width:100%"');
|
|
|
- this.endTime = data.end_time
|
|
|
|
|
- this.newtime = Math.floor((new Date().getTime() - this.endTime*1000)/1000)
|
|
|
|
|
- console.log(this.endTime,this.newtime,'--------------------------')
|
|
|
|
|
- this.timer = setInterval( () => {
|
|
|
|
|
- this.newtime--
|
|
|
|
|
- if(this.newtime==0){
|
|
|
|
|
- this.pushBoolen = true
|
|
|
|
|
- clearInterval(this.timer)
|
|
|
|
|
- }
|
|
|
|
|
- },1000)
|
|
|
|
|
|
|
+ this.setTime(data.end_time)
|
|
|
|
|
+ // this.endTime = data.end_time
|
|
|
|
|
+ // this.newtime = Math.floor((new Date().getTime() - this.endTime*1000)/1000)
|
|
|
|
|
+ // console.log(this.endTime,this.newtime,'--------------------------')
|
|
|
|
|
+ // this.timer = setInterval( () => {
|
|
|
|
|
+ // this.newtime--
|
|
|
|
|
+ // if(this.newtime==0){
|
|
|
|
|
+ // this.pushBoolen = true
|
|
|
|
|
+ // clearInterval(this.timer)
|
|
|
|
|
+ // }
|
|
|
|
|
+ // },1000)
|
|
|
this.proInfo = data;
|
|
this.proInfo = data;
|
|
|
console.log(this.proInfo, 'this.proInfo++++++++++++++++');
|
|
console.log(this.proInfo, 'this.proInfo++++++++++++++++');
|
|
|
let arr = this.proInfo.project_donation_info;
|
|
let arr = this.proInfo.project_donation_info;
|
|
@@ -431,6 +434,7 @@ export default {
|
|
|
return str;
|
|
return str;
|
|
|
},
|
|
},
|
|
|
cant() {
|
|
cant() {
|
|
|
|
|
+ console.log(this.pushBoolen)
|
|
|
if(this.pushBoolen){
|
|
if(this.pushBoolen){
|
|
|
return this.$api.msg('捐赠活动已结束');
|
|
return this.$api.msg('捐赠活动已结束');
|
|
|
}
|
|
}
|
|
@@ -460,6 +464,25 @@ export default {
|
|
|
}).then( res => {
|
|
}).then( res => {
|
|
|
console.log(res,'getOrderInfo+++++++++++++++')
|
|
console.log(res,'getOrderInfo+++++++++++++++')
|
|
|
})
|
|
})
|
|
|
|
|
+ },
|
|
|
|
|
+ setTime(endTime) {
|
|
|
|
|
+ this.endTime = endTime
|
|
|
|
|
+ this.newtime = Math.floor((new Date().getTime() - this.endTime*1000)/1000 )
|
|
|
|
|
+ if(this.newtime<0){
|
|
|
|
|
+ // this.pushBoolen = true
|
|
|
|
|
+ console.log(this.newtime,'newtime+++++++++++++++')
|
|
|
|
|
+ this.timer = setInterval(()=> {
|
|
|
|
|
+ this.newtime++
|
|
|
|
|
+ console.log(this.newtime)
|
|
|
|
|
+ if(this.newtime==0){
|
|
|
|
|
+ this.pushBoolen = true
|
|
|
|
|
+ clearInterval(this.timer)
|
|
|
|
|
+ }
|
|
|
|
|
+ },1000)
|
|
|
|
|
+ }else {
|
|
|
|
|
+ this.pushBoolen = true
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|