Эх сурвалжийг харах

refactor(create-order): 优化订单详情页面展示逻辑

- 修改补充服务权益的展示逻辑,根据supServiceIds、buyAccountCount和giftAccountCount生成相应的展示内容
- 优化付款信息组件,根据订单状态控制审核按钮的显示
- 修改审核未通过的展示文案为"审核失败"

Signed-off-by: tangshizhe <48740614+tangshizhe@users.noreply.github.com>
tangshizhe 1 сар өмнө
parent
commit
d7cca3e852

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

@@ -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) => {

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

@@ -40,7 +40,8 @@
             <span @click="vouched(row.row.voucher)" class="column-cell">点击查看</span>
           </template>
           <template v-slot:action="{ row }">
-            <span @click="payShenHe" class="column-cell">审核</span>
+            <span v-if="row.row.status !== 1 && row.row.status !== 2" @click="payShenHe" class="column-cell">审核</span>
+            <span v-else>-</span>
           </template>
         </TableCard>
       </div>
@@ -199,7 +200,7 @@ export default {
             if(row.state == 1) {
               return '审核通过'
             } else if(row.state == 2) {
-              return '审核未通过'
+              return '审核失败'
             } else {
               return '待审核'
             }