Kaynağa Gözat

:art: 买卖确认总价修改

Ritchie 1 yıl önce
ebeveyn
işleme
d0f791cf0c

+ 7 - 5
src/views/buyOrSell/BuyConf.vue

@@ -1,5 +1,6 @@
 <script setup>
-import { ref, onMounted, onBeforeUnmount, computed } from "vue";
+// import { ref, onMounted, onBeforeUnmount, computed } from "vue";
+import { ref, onMounted, onBeforeUnmount } from "vue";
 import sHeader from "@/components/SimpleHeader";
 import { useTradeStore } from '@/stores/trade';
 import { uploadImg, buyerConf } from "@/service/buyOrSell";
@@ -12,10 +13,10 @@ const tradeNumber = ref(0) // 股票数量
 // const sellerUserName = ref('')  // 卖家用户名
 const sellerPayeeCode = ref('') // 卖家支付宝
 const sellerCardNo = ref('') // 卖家银行卡号
-let totalPrice = computed(() => { // 需付款
-    return Math.round(price.value * tradeNumber.value * 100) / 100;
-})
-
+// let totalPrice = computed(() => { // 需付款
+//     return Math.round(price.value * tradeNumber.value * 100) / 100;
+// })
+const totalPrice = ref(0) // 需付款
 
 const tradeStore = useTradeStore()
 const router = useRouter()
@@ -82,6 +83,7 @@ onMounted(() => {
         sellerCardNo.value = item.sellerCardNo;
         price.value = item.price;
         orderId.value = item.id;
+        totalPrice.value = item.totalPrice;
     }
 });
 

+ 8 - 4
src/views/buyOrSell/SellConf.vue

@@ -1,6 +1,7 @@
 <script setup>
 import sHeader from "@/components/SimpleHeader";
-import { ref, onMounted, onBeforeUnmount, computed } from 'vue'
+// import { ref, onMounted, onBeforeUnmount, computed } from 'vue'
+import { ref, onMounted, onBeforeUnmount } from 'vue'
 import { sellerConf, getImg } from "@/service/buyOrSell";
 import { showFailToast, showSuccessToast } from "vant";
 import { useRouter } from 'vue-router'
@@ -14,9 +15,11 @@ const tradeStore = useTradeStore()
 
 const price = ref(0) // 价格
 const tradeNumber = ref(0) // 股票数量
-let totalPrice = computed(() => { // 应收款
-    return Math.round(price.value * tradeNumber.value * 100) / 100;
-})
+// let totalPrice = computed(() => { // 应收款
+//     return Math.round(price.value * tradeNumber.value * 100) / 100;
+// })
+
+const totalPrice = ref(0) // 应收款
 
 const orderId = ref('') // 交易单号id
 
@@ -68,6 +71,7 @@ onMounted(() => {
         tradeNumber.value = item.tradeNumber;
         price.value = item.price;
         orderId.value = item.id;
+        totalPrice.value = item.totalPrice;
     }
     getImgFunc(orderId.value)
 });

+ 0 - 3
src/views/position/PositionIndex.vue

@@ -158,7 +158,6 @@ import { listMyOrderHis, getMyStock } from "@/service/position";
 import SearchPop from "./SearchPop";
 import { showFailToast } from "vant";
 
-
 const orderHisList = ref([]);
 const error = ref(false);
 
@@ -167,8 +166,6 @@ const finished = ref(false)
 const hisLength = ref(0)
 const stockNum = ref(0)
 
-
-
 function twoNumber(val) {
     const num = parseFloat(val)
     if (!isNaN(num)) {