瀏覽代碼

fix(create-order): 修复订单详情卡片中的产品列表和子账号数量显示问题

- 在 OrderDetailCardProductList 组件中,增加了对 totalNums 的判断,避免显示 0 条的情况
- 在 SelectOrderDetailCard 组件中,优化了子账号数量的显示逻辑,避免显示 0 个的情况
- 这些修改提高了订单详情页面的信息准确性和用户体验

Signed-off-by: tangshizhe <48740614+tangshizhe@users.noreply.github.com>
tangshizhe 1 月之前
父節點
當前提交
87367fd569

+ 2 - 2
src/views/create-order/components/order-detail-submodule/OrderDetailCardProductList.vue

@@ -457,8 +457,8 @@ export default {
       const totalNums = Number(pNum) + (Number(give_cycle) || 0);
       const { product_type } = product;
       const includeProductType = ['数据流量包', '历史数据', '结构化数据']
-      if(includeProductType.includes(product_type)) {
-        return `付费${pNum}条,赠送${give_cycle}条,合计<span class="color_main">${totalNums}</span>条`; 
+      if(includeProductType.includes(product_type) && totalNums) {
+        return `付费${pNum || 0}条,赠送${give_cycle || 0}条,合计<span class="color_main">${totalNums}</span>条`; 
       } else {
         return '';
       }

+ 3 - 4
src/views/create-order/components/order-detail-submodule/SelectOrderDetailCard.vue

@@ -614,10 +614,9 @@ export default {
 
     // 构造子账号数量字符串。
     buildSubAccountCount(product, filter) {
-
-      if (product.product_type === 'VIP订阅' || product.product_type === '大会员') {
-        const buyCount = Number(filter?.buyAccountCount) || 0;
-        const giftCount = Number(filter?.giftAccountCount) || 0;
+      const buyCount = Number(filter?.buyAccountCount) || 0;
+      const giftCount = Number(filter?.giftAccountCount) || 0;
+      if (buyCount || giftCount) {
         const countTotal = buyCount + giftCount;
         return `付费${buyCount}个,赠送${giftCount}个,合计:<span class="color_main">${countTotal}</span>个`;
       }