Bulk.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. <template>
  2. <!-- <img src="@/assets/icon/asset/c2c.svg" class="c2c" alt="" /> -->
  3. <div class="buy-sell">
  4. <div class="buy-left">
  5. <div
  6. class="buy-btn pf500 fs14 fc999999"
  7. :class="buySellFlag == 1 ? 'buy-green' : ''"
  8. @click="buySellData(1)">
  9. 购买
  10. </div>
  11. <div
  12. class="sell-btn pf500 fs14 fc999999"
  13. :class="buySellFlag == 2 ? 'buy-red' : ''"
  14. @click="buySellData(2)">
  15. 出售
  16. </div>
  17. </div>
  18. <div class="buy-right">
  19. <div class="text pf400 fs14 fc333333">CNY</div>
  20. <img src="@/assets/icon/asset/bottom-arrow-black.svg" alt="" />
  21. </div>
  22. </div>
  23. <div class="filter-area">
  24. <div class="filter-left">
  25. <div class="left-coin">
  26. <img src="@/assets/icon/coin/bnb.svg" class="coin" alt="" />
  27. <div class="text pf400 fs14 fc333333">BTC</div>
  28. <img src="@/assets/icon/asset/bottom-arrow-black.svg" class="bottom-arrow" />
  29. </div>
  30. <div class="left-money" @click="amountFlag = true">
  31. <div class="text pf400 fs14 fc333333">金额</div>
  32. <img src="@/assets/icon/asset/bottom-arrow-black.svg" class="bottom-arrow" />
  33. </div>
  34. <div class="left-pay-way" @click="paymentWayFlag = true">
  35. <div class="text pf400 fs14 fc333333">支付方式</div>
  36. <img src="@/assets/icon/asset/bottom-arrow-black.svg" class="bottom-arrow" />
  37. </div>
  38. </div>
  39. <div class="filter-right" @click="filterFlag = true">
  40. <img src="@/assets/icon/asset/filter.svg" alt="" />
  41. </div>
  42. </div>
  43. <div class="goods-area">
  44. <div class="goods-item" v-for="(item, index) in OTCPendingOrderData" :key="index">
  45. <div class="item-merchant">
  46. <div class="merchant-left" @click="goMerchantDetails">
  47. <img src="@/assets/img/index/user/default-head.png" alt="" />
  48. <div class="left-name pf500 fs14 fc2C3131">{{ item.otc_name }}</div>
  49. <div class="vip-flag pf500 fs10 fcDF384C">{{ item.otc_level }}</div>
  50. </div>
  51. <div class="merchant-right pf400 fs10 fc999999">
  52. 入驻时间: {{ item.otc_create_time }}
  53. </div>
  54. </div>
  55. <div class="item-chengjiao-number pf400 fs10 fc999999">
  56. 成交量 {{ item.order_info.total }} · {{ item.order_info.rate }} 成交率
  57. </div>
  58. <div class="item-price">
  59. <div class="price-area">
  60. <div class="text pf400 fs10 fc999999">单价</div>
  61. <div class="price-number pf400 fs10 fc999999">
  62. <span class="pf500 fs16 fc333333">{{ Number(item.price).toFixed(2) }}</span>
  63. /USDT
  64. </div>
  65. <div class="number pf400 fs10 fc999999">
  66. 数量
  67. <span class="pf400 fs12 fc666666"
  68. >{{ Number(item.left_count).toFixed(2) }} USDT</span
  69. >
  70. </div>
  71. <div class="number pf400 fs10 fc999999">
  72. 限额
  73. <span class="pf400 fs12 fc666666">
  74. {{ Number(item.min_limit).toFixed(2) }} -
  75. {{ Number(item.max_limit).toFixed(2) }} CNY</span
  76. >
  77. </div>
  78. </div>
  79. <div class="price-func">
  80. <div class="func-time pf400 fs10 fc999999">
  81. <img src="@/assets/icon/asset/clock-gray.svg" alt="" />
  82. {{ item.order_info.avg_time }}
  83. </div>
  84. <div class="func-pay-way pf400 fs10 fc999999">
  85. <div class="color"></div>
  86. <!-- 1.银行卡 2.支付宝 3.微信 -->
  87. <div v-if="item.status == 1">银行卡</div>
  88. <div v-if="item.status == 2">支付宝</div>
  89. <div v-if="item.status == 3">微信</div>
  90. </div>
  91. <div class="func-main">
  92. <div class="func-chat pf500 fs12 fcDF384C" @click="getChatIdData(item.otc)">
  93. 聊天
  94. </div>
  95. <div
  96. class="func-buy pf500 fs12 fcFFFFFF"
  97. @click="OTCBuy(item.id, item.otc)"
  98. v-if="buySellFlag == 1">
  99. 购买
  100. </div>
  101. <div
  102. class="func-sell pf500 fs12 fcFFFFFF"
  103. @click="OTCSell(item)"
  104. v-if="buySellFlag == 2">
  105. 出售
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. <PaymentWay v-show="paymentWayFlag" @paymentWayClose="paymentWayClose"></PaymentWay>
  112. <Amount v-show="amountFlag" @amountClose="amountClose"></Amount>
  113. <Filter v-show="filterFlag" @filterClose="filterClose"></Filter>
  114. <!-- 购买弹窗 -->
  115. <C2CBuy
  116. v-show="BuyFlag"
  117. :otcId="otcId"
  118. :chatId="chatId"
  119. :orderId="orderId"
  120. @BuyClose="BuyClose"></C2CBuy>
  121. <!-- 出售弹窗 -->
  122. <C2CSell
  123. v-show="sellFlag"
  124. :otcId="otcId"
  125. :orderId="orderId"
  126. @sellClose="sellClose"></C2CSell>
  127. <!-- 暂无收款方式,还没点击的地方 -->
  128. <NotPaymentWay
  129. v-show="notPaymnetWayFlag"
  130. @notPaymentWayClose="notPaymentWayClose"></NotPaymentWay>
  131. <!-- 添加收款方式,还没点击的地方 -->
  132. <PaymentAccount
  133. v-show="paymentAccountFlag"
  134. @paymentAccountClose="paymentAccountClose"></PaymentAccount>
  135. <!-- 取消订单,还没点击的地方 -->
  136. <CancelOrder
  137. v-show="cancelOrderFlag"
  138. @cancelOrderClose="cancelOrderClose"></CancelOrder>
  139. <!-- 是否完成付款,还没点击的地方 -->
  140. <CompletePayment
  141. v-show="completePaymentFlag"
  142. @completePaymentClose="completePaymentClose"></CompletePayment>
  143. </div>
  144. </template>
  145. <script setup>
  146. import { ref, onMounted } from "vue";
  147. import { useRoute, useRouter } from "vue-router";
  148. import { GetOTCPendingOrder, GetChatId } from "@/api/otc";
  149. import PaymentWay from "../../dialog/PaymentWay.vue";
  150. import Amount from "../../dialog/Amount.vue";
  151. import Filter from "../../dialog/Filter.vue";
  152. import C2CSell from "../../dialog/C2CSell.vue";
  153. import C2CBuy from "../../dialog/C2CBuy.vue";
  154. import NotPaymentWay from "../../dialog/NotPaymentWay.vue";
  155. import PaymentAccount from "../../dialog/PaymentAccount.vue";
  156. import CancelOrder from "../../dialog/CancelOrder.vue";
  157. import CompletePayment from "../../dialog/CompletePayment.vue";
  158. const router = useRouter();
  159. const otcId = ref();
  160. const chatId = ref();
  161. const orderId = ref();
  162. const buySellFlag = ref(1);
  163. const orderData = ref({
  164. // 1购买 2出售
  165. order_type: "1",
  166. });
  167. const buySellData = (flag) => {
  168. buySellFlag.value = flag;
  169. orderData.value.order_type = flag;
  170. GetOTCPendingOrderData();
  171. };
  172. // item.id 6, item.otc 1
  173. const OTCBuy = async (id, otc) => {
  174. otcId.value = otc;
  175. orderId.value = id;
  176. const params = {
  177. otc_id: otc,
  178. };
  179. const data = await GetChatId(params);
  180. if (data) {
  181. chatId.value = data;
  182. BuyFlag.value = true;
  183. }
  184. };
  185. const OTCSell = (item) => {
  186. otcId.value = item.otc;
  187. orderId.value = item.id;
  188. console.log(3, orderId.value);
  189. sellFlag.value = true;
  190. // console.log(1, item);
  191. };
  192. const getChatIdData = async (otc) => {
  193. const params = {
  194. otc_id: otc,
  195. };
  196. const data = await GetChatId(params);
  197. if (data) {
  198. chatId.value = data;
  199. router.push({
  200. name: "OTCCustomService",
  201. params: { chatId: chatId.value, otcId: otc },
  202. });
  203. }
  204. };
  205. const goMerchantDetails = () => {
  206. router.push("/OTCMerchantDetails");
  207. };
  208. const OTCPendingOrderData = ref();
  209. const GetOTCPendingOrderData = async () => {
  210. OTCPendingOrderData.value = [];
  211. const params = {
  212. // 1购买,2出售
  213. order_type: orderData.value.order_type,
  214. // 1,普通交易,2快捷交易,3.大宗交易
  215. trans_type: "3",
  216. coin_type: "",
  217. price: "",
  218. count: "",
  219. min_limit: "",
  220. min_amount: "",
  221. pay_type: "",
  222. left_count: "",
  223. };
  224. const data = await GetOTCPendingOrder(params);
  225. if (data) {
  226. OTCPendingOrderData.value = data.list;
  227. }
  228. };
  229. onMounted(() => {
  230. GetOTCPendingOrderData();
  231. });
  232. const completePaymentFlag = ref(false);
  233. const completePaymentClose = () => {
  234. completePaymentFlag.value = false;
  235. };
  236. const cancelOrderFlag = ref(false);
  237. const cancelOrderClose = () => {
  238. cancelOrderFlag.value = false;
  239. };
  240. const paymentAccountFlag = ref(false);
  241. const paymentAccountClose = () => {
  242. paymentAccountFlag.value = false;
  243. };
  244. const notPaymnetWayFlag = ref(false);
  245. const notPaymentWayClose = () => {
  246. notPaymnetWayFlag.value = false;
  247. };
  248. const BuyFlag = ref(false);
  249. const BuyClose = () => {
  250. BuyFlag.value = false;
  251. };
  252. const sellFlag = ref(false);
  253. const sellClose = () => {
  254. sellFlag.value = false;
  255. };
  256. const filterFlag = ref(false);
  257. const filterClose = () => {
  258. filterFlag.value = false;
  259. };
  260. const amountFlag = ref(false);
  261. const amountClose = () => {
  262. amountFlag.value = false;
  263. };
  264. const paymentWayFlag = ref(false);
  265. const paymentWayClose = () => {
  266. paymentWayFlag.value = false;
  267. };
  268. </script>
  269. <style lang="less" scoped>
  270. .c2c {
  271. margin-top: 13px;
  272. width: 345px;
  273. height: 100px;
  274. }
  275. .buy-sell {
  276. display: flex;
  277. flex-direction: row;
  278. justify-content: space-between;
  279. margin-top: 13px;
  280. width: 345px;
  281. height: 35px;
  282. .buy-left {
  283. display: flex;
  284. flex-direction: row;
  285. justify-content: flex-start;
  286. height: 100%;
  287. .buy-green {
  288. background: #45b26b !important;
  289. color: #ffffff;
  290. transition: all ease 0.3s;
  291. }
  292. .buy-red {
  293. background: #df384c !important;
  294. color: #ffffff;
  295. transition: all ease 0.3s;
  296. }
  297. .buy-btn {
  298. width: 85px;
  299. height: 35px;
  300. line-height: 35px;
  301. text-align: center;
  302. border-radius: 6px;
  303. background: #f5f5f5;
  304. }
  305. .sell-btn {
  306. margin-left: 14px;
  307. width: 85px;
  308. height: 35px;
  309. line-height: 35px;
  310. text-align: center;
  311. border-radius: 6px;
  312. background: #f5f5f5;
  313. }
  314. }
  315. .buy-right {
  316. display: flex;
  317. flex-direction: row;
  318. justify-content: flex-start;
  319. align-items: center;
  320. width: 75px;
  321. height: 35px;
  322. line-height: 35px;
  323. text-align: center;
  324. border-radius: 6px;
  325. background: #f5f5f5;
  326. .text {
  327. margin-left: 15px;
  328. }
  329. img {
  330. margin-left: 12px;
  331. }
  332. }
  333. }
  334. .filter-area {
  335. display: flex;
  336. flex-direction: row;
  337. justify-content: space-between;
  338. padding-left: 6px;
  339. margin-top: 13px;
  340. width: 345px;
  341. height: 18px;
  342. box-sizing: border-box;
  343. .filter-left {
  344. display: flex;
  345. flex-direction: row;
  346. justify-content: flex-start;
  347. align-items: center;
  348. height: 18px;
  349. .left-coin {
  350. display: flex;
  351. flex-direction: row;
  352. justify-content: flex-start;
  353. align-items: center;
  354. height: 18px;
  355. .coin {
  356. width: 18px;
  357. height: 18px;
  358. }
  359. .text {
  360. margin-left: 3px;
  361. }
  362. .bottom-arrow {
  363. margin-left: 5px;
  364. }
  365. }
  366. .left-money {
  367. display: flex;
  368. flex-direction: row;
  369. justify-content: flex-start;
  370. align-items: center;
  371. margin-left: 34px;
  372. height: 18px;
  373. .text {
  374. margin-left: 3px;
  375. }
  376. .bottom-arrow {
  377. margin-left: 5px;
  378. }
  379. }
  380. .left-pay-way {
  381. display: flex;
  382. flex-direction: row;
  383. justify-content: flex-start;
  384. align-items: center;
  385. margin-left: 34px;
  386. height: 18px;
  387. .text {
  388. margin-left: 3px;
  389. }
  390. .bottom-arrow {
  391. margin-left: 5px;
  392. }
  393. }
  394. }
  395. .filter-right {
  396. display: flex;
  397. flex-direction: row;
  398. justify-content: center;
  399. align-items: center;
  400. height: 18px;
  401. }
  402. }
  403. .goods-area {
  404. margin-top: 10px;
  405. margin-bottom: 30px;
  406. width: 345px;
  407. .goods-item {
  408. padding: 0 10px;
  409. margin-top: 10px;
  410. width: 345px;
  411. height: 150px;
  412. border-radius: 8px;
  413. border: 1px solid #ebebeb;
  414. box-sizing: border-box;
  415. .item-merchant {
  416. display: flex;
  417. flex-direction: row;
  418. justify-content: space-between;
  419. align-items: center;
  420. margin-top: 15px;
  421. width: 100%;
  422. height: 24px;
  423. .merchant-left {
  424. display: flex;
  425. flex-direction: row;
  426. justify-content: flex-start;
  427. align-items: center;
  428. height: 24px;
  429. img {
  430. width: 24px;
  431. height: 24px;
  432. }
  433. .left-name {
  434. margin-left: 4px;
  435. }
  436. .vip-flag {
  437. margin-left: 4px;
  438. width: 18px;
  439. height: 15px;
  440. line-height: 15px;
  441. text-align: center;
  442. border-radius: 3px;
  443. background: #df384c1a;
  444. }
  445. }
  446. }
  447. .item-chengjiao-number {
  448. margin-top: 6px;
  449. }
  450. .item-price {
  451. display: flex;
  452. flex-direction: row;
  453. justify-content: space-between;
  454. margin-top: 10px;
  455. .price-area {
  456. .price-number {
  457. margin-top: 3px;
  458. }
  459. .number {
  460. margin-top: 5px;
  461. height: 13px;
  462. line-height: 13px;
  463. span {
  464. margin-left: 1px;
  465. }
  466. }
  467. }
  468. .price-func {
  469. display: flex;
  470. flex-direction: column;
  471. justify-content: flex-start;
  472. align-items: flex-end;
  473. .func-time {
  474. display: flex;
  475. flex-direction: row;
  476. justify-content: flex-start;
  477. align-items: center;
  478. height: 12px;
  479. img {
  480. margin-right: 3px;
  481. width: 9px;
  482. height: 9px;
  483. }
  484. }
  485. .func-pay-way {
  486. display: flex;
  487. flex-direction: row;
  488. justify-content: flex-start;
  489. align-items: center;
  490. margin-top: 5px;
  491. height: 12px;
  492. .color {
  493. margin-right: 3px;
  494. width: 3px;
  495. height: 10px;
  496. border-radius: 2px;
  497. background: #df384c;
  498. }
  499. }
  500. .func-main {
  501. display: flex;
  502. flex-direction: row;
  503. justify-content: flex-start;
  504. margin-top: 15px;
  505. height: 24px;
  506. .func-chat {
  507. width: 58px;
  508. height: 24px;
  509. line-height: 24px;
  510. text-align: center;
  511. border-radius: 5px;
  512. background: #df384c1a;
  513. }
  514. .func-buy {
  515. margin-left: 8px;
  516. width: 58px;
  517. height: 24px;
  518. line-height: 24px;
  519. text-align: center;
  520. border-radius: 5px;
  521. background: #45b26b;
  522. }
  523. .func-sell {
  524. margin-left: 8px;
  525. width: 58px;
  526. height: 24px;
  527. line-height: 24px;
  528. text-align: center;
  529. border-radius: 5px;
  530. background: #df384c;
  531. }
  532. }
  533. }
  534. }
  535. }
  536. }
  537. </style>