|
@@ -236,7 +236,7 @@ export default {
|
|
|
const serviceIds = parsedFilter.serviceIds || [];
|
|
|
const supServiceIdsOrigin = parsedFilter.supServiceIds || [];
|
|
|
// 等待异步方法完成
|
|
|
- const supServiceIds = await this.buildSupServiceIds(parsedFilter.supServiceIds || []);
|
|
|
+ const supServiceIds = this.buildSupServiceIds(parsedFilter || []);
|
|
|
const bigServiceNames = product.product_type === '大会员' ? await this.buildBigServiceNames(serviceIds, supServiceIdsOrigin) : '';
|
|
|
const rate = this.calculateDiscountRate(product);
|
|
|
const validityPeriod = this.calculateValidityPeriod(
|
|
@@ -342,32 +342,16 @@ export default {
|
|
|
divided(a, b) {
|
|
|
return div(a, b)
|
|
|
},
|
|
|
- buildSupServiceIds(supServiceIds) {
|
|
|
- return new Promise((resolve) => {
|
|
|
- if (!supServiceIds || supServiceIds.length === 0) {
|
|
|
- resolve('');
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- // 避免修改原始数组,创建新的整型数组
|
|
|
- const numericServiceIds = supServiceIds.map(id => parseInt(id));
|
|
|
- this.$nextTick(() => {
|
|
|
- try {
|
|
|
-
|
|
|
- const serviceListRef = this.$refs.serviceListRef;
|
|
|
- if (!serviceListRef || typeof serviceListRef.calcAlreadyBuyServiceNamesArr !== 'function') {
|
|
|
- resolve('');
|
|
|
- return;
|
|
|
- }
|
|
|
- const baseServiceIdsArr = serviceListRef.calcAlreadyBuyServiceNamesArr(numericServiceIds);
|
|
|
- const serviceData = Array.isArray(baseServiceIdsArr) ? baseServiceIdsArr.join('、') : '';
|
|
|
- resolve(serviceData);
|
|
|
- } catch (error) {
|
|
|
- console.error('Error calculating service names:', error);
|
|
|
- resolve('');
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
+ buildSupServiceIds(parfilter) {
|
|
|
+ const { supServiceIds, buyAccountCount, giftAccountCount } = parfilter
|
|
|
+ const upgradeContent = []
|
|
|
+ if (supServiceIds && supServiceIds.length > 0) {
|
|
|
+ upgradeContent.push('补充权益')
|
|
|
+ }
|
|
|
+ if(buyAccountCount || giftAccountCount) {
|
|
|
+ upgradeContent.push('增购子账号')
|
|
|
+ }
|
|
|
+ return upgradeContent.length ? upgradeContent.join('、') : '-'
|
|
|
},
|
|
|
buildBigServiceNames(serviceIds, supServiceIds) {
|
|
|
return new Promise((resolve) => {
|