|
@@ -1,9 +1,19 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <!-- <img src="@/assets/icon/asset/dazong-sell-banner.svg" class="c2c" alt="" /> -->
|
|
|
|
|
|
|
+ <!-- <img src="@/assets/icon/asset/c2c.svg" class="c2c" alt="" /> -->
|
|
|
<div class="buy-sell">
|
|
<div class="buy-sell">
|
|
|
<div class="buy-left">
|
|
<div class="buy-left">
|
|
|
- <div class="buy-btn pf500 fs14 fcFFFFFF">购买</div>
|
|
|
|
|
- <div class="sell-btn pf500 fs14 fc999999">出售</div>
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="buy-btn pf500 fs14 fc999999"
|
|
|
|
|
+ :class="buySellFlag == 1 ? 'buy-green' : ''"
|
|
|
|
|
+ @click="buySellData(1)">
|
|
|
|
|
+ 购买
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="sell-btn pf500 fs14 fc999999"
|
|
|
|
|
+ :class="buySellFlag == 2 ? 'buy-red' : ''"
|
|
|
|
|
+ @click="buySellData(2)">
|
|
|
|
|
+ 出售
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="buy-right">
|
|
<div class="buy-right">
|
|
|
<div class="text pf400 fs14 fc333333">CNY</div>
|
|
<div class="text pf400 fs14 fc333333">CNY</div>
|
|
@@ -17,67 +27,266 @@
|
|
|
<div class="text pf400 fs14 fc333333">BTC</div>
|
|
<div class="text pf400 fs14 fc333333">BTC</div>
|
|
|
<img src="@/assets/icon/asset/bottom-arrow-black.svg" class="bottom-arrow" />
|
|
<img src="@/assets/icon/asset/bottom-arrow-black.svg" class="bottom-arrow" />
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="left-money">
|
|
|
|
|
|
|
+ <div class="left-money" @click="amountFlag = true">
|
|
|
<div class="text pf400 fs14 fc333333">金额</div>
|
|
<div class="text pf400 fs14 fc333333">金额</div>
|
|
|
<img src="@/assets/icon/asset/bottom-arrow-black.svg" class="bottom-arrow" />
|
|
<img src="@/assets/icon/asset/bottom-arrow-black.svg" class="bottom-arrow" />
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="left-pay-way">
|
|
|
|
|
|
|
+ <div class="left-pay-way" @click="paymentWayFlag = true">
|
|
|
<div class="text pf400 fs14 fc333333">支付方式</div>
|
|
<div class="text pf400 fs14 fc333333">支付方式</div>
|
|
|
<img src="@/assets/icon/asset/bottom-arrow-black.svg" class="bottom-arrow" />
|
|
<img src="@/assets/icon/asset/bottom-arrow-black.svg" class="bottom-arrow" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="filter-right">
|
|
|
|
|
|
|
+ <div class="filter-right" @click="filterFlag = true">
|
|
|
<img src="@/assets/icon/asset/filter.svg" alt="" />
|
|
<img src="@/assets/icon/asset/filter.svg" alt="" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="goods-area">
|
|
<div class="goods-area">
|
|
|
- <div class="goods-item" v-for="(item, index) in 2" :key="index">
|
|
|
|
|
|
|
+ <div class="goods-item" v-for="(item, index) in OTCPendingOrderData" :key="index">
|
|
|
<div class="item-merchant">
|
|
<div class="item-merchant">
|
|
|
- <div class="merchant-left">
|
|
|
|
|
|
|
+ <div class="merchant-left" @click="goMerchantDetails">
|
|
|
<img src="@/assets/img/index/user/default-head.png" alt="" />
|
|
<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">{{ item.otc_name }}</div>
|
|
|
|
|
+ <div class="vip-flag pf500 fs10 fcDF384C">{{ item.otc_level }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="merchant-right pf400 fs10 fc999999">
|
|
<div class="merchant-right pf400 fs10 fc999999">
|
|
|
- 入驻时间: 2025-11-07 12:25:10
|
|
|
|
|
|
|
+ 入驻时间: {{ item.otc_create_time }}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="item-chengjiao-number pf400 fs10 fc999999">
|
|
<div class="item-chengjiao-number pf400 fs10 fc999999">
|
|
|
- 成交量 12550 · 98.95% 成交率
|
|
|
|
|
|
|
+ 成交量 {{ item.order_info.total }} · {{ item.order_info.rate }} 成交率
|
|
|
</div>
|
|
</div>
|
|
|
<div class="item-price">
|
|
<div class="item-price">
|
|
|
<div class="price-area">
|
|
<div class="price-area">
|
|
|
<div class="text pf400 fs10 fc999999">单价</div>
|
|
<div class="text pf400 fs10 fc999999">单价</div>
|
|
|
<div class="price-number pf400 fs10 fc999999">
|
|
<div class="price-number pf400 fs10 fc999999">
|
|
|
¥
|
|
¥
|
|
|
- <span class="pf500 fs16 fc333333">6.58</span>
|
|
|
|
|
|
|
+ <span class="pf500 fs16 fc333333">{{ Number(item.price).toFixed(2) }}</span>
|
|
|
/USDT
|
|
/USDT
|
|
|
</div>
|
|
</div>
|
|
|
<div class="number pf400 fs10 fc999999">
|
|
<div class="number pf400 fs10 fc999999">
|
|
|
- 数量 <span class="pf400 fs12 fc666666">1000.05 USDT</span>
|
|
|
|
|
|
|
+ 数量
|
|
|
|
|
+ <span class="pf400 fs12 fc666666"
|
|
|
|
|
+ >{{ Number(item.left_count).toFixed(2) }} USDT</span
|
|
|
|
|
+ >
|
|
|
</div>
|
|
</div>
|
|
|
<div class="number pf400 fs10 fc999999">
|
|
<div class="number pf400 fs10 fc999999">
|
|
|
- 限额 <span class="pf400 fs12 fc666666">20000 - 1000.05 CNY</span>
|
|
|
|
|
|
|
+ 限额
|
|
|
|
|
+ <span class="pf400 fs12 fc666666">
|
|
|
|
|
+ {{ Number(item.min_limit).toFixed(2) }} -
|
|
|
|
|
+ {{ Number(item.max_limit).toFixed(2) }} CNY</span
|
|
|
|
|
+ >
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="price-func">
|
|
<div class="price-func">
|
|
|
<div class="func-time pf400 fs10 fc999999">
|
|
<div class="func-time pf400 fs10 fc999999">
|
|
|
- <img src="@/assets/icon/asset/clock-gray.svg" alt="" />0m 45s
|
|
|
|
|
|
|
+ <img src="@/assets/icon/asset/clock-gray.svg" alt="" />
|
|
|
|
|
+ {{ item.order_info.avg_time }}
|
|
|
</div>
|
|
</div>
|
|
|
<div class="func-pay-way pf400 fs10 fc999999">
|
|
<div class="func-pay-way pf400 fs10 fc999999">
|
|
|
<div class="color"></div>
|
|
<div class="color"></div>
|
|
|
- 银行卡
|
|
|
|
|
|
|
+ <!-- 1.银行卡 2.支付宝 3.微信 -->
|
|
|
|
|
+ <div v-if="item.status == 1">银行卡</div>
|
|
|
|
|
+ <div v-if="item.status == 2">支付宝</div>
|
|
|
|
|
+ <div v-if="item.status == 3">微信</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="func-main">
|
|
<div class="func-main">
|
|
|
- <div class="func-chat pf500 fs12 fcDF384C">聊天</div>
|
|
|
|
|
- <div class="func-buy pf500 fs12 fcFFFFFF">验证购买</div>
|
|
|
|
|
|
|
+ <div class="func-chat pf500 fs12 fcDF384C" @click="getChatIdData(item.otc)">
|
|
|
|
|
+ 聊天
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="func-buy pf500 fs12 fcFFFFFF"
|
|
|
|
|
+ @click="OTCBuy(item.id, item.otc)"
|
|
|
|
|
+ v-if="buySellFlag == 1">
|
|
|
|
|
+ 购买
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="func-sell pf500 fs12 fcFFFFFF"
|
|
|
|
|
+ @click="OTCSell(item)"
|
|
|
|
|
+ v-if="buySellFlag == 2">
|
|
|
|
|
+ 出售
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <PaymentWay v-show="paymentWayFlag" @paymentWayClose="paymentWayClose"></PaymentWay>
|
|
|
|
|
+ <Amount v-show="amountFlag" @amountClose="amountClose"></Amount>
|
|
|
|
|
+ <Filter v-show="filterFlag" @filterClose="filterClose"></Filter>
|
|
|
|
|
+ <!-- 购买弹窗 -->
|
|
|
|
|
+ <C2CBuy
|
|
|
|
|
+ v-show="BuyFlag"
|
|
|
|
|
+ :otcId="otcId"
|
|
|
|
|
+ :chatId="chatId"
|
|
|
|
|
+ :orderId="orderId"
|
|
|
|
|
+ @BuyClose="BuyClose"></C2CBuy>
|
|
|
|
|
+ <!-- 出售弹窗 -->
|
|
|
|
|
+ <C2CSell
|
|
|
|
|
+ v-show="sellFlag"
|
|
|
|
|
+ :otcId="otcId"
|
|
|
|
|
+ :orderId="orderId"
|
|
|
|
|
+ @sellClose="sellClose"></C2CSell>
|
|
|
|
|
+ <!-- 暂无收款方式,还没点击的地方 -->
|
|
|
|
|
+ <NotPaymentWay
|
|
|
|
|
+ v-show="notPaymnetWayFlag"
|
|
|
|
|
+ @notPaymentWayClose="notPaymentWayClose"></NotPaymentWay>
|
|
|
|
|
+ <!-- 添加收款方式,还没点击的地方 -->
|
|
|
|
|
+ <PaymentAccount
|
|
|
|
|
+ v-show="paymentAccountFlag"
|
|
|
|
|
+ @paymentAccountClose="paymentAccountClose"></PaymentAccount>
|
|
|
|
|
+ <!-- 取消订单,还没点击的地方 -->
|
|
|
|
|
+ <CancelOrder
|
|
|
|
|
+ v-show="cancelOrderFlag"
|
|
|
|
|
+ @cancelOrderClose="cancelOrderClose"></CancelOrder>
|
|
|
|
|
+ <!-- 是否完成付款,还没点击的地方 -->
|
|
|
|
|
+ <CompletePayment
|
|
|
|
|
+ v-show="completePaymentFlag"
|
|
|
|
|
+ @completePaymentClose="completePaymentClose"></CompletePayment>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
-<script setup></script>
|
|
|
|
|
|
|
+<script setup>
|
|
|
|
|
+ import { ref, onMounted } from "vue";
|
|
|
|
|
+ import { useRoute, useRouter } from "vue-router";
|
|
|
|
|
+ import { GetOTCPendingOrder, GetChatId } from "@/api/otc";
|
|
|
|
|
+ import PaymentWay from "../../dialog/PaymentWay.vue";
|
|
|
|
|
+ import Amount from "../../dialog/Amount.vue";
|
|
|
|
|
+ import Filter from "../../dialog/Filter.vue";
|
|
|
|
|
+ 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";
|
|
|
|
|
+
|
|
|
|
|
+ const router = useRouter();
|
|
|
|
|
+
|
|
|
|
|
+ const otcId = ref();
|
|
|
|
|
+ const chatId = ref();
|
|
|
|
|
+ const orderId = ref();
|
|
|
|
|
+ const buySellFlag = ref(1);
|
|
|
|
|
+ const orderData = ref({
|
|
|
|
|
+ // 1购买 2出售
|
|
|
|
|
+ order_type: "1",
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ const buySellData = (flag) => {
|
|
|
|
|
+ buySellFlag.value = flag;
|
|
|
|
|
+ orderData.value.order_type = flag;
|
|
|
|
|
+ GetOTCPendingOrderData();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // item.id 6, item.otc 1
|
|
|
|
|
+ const OTCBuy = async (id, otc) => {
|
|
|
|
|
+ otcId.value = otc;
|
|
|
|
|
+ orderId.value = id;
|
|
|
|
|
+
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ otc_id: otc,
|
|
|
|
|
+ };
|
|
|
|
|
+ const data = await GetChatId(params);
|
|
|
|
|
+ if (data) {
|
|
|
|
|
+ chatId.value = data;
|
|
|
|
|
+ BuyFlag.value = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const OTCSell = (item) => {
|
|
|
|
|
+ otcId.value = item.otc;
|
|
|
|
|
+ orderId.value = item.id;
|
|
|
|
|
+ console.log(3, orderId.value);
|
|
|
|
|
+ sellFlag.value = true;
|
|
|
|
|
+ // console.log(1, item);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const getChatIdData = async (otc) => {
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ otc_id: otc,
|
|
|
|
|
+ };
|
|
|
|
|
+ const data = await GetChatId(params);
|
|
|
|
|
+ if (data) {
|
|
|
|
|
+ chatId.value = data;
|
|
|
|
|
+
|
|
|
|
|
+ router.push({
|
|
|
|
|
+ name: "OTCCustomService",
|
|
|
|
|
+ params: { chatId: chatId.value, otcId: otc },
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const goMerchantDetails = () => {
|
|
|
|
|
+ router.push("/OTCMerchantDetails");
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const OTCPendingOrderData = ref();
|
|
|
|
|
+ const GetOTCPendingOrderData = async () => {
|
|
|
|
|
+ OTCPendingOrderData.value = [];
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ // 1购买,2出售
|
|
|
|
|
+ order_type: orderData.value.order_type,
|
|
|
|
|
+ // 1,普通交易,2快捷交易,3.大宗交易
|
|
|
|
|
+ trans_type: "3",
|
|
|
|
|
+ coin_type: "",
|
|
|
|
|
+ price: "",
|
|
|
|
|
+ count: "",
|
|
|
|
|
+ min_limit: "",
|
|
|
|
|
+ min_amount: "",
|
|
|
|
|
+ pay_type: "",
|
|
|
|
|
+ left_count: "",
|
|
|
|
|
+ };
|
|
|
|
|
+ const data = await GetOTCPendingOrder(params);
|
|
|
|
|
+ if (data) {
|
|
|
|
|
+ OTCPendingOrderData.value = data.list;
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ onMounted(() => {
|
|
|
|
|
+ GetOTCPendingOrderData();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ const completePaymentFlag = ref(false);
|
|
|
|
|
+ const completePaymentClose = () => {
|
|
|
|
|
+ completePaymentFlag.value = false;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const cancelOrderFlag = ref(false);
|
|
|
|
|
+ const cancelOrderClose = () => {
|
|
|
|
|
+ cancelOrderFlag.value = false;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const paymentAccountFlag = ref(false);
|
|
|
|
|
+ const paymentAccountClose = () => {
|
|
|
|
|
+ paymentAccountFlag.value = false;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const notPaymnetWayFlag = ref(false);
|
|
|
|
|
+ const notPaymentWayClose = () => {
|
|
|
|
|
+ notPaymnetWayFlag.value = false;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const BuyFlag = ref(false);
|
|
|
|
|
+ const BuyClose = () => {
|
|
|
|
|
+ BuyFlag.value = false;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const sellFlag = ref(false);
|
|
|
|
|
+ const sellClose = () => {
|
|
|
|
|
+ sellFlag.value = false;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const filterFlag = ref(false);
|
|
|
|
|
+ const filterClose = () => {
|
|
|
|
|
+ filterFlag.value = false;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const amountFlag = ref(false);
|
|
|
|
|
+ const amountClose = () => {
|
|
|
|
|
+ amountFlag.value = false;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const paymentWayFlag = ref(false);
|
|
|
|
|
+ const paymentWayClose = () => {
|
|
|
|
|
+ paymentWayFlag.value = false;
|
|
|
|
|
+ };
|
|
|
|
|
+</script>
|
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
|
.c2c {
|
|
.c2c {
|
|
|
margin-top: 13px;
|
|
margin-top: 13px;
|
|
@@ -99,13 +308,25 @@
|
|
|
justify-content: flex-start;
|
|
justify-content: flex-start;
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
|
|
|
|
|
|
|
+ .buy-green {
|
|
|
|
|
+ background: #45b26b !important;
|
|
|
|
|
+ color: #ffffff;
|
|
|
|
|
+ transition: all ease 0.3s;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .buy-red {
|
|
|
|
|
+ background: #df384c !important;
|
|
|
|
|
+ color: #ffffff;
|
|
|
|
|
+ transition: all ease 0.3s;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.buy-btn {
|
|
.buy-btn {
|
|
|
width: 85px;
|
|
width: 85px;
|
|
|
height: 35px;
|
|
height: 35px;
|
|
|
line-height: 35px;
|
|
line-height: 35px;
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
border-radius: 6px;
|
|
border-radius: 6px;
|
|
|
- background: #45b26b;
|
|
|
|
|
|
|
+ background: #f5f5f5;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.sell-btn {
|
|
.sell-btn {
|
|
@@ -224,6 +445,8 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.goods-area {
|
|
.goods-area {
|
|
|
|
|
+ margin-top: 10px;
|
|
|
|
|
+ margin-bottom: 30px;
|
|
|
width: 345px;
|
|
width: 345px;
|
|
|
|
|
|
|
|
.goods-item {
|
|
.goods-item {
|
|
@@ -360,6 +583,16 @@
|
|
|
border-radius: 5px;
|
|
border-radius: 5px;
|
|
|
background: #45b26b;
|
|
background: #45b26b;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .func-sell {
|
|
|
|
|
+ margin-left: 8px;
|
|
|
|
|
+ width: 58px;
|
|
|
|
|
+ height: 24px;
|
|
|
|
|
+ line-height: 24px;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ border-radius: 5px;
|
|
|
|
|
+ background: #df384c;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|