index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. <template>
  2. <view>
  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="iconfont">&#xe625;</text>
  15. </view>
  16. </view>
  17. <view class="lable-title">
  18. <template v-for="(item , index) in lableList">
  19. <text @click.stop="lableIndex = index"
  20. :class="['lable-item', lableIndex === index ? 'active-lable-item' : '' ]">{{ item }}</text>
  21. </template>
  22. </view>
  23. <view class="shortcut">
  24. <view class="shortcut-type">
  25. <view class="type-box">
  26. <text class="type-item active-type-item">市价委托</text>
  27. <text class="type-item">计划委托</text>
  28. </view>
  29. <view class="type-times">
  30. {{leverName}}{{ multiple }}x
  31. <text class="iconfont">&#xeb6d;</text>
  32. </view>
  33. </view>
  34. <view class="shortcut-price">
  35. <view class="price-box">
  36. <text class="price-lable">价格</text>
  37. <view class="price-info">
  38. <text class="price-num">78.66</text>
  39. <text class="price-tag">USDT</text>
  40. </view>
  41. </view>
  42. <view class="price-box">
  43. <text class="price-lable">保证金</text>
  44. <input class="price-inp" type="number">
  45. <view class="price-info">
  46. USDT
  47. </view>
  48. </view>
  49. </view>
  50. <view class="shortcut-usable">
  51. <view class="usable-info">
  52. 可用:2927.81 USDT
  53. </view>
  54. <view class="usable-btn">
  55. 充值
  56. </view>
  57. </view>
  58. <view class="shortcut-btns">
  59. <view class="shortcut-btn" @click.stop="setSubmitLever()">
  60. 买入/做多
  61. </view>
  62. <view class="shortcut-btn">
  63. 卖出/做空
  64. </view>
  65. </view>
  66. </view>
  67. <lever :leverNum.sync="multiple" :leverName.sync="leverName" />
  68. </view>
  69. </template>
  70. <script>
  71. import {
  72. Api_setSubmitLever
  73. } from "@/api/index.js"
  74. import lever from "../sustainability/lever.vue"
  75. export default {
  76. name: 'shortcut',
  77. components: {
  78. lever
  79. },
  80. data() {
  81. return {
  82. lableList: [
  83. '开仓',
  84. '当前持仓'
  85. ],
  86. lableIndex: 0,
  87. leverName: '逐仓',
  88. multiple: 100, // 逐仓倍数
  89. };
  90. },
  91. mounted() {
  92. },
  93. methods: {
  94. setSubmitLever(){}
  95. }
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. .contract-title {
  100. padding: 5rpx $pages-padding 0;
  101. min-height: 90rpx;
  102. display: flex;
  103. align-items: center;
  104. justify-content: space-between;
  105. border-bottom: 1rpx solid $border-color;
  106. .contract-item {
  107. display: flex;
  108. align-items: center;
  109. .title-iocn {
  110. width: 28rpx;
  111. height: 24rpx;
  112. display: flex;
  113. flex-direction: column;
  114. // align-items: center;
  115. justify-content: space-between;
  116. .title-iocn-item {
  117. width: 100%;
  118. height: 5rpx;
  119. border-radius: 3rpx;
  120. background: #111111;
  121. &:first-child {
  122. width: 50%;
  123. }
  124. }
  125. }
  126. .title-text {
  127. font-size: 34rpx;
  128. font-family: PingFang SC, PingFang SC-Bold;
  129. font-weight: 700;
  130. text-align: left;
  131. color: #141213;
  132. line-height: 1.2;
  133. letter-spacing: 0.74rpx;
  134. padding-left: 19rpx;
  135. }
  136. .title-ratio {
  137. font-size: 24rpx;
  138. font-family: PingFang SC, PingFang SC-Regular;
  139. font-weight: 400;
  140. color: #808080;
  141. line-height: 33rpx;
  142. }
  143. .ratio-icon {
  144. width: 31rpx;
  145. height: 33rpx;
  146. margin-left: 22rpx;
  147. }
  148. }
  149. }
  150. // <view class="lable-title">
  151. // <template v-for="(item , index) in lableList">
  152. // <text class="lable-item">{{ item }}</text>
  153. // </template>
  154. // </view>
  155. .lable-title {
  156. padding: 0 $pages-padding;
  157. width: 100%;
  158. height: 100rpx;
  159. border-bottom: 1rpx solid $border-color;
  160. display: flex;
  161. align-items: stretch;
  162. .lable-item {
  163. font-size: 28rpx;
  164. display: flex;
  165. align-items: center;
  166. &:nth-child(n + 2) {
  167. margin-left: 60rpx;
  168. }
  169. }
  170. .active-lable-item {
  171. font-size: 34rpx;
  172. color: $Theme-Color;
  173. position: relative;
  174. &::before {
  175. content: '';
  176. position: absolute;
  177. left: 50%;
  178. bottom: 0;
  179. width: 30rpx;
  180. height: 5rpx;
  181. background-color: $Theme-Color;
  182. border-radius: 3rpx;
  183. transform: translateX(-50%);
  184. }
  185. }
  186. }
  187. .shortcut {
  188. padding: 30rpx $pages-padding;
  189. .shortcut-type {
  190. width: 100%;
  191. display: flex;
  192. align-items: stretch;
  193. justify-content: space-between;
  194. .type-box {
  195. flex: 1;
  196. display: flex;
  197. align-items: stretch;
  198. border-radius: 6rpx;
  199. overflow: hidden;
  200. .type-item {
  201. font-size: 24rpx;
  202. flex-shrink: 0;
  203. flex: 1;
  204. text-align: center;
  205. display: flex;
  206. align-items: center;
  207. justify-content: center;
  208. border: 1rpx solid $border-color6;
  209. color: $SizeColor;
  210. }
  211. .active-type-item {
  212. color: #fff;
  213. background-color: $Theme-Color;
  214. border: 1rpx solid $Theme-Color;
  215. }
  216. }
  217. .type-times {
  218. margin-left: 20rpx;
  219. width: 230rpx;
  220. height: 50rpx;
  221. line-height: 50rpx;
  222. border: 1rpx solid red;
  223. text-align: center;
  224. font-size: 26rpx;
  225. position: relative;
  226. color: $SizeColor;
  227. border: 1rpx solid $border-color6;
  228. border-radius: 6rpx;
  229. .iconfont {
  230. position: absolute;
  231. right: 10rpx;
  232. top: 50%;
  233. transform: translateY(-50%);
  234. font-size: 20rpx;
  235. color: $Theme-Color;
  236. }
  237. }
  238. }
  239. }
  240. .shortcut-price {
  241. width: 100%;
  242. padding-top: 60rpx;
  243. .price-box {
  244. width: 100%;
  245. height: 80rpx;
  246. border-radius: 10rpx;
  247. display: flex;
  248. justify-content: space-between;
  249. align-items: center;
  250. padding: 0 20rpx;
  251. background-color: $box-bg;
  252. font-size: 24rpx;
  253. color: $SizeColor2;
  254. .price-lable,
  255. .price-info {
  256. flex-shrink: 0;
  257. }
  258. .price-info {
  259. .price-num {
  260. color: #000;
  261. padding-right: 20rpx;
  262. }
  263. }
  264. .price-inp {
  265. flex: 1;
  266. height: 100%;
  267. padding: 0 10rpx;
  268. font-size: 24rpx;
  269. color: #000;
  270. text-align: right;
  271. }
  272. // <view class="price-box">
  273. // <text class="price-lable">价格</text>
  274. // <input class="price-inp" type="number">
  275. // <view class="price-info">
  276. // USDT
  277. // </view>
  278. // </view>
  279. }
  280. .price-box+.price-box {
  281. background-color: #fff;
  282. margin-top: 20rpx;
  283. border: 1rpx solid $box-bg;
  284. }
  285. }
  286. // <view class="shortcut-usable">
  287. // <view class="usable-info">
  288. // 可用:2927.81 USDT
  289. // </view>
  290. // <view class="usable-btn">
  291. // 充值
  292. // </view>
  293. // </view>
  294. .shortcut-usable {
  295. width: 100%;
  296. display: flex;
  297. justify-content: space-between;
  298. align-items: center;
  299. font-size: 24rpx;
  300. color: $SizeColor2;
  301. padding: 20rpx 0 40rpx;
  302. .usable-btn {
  303. color: $Theme-Color;
  304. }
  305. }
  306. // <view class="shortcut-btns">
  307. // <view class="shortcut-btn">
  308. // 买入/做多
  309. // </view>
  310. // <view class="shortcut-btn">
  311. // 卖出做空
  312. // </view>
  313. // </view>
  314. .shortcut-btns {
  315. display: flex;
  316. align-items: center;
  317. .shortcut-btn {
  318. flex: 1;
  319. height: 70rpx;
  320. line-height: 70rpx;
  321. text-align: center;
  322. font-size: 28rpx;
  323. color: #fff;
  324. background-color: $Theme-Color;
  325. &:nth-child(n + 2) {
  326. margin-left: 30rpx;
  327. background-color: $Theme-Color2;
  328. }
  329. }
  330. }
  331. </style>