Kaynağa Gözat

Update trade-detail.tsx

lex-xin 5 ay önce
ebeveyn
işleme
724599b68b
1 değiştirilmiş dosya ile 26 ekleme ve 24 silme
  1. 26 24
      src/views/trade/trade-detail.tsx

+ 26 - 24
src/views/trade/trade-detail.tsx

@@ -59,21 +59,14 @@ export default defineComponent({
   },
   computed: {
     orderDetailList() {
-
       const result: any = this.result
       const orderDetailList = result.orderDetailList || []
       orderDetailList.forEach((item: any) => {
         let tempPrice = item?.expectPrice || item.actualPrice
         if (item?.couponAmount) {
-            tempPrice = Number(
-              (
-                (tempPrice - item.couponAmount) / item.goodNum
-              ).toFixed(2)
-            )
+          tempPrice = Number((tempPrice / item.goodNum).toFixed(2))
         } else {
-          tempPrice = Number(
-            tempPrice / item.goodNum
-            ).toFixed(2)
+          tempPrice = Number(tempPrice / item.goodNum).toFixed(2)
         }
 
         item.showPrice = tempPrice || 0
@@ -224,13 +217,15 @@ export default defineComponent({
                     ),
                     default: () => (
                       <div class={styles.content}>
-                        {item.giftFlag ? <span class={styles.price}>
-                          赠送
-                        </span>: <span class={styles.price}>
-                          ¥
-                          {(this as any).$filters.moneyFormat(item.showPrice)}
-                        </span>}
-                        
+                        {item.giftFlag ? (
+                          <span class={styles.price}>赠送</span>
+                        ) : (
+                          <span class={styles.price}>
+                            ¥
+                            {(this as any).$filters.moneyFormat(item.showPrice)}
+                          </span>
+                        )}
+
                         <span class={styles.num}>x{item.goodNum}</span>
                       </div>
                     )
@@ -238,14 +233,21 @@ export default defineComponent({
                 />
               ))}
 
-              {this.result.couponAmount > 0 && <Row class={styles.optionRow}>
-                <Col span="8" offset={1}>
-                  优惠金额:
-                </Col>
-                <Col span="14">¥{(this as any).$filters.moneyFormat(this.result.couponAmount)}</Col>
-                <Col span="1"> </Col>
-              </Row>}
-              
+              {this.result.couponAmount > 0 && (
+                <Row class={styles.optionRow}>
+                  <Col span="8" offset={1}>
+                    优惠金额:
+                  </Col>
+                  <Col span="14">
+                    ¥
+                    {(this as any).$filters.moneyFormat(
+                      this.result.couponAmount
+                    )}
+                  </Col>
+                  <Col span="1"> </Col>
+                </Row>
+              )}
+
               <Row class={styles.optionRow}>
                 <Col span="8" offset={1}>
                   订单号: