Jelajahi Sumber

支付弹窗bug

秦鹏 3 tahun lalu
induk
melakukan
89cc156d03
2 mengubah file dengan 26 tambahan dan 28 penghapusan
  1. 11 14
      src/components/payment/Confirmorder.vue
  2. 15 14
      src/components/payment/Payment.vue

+ 11 - 14
src/components/payment/Confirmorder.vue

@@ -38,7 +38,7 @@
       </span>
       <template v-else>
         <span class="sp2" v-if="discount_code_status == 1"
-          >-<span v-html="changePrice(discount_money, 16)"></span
+          >-¥<span v-html="changePrice(discount_money, 16)"></span
         ></span>
       </template>
     </div>
@@ -92,19 +92,16 @@ export default {
   watch: {},
   //方法集合
   methods: {
-    changePrice(price, fontSize) {
-      let str = "";
-      price = price ? price.toString() : "0.00";
-      if (price.indexOf(".") > -1) {
-        let arr = price.split(".");
-        str = `<span style="font-size: ${fontSize ? fontSize : 16}px;">${
-          arr[0]
-        }</span>.<span style="font-size: 16px;">${arr[1]}</span>`;
-      } else {
-        str = `<span style="font-size: ${
-          fontSize ? fontSize : 16
-        }px;">${price}</span>.<span  style="font-size: 16px;">00</span>`;
-      }
+    changePrice(price, fontSize1, fontSize2) {
+      price = price ? price * 1 : 0;
+      price = price.toFixed(2);
+      price = price.toString();
+      let arr = price.split(".");
+      let str = `<span style="font-size: ${fontSize1 ? fontSize1 : 16}px;">${
+        arr[0]
+      }</span>.<span style="font-size: ${fontSize2 ? fontSize2 : 16}px;">${
+        arr[1]
+      }</span>`;
 
       return str;
     },

+ 15 - 14
src/components/payment/Payment.vue

@@ -52,7 +52,11 @@
       <p class="p4">
         <span></span>
         <span class="co-value useCode">
-          {{ data.discount_code ? $t("Key232") + data.discount_code : $t("Key108") }}
+          {{
+            data.back_discount_code
+              ? $t("Key232") + ":" + data.back_discount_code
+              : $t("Key108")
+          }}
         </span>
       </p>
       <p class="p3">
@@ -97,19 +101,16 @@ export default {
   watch: {},
   //方法集合
   methods: {
-    changePrice(price, fontSize) {
-      let str = "";
-      price = price ? price.toString() : "0.00";
-      if (price.indexOf(".") > -1) {
-        let arr = price.split(".");
-        str = `<span style="font-size: ${fontSize ? fontSize : 16}px;">${
-          arr[0]
-        }</span>.<span style="font-size: 16px;">${arr[1]}</span>`;
-      } else {
-        str = `<span style="font-size: ${
-          fontSize ? fontSize : 16
-        }px;">${price}</span>.<span  style="font-size: 16px;">00</span>`;
-      }
+    changePrice(price, fontSize1, fontSize2) {
+      price = price ? price * 1 : 0;
+      price = price.toFixed(2);
+      price = price.toString();
+      let arr = price.split(".");
+      let str = `<span style="font-size: ${fontSize1 ? fontSize1 : 16}px;">${
+        arr[0]
+      }</span>.<span style="font-size: ${fontSize2 ? fontSize2 : 16}px;">${
+        arr[1]
+      }</span>`;
 
       return str;
     },