Commit b1d8a742 authored by Facius's avatar Facius

Merge branch 'dev-v1.0.0' of https://git.banshouhui.com/wuzhenzhe/study into dev-v1.0.0

parents 52bde81d 27d03587
......@@ -85,7 +85,7 @@ export default {
case 5:
status = '已绑定'
data[i].statusStyle = { color: '#2953FF' }
data[i].subtitle = '请前往首页答题联系吧'
data[i].subtitle = '请前往首页答题练习吧'
break
case 10:
status = '已激活'
......@@ -95,7 +95,10 @@ export default {
res[i].echoMap.cardId &&
res[i].echoMap.cardId.activationTime
) {
let diff = this.datedifference(sDate1, sDate2)
let diff = this.datedifference(
res[i].echoMap.cardId.activationTime.split(' ')[0],
this.getTodayDate()
)
leaveDay = res[i].echoMap.cardId.effectiveDay - diff
leaveDay = leaveDay > 0 ? leaveDay : 0
}
......@@ -118,6 +121,19 @@ export default {
}
})
},
getTodayDate() {
let day = new Date()
day.setTime(day.getTime())
let m = day.getMonth() + 1
let d = day.getDate()
return (
day.getFullYear() +
'-' +
(String(m).length < 2 ? '0' + m : m) +
'-' +
(String(d).length < 2 ? '0' + d : d)
)
},
datedifference(sDate1, sDate2) {
//2021-01-01,2020-02-01,31
var dateSpan, tempDate, iDays
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment