Commit bf46ab3dc6ddcd28e1ed13730faaa4cdcecbd09d

Authored by 王强
1 parent 8373615e

新达人列表时间显示问题处理~

src/components/darenListCom/darenListCom.vue
... ... @@ -151,12 +151,14 @@
151 151 } else if (now.getFullYear() > add.getFullYear()) { // 跨年,判断设置年份和闰年等,设置昨天/前天/日期
152 152  
153 153 // 设置年
154   - if (!this.years.includes(add.getFullYear())) {
155   - result.year = add.getFullYear();
156   - this.years.push(add.getFullYear());
157   - } else {
158   - result.year = "";
159   - }
  154 + // if (!this.years.includes(add.getFullYear())) {
  155 + // result.year = add.getFullYear();
  156 + // this.years.push(add.getFullYear());
  157 + // } else {
  158 + // result.year = "";
  159 + // }
  160 +
  161 + result.year = add.getFullYear();
160 162  
161 163 // 一年的天数
162 164 let fullYearDay = 365;
... ... @@ -176,10 +178,13 @@
176 178 } else if (nowDays + fullYearDay - addDays === 2) {
177 179 result.day = "前天";
178 180 result.date = (add.getHours() >= 10 ? add.getHours() : "0" + add.getHours()) + ":" + (add.getMinutes() >= 10 ? add.getMinutes() : "0" + add.getMinutes());
  181 + } else {
  182 + result.day = "";
  183 + result.date = add.getFullYear() + "-" + (add.getMonth() + 1) + "-" + add.getDate();
179 184 }
180 185 } else {
181 186 result.day = "";
182   - result.date = (add.getMonth() + 1) + "-" + add.getDate();
  187 + result.date = add.getFullYear() + "-" + (add.getMonth() + 1) + "-" + add.getDate();
183 188 }
184 189 }
185 190  
... ...