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