Ver código fonte

今日工作12.13 接口联调 1,大宗交易和C2C模块,购买和出售页面数据渲染及购买前增加判断条件。出售页面收款方式和收款账号接口联调,整体出售逻辑修改 2,增加银行账户和增加支付宝账户接口修改,增加用户提示 3,快捷交易的页面修改,还未对接接口 4,输入密码页面,解决页面bug2处

jhaoG 2 semanas atrás
pai
commit
3b2b8e4b37

BIN
dist.zip


+ 3 - 2
src/api/index.js

@@ -79,10 +79,11 @@ export function GetWealthOrderList() {
 }
 
 // 获取余额
-export function GetUsdtBalance() {
+export function GetBalance(params) {
   return request({
-    url: "/custom/custom/get_usdt_balance/",
+    url: "/custom/custom/get_balance/",
     method: "get",
+    params,
   });
 }
 

+ 10 - 2
src/api/otc.js

@@ -11,11 +11,19 @@ export function GetOTCPendingOrder(params) {
 }
 
 // 添加银行卡
-export function AddBankManager(params) {
+export function AddBankManager(data) {
   return request({
     url: "/custom/bank_manager/",
     method: "post",
-    params,
+    data,
+  });
+}
+
+// 获取银行卡
+export function GetBankManager() {
+  return axiosRequest({
+    url: "/custom/bank_manager/",
+    method: "get",
   });
 }
 

BIN
src/assets/icon/coin/cny.png


+ 0 - 3
src/utils/axiosRequest.js

@@ -26,9 +26,6 @@ service.interceptors.request.use(
 
 service.interceptors.response.use((response) => {
   const res = response.data;
-  // else if (res.msg == "please set your password") {
-  //   showFailToast("您还没有设置密码,请设置密码");
-  // }
   if (res.code === 401) {
     localStorage.removeItem("token");
     location.reload();

+ 58 - 36
src/views/asset/dialog/C2CBuy.vue

@@ -8,27 +8,35 @@
         <div class="info-left">
           <div class="shangjia">
             <img src="@/assets/img/index/user/default-head.png" alt="" />
-            <div class="left-name pf500 fs14 fc2C3131">商家昵称</div>
-            <div class="vip-flag pf500 fs10 fcDF384C">V2</div>
+            <div class="left-name pf500 fs14 fc2C3131">{{ payList.otc_name }}</div>
+            <div class="vip-flag pf500 fs10 fcDF384C">{{ payList.otc_level }}</div>
+          </div>
+          <div class="chengjiao pf400 fs10 fc999999">
+            成交量 {{ orderInfo.total }} · {{ orderInfo.rate }} 成交率
           </div>
-          <div class="chengjiao pf400 fs10 fc999999">成交量 12550 · 98.95% 成交率</div>
         </div>
         <div class="info-right">
           <div class="text pf400 fs10 fc999999">单价</div>
           <div class="price-number pf400 fs10 fc999999">
-            <span class="pf500 fs16 fc333333">6.58</span>
+            <span class="pf500 fs16 fc333333">{{
+              Number(payList.price).toFixed(2)
+            }}</span>
             /USDT
           </div>
         </div>
       </div>
       <div class="required-quantity pf500 fs14 fc999999">
         <div>需求数量</div>
-        <div>150200.00 USDT</div>
+        <div>{{ Number(payList.left_count).toFixed(2) }} USDT</div>
       </div>
       <div class="required-quantity pf500 fs14 fc999999">
         <div>单笔限额</div>
-        <div>100.00 - 252020.00 USDT</div>
+        <div>
+          {{ Number(payList.min_limit).toFixed(2) }} -
+          {{ Number(payList.max_limit).toFixed(2) }}
+          USDT
+        </div>
       </div>
       <div class="number-input">
         <input
@@ -38,21 +46,23 @@
           placeholder="请输入购买数量" />
         <div class="all pf400 fs14 fc333333">USDT <span class="fcDF384C">全部</span></div>
       </div>
-      <div class="use-number pf400 fs12 fc333333">可买&nbsp; 215.0508 USDT</div>
+      <div class="use-number pf400 fs12 fc333333">
+        可买&nbsp; {{ Number(payList.left_count).toFixed(2) }} USDT
+      </div>
       <div class="account pf500 fs14 fc999999">
         <div>付款方式</div>
         <div class="account-right">
           <div class="color"></div>
-          <span v-if="payList.type == 1">银行卡</span>
-          <span v-if="payList.type == 2">支付宝</span>
-          <span v-if="payList.type == 3">微信</span>
+          <span v-if="targetPayType.status == 1">银行卡</span>
+          <span v-if="targetPayType.status == 2">支付宝</span>
+          <span v-if="targetPayType.status == 3">微信</span>
         </div>
       </div>
       <div class="account pf500 fs14 fc999999">
         <div>付款账号</div>
         <div class="account-right fcDF384C" @click="goAddBankAccount">
-          {{ payList.card_no }}
-          <img src="@/assets/icon/asset/right-arrow-black.svg" alt="" />
+          {{ targetPayType.card_no }}
+          <!-- <img src="@/assets/icon/asset/right-arrow-black.svg" alt="" /> -->
         </div>
       </div>
       <div class="sure-btn pf600 fs14 fcFFFFFF" @click="sureBuy">确定购买</div>
@@ -65,15 +75,19 @@
 <script setup>
   import { useRouter } from "vue-router";
   import { BuyCoin } from "@/api/otc";
-  import { watch, ref } from "vue";
+  import { watch, ref, toRef, onMounted } from "vue";
   import { showToast, showFailToast } from "vant";
   import InputPassword from "@/views/user/InputPassword.vue";
 
   const router = useRouter();
-  const props = defineProps(["otcId", "chatId", "orderId"]);
+
+  const props = defineProps(["otcId", "chatId", "orderId", "currentOrderData"]);
   const emits = defineEmits(["BuyClose"]);
+  const currentOrderDataRef = toRef(props, "currentOrderData");
 
   const payList = ref({});
+  const orderInfo = ref({});
+  const targetPayType = ref({});
   const otcId = ref();
   const chatId = ref();
   const orderId = ref();
@@ -83,7 +97,6 @@
     () => props.otcId,
     async (newVal, oldVal) => {
       otcId.value = newVal;
-      console.log(otcId.value);
     }
   );
 
@@ -98,38 +111,47 @@
     () => props.chatId,
     async (newVal, oldVal) => {
       chatId.value = newVal;
-      console.log(chatId.value);
     }
   );
 
+  watch(
+    currentOrderDataRef,
+    (val) => {
+      payList.value = val;
+      orderInfo.value = payList.value.order_info;
+      targetPayType.value = payList.value.target_pay_type;
+    },
+    { deep: true }
+  );
+
   const inputPasswordFlag = ref(false);
   const inputPasswordClose = async (password) => {
     inputPasswordFlag.value = false;
 
-    if (buyCount.value > 0) {
-      const params = {
-        pid: orderId.value,
-        count: buyCount.value,
-        password: password,
-      };
-      const data = await BuyCoin(params);
-      if (data.msg == "please set your password") {
-        showFailToast("请前往个人中心设置您的密码");
-      } else if (data.msg == "password error") {
-        showFailToast("支付密码错误");
-      } else if (data.data == "success") {
-        router.push({
-          name: "OTCCustomService",
-          params: { chatId: chatId.value, otcId: otcId.value },
-        });
-      }
-    } else {
-      showFailToast("请输入您要卖出的数量");
+    const params = {
+      pid: orderId.value,
+      count: buyCount.value,
+      password: password,
+    };
+    const data = await BuyCoin(params);
+    if (data.msg == "please set your password") {
+      showFailToast("请前往个人中心设置您的密码");
+    } else if (data.msg == "password error") {
+      showFailToast("支付密码错误");
+    } else if (data.data == "success") {
+      router.push({
+        name: "OTCCustomService",
+        params: { chatId: chatId.value, otcId: otcId.value },
+      });
     }
   };
 
   const sureBuy = async () => {
-    inputPasswordFlag.value = true;
+    if (buyCount.value <= 0 || !buyCount.value) {
+      showFailToast("请输入您要卖出的数量");
+    } else {
+      inputPasswordFlag.value = true;
+    }
   };
 
   const goAddBankAccount = () => {

+ 116 - 32
src/views/asset/dialog/C2CSell.vue

@@ -8,27 +8,35 @@
         <div class="info-left">
           <div class="shangjia">
             <img src="@/assets/img/index/user/default-head.png" alt="" />
-            <div class="left-name pf500 fs14 fc2C3131">商家昵称</div>
-            <div class="vip-flag pf500 fs10 fcDF384C">V2</div>
+            <div class="left-name pf500 fs14 fc2C3131">{{ payList.otc_name }}</div>
+            <div class="vip-flag pf500 fs10 fcDF384C">{{ payList.otc_level }}</div>
+          </div>
+          <div class="chengjiao pf400 fs10 fc999999">
+            成交量 {{ orderInfo.total }} · {{ orderInfo.rate }} 成交率
           </div>
-          <div class="chengjiao pf400 fs10 fc999999">成交量 12550 · 98.95% 成交率</div>
         </div>
         <div class="info-right">
           <div class="text pf400 fs10 fc999999">单价</div>
           <div class="price-number pf400 fs10 fc999999">
-            <span class="pf500 fs16 fc333333">6.58</span>
+            <span class="pf500 fs16 fc333333">{{
+              Number(payList.price).toFixed(2)
+            }}</span>
             /USDT
           </div>
         </div>
       </div>
       <div class="required-quantity pf500 fs14 fc999999">
         <div>需求数量</div>
-        <div>150200.00 USDT</div>
+        <div>{{ Number(payList.left_count).toFixed(2) }} USDT</div>
       </div>
       <div class="required-quantity pf500 fs14 fc999999">
         <div>单笔限额</div>
-        <div>100.00 - 252020.00 USDT</div>
+        <div>
+          {{ Number(payList.min_limit).toFixed(2) }} -
+          {{ Number(payList.max_limit).toFixed(2) }}
+          USDT
+        </div>
       </div>
       <div class="number-input">
         <input
@@ -38,17 +46,24 @@
           v-model="buyCount" />
         <div class="all pf400 fs14 fc333333">USDT <span class="fcDF384C">全部</span></div>
       </div>
-      <div class="use-number pf400 fs12 fc333333">可卖&nbsp; 215.0508 USDT</div>
+      <div class="use-number pf400 fs12 fc333333">可卖&nbsp; {{ usdtBalance }} USDT</div>
       <div class="account pf500 fs14 fc999999">
         <div>收款方式</div>
-        <div class="account-right">
+        <div
+          class="account-right fcDF384C"
+          v-if="paymentWayFlag == 0"
+          @click="paymentAccountFlag = true">
+          请选择
+          <img src="@/assets/icon/asset/right-arrow-black.svg" alt="" />
+        </div>
+        <div v-if="paymentWayFlag == 1">
           <div class="color"></div>
-          银行卡
+          {{ paymentWay }}
         </div>
       </div>
       <div class="account pf500 fs14 fc999999">
         <div>收款账号</div>
-        <div class="account-right fcDF384C">
+        <div class="account-right fcDF384C" @click="moneyAccount(1)">
           请选择
           <img src="@/assets/icon/asset/right-arrow-black.svg" alt="" />
         </div>
@@ -58,29 +73,41 @@
     <InputPassword
       v-show="inputPasswordFlag"
       @inputPasswordClose="inputPasswordClose"></InputPassword>
+    <PaymentAccount
+      v-show="paymentAccountFlag"
+      :paymentAccountTab="paymentAccountTab"
+      @paymentAccountClose="paymentAccountClose"></PaymentAccount>
   </div>
 </template>
 <script setup>
   import { useRoute, useRouter } from "vue-router";
-  import { watch, ref } from "vue";
-  import { BuyCoin } from "@/api/otc";
+  import { watch, ref, toRef, onMounted } from "vue";
+  import { BuyCoin, GetBankManager } from "@/api/otc";
+  import { GetBalance } from "@/api/index";
   import { showToast, showFailToast } from "vant";
   import InputPassword from "@/views/user/InputPassword.vue";
+  import PaymentAccount from "./PaymentAccount.vue";
 
   const router = useRouter();
 
-  const props = defineProps(["otcId", "orderId"]);
+  const props = defineProps(["otcId", "orderId", "currentOrderData"]);
   const emits = defineEmits(["sellClose"]);
+  const currentOrderDataRef = toRef(props, "currentOrderData");
 
+  const payList = ref({});
+  const orderInfo = ref({});
   const otcId = ref();
   const orderId = ref();
   const buyCount = ref();
+  const usdtBalance = ref();
+  const paymentWayFlag = ref();
+  const paymentWay = ref();
+  const paymentId = ref();
 
   watch(
     () => props.otcId,
     async (newVal, oldVal) => {
       otcId.value = newVal;
-      console.log(otcId.value);
     }
   );
 
@@ -91,31 +118,88 @@
     }
   );
 
-  const inputPasswordFlag = ref(false);
-  const inputPasswordClose = async (password) => {
-    if (buyCount.value > 0) {
-      const params = {
-        pid: orderId.value,
-        count: buyCount.value,
-        password: password,
-      };
-      const data = await BuyCoin(params);
-      if (data.msg == "password error") {
-        showFailToast("支付密码错误");
-      } else if (data.msg == "please set your password") {
-        showFailToast("请前往个人中心设置您的密码");
-      } else if (data.data == "success") {
-        showToast("出售成功");
-        emits("sellClose");
+  watch(
+    currentOrderDataRef,
+    async (val) => {
+      if (val) {
+        payList.value = val;
+        orderInfo.value = payList.value.order_info;
+        await getBankManagerData();
       }
+    },
+    { deep: true }
+  );
+
+  const paymentAccountTab = ref();
+  const paymentAccountFlag = ref(false);
+  const paymentAccountClose = (id) => {
+    paymentAccountFlag.value = false;
+    paymentId.value = id;
+  };
+
+  const moneyAccount = (index) => {
+    paymentAccountTab.value = index;
+    paymentAccountFlag.value = true;
+  };
+
+  const getBankManagerData = async () => {
+    const data = await GetBankManager();
+    if (data.data.data.length == 0) {
+      paymentWayFlag.value = 0;
     } else {
-      showFailToast("请输入您要卖出的数量");
+      paymentWayFlag.value = 1;
+      if (data.data.data[0].status == 1) {
+        paymentWay.value = "银行卡";
+      } else if (data.data.data[0].status == 2) {
+        paymentWay.value = "支付宝";
+      } else if (data.data.data[0].status == 3) {
+        paymentWay.value = "微信";
+      }
+    }
+  };
+
+  const GetUsdtBalanceData = async () => {
+    const params = {
+      coin_id: "",
+    };
+    const data = await GetBalance(params);
+    if (data) {
+      usdtBalance.value = data;
+    }
+  };
+
+  const inputPasswordFlag = ref(false);
+  const inputPasswordClose = async (password) => {
+    const params = {
+      pid: orderId.value,
+      count: buyCount.value,
+      password: password,
+      card_id: paymentId.value,
+    };
+    const data = await BuyCoin(params);
+    if (data.msg == "password error") {
+      showFailToast("支付密码错误");
+    } else if (data.msg == "please set your password") {
+      showFailToast("请前往个人中心设置您的密码");
+    } else if (data.data == "success") {
+      showToast("出售成功");
+      emits("sellClose");
     }
   };
 
   const sureSell = async () => {
-    inputPasswordFlag.value = true;
+    if (buyCount.value <= 0 || !buyCount.value) {
+      showFailToast("请输入您要卖出的数量");
+    } else if (!paymentId.value) {
+      showFailToast("请选择收款账号");
+    } else {
+      inputPasswordFlag.value = true;
+    }
   };
+
+  onMounted(async () => {
+    await GetUsdtBalanceData();
+  });
 </script>
 <style lang="less" scoped>
   .sell-and-buy {

+ 45 - 5
src/views/asset/dialog/PaymentAccount.vue

@@ -4,18 +4,26 @@
     <div class="apply-content">
       <div class="slide-line"></div>
       <div class="account-not" v-if="current == 0">
-        <div class="not-item pf600 fs16 fc333333" v-for="(item, index) in 2" :key="index">
-          暂无银行卡账号
+        <div
+          class="not-item pf600 fs16 fc333333"
+          v-for="(item, index) in notAccountText"
+          :key="index"
+          @click="addAccount(index)">
+          {{ item }}
           <div class="add pf500 fs12 fcFFFFFF">添加</div>
         </div>
       </div>
       <div class="account-have" v-else>
-        <div class="have-item" v-for="(item, index) in 2" :key="index">
+        <div
+          class="have-item"
+          v-for="(item, index) in filteredBankData"
+          :key="index"
+          @click="choiceCard(item.id)">
           <div class="have-left">
             <div class="left-text pf600 fs16 fcDF384C">
               银行卡&nbsp;&nbsp;<span class="pf500 fs12 fcA8A8A8">删除</span>
             </div>
-            <div class="left-bumber pf400 fs14 fcDF384C">1502 0802 0802 0820 252</div>
+            <div class="left-bumber pf400 fs14 fcDF384C">{{ item.card_number }}</div>
           </div>
           <div class="have-right">
             <img src="@/assets/icon/asset/Checkbox Only.svg" alt="" />
@@ -26,11 +34,43 @@
   </div>
 </template>
 <script setup>
-  import { ref } from "vue";
+  import { ref, watch } from "vue";
+  import { useRouter } from "vue-router";
+  import { GetBankManager } from "@/api/otc";
 
+  const router = useRouter();
+
+  const props = defineProps(["paymentAccountTab"]);
   const emits = defineEmits(["paymentAccountClose"]);
 
   const current = ref(0);
+  const notAccountText = ["暂无银行卡账号", "暂无支付宝账号"];
+  const filteredBankData = ref();
+
+  watch(
+    async () => props.paymentAccountTab,
+    async (newVal, oldVal) => {
+      current.value = newVal;
+      await getBankManagerData();
+    }
+  );
+
+  const choiceCard = (id) => {
+    emits("paymentAccountClose", id);
+  };
+
+  const getBankManagerData = async () => {
+    const data = await GetBankManager();
+    filteredBankData.value = data.data.data.filter((item) => item.status === 1);
+  };
+
+  const addAccount = (index) => {
+    if (index == 0) {
+      router.push("/addBankAccount");
+    } else {
+      router.push("/addzfbAccount");
+    }
+  };
 </script>
 <style lang="less" scoped>
   .not-account {

+ 8 - 2
src/views/asset/otc/transaction/AddBankAccount.vue

@@ -48,6 +48,10 @@
   import HeaderNav from "../../../index/components/HeaderNav.vue";
   import { AddBankManager } from "@/api/otc";
   import { ref } from "vue";
+  import { useRouter } from "vue-router";
+  import { showToast, showFailToast } from "vant";
+
+  const router = useRouter();
 
   const name = ref();
   const phone = ref();
@@ -64,8 +68,10 @@
     };
     const data = await AddBankManager(params);
     if (data) {
-      // 差一个跳转到购买的页面
-      console.log(data);
+      showFailToast("添加成功");
+      router.back();
+    } else {
+      showFailToast("添加失败");
     }
   };
 </script>

+ 4 - 2
src/views/asset/otc/transaction/AddzfbAccount.vue

@@ -64,8 +64,10 @@
     };
     const data = await AddBankManager(params);
     if (data) {
-      // 差一个跳转到购买的页面
-      console.log(data);
+      showFailToast("添加成功");
+      router.back();
+    } else {
+      showFailToast("添加失败");
     }
   };
 </script>

+ 8 - 16
src/views/asset/otc/transaction/Bulk.vue

@@ -95,7 +95,7 @@
             </div>
             <div
               class="func-buy pf500 fs12 fcFFFFFF"
-              @click="OTCBuy(item.id, item.otc)"
+              @click="OTCBuy(item.id, item.otc, item)"
               v-if="buySellFlag == 1">
               购买
             </div>
@@ -118,21 +118,19 @@
       :otcId="otcId"
       :chatId="chatId"
       :orderId="orderId"
+      :currentOrderData="currentOrderData"
       @BuyClose="BuyClose"></C2CBuy>
     <!-- 出售弹窗 -->
     <C2CSell
       v-show="sellFlag"
       :otcId="otcId"
       :orderId="orderId"
+      :currentOrderData="currentOrderData"
       @sellClose="sellClose"></C2CSell>
     <!-- 暂无收款方式,还没点击的地方 -->
     <NotPaymentWay
       v-show="notPaymnetWayFlag"
       @notPaymentWayClose="notPaymentWayClose"></NotPaymentWay>
-    <!-- 添加收款方式,还没点击的地方 -->
-    <PaymentAccount
-      v-show="paymentAccountFlag"
-      @paymentAccountClose="paymentAccountClose"></PaymentAccount>
     <!-- 取消订单,还没点击的地方 -->
     <CancelOrder
       v-show="cancelOrderFlag"
@@ -153,7 +151,6 @@
   import C2CSell from "../../dialog/C2CSell.vue";
   import C2CBuy from "../../dialog/C2CBuy.vue";
   import NotPaymentWay from "../../dialog/NotPaymentWay.vue";
-  import PaymentAccount from "../../dialog/PaymentAccount.vue";
   import CancelOrder from "../../dialog/CancelOrder.vue";
   import CompletePayment from "../../dialog/CompletePayment.vue";
 
@@ -163,6 +160,7 @@
   const chatId = ref();
   const orderId = ref();
   const buySellFlag = ref(1);
+  const currentOrderData = ref();
   const orderData = ref({
     // 1购买 2出售
     order_type: "1",
@@ -175,9 +173,10 @@
   };
 
   // item.id 6, item.otc 1
-  const OTCBuy = async (id, otc) => {
+  const OTCBuy = async (id, otc, itemData) => {
     otcId.value = otc;
     orderId.value = id;
+    currentOrderData.value = itemData;
 
     const params = {
       otc_id: otc,
@@ -192,9 +191,8 @@
   const OTCSell = (item) => {
     otcId.value = item.otc;
     orderId.value = item.id;
-    console.log(3, orderId.value);
+    currentOrderData.value = item;
     sellFlag.value = true;
-    // console.log(1, item);
   };
 
   const getChatIdData = async (otc) => {
@@ -220,9 +218,8 @@
   const GetOTCPendingOrderData = async () => {
     OTCPendingOrderData.value = [];
     const params = {
-      // 1购买,2出售
       order_type: orderData.value.order_type,
-      // 1,普通交易,2快捷交易,3.大宗交易
+      // 1,普通交易,2快捷交易,3.大宗交易
       trans_type: "3",
       coin_type: "",
       price: "",
@@ -252,11 +249,6 @@
     cancelOrderFlag.value = false;
   };
 
-  const paymentAccountFlag = ref(false);
-  const paymentAccountClose = () => {
-    paymentAccountFlag.value = false;
-  };
-
   const notPaymnetWayFlag = ref(false);
   const notPaymentWayClose = () => {
     notPaymnetWayFlag.value = false;

+ 7 - 13
src/views/asset/otc/transaction/C2C.vue

@@ -95,7 +95,7 @@
             </div>
             <div
               class="func-buy pf500 fs12 fcFFFFFF"
-              @click="OTCBuy(item.id, item.otc)"
+              @click="OTCBuy(item.id, item.otc, item)"
               v-if="buySellFlag == 1">
               购买
             </div>
@@ -118,21 +118,19 @@
       :otcId="otcId"
       :chatId="chatId"
       :orderId="orderId"
+      :currentOrderData="currentOrderData"
       @BuyClose="BuyClose"></C2CBuy>
     <!-- 出售弹窗 -->
     <C2CSell
       v-show="sellFlag"
       :otcId="otcId"
       :orderId="orderId"
+      :currentOrderData="currentOrderData"
       @sellClose="sellClose"></C2CSell>
     <!-- 暂无收款方式,还没点击的地方 -->
     <NotPaymentWay
       v-show="notPaymnetWayFlag"
       @notPaymentWayClose="notPaymentWayClose"></NotPaymentWay>
-    <!-- 添加收款方式,还没点击的地方 -->
-    <PaymentAccount
-      v-show="paymentAccountFlag"
-      @paymentAccountClose="paymentAccountClose"></PaymentAccount>
     <!-- 取消订单,还没点击的地方 -->
     <CancelOrder
       v-show="cancelOrderFlag"
@@ -153,7 +151,6 @@
   import C2CSell from "../../dialog/C2CSell.vue";
   import C2CBuy from "../../dialog/C2CBuy.vue";
   import NotPaymentWay from "../../dialog/NotPaymentWay.vue";
-  import PaymentAccount from "../../dialog/PaymentAccount.vue";
   import CancelOrder from "../../dialog/CancelOrder.vue";
   import CompletePayment from "../../dialog/CompletePayment.vue";
 
@@ -163,6 +160,7 @@
   const chatId = ref();
   const orderId = ref();
   const buySellFlag = ref(1);
+  const currentOrderData = ref();
   const orderData = ref({
     // 1购买 2出售
     order_type: "1",
@@ -175,9 +173,10 @@
   };
 
   // item.id 6, item.otc 1
-  const OTCBuy = async (id, otc) => {
+  const OTCBuy = async (id, otc, itemData) => {
     otcId.value = otc;
     orderId.value = id;
+    currentOrderData.value = itemData;
 
     const params = {
       otc_id: otc,
@@ -192,8 +191,8 @@
   const OTCSell = (item) => {
     otcId.value = item.otc;
     orderId.value = item.id;
+    currentOrderData.value = item;
     sellFlag.value = true;
-    // console.log(1, item);
   };
 
   const getChatIdData = async (otc) => {
@@ -250,11 +249,6 @@
     cancelOrderFlag.value = false;
   };
 
-  const paymentAccountFlag = ref(false);
-  const paymentAccountClose = () => {
-    paymentAccountFlag.value = false;
-  };
-
   const notPaymnetWayFlag = ref(false);
   const notPaymentWayClose = () => {
     notPaymnetWayFlag.value = false;

+ 78 - 27
src/views/asset/otc/transaction/Fast.vue

@@ -13,42 +13,79 @@
       出售
     </div>
   </div>
-  <div class="user-staking margin-top43">
-    <div class="user-staking-title pf500 fs14 fc2C3131">我要支付</div>
-    <div class="user-staking-number">
-      <input
-        type="text"
-        class="user-staking-number-input pf400 fs26 fc333333"
-        placeholder="0" />
-      <div class="user-staking-number-coin pf500 fs18 fc1F2937">
-        <img src="@/assets/icon/coin/bnb.svg" class="coin" alt="" />BTC
-        <img src="@/assets/icon/index/bottom-arrow.svg" class="bottom-arrow" alt="" />
+  <div v-if="buySellFlag == 0">
+    <div class="user-staking margin-top43">
+      <div class="user-staking-title pf500 fs14 fc2C3131">我要支付</div>
+      <div class="user-staking-number">
+        <input
+          type="text"
+          class="user-staking-number-input pf400 fs26 fc333333"
+          placeholder="0" />
+        <div class="user-staking-number-coin pf500 fs18 fc1F2937">
+          <div class="coin"><img src="@/assets/icon/coin/cny.png" alt="" /></div>
+          CNY
+          <img src="@/assets/icon/index/bottom-arrow.svg" class="bottom-arrow" alt="" />
+        </div>
       </div>
+      <div class="user-staking-line"></div>
+      <div class="tips pf400 fs12 fc999999">10 - 5000.000</div>
     </div>
-    <div class="user-staking-line"></div>
-    <div class="tips pf400 fs12 fc999999">10 - 5000.000</div>
+    <div class="user-staking margin-top15">
+      <div class="user-staking-title pf500 fs14 fc2C3131">我将收到</div>
+      <div class="user-staking-number">
+        <input
+          type="text"
+          class="user-staking-number-input pf400 fs26 fc333333"
+          placeholder="0" />
+        <div class="user-staking-number-coin pf500 fs18 fc1F2937">
+          <img src="@/assets/icon/coin/bnb.svg" class="coin" alt="" />BTC
+          <img src="@/assets/icon/index/bottom-arrow.svg" class="bottom-arrow" alt="" />
+        </div>
+      </div>
+      <div class="user-staking-line"></div>
+      <div class="tips pf400 fs12 fc999999">1 CNY ≈ 0.1684258 BTC</div>
+    </div>
+    <div class="buy-sell-btn pf600 fs14 fcFFFFFF">购买</div>
   </div>
-  <div class="user-staking margin-top15">
-    <div class="user-staking-title pf500 fs14 fc2C3131">我将收到</div>
-    <div class="user-staking-number">
-      <input
-        type="text"
-        class="user-staking-number-input pf400 fs26 fc333333"
-        placeholder="0" />
-      <div class="user-staking-number-coin pf500 fs18 fc1F2937">
-        <img src="@/assets/icon/coin/bnb.svg" class="coin" alt="" />BTC
-        <img src="@/assets/icon/index/bottom-arrow.svg" class="bottom-arrow" alt="" />
+  <div v-else>
+    <div class="user-staking margin-top15">
+      <div class="user-staking-title pf500 fs14 fc2C3131">我要出售</div>
+      <div class="user-staking-number">
+        <input
+          type="text"
+          class="user-staking-number-input pf400 fs26 fc333333"
+          placeholder="0" />
+        <div class="user-staking-number-coin pf500 fs18 fc1F2937">
+          <img src="@/assets/icon/coin/bnb.svg" class="coin" alt="" />BTC
+          <img src="@/assets/icon/index/bottom-arrow.svg" class="bottom-arrow" alt="" />
+        </div>
+      </div>
+      <div class="user-staking-line"></div>
+      <div class="tips pf400 fs12 fc999999">10 - 5000.000</div>
+    </div>
+    <div class="user-staking margin-top43">
+      <div class="user-staking-title pf500 fs14 fc2C3131">我将收到</div>
+      <div class="user-staking-number">
+        <input
+          type="text"
+          class="user-staking-number-input pf400 fs26 fc333333"
+          placeholder="0" />
+        <div class="user-staking-number-coin pf500 fs18 fc1F2937">
+          <div class="coin"><img src="@/assets/icon/coin/cny.png" alt="" /></div>
+          CNY
+          <img src="@/assets/icon/index/bottom-arrow.svg" class="bottom-arrow" alt="" />
+        </div>
       </div>
+      <div class="user-staking-line"></div>
+      <div class="tips pf400 fs12 fc999999">1 CNY ≈ 0.1684258 BTC</div>
     </div>
-    <div class="user-staking-line"></div>
-    <div class="tips pf400 fs12 fc999999">1 CNY ≈ 0.1684258 BTC</div>
+    <div class="buy-sell-btn pf600 fs14 fcFFFFFF">出售</div>
   </div>
-  <div class="buy-sell-btn pf600 fs14 fcFFFFFF">购买</div>
 </template>
 <script setup>
   import { ref, onMounted } from "vue";
 
-  const buySellFlag = ref(0);
+  const buySellFlag = ref(1);
 </script>
 <style lang="less" scoped>
   .buy-left {
@@ -104,6 +141,8 @@
     flex-direction: column;
     justify-content: flex-start;
     align-items: center;
+    margin: 0 auto;
+    margin-top: 20px;
     width: 345px;
 
     .user-staking-title {
@@ -111,7 +150,7 @@
       flex-direction: row;
       justify-content: flex-start;
       align-items: center;
-      width: 345px;
+      width: 311px;
       height: 24px;
 
       img {
@@ -149,10 +188,21 @@
         box-sizing: border-box;
 
         .coin {
+          display: flex;
+          flex-direction: row;
+          justify-content: center;
+          align-items: center;
           margin-left: 8px;
           margin-right: 6px;
           width: 24px;
           height: 24px;
+          border-radius: 40px;
+          background: #df384c;
+
+          img {
+            width: 24px;
+            height: 24px;
+          }
         }
 
         .bottom-arrow {
@@ -179,6 +229,7 @@
   }
 
   .buy-sell-btn {
+    margin: 0 auto;
     margin-top: 50px;
     width: 311px;
     height: 40px;

+ 5 - 7
src/views/index/financial/Buy.vue

@@ -72,11 +72,7 @@
   import CheckBox from "../../../components/ui/CheckBox.vue";
   import { ref, onMounted } from "vue";
   import { useRoute, useRouter } from "vue-router";
-  import {
-    GetWealthProductsDetails,
-    GetUsdtBalance,
-    wealthSubmitOrder,
-  } from "@/api/index";
+  import { GetWealthProductsDetails, GetBalance, wealthSubmitOrder } from "@/api/index";
   import { showToast, showFailToast } from "vant";
 
   const route = useRoute();
@@ -99,8 +95,10 @@
   };
 
   const GetUsdtBalanceData = async () => {
-    const data = await GetUsdtBalance();
-    console.log(1, data);
+    const params = {
+      coin_id: "",
+    };
+    const data = await GetBalance(params);
     if (data) {
       usdtBalance.value = data;
     }

+ 2 - 1
src/views/user/InputPassword.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="cancel-order">
-    <div class="apply-mask" @click="emits('inputPasswordClose')"></div>
+    <div class="apply-mask"></div>
     <div class="apply-content">
       <div class="slide-line"></div>
       <div class="order-title pf600 fs18 fc333333">支付密码</div>
@@ -15,6 +15,7 @@
           pattern="[0-9]*"
           class="pw-input"
           v-model="password[idx]"
+          :disabled="idx > 0 && !password[idx - 1]"
           @input="onInput(idx, $event)"
           @keydown.backspace="onBackspace(idx, $event)"
           style="

+ 1 - 1
vue.config.js

@@ -5,8 +5,8 @@ module.exports = defineConfig({
   devServer: {
     proxy: {
       "/api": {
-        // http://63.141.230.43:57676
         // http://backend.66linknow.com
+        // http://63.141.230.43:57676
         // https://test2.66linknow.com
         target: "https://test2.66linknow.com",
         changeOrigin: true, // 允许跨域