|
@@ -373,9 +373,9 @@ export default {
|
|
|
|
|
|
// 已购服务
|
|
// 已购服务
|
|
// 不同的值组成的数组
|
|
// 不同的值组成的数组
|
|
- // differentValues = serviceIds.filter(value => !supServiceIds.includes(value));
|
|
|
|
- const serviceIdsArr = serviceIds.map(id => parseInt(id));
|
|
|
|
- const baseServiceIdsArr = serviceListRef.calcAlreadyBuyServiceNamesArr(serviceIdsArr);
|
|
|
|
|
|
+ differentValues = serviceIds.filter(value => !supServiceIds.includes(value));
|
|
|
|
+ const differentValuesArr = differentValues.map(id => parseInt(id));
|
|
|
|
+ const baseServiceIdsArr = serviceListRef.calcAlreadyBuyServiceNamesArr(differentValuesArr);
|
|
const baseServiceData = Array.isArray(baseServiceIdsArr)? baseServiceIdsArr.join('、') : ''
|
|
const baseServiceData = Array.isArray(baseServiceIdsArr)? baseServiceIdsArr.join('、') : ''
|
|
// 补充服务
|
|
// 补充服务
|
|
// 相同的值组成的数组
|
|
// 相同的值组成的数组
|
|
@@ -516,14 +516,12 @@ export default {
|
|
days += value * 365;
|
|
days += value * 365;
|
|
text = `${value}年`;
|
|
text = `${value}年`;
|
|
}
|
|
}
|
|
- console.log(days, text, 'processCycle');
|
|
|
|
return { days, text };
|
|
return { days, text };
|
|
};
|
|
};
|
|
|
|
|
|
// 计算购买和赠送部分
|
|
// 计算购买和赠送部分
|
|
const buyResult = processCycle(buy_cycle, buy_type);
|
|
const buyResult = processCycle(buy_cycle, buy_type);
|
|
const giveResult = processCycle(give_cycle, give_type);
|
|
const giveResult = processCycle(give_cycle, give_type);
|
|
- console.log(buyResult, giveResult, 'buyResult, giveResult');
|
|
|
|
|
|
|
|
// 总天数
|
|
// 总天数
|
|
const totalDays = buyResult.days + giveResult.days;
|
|
const totalDays = buyResult.days + giveResult.days;
|
|
@@ -536,7 +534,14 @@ export default {
|
|
if(totalDays % 30 === 0) {
|
|
if(totalDays % 30 === 0) {
|
|
totalText = `${Math.floor(totalDays / 30)}个月`;
|
|
totalText = `${Math.floor(totalDays / 30)}个月`;
|
|
} else {
|
|
} else {
|
|
- totalText = `${Math.floor(totalDays / 30)}个月${totalDays % 30}天`;
|
|
|
|
|
|
+ // 如果天数小于30天,则不显示月,只显示天
|
|
|
|
+ const isHas30Days = totalDays / 30 < 1;
|
|
|
|
+ totalText = `${isHas30Days ? totalDays % 30 : Math.floor(totalDays / 30)}个月${totalDays % 30}日`;
|
|
|
|
+ if(isHas30Days) {
|
|
|
|
+ totalText = `${totalDays % 30}日`;
|
|
|
|
+ } else {
|
|
|
|
+ totalText = `${Math.floor(totalDays / 30)}个月${totalDays % 30}日`;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 如果总天数为365或者365的整数倍,则显示为totalText/365*12个月,
|
|
// 如果总天数为365或者365的整数倍,则显示为totalText/365*12个月,
|
|
@@ -544,7 +549,6 @@ export default {
|
|
totalText = `${Math.floor(totalDays / 365) * 12}个月`;
|
|
totalText = `${Math.floor(totalDays / 365) * 12}个月`;
|
|
}
|
|
}
|
|
|
|
|
|
- console.log(totalText, 'totalText');
|
|
|
|
const giveResultText = giveResult.text ? `赠送${giveResult.text},` : '';
|
|
const giveResultText = giveResult.text ? `赠送${giveResult.text},` : '';
|
|
return `付费${buyResult.text},${giveResultText}合计<span class="color_main">${totalText}</span>${returned_opens}`;
|
|
return `付费${buyResult.text},${giveResultText}合计<span class="color_main">${totalText}</span>${returned_opens}`;
|
|
},
|
|
},
|
|
@@ -579,7 +583,6 @@ export default {
|
|
|
|
|
|
orderServiceType(val) {
|
|
orderServiceType(val) {
|
|
const matchedOption = paymentTypeOptions.find(option => option.value === val);
|
|
const matchedOption = paymentTypeOptions.find(option => option.value === val);
|
|
- console.log(matchedOption, 'matchedOption');
|
|
|
|
return matchedOption ? matchedOption.label : val; // 如果未找到匹配项,返回原始值
|
|
return matchedOption ? matchedOption.label : val; // 如果未找到匹配项,返回原始值
|
|
},
|
|
},
|
|
}
|
|
}
|