소스 검색

bugfix:商品列表/复消商品下单时价格/PV显示小数点位数错误修复

kevin_zhangl 3 년 전
부모
커밋
566264c22a
2개의 변경된 파일10개의 추가작업 그리고 10개의 파일을 삭제
  1. 5 5
      frontendEle/src/views/shop/order.vue
  2. 5 5
      frontendEle/src/views/shop/reconsume-order.vue

+ 5 - 5
frontendEle/src/views/shop/order.vue

@@ -26,7 +26,7 @@
                     <el-table-column label="数量" prop="chose_num">
 
                     </el-table-column>
-                    <el-table-column label="会员价格合计金额" prop="member_price_plus">
+                    <el-table-column label="合计金额" prop="member_price_plus">
 
                     </el-table-column>
                     <el-table-column label="合计PV" prop="member_pv_plus"></el-table-column>
@@ -125,11 +125,11 @@
                     pageList.map((pageData, index)=>{
                         if( Number(pageData.chose_num) > 0 ) {
                             let discount = pageData.DISCOUNT / 100;
-                            pageData.member_price = pageData.SELL_PRICE * discount;
-                            pageData.member_price_plus = pageData.SELL_PRICE * Number(pageData.chose_num) * discount;
+                            pageData.member_price = Math.round(pageData.SELL_PRICE * discount * 100) / 100;
+                            pageData.member_price_plus = Math.round(pageData.SELL_PRICE * Number(pageData.chose_num) * discount * 100) / 100;
 
-                            pageData.member_pv = pageData.PRICE_PV * discount;
-                            pageData.member_pv_plus = pageData.PRICE_PV * Number(pageData.chose_num) * discount;
+                            pageData.member_pv = Math.round(pageData.PRICE_PV * discount * 100) / 100;
+                            pageData.member_pv_plus = Math.round(pageData.PRICE_PV * Number(pageData.chose_num) * discount * 100) / 100;
 
                             this.goods.push(pageData)
                         }

+ 5 - 5
frontendEle/src/views/shop/reconsume-order.vue

@@ -26,7 +26,7 @@
                     <el-table-column label="数量" prop="chose_num">
 
                     </el-table-column>
-                    <el-table-column label="会员价格合计金额" prop="member_price_plus">
+                    <el-table-column label="合计金额" prop="member_price_plus">
 
                     </el-table-column>
                     <el-table-column label="合计PV" prop="member_pv_plus"></el-table-column>
@@ -196,11 +196,11 @@
                     pageList.map((pageData, index)=>{
                         if( Number(pageData.chose_num) > 0 ) {
                             let discount = pageData.DISCOUNT / 100;
-                            pageData.member_price = pageData.SELL_PRICE * discount;
-                            pageData.member_price_plus = pageData.SELL_PRICE * Number(pageData.chose_num) * discount;
+                            pageData.member_price = Math.round(pageData.SELL_PRICE * discount * 100) / 100;
+                            pageData.member_price_plus = Math.round(pageData.SELL_PRICE * Number(pageData.chose_num) * discount * 100) / 100;
 
-                            pageData.member_pv = pageData.PRICE_PV * discount;
-                            pageData.member_pv_plus = pageData.PRICE_PV * Number(pageData.chose_num) * discount;
+                            pageData.member_pv = Math.round(pageData.PRICE_PV * discount * 100) / 100;
+                            pageData.member_pv_plus = Math.round(pageData.PRICE_PV * Number(pageData.chose_num) * discount * 100) / 100;
 
                             this.goods.push(pageData)
                         }