Procházet zdrojové kódy

优化分账金额为0时也显示,地址如果是空的就不显示

张田田 před 3 měsíci
rodič
revize
992719d3ee
2 změnil soubory, kde provedl 8 přidání a 8 odebrání
  1. 4 4
      src/service/OrderDetail.vue
  2. 4 4
      src/service/SingleItemDetail.vue

+ 4 - 4
src/service/OrderDetail.vue

@@ -318,15 +318,15 @@ watch(
 
 
     <!-- 分账信息 -->
     <!-- 分账信息 -->
     <div class="info-section"
     <div class="info-section"
-      v-if="tableData?.profitSharing  || tableData?.profitSharingAmount ">
+      v-if="tableData?.profitSharing !== null || tableData?.profitSharingAmount !== null">
       <h3 class="info-title">分账信息</h3>
       <h3 class="info-title">分账信息</h3>
       <div class="info-content-wrapper">
       <div class="info-content-wrapper">
         <div class="info-content">
         <div class="info-content">
-          <div class="info-item" v-if="tableData?.profitSharing">
+          <div class="info-item" v-if="tableData?.profitSharing!==null">
             <span class="info-label">分账比例:</span>
             <span class="info-label">分账比例:</span>
-            <span class="info-value">{{ tableData?.profitSharing }}%</span>
+            <span class="info-value">{{ tableData?.profitSharing }}</span>
           </div>
           </div>
-          <div class="info-item" v-if="tableData?.profitSharingAmount">
+          <div class="info-item" v-if="tableData?.profitSharingAmount !== null">
             <span class="info-label">分账金额:</span>
             <span class="info-label">分账金额:</span>
             <span class="info-value">
             <span class="info-value">
               {{ tableData?.profitSharingAmount }}元
               {{ tableData?.profitSharingAmount }}元

+ 4 - 4
src/service/SingleItemDetail.vue

@@ -27,7 +27,7 @@ const mockLogisticsData = computed(() => {
     trackingNumber: `${expressTypeText[props.data.expressType || '']} ${props.data.expressNo || ''}`,
     trackingNumber: `${expressTypeText[props.data.expressType || '']} ${props.data.expressNo || ''}`,
     recipientName: props.data.liaison || '',
     recipientName: props.data.liaison || '',
     recipientPhone: props.data.phone || '',
     recipientPhone: props.data.phone || '',
-    recipientAddress: props.data.provinceName + ' ' + props.data.cityName + ' ' + props.data.areaName + ' ' + props.data.detailAddress
+    recipientAddress: props.data.provinceName + ' ' + (props.data.cityName !== null ? props.data.cityName + ' ' : '') + (props.data.areaName !== null ? props.data.areaName + ' ' : '') + props.data.detailAddress !== null ? props.data.detailAddress : ''
   };
   };
 });
 });
 const expressTypeText: Record<string, string> = {
 const expressTypeText: Record<string, string> = {
@@ -138,7 +138,7 @@ const sellTypeText: Record<string, string> = {
         </vxe-column>
         </vxe-column>
         <vxe-column field="realAmount" title="分账金额" align="center">
         <vxe-column field="realAmount" title="分账金额" align="center">
           <template #default="{ row }">
           <template #default="{ row }">
-            {{ row.realAmount }}元
+            {{ row.realAmount ?? 0 }}元
           </template>
           </template>
         </vxe-column>
         </vxe-column>
       </vxe-table>
       </vxe-table>
@@ -157,8 +157,8 @@ const sellTypeText: Record<string, string> = {
           <div class="logistics-recipient">
           <div class="logistics-recipient">
             <span class="receive-icon">收</span>
             <span class="receive-icon">收</span>
             <span class="recipient-info">
             <span class="recipient-info">
-              {{ mockLogisticsData.recipientName  
-              || '' }}, {{ mockLogisticsData.recipientPhone  || '' }}, {{
+              {{ mockLogisticsData.recipientName
+                || '' }} {{ mockLogisticsData.recipientPhone || '' }} {{
                 mockLogisticsData.recipientAddress || '' }}
                 mockLogisticsData.recipientAddress || '' }}
             </span>
             </span>
           </div>
           </div>