|
@@ -468,6 +468,8 @@
|
|
|
ends = data.endtime;
|
|
|
monthPrice = data.monthprice;
|
|
|
yearPrice = data.yearprice;
|
|
|
+ console.log(area)
|
|
|
+ console.log(buyerclass)
|
|
|
//
|
|
|
var areaArr = [];
|
|
|
var areaHtml = "";
|
|
@@ -524,19 +526,35 @@
|
|
|
dateHtml = start + " - " + end;
|
|
|
$(".item_validity .label_for").text(dateHtml);
|
|
|
}
|
|
|
- if(cyclecount !== "" && cyclecount !== undefined){
|
|
|
+ if(starts !== "" && ends !== ""){
|
|
|
+ let end = new Date(ends*1000).toLocaleDateString();
|
|
|
+ let endtime = end.split("/");
|
|
|
+ let endYear = Number(endtime[0]);
|
|
|
+ let endMonth = Number(endtime[1]);
|
|
|
+ let start = new Date(starts*1000).toLocaleDateString();
|
|
|
+ let starttime = start.split("/");
|
|
|
+ let startYear = Number(starttime[0]);
|
|
|
+ let startMonth = Number(starttime[1]);
|
|
|
let year = "";
|
|
|
let month = "";
|
|
|
- if(cyclecount >= 12){
|
|
|
- year = Math.floor(Number(cyclecount) / 12);
|
|
|
- month = Number(cyclecount) - 12*year;
|
|
|
- }else{
|
|
|
- month = Number(cyclecount);
|
|
|
+ if(endYear > startYear){
|
|
|
+ if(endMonth > startMonth){
|
|
|
+ year = endYear - startYear;
|
|
|
+ month = endMonth - startMonth;
|
|
|
+ }else{
|
|
|
+ year = endYear - startYear-1;
|
|
|
+ month = 12+Number(endMonth)-startMonth;
|
|
|
+ if(year === 0){
|
|
|
+ year = "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if(endYear === startYear){
|
|
|
+ month = endMonth - startMonth;
|
|
|
}
|
|
|
-
|
|
|
- if(year !== "" && month !=="" && month !== 0){
|
|
|
+ //
|
|
|
+ if(year !== "" && month !==""){
|
|
|
$(".item_cycle .label_for").text(year+"年"+month+"个月");
|
|
|
- }else if(year !== ""&& (month ===""||month ===0)){
|
|
|
+ }else if(year !== ""&& month ===""){
|
|
|
$(".item_cycle .label_for").text(year+"年");
|
|
|
}else if(year === ""&& month !==""){
|
|
|
$(".item_cycle .label_for").text(month+"个月");
|