index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742
  1. <template>
  2. <view class="contract-box">
  3. <view class="contract-title">
  4. <view class="contract-item" @click.stop="openDrawer">
  5. <view class="title-iocn">
  6. <text class="title-iocn-item"></text>
  7. <text class="title-iocn-item"></text>
  8. <text class="title-iocn-item"></text>
  9. </view>
  10. <!-- <image class="title-iocn" src="../../../static/logo.png" mode="aspectFit"></image> -->
  11. <text class="title-text">ETH/USDT</text>
  12. </view>
  13. <view class="contract-item">
  14. <text class="title-ratio">资金费率:-0.0100%</text>
  15. <image class="ratio-icon" src="../../../static/logo.png" mode="aspectFit"></image>
  16. <image class="ratio-icon" src="../../../static/logo.png" mode="aspectFit"></image>
  17. </view>
  18. </view>
  19. <view class="account-box">
  20. <view class="account-item">
  21. <view class="account-title">
  22. <text class="text">持仓保证金USDT]</text>
  23. </view>
  24. <text class="account-num">365.26</text>
  25. </view>
  26. <view class="account-item">
  27. <view class="account-title">
  28. <text class="text">可用保证金(USDT)</text>
  29. </view>
  30. <text class="account-num">365.26</text>
  31. </view>
  32. <view class="account-item">
  33. <view class="account-title">
  34. <text class="text">未实现亏盈(USDT] 三1</text>
  35. </view>
  36. <text class="account-num">-0.99</text>
  37. </view>
  38. <view class="account-item">
  39. <view class="account-title">
  40. <text class="text">净值(USDIL</text>
  41. </view>
  42. <text class="account-num">9869.77</text>
  43. </view>
  44. <view class="account-item">
  45. <view class="account-title">
  46. <text class="text">风险率必</text>
  47. </view>
  48. <text class="account-num">9869.77</text>
  49. </view>
  50. <view class="account-item">
  51. <view class="account-title">
  52. <text class="text">账户余额[USDTI</text>
  53. </view>
  54. <text class="account-num">9869.77</text>
  55. </view>
  56. </view>
  57. <gap height="8rpx" />
  58. <view class="data-box">
  59. <view class="data-left">
  60. <view class="left-title flex">
  61. <text>价格</text>
  62. <text>数量</text>
  63. </view>
  64. <view class="subhead-title flex">
  65. <text>(USDT)</text>
  66. <text>(张)</text>
  67. </view>
  68. <view class="nums-list">
  69. <view class="nums-item" v-for="item in 7">
  70. <text class="nums-item-bg"></text>
  71. <view class="item-num">
  72. <text>28516.8</text>
  73. <text>28516.8</text>
  74. </view>
  75. </view>
  76. </view>
  77. <view class="left-title index-num-title flex">
  78. <text>28515.6</text>
  79. <text>+0.09%</text>
  80. </view>
  81. <view class="subhead-title index-title flex">
  82. <text>指数28523.0</text>
  83. <text>标记285114</text>
  84. </view>
  85. <view class="nums-list" style="padding-top: 6.5rpx;">
  86. <view class="nums-item" v-for="item in 7">
  87. <text class="nums-item-bg"></text>
  88. <view class="item-num">
  89. <text>28516.8</text>
  90. <text>28516.8</text>
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. <view class="data-right">
  96. <view class="right-select">
  97. <view class="select-box position-select" @click.stop="selectList = !selectList">
  98. <text class="select-text">{{ value }}</text>
  99. <text class="iconfont">&#xe601;</text>
  100. <view class="select-list" v-show="selectList">
  101. <text @click.stop="value = item.value ; selectList = false"
  102. :class="['select-list-item' , value === item.value ? 'active-select-item' : '']"
  103. v-for="item in range">{{ item.value }}</text>
  104. </view>
  105. </view>
  106. <view class="select-box" @click.stop="adjustLever()">
  107. <text class="select-text">{{ leverName }}{{ leverNum }}</text>
  108. <text class="iconfont">&#xe601;</text>
  109. </view>
  110. <!-- <uni-data-select :localdata="range" class="select-item" v-model="value"
  111. @change="change"></uni-data-select>
  112. <uni-data-select class="select-item" v-model="value" @change="change"></uni-data-select> -->
  113. </view>
  114. <view class="right-input input-item-p">
  115. 市价
  116. </view>
  117. <view class="right-input">
  118. <input class="input-item">
  119. <view class="right-input-icon">
  120. <text>张</text>
  121. <text class="icon-link">|</text>
  122. <text class="switch-icon iconfont">&#xe607;</text>
  123. </view>
  124. </view>
  125. <view class="step-content">
  126. <step :width="365"/>
  127. </view>
  128. <view class="set-node">
  129. <view class="set-node-status"></view>
  130. <text class="set-node-text">设置止盈止损</text>
  131. </view>
  132. <view class="info-item">
  133. <text class="info-item-lable">成本</text>
  134. <view class="info-item-val">0.00 USDT</view>
  135. </view>
  136. <view class="info-item">
  137. <text class="info-item-lable">可用</text>
  138. <view class="info-item-val">
  139. <text>USDT</text>
  140. <text class="info-item-icon iconfont">&#xe607;</text>
  141. </view>
  142. </view>
  143. <view class="info-btns">
  144. <view class="info-btn-info">
  145. <text class="info-btn-lable">可做多</text>
  146. <text class="info-btn-val">33719张</text>
  147. </view>
  148. <view class="info-btn">
  149. 买入/做多
  150. </view>
  151. </view>
  152. <view class="info-btns err-btns">
  153. <view class="info-btn-info">
  154. <text class="info-btn-lable">可做多</text>
  155. <text class="info-btn-val">33719张</text>
  156. </view>
  157. <view class="info-btn">
  158. 卖出/做空
  159. </view>
  160. </view>
  161. </view>
  162. </view>
  163. <!-- 侧边抽屉 -->
  164. <drawer ref="drawerRef" />
  165. <!-- 调整杠杆 -->
  166. <lever ref="leverRef" :lever-num.sync="leverNum" :leverName.sync="leverName"/>
  167. </view>
  168. </template>
  169. <script>
  170. import drawer from "./../modules/drawer.vue"
  171. import lever from "./lever.vue"
  172. export default {
  173. components: {
  174. drawer,
  175. lever
  176. },
  177. data() {
  178. return {
  179. selectList: false,
  180. value: '市价委托',
  181. range: [{
  182. value: '市价委托',
  183. text: '市价委托'
  184. },
  185. {
  186. value: '限价委托',
  187. text: '限价委托'
  188. },
  189. {
  190. value: '计划委托',
  191. text: '计划委托'
  192. },
  193. ],
  194. leverName:'全仓',
  195. leverNum:'100X',
  196. };
  197. },
  198. methods: {
  199. openDrawer() {
  200. this.$refs.drawerRef.open();
  201. },
  202. change(e) {
  203. console.log("e:", e);
  204. },
  205. adjustLever(){
  206. this.$nextTick(() => {
  207. this.$refs.leverRef.open()
  208. })
  209. },
  210. },
  211. }
  212. </script>
  213. <style lang="scss" scoped>
  214. .contract-box {
  215. .contract-title {
  216. padding: 5rpx $pages-padding 0;
  217. min-height: 78rpx;
  218. display: flex;
  219. align-items: center;
  220. justify-content: space-between;
  221. .contract-item {
  222. display: flex;
  223. align-items: center;
  224. .title-iocn {
  225. width: 28rpx;
  226. height: 24rpx;
  227. display: flex;
  228. flex-direction: column;
  229. // align-items: center;
  230. justify-content: space-between;
  231. .title-iocn-item {
  232. width: 100%;
  233. height: 4rpx;
  234. border-radius: 2rpx;
  235. background: #111111;
  236. &:first-child {
  237. width: 50%;
  238. }
  239. }
  240. }
  241. .title-text {
  242. font-size: 37rpx;
  243. font-family: PingFang SC, PingFang SC-Bold;
  244. font-weight: 700;
  245. text-align: left;
  246. color: #141213;
  247. line-height: 52px;
  248. letter-spacing: 0.74rpx;
  249. padding-left: 19rpx;
  250. }
  251. .title-ratio {
  252. font-size: 24rpx;
  253. font-family: PingFang SC, PingFang SC-Regular;
  254. font-weight: 400;
  255. color: #808080;
  256. line-height: 33rpx;
  257. }
  258. .ratio-icon {
  259. width: 31rpx;
  260. height: 33rpx;
  261. margin-left: 22rpx;
  262. }
  263. }
  264. }
  265. .account-box {
  266. width: 100%;
  267. padding: 21rpx $pages-padding;
  268. display: flex;
  269. flex-wrap: wrap;
  270. background-color: #F6F6F6;
  271. margin-bottom: 25rpx;
  272. .account-item {
  273. display: flex;
  274. flex-direction: column;
  275. flex-shrink: 0;
  276. &:nth-child(3n) {
  277. width: 40%;
  278. text-align: right;
  279. }
  280. &:nth-child(3n - 1) {
  281. width: 30%;
  282. text-align: right;
  283. }
  284. &:nth-child(3n - 2) {
  285. width: 30%;
  286. }
  287. &:nth-child(n + 4) {
  288. margin-top: 20rpx;
  289. }
  290. .account-title {
  291. font-size: 22rpx;
  292. font-family: PingFang SC, PingFang SC-Bold;
  293. font-weight: 700;
  294. color: #807e89;
  295. line-height: 30rpx;
  296. .text {
  297. border-bottom: 2rpx dashed #707070;
  298. }
  299. }
  300. .account-num {
  301. font-size: 24rpx;
  302. font-family: PingFang SC, PingFang SC-Bold;
  303. font-weight: 700;
  304. color: #1a1a1a;
  305. line-height: 33rpx;
  306. margin-top: 11rpx;
  307. }
  308. }
  309. }
  310. }
  311. .data-box {
  312. width: 100%;
  313. padding: 25rpx $pages-padding 0;
  314. display: flex;
  315. justify-content: space-between;
  316. align-items: stretch;
  317. .data-left {
  318. width: 303rpx;
  319. .flex {
  320. display: flex;
  321. justify-content: space-between;
  322. align-items: center;
  323. }
  324. .left-title {
  325. font-size: 24rpx;
  326. font-family: PingFang SC, PingFang SC-Bold;
  327. font-weight: 700;
  328. color: #807e89;
  329. line-height: 33rpx;
  330. }
  331. .subhead-title {
  332. font-size: 24rpx;
  333. font-family: PingFang SC, PingFang SC-Bold;
  334. font-weight: 700;
  335. color: #807e89;
  336. line-height: 33rpx;
  337. }
  338. .index-num-title {
  339. font-size: 36rpx;
  340. font-family: PingFang SC, PingFang SC-Bold;
  341. font-weight: 700;
  342. color: #20b482;
  343. line-height: 50rpx;
  344. text+text {
  345. font-size: 28rpx;
  346. font-family: PingFang SC, PingFang SC-Bold;
  347. font-weight: 700;
  348. color: #20b482;
  349. line-height: 40rpx;
  350. }
  351. }
  352. .index-title {
  353. font-size: 20rpx;
  354. color: #808080;
  355. line-height: 1.2;
  356. text {
  357. border-bottom: 2rpx dashed #707070;
  358. }
  359. padding-bottom: 18rpx;
  360. border-bottom: 1px solid #f2f2f2;
  361. }
  362. .nums-list {
  363. width: 100%;
  364. padding: 10rpx 0 4rpx;
  365. border-bottom: 1rpx solid #f2f2f2;
  366. .nums-item {
  367. width: 100%;
  368. position: relative;
  369. height: 40rpx;
  370. margin-bottom: 4rpx;
  371. .nums-item-bg {
  372. position: absolute;
  373. top: 0;
  374. right: 0;
  375. z-index: 1;
  376. width: 50%;
  377. height: 100%;
  378. background-color: #FEEBED;
  379. }
  380. .item-num {
  381. width: 100%;
  382. height: 100%;
  383. position: absolute;
  384. top: 0;
  385. right: 0;
  386. z-index: 2;
  387. display: flex;
  388. justify-content: space-between;
  389. align-items: center;
  390. font-size: 22rpx;
  391. font-family: PingFang SC, PingFang SC-Bold;
  392. font-weight: 700;
  393. color: #ea5162;
  394. line-height: 33rpx;
  395. text+text {
  396. font-weight: 700;
  397. color: #1a1a1a;
  398. line-height: 33rpx;
  399. }
  400. }
  401. }
  402. }
  403. // <view class="nums-list">
  404. // <view class="nums-item">
  405. // <text class="nums-item-bg"></text>
  406. // <text class="item-num">28516.8</text>
  407. // <text class="item-num">28516.8</text>
  408. // </view>
  409. // </view>
  410. }
  411. .data-right {
  412. width: 365rpx;
  413. // background-color: green;
  414. .right-select {
  415. width: 100%;
  416. display: flex;
  417. justify-content: space-between;
  418. align-items: center;
  419. .select-box {
  420. width: 175rpx;
  421. height: 50rpx;
  422. display: flex;
  423. justify-content: space-between;
  424. align-items: center;
  425. background-color: #f1f1f1;
  426. padding: 0 3px;
  427. border-radius: 4rpx;
  428. .select-text {
  429. font-size: 26rpx;
  430. font-weight: 700;
  431. }
  432. .iconfont {
  433. font-size: 20rpx;
  434. color: $Theme-Color;
  435. }
  436. }
  437. .position-select {
  438. position: relative;
  439. .select-list {
  440. position: absolute;
  441. left: 0;
  442. top: 50rpx;
  443. width: 185rpx;
  444. display: flex;
  445. flex-direction: column;
  446. background-color: #fff;
  447. z-index: 1;
  448. .select-list-item {
  449. width: 100%;
  450. height: 70rpx;
  451. line-height: 70rpx;
  452. padding: 0 30rpx;
  453. font-size: 22rpx;
  454. font-weight: bold;
  455. color: #c1c1c1;
  456. }
  457. .active-select-item {
  458. background-color: #f1f1f1;
  459. color: #000;
  460. }
  461. }
  462. }
  463. // <view class="select-box">
  464. // <text class="select-text">限价委托</text>
  465. // <text class="iconfont">&#xe601;</text>
  466. // </view>
  467. // <view class="select-box">
  468. // <text class="select-text">限价委托</text>
  469. // <text class="iconfont">&#xe601;</text>
  470. // </view>
  471. // .select-item {
  472. // width: 175rpx !important;
  473. // height: 50rpx;
  474. // flex: 0;
  475. // ::v-deep .uni-stat-box {
  476. // width: 175rpx !important;
  477. // height: 48rpx;
  478. // .uni-select {
  479. // width: 175rpx !important;
  480. // height: 48rpx;
  481. // .uni-select__input-box {
  482. // width: 100%;
  483. // height: 48rpx !important;
  484. // }
  485. // .uniui-clear{
  486. // display: none;
  487. // }
  488. // }
  489. // }
  490. // }
  491. }
  492. .right-input {
  493. width: 100%;
  494. height: 80rpx;
  495. background: #efefef;
  496. border-radius: 10rpx;
  497. margin-top: 20rpx;
  498. display: flex;
  499. justify-content: space-between;
  500. align-items: center;
  501. padding: 0 20rpx;
  502. font-size: 24rpx;
  503. font-family: PingFang SC, PingFang SC-Bold;
  504. font-weight: 700;
  505. color: #808080;
  506. line-height: 40rpx;
  507. .input-item {
  508. height: 100%;
  509. }
  510. .input-item-p {
  511. font-size: 24rpx;
  512. font-family: PingFang SC, PingFang SC-Bold;
  513. font-weight: 700;
  514. color: #808080;
  515. line-height: 40rpx;
  516. opacity: 0.3;
  517. }
  518. .right-input-icon {
  519. flex-shrink: 0;
  520. font-size: 28rpx;
  521. font-family: PingFang SC, PingFang SC-Bold;
  522. font-weight: 700;
  523. color: #808080;
  524. line-height: 40rpx;
  525. display: flex;
  526. align-items: center;
  527. .icon-link {
  528. margin: 0 15rpx;
  529. }
  530. .icon {
  531. width: 30rpx;
  532. height: 26rpx;
  533. }
  534. }
  535. }
  536. .step-content {
  537. padding: 24rpx 0 35rpx;
  538. }
  539. .set-node {
  540. width: 100%;
  541. display: flex;
  542. align-items: center;
  543. .set-node-status {
  544. width: 27rpx;
  545. height: 27rpx;
  546. background: #e6e6e8;
  547. border-radius: 2rpx;
  548. }
  549. .set-node-text {
  550. font-size: 24rpx;
  551. font-family: PingFang SC, PingFang SC-Regular;
  552. font-weight: 400;
  553. color: #808080;
  554. line-height: 34rpx;
  555. margin-left: 14rpx;
  556. border-bottom: 2rpx dashed #707070;
  557. }
  558. }
  559. .info-item {
  560. width: 100%;
  561. display: flex;
  562. justify-content: space-between;
  563. align-items: center;
  564. font-size: 26rpx;
  565. padding: 16rpx 0;
  566. line-height: 1.1;
  567. .info-item-lable {
  568. color: #ccc;
  569. border-bottom: 1rpx dashed #707070;
  570. }
  571. .info-item-val {
  572. font-size: 22rpx;
  573. font-weight: bold;
  574. display: flex;
  575. align-items: center;
  576. .info-item-icon {
  577. font-size: 20rpx;
  578. margin-left: 20rpx;
  579. width: 30rpx;
  580. height: 30rpx;
  581. background-color: $Theme-Color;
  582. color: #fff;
  583. text-align: center;
  584. line-height: 30rpx;
  585. border-radius: 6rpx;
  586. }
  587. }
  588. }
  589. .info-btns {
  590. width: 100%;
  591. padding-top: 16rpx;
  592. .info-btn-info {
  593. display: flex;
  594. justify-content: space-between;
  595. font-size: 24rpx;
  596. padding-bottom: 10rpx;
  597. .info-btn-lable {
  598. color: #ccc;
  599. }
  600. .info-btn-val{
  601. font-weight: bold;
  602. }
  603. // <view class="info-btn-info">
  604. // <text class="info-btn-lable">可做多</text>
  605. // <text class="info-btn-val">33719张</text>
  606. // </view>
  607. }
  608. .info-btn {
  609. width: 100%;
  610. height: 80rpx;
  611. background-color: $Theme-Color;
  612. text-align: center;
  613. line-height: 80rpx;
  614. font-size: 30rpx;
  615. color: #fff;
  616. }
  617. }
  618. .err-btns {
  619. .info-btn {
  620. background-color: red;
  621. }
  622. }
  623. // <view class="info-btns">
  624. // <view class="info-btn-info">
  625. // <text class="info-btn-lable">可做多</text>
  626. // <text class="info-btn-val">33719张</text>
  627. // </view>
  628. // <view class="info-btn">
  629. // 买入/做多
  630. // </view>
  631. // </view>
  632. // <view class="set-node">
  633. // <view class="set-node-status"></view>
  634. // <text class="set-node-text">设置止盈止损</text>
  635. // </view>
  636. }
  637. }
  638. .switch-icon{
  639. color: $Theme-Color;
  640. font-size: 26rpx;
  641. }
  642. </style>