index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155
  1. <template>
  2. <view>
  3. <view class="contract-title" :rise-fall="stocksColor">
  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">{{currencyVal.currency_name}}/{{currencyVal.legal_name}}</text>
  12. </view>
  13. <view class="contract-price" :class="$setColor(daymarket.now_price)">
  14. <text class="color">{{ daymarket.now_price }}</text>
  15. <text class="color" v-show="daymarket.change">{{ daymarket.change }}%</text>
  16. </view>
  17. <view class="contract-item">
  18. <text class="iconfont">&#xe625;</text>
  19. </view>
  20. </view>
  21. <view class="iframe-box">
  22. <template v-if="currencyVal.legal_id">
  23. <k-line ></k-line>
  24. </template>
  25. </view>
  26. <gap />
  27. <view class="swiper-title">
  28. <view class="swiper-lable">
  29. <template v-for="(item , index) in lableList">
  30. <text @click.stop="lableIndex = index"
  31. :class="['swiper-item', lableIndex === index ? 'active-swiper-item' : '' ]">{{ item }}</text>
  32. </template>
  33. </view>
  34. <view class="iconfont" @click.stop="getHistory()">&#xe613;</view>
  35. </view>
  36. <!-- {{ pagesInfo }} -->
  37. <view class="shortcut">
  38. <swiper class="swiper-content" :current="lableIndex"
  39. :style="{'height': scrollHeight ? `${scrollHeight}px` : '' }" disable-touch>
  40. <swiper-item class="swiper-item-box">
  41. <u-list>
  42. <view class="shortcut-open">
  43. <view class="shortcut-type">
  44. <view class="type-box">
  45. <text class="type-item active-type-item">市价委托</text>
  46. <text class="type-item">计划委托</text>
  47. </view>
  48. <view class="type-times" @click.stop="adjustLever()">
  49. {{leverName}}{{ multiple }}x
  50. <text class="iconfont">&#xeb6d;</text>
  51. </view>
  52. </view>
  53. <view class="shortcut-price">
  54. <view class="price-box">
  55. <text class="price-lable">价格</text>
  56. <view class="price-info">
  57. <text class="price-num">{{ daymarket.now_price }}</text>
  58. <text class="price-tag">USDT</text>
  59. </view>
  60. </view>
  61. <view class="price-box">
  62. <text class="price-lable">保证金</text>
  63. <text @click.stop="switchShare" class="price-inp price-inp-text"
  64. v-show="percent">{{ percent }}%</text>
  65. <input v-show="!percent" :focus="isShareFocus" class="price-inp" type="number"
  66. v-model="caution_money">
  67. <view class="price-info">
  68. USDT
  69. </view>
  70. </view>
  71. <view class="step-content">
  72. <step :percent.sync="percent" />
  73. </view>
  74. </view>
  75. <view class="set-node">
  76. <view class="set-node-box">
  77. <view @click.stop="setNodePrice = !setNodePrice"
  78. :class="['set-node-status' , setNodePrice ? 'active-set' : '']">
  79. <text class="iconfont" v-show="setNodePrice">&#xe6c5;</text>
  80. </view>
  81. <text class="set-node-text">设置止盈止损</text>
  82. </view>
  83. </view>
  84. <view class="set-profit-loss" v-show="setNodePrice">
  85. <!-- 止盈 -->
  86. <view class="set-profit-loss-title">
  87. <text class="title-name">止盈</text>
  88. <view class="title-btn" @click.stop="() => {
  89. restrictProfitVal = ''
  90. restrictProfitStatus === 1 ? restrictProfitStatus = 2 : restrictProfitStatus = 1;
  91. }">
  92. <text class="iconfont">&#xe672;</text>
  93. <text>按{{ restrictProfitStatus === 1 ? '价格' : '比例' }}设置</text>
  94. </view>
  95. </view>
  96. <view class="profit-loss-input">
  97. <text>请输入止盈价格</text>
  98. <input class="input-item" v-model="restrictProfitVal" type="number">
  99. <text>{{ restrictProfitStatus === 1 ? 'USDT' : '%' }}</text>
  100. </view>
  101. <!-- 止损 -->
  102. <view class="set-profit-loss-title">
  103. <text class="title-name">止盈</text>
  104. <view class="title-btn" @click.stop="() => {
  105. restrictLossVal = ''
  106. restrictLossStatus === 1 ? restrictLossStatus = 2 : restrictLossStatus = 1;
  107. }">
  108. <text class=" iconfont">&#xe672;</text>
  109. <text>按{{ restrictLossStatus === 1 ? '价格' : '比例' }}设置</text>
  110. </view>
  111. </view>
  112. <view class="profit-loss-input">
  113. <text>请输入止损价格</text>
  114. <input class="input-item" v-model="restrictLossVal" type="number">
  115. <text>{{ restrictLossStatus === 1 ? 'USDT' : '%' }}</text>
  116. </view>
  117. </view>
  118. <view class="shortcut-usable">
  119. <view class="usable-info">
  120. 可用:{{ pagesInfo.user_lever }} USDT
  121. </view>
  122. <view class="usable-btn" @click.stop="PayCurrency()">
  123. 充值
  124. </view>
  125. </view>
  126. <view class="shortcut-btns">
  127. <view class="shortcut-btn" @click.stop="setSubmitLever(2)">
  128. 买入/做多
  129. </view>
  130. <view class="shortcut-btn" @click.stop="setSubmitLever(1)">
  131. 卖出/做空
  132. </view>
  133. </view>
  134. </view>
  135. </u-list>
  136. </swiper-item>
  137. <swiper-item>
  138. <u-list class="swiper-list" :style="{'height': scrollHeight ? `${scrollHeight}px` : '' }">
  139. <template v-if="myFast && myFast.length > 0">
  140. <view class="lable-title">
  141. <text class="lable-title-text">仓位信息</text>
  142. <text class="lable-title-btn" @click.stop="setCloseLeverAll()">全部平仓</text>
  143. </view>
  144. <view class="account-box" :rise-fall="stocksColor">
  145. <view class="account-item">
  146. <view class="account-title">
  147. <text class="text">持仓保证金USDT)</text>
  148. </view>
  149. <text class="account-num">{{ pagesInfo.caution_money_total || '--' }}</text>
  150. </view>
  151. <view class="account-item">
  152. <view class="account-title">
  153. <text class="text">可用保证金(USDT)</text>
  154. </view>
  155. <text
  156. class="account-num">{{ pagesInfo.available_caution_money_total || '--' }}</text>
  157. </view>
  158. <view class="account-item" :class="[$setColor(pagesInfo.profits_total || '0.00')]">
  159. <view class="account-title">
  160. <text class="text">未实现亏盈(USDT)</text>
  161. </view>
  162. <text class="account-num color">{{ pagesInfo.profits_total }}</text>
  163. </view>
  164. </view>
  165. <template v-for="item in myFast">
  166. <view class="content-box" :rise-fall="stocksColor">
  167. <view class="content-top">
  168. <view class="top-left">
  169. <view class="top-left-title">
  170. <text>{{ item.symbol }}</text>
  171. <text v-if="item.settled == 0">永续</text>
  172. <text v-else-if="item.settled == 9">快捷合约</text>
  173. </view>
  174. <view class="top-left-b">
  175. <text>{{ item.multiple }}倍杠杆</text>
  176. <text class="top-left-b-tag">{{ item.type_name }}</text>
  177. </view>
  178. </view>
  179. <view class="top-right" :class="[$setColor(item.profits || '0.00')]">
  180. <text class="color">{{ item.profits }}</text>
  181. <text
  182. class="top-right-float color"><text>浮动盈亏</text>{{ $getChange(item , 4) }}%</text>
  183. </view>
  184. </view>
  185. <view class="content-info">
  186. <view class="info-item">
  187. <text class="info-item-lable">保证金(USDT)</text>
  188. <text class="info-item-val">{{ item.caution_money }}</text>
  189. </view>
  190. <view class="info-item">
  191. <text class="info-item-lable">开仓价格(USDT)</text>
  192. <text class="info-item-val">{{ item.origin_price }}</text>
  193. </view>
  194. <view class="info-item">
  195. <text class="info-item-lable">预估平仓价格(USDT)</text>
  196. <text class="info-item-val">{{item.update_price}}</text>
  197. </view>
  198. <view class="info-item">
  199. <text class="info-item-lable">过夜费</text>
  200. <text class="info-item-val">{{item.overnight_money}}</text>
  201. </view>
  202. <view class="info-item">
  203. <text class="info-item-lable">风险率(%)</text>
  204. <text class="info-item-val">{{ $getChange(item , 2) }}%</text>
  205. <!-- {{ item.caution_money }} -->
  206. </view>
  207. <!-- <view class="info-item">
  208. <text class="info-item-lable">预计止损(USDT)</text>
  209. <text class="info-item-val"
  210. @click.stop="setRestrict(item)">{{ item.stop_loss_price || '--' }} <text
  211. class="iconfont">&#xe610;</text></text>
  212. </view>
  213. <view class="info-item">
  214. <text class="info-item-lable">预计止盈(USDT)</text>
  215. <text class="info-item-val"
  216. @click.stop="setRestrict(item)">{{ item.target_profit_price || '--' }} <text
  217. class="iconfont">&#xe610;</text> </text>
  218. </view> -->
  219. <view class="info-item">
  220. <text class="info-item-lable">创建时间</text>
  221. <text class="info-item-val">{{ item.transaction_time }}</text>
  222. </view>
  223. </view>
  224. <view class="content-btns">
  225. <view class="content-btn-item" @click.stop="setCloseLever(item)">
  226. 平仓
  227. </view>
  228. <!-- @click.stop="setInversion(item)" -->
  229. <view class="content-btn-item">
  230. 反向开仓
  231. </view>
  232. <!-- <view class="content-btn-item">
  233. 加仓
  234. </view> -->
  235. </view>
  236. <view class="set-stop">
  237. <view class="stop-left" @click.stop="setRestrict(item)">
  238. <text>止盈/止损</text>
  239. <text
  240. class="stop-num">{{ item.target_profit_price || '--' }}/{{ item.stop_loss_price || '--'}}</text>
  241. <text class="iconfont">&#xe610;</text>
  242. </view>
  243. <view class="stop-right" @click.stop="$emit('shareContent' , item)">
  244. <text class="icon-size iconfont">&#xe8b0;</text>
  245. <text class="icon-size">分享</text>
  246. </view>
  247. </view>
  248. </view>
  249. <gap />
  250. </template>
  251. </template>
  252. </u-list>
  253. </swiper-item>
  254. </swiper>
  255. </view>
  256. <drawer ref="drawerRef" />
  257. <restrictPopup ref="restrictRef" @setSuccess="setSuccess" />
  258. <lever ref="leverRef" :leverNum.sync="multiple" :leverName.sync="leverName" />
  259. <unopen ref="placeOrderRef" @confirm="confirmPlaceOrder" title="下单确认" cancelBtn content="确定要下单吗?" />
  260. <unopen ref="unopenRef" @confirm="confirm" textAlign="left" :title="unopenSolt.title" cancelBtn
  261. :content="unopenSolt.closeLeverContent" />
  262. <popupHint ref="hintRef" title="快捷合约">
  263. <template #hintContent>
  264. <view class="">
  265. 快捷合约是币王交易所为用户带来的新型区块链合约衍生品,有闪电开平仓、持仓稳定、抗市场干扰的优势,主要特点如下:
  266. </view>
  267. <!-- <view class="">
  268. 赠金获取方式:
  269. </view> -->
  270. <view class="content-list">
  271. <text>1. 开仓/平仓流程及功能与永续一致</text>
  272. <text>2. 五交割期</text>
  273. <text>3. 市价开仓100%快速成交</text>
  274. <text>4. 开平仓价即为预估成交价</text>
  275. <text>5. 每天4:00(UTC+8)收取0.02%过夜费</text>
  276. </view>
  277. <view class="">
  278. 更多内容请点击<text class="explain" @click.stop="readPactInfo(189)">《快捷合约》</text>
  279. </view>
  280. <view class="hite-box" @click.stop="readPact = !readPact">
  281. <text class="box">
  282. <text v-show="readPact" class="iconfont2">&#xe6c5;</text>
  283. </text>
  284. <text>不在提示</text>
  285. </view>
  286. <view class="confirm-btn" @click.stop="confirmHiteBtn">
  287. 确定
  288. </view>
  289. </template>
  290. </popupHint>
  291. </view>
  292. </template>
  293. <script>
  294. import {
  295. mapGetters
  296. } from 'vuex'
  297. import {
  298. Api_setSubmitLever,
  299. Api_getLeverDeal,
  300. Api_getRegister,
  301. Api_setBatchClose,
  302. Api_setCloseLever
  303. } from "@/api/index.js"
  304. import lever from "../sustainability/lever.vue"
  305. import drawer from "./../modules/drawer.vue"
  306. import popupHint from "../modules/popup-hint.vue"
  307. import restrictPopup from "./../modules/restrict.vue"
  308. export default {
  309. name: 'shortcut',
  310. components: {
  311. lever,
  312. drawer,
  313. restrictPopup,
  314. popupHint
  315. },
  316. data() {
  317. return {
  318. readPact: false,
  319. closeLeverItem: null,
  320. lableList: [
  321. '开仓',
  322. '当前持仓'
  323. ],
  324. lableIndex: 0,
  325. leverName: '逐仓',
  326. multiple: 100, // 逐仓倍数
  327. caution_money: '',
  328. status: 1, // 状态,填1. 1市价交易,为0则是挂单交易
  329. scrollHeight: 0,
  330. unopenSolt: {
  331. title: '',
  332. content: ''
  333. },
  334. percent: 0,
  335. isShareFocus: false,
  336. // 止盈止损
  337. setNodePrice: false,
  338. // 止盈
  339. restrictProfitVal: '',
  340. restrictProfitStatus: 1, // 按价格止盈 , 2 : 比例止盈
  341. // 止损
  342. restrictLossVal: '',
  343. restrictLossStatus: 1, // 按价格止损 , 2 : 比例止损
  344. };
  345. },
  346. props: {
  347. myFast: {
  348. type: Array,
  349. default: () => {
  350. return []
  351. }
  352. },
  353. pagesInfo: {
  354. type: Object,
  355. default: () => {
  356. return {}
  357. }
  358. },
  359. rateProfitsTotal: {
  360. type: Object,
  361. default: () => {
  362. return {}
  363. }
  364. },
  365. },
  366. computed: {
  367. ...mapGetters([
  368. 'currencyVal',
  369. 'daymarket',
  370. 'stocksColor',
  371. 'PageContentHeight',
  372. 'tabBarHeight',
  373. 'contractAccount'
  374. ]),
  375. },
  376. mounted() {
  377. },
  378. watch: {
  379. currencyVal: {
  380. handler(newCurrency) {
  381. if (newCurrency && newCurrency?.legal_id) {
  382. this.init()
  383. }
  384. },
  385. deep: true,
  386. immediate: true
  387. },
  388. PageContentHeight: {
  389. handler(newHeigth) {
  390. if (newHeigth) {
  391. console.log('newHeigth = ', newHeigth)
  392. this.scrollHeight = newHeigth - uni.upx2px(100) - this.tabBarHeight;
  393. }
  394. },
  395. deep: true,
  396. immediate: true
  397. },
  398. },
  399. created() {
  400. this.openPactPopup()
  401. },
  402. methods: {
  403. init() {
  404. // this.getLeverDeal()
  405. // this.getRegister()
  406. },
  407. // 切换张数
  408. switchShare() {
  409. this.percent = 0
  410. this.isShareFocus = false;
  411. this.$nextTick(() => {
  412. this.isShareFocus = true;
  413. });
  414. },
  415. // getRegister() {
  416. // Api_getRegister({
  417. // status: 1,
  418. // legal_id: this.currencyVal.legal_id,
  419. // currency_id: this.currencyVal.currency_id,
  420. // settled: 9,
  421. // limit: 1000
  422. // }).then(res => {
  423. // console.log('Api_getRegister = ', res)
  424. // })
  425. // },
  426. confirmBtn() {
  427. },
  428. openDrawer() {
  429. this.$nextTick(() => {
  430. this.$refs.drawerRef.open();
  431. })
  432. },
  433. setSubmitLever() {
  434. this.$nextTick(() => {
  435. this.$refs.placeOrderRef.open()
  436. })
  437. },
  438. // 确认下单
  439. confirmPlaceOrder(type) {
  440. const obj = {
  441. legal_id: this.currencyVal.legal_id,
  442. currency_id: this.currencyVal.currency_id,
  443. multiple: this.multiple,
  444. caution_money: this.percent ? `${this.percent}%` : this.caution_money,
  445. status: this.status
  446. }
  447. if (this.setNodePrice) {
  448. // 设置止盈止损
  449. // // 止盈
  450. // restrictProfitVal: '',
  451. // restrictProfitStatus: 1, // 按价格止盈 , 2 : 比例止盈
  452. // // 止损
  453. // restrictLossVal: '',
  454. // restrictLossStatus: 1, // 按价格止损 , 2 : 比例止损
  455. obj.target_profit_price = this.restrictProfitStatus === 1 ? this.restrictProfitVal :
  456. `${restrictProfitVal}%`;
  457. obj.stop_loss_price = this.restrictLossStatus === 1 ? this.restrictLossVal : `${restrictLossVal}%`;
  458. }
  459. uni.showLoading({
  460. title: '',
  461. mask: true
  462. })
  463. Api_setSubmitLever(obj).then(res => {
  464. setTimeout(() => {
  465. uni.showToast({
  466. title: '下单成功',
  467. icon: 'none'
  468. })
  469. setTimeout(() => {
  470. uni.hideToast()
  471. this.setSuccess()
  472. }, 300)
  473. }, 201)
  474. }).finally(() => {
  475. setTimeout(() => {
  476. uni.hideLoading()
  477. }, 200)
  478. })
  479. },
  480. // 设置止盈止损
  481. setRestrict(item) {
  482. this.$nextTick(() => {
  483. this.$refs.restrictRef.open(item)
  484. })
  485. },
  486. setSuccess() {
  487. this.$emit('refreshData')
  488. },
  489. setCloseLever(item) {
  490. // this.closeLeverItem = item;
  491. // this.unopenSolt = {
  492. // title: '平仓',
  493. // closeLeverContent: '如果存在平仓挂单(限价止盈止损),将会在全平前被撤单,确定平仓吗?'
  494. // }
  495. // this.setDepot();
  496. this.$emit('setCloseLever', item)
  497. },
  498. setInversion() {
  499. this.closeLeverItem = -1;
  500. this.unopenSolt = {
  501. title: '反向开仓',
  502. closeLeverContent: '如果存在平仓挂单(限价止盈止损),将会在全平前被撤单,确定反向开仓吗?',
  503. }
  504. this.setDepot();
  505. },
  506. setCloseLeverAll() {
  507. this.closeLeverItem = null;
  508. this.unopenSolt = {
  509. title: '全部平仓',
  510. closeLeverContent: '如果存在平仓挂单(限价止盈止损),将会在全平前被撤单,确定全部平仓吗?',
  511. }
  512. this.setDepot();
  513. // this.setDepot();
  514. // this.title = '全部平仓';
  515. // this.closeLeverContent = '';
  516. // this.closeLeverItem = null;
  517. // this.$refs.unopenRef.open();
  518. },
  519. // 平仓 - 反向开仓
  520. setDepot() {
  521. this.$nextTick(() => {
  522. this.$refs.unopenRef.open()
  523. })
  524. },
  525. confirm() {
  526. if (this.myFast.length > 0) {
  527. if (this.closeLeverItem && this.closeLeverItem !== -1) {
  528. // 平仓
  529. Api_setCloseLever({
  530. id: this.closeLeverItem.id
  531. }).then(res => {
  532. setTimeout(() => {
  533. uni.showToast({
  534. title: '平仓成功',
  535. icon: 'none'
  536. })
  537. setTimeout(() => {
  538. uni.hideToast();
  539. this.setSuccess()
  540. }, 300)
  541. }, 201)
  542. }).finally(() => {
  543. setTimeout(() => {
  544. uni.hideLoading()
  545. }, 200)
  546. })
  547. } else if (this.closeLeverItem == -1) {
  548. // 反向开仓
  549. } else {
  550. // 全部平仓
  551. Api_setBatchClose({
  552. type: 0,
  553. currency_id: this.currencyVal.currency_id
  554. }).then(res => {
  555. setTimeout(() => {
  556. uni.showToast({
  557. title: '平仓成功',
  558. icon: 'none'
  559. })
  560. setTimeout(() => {
  561. uni.hideToast();
  562. this.setSuccess()
  563. }, 300)
  564. }, 201)
  565. }).finally(() => {
  566. setTimeout(() => {
  567. uni.hideLoading()
  568. }, 200)
  569. })
  570. }
  571. }
  572. },
  573. adjustLever() {
  574. this.$nextTick(() => {
  575. this.$refs.leverRef.open()
  576. })
  577. },
  578. openPactPopup() {
  579. const readPactObj = this.$getStorageSync('contractReadPact');
  580. if (!readPactObj || !readPactObj.rapidPact) {
  581. this.readPact = false
  582. this.$nextTick(() => {
  583. this.$refs.hintRef.open()
  584. })
  585. }
  586. },
  587. // 提示弹框确认按钮
  588. confirmHiteBtn() {
  589. // t.readPact
  590. const readPactObj = this.$getStorageSync('contractReadPact') || {}
  591. readPactObj.rapidPact = this.readPact
  592. this.$setStorageSync('contractReadPact', readPactObj)
  593. this.$refs.hintRef.close();
  594. },
  595. // 阅读合约
  596. readPactInfo(id) {
  597. this.$readArticleInfo(id)
  598. },
  599. // 充值
  600. PayCurrency() {
  601. uni.navigateTo({
  602. url: '/pages/content/select-currency?type=recharge'
  603. })
  604. },
  605. // 获取历史
  606. getHistory() {
  607. uni.navigateTo({
  608. url: '/pages/contract/history/fast-history'
  609. })
  610. }
  611. }
  612. }
  613. </script>
  614. <style lang="scss" scoped>
  615. @import "~../sustainability/index.scss";
  616. .contract-title {
  617. padding: 5rpx $pages-padding 0;
  618. min-height: 90rpx;
  619. display: flex;
  620. align-items: center;
  621. justify-content: space-between;
  622. border-bottom: 1rpx solid $border-color;
  623. .contract-price {
  624. flex: 1;
  625. display: flex;
  626. justify-content: space-between;
  627. align-items: center;
  628. padding: 0 30rpx 0 20rpx;
  629. font-size: 28rpx;
  630. }
  631. .contract-item {
  632. flex-shrink: 0;
  633. display: flex;
  634. align-items: center;
  635. .title-iocn {
  636. width: 28rpx;
  637. height: 24rpx;
  638. display: flex;
  639. flex-direction: column;
  640. // align-items: center;
  641. justify-content: space-between;
  642. .title-iocn-item {
  643. width: 100%;
  644. height: 5rpx;
  645. border-radius: 3rpx;
  646. background: #111111;
  647. &:first-child {
  648. width: 50%;
  649. }
  650. }
  651. }
  652. .title-text {
  653. font-size: 34rpx;
  654. font-family: PingFang SC, PingFang SC-Bold;
  655. font-weight: 700;
  656. text-align: left;
  657. color: #141213;
  658. line-height: 1.2;
  659. letter-spacing: 0.74rpx;
  660. padding-left: 19rpx;
  661. }
  662. .title-ratio {
  663. font-size: 24rpx;
  664. font-family: PingFang SC, PingFang SC-Regular;
  665. font-weight: 400;
  666. color: #808080;
  667. line-height: 33rpx;
  668. }
  669. .ratio-icon {
  670. width: 31rpx;
  671. height: 33rpx;
  672. margin-left: 22rpx;
  673. }
  674. }
  675. }
  676. // <view class="lable-title">
  677. // <template v-for="(item , index) in lableList">
  678. // <text class="lable-item">{{ item }}</text>
  679. // </template>
  680. // </view>
  681. .swiper-title {
  682. padding: 0 $pages-padding;
  683. width: 100%;
  684. height: 100rpx;
  685. border-bottom: 1rpx solid $border-color;
  686. display: flex;
  687. align-items: center;
  688. justify-content: space-between;
  689. // width: 100%;
  690. // height: 100rpx;
  691. // border-bottom: 1rpx solid $border-color;
  692. // padding: 0 $pages-padding;
  693. // display: flex;
  694. // justify-content: space-between;
  695. // align-items: center;
  696. .swiper-lable {
  697. height: 100%;
  698. display: flex;
  699. align-items: center;
  700. justify-content: space-between;
  701. }
  702. .swiper-item {
  703. height: 100%;
  704. font-size: 28rpx;
  705. display: flex;
  706. align-items: center;
  707. &:nth-child(n + 2) {
  708. margin-left: 60rpx;
  709. }
  710. }
  711. .active-swiper-item {
  712. font-size: 34rpx;
  713. color: $Theme-Color;
  714. position: relative;
  715. &::before {
  716. content: '';
  717. position: absolute;
  718. left: 50%;
  719. bottom: 0;
  720. width: 30rpx;
  721. height: 5rpx;
  722. background-color: $Theme-Color;
  723. border-radius: 3rpx;
  724. transform: translateX(-50%);
  725. }
  726. }
  727. .iconfont {
  728. font-size: 30rpx;
  729. color: #878592;
  730. }
  731. }
  732. .shortcut {
  733. .shortcut-open {
  734. padding: 30rpx $pages-padding;
  735. }
  736. .shortcut-type {
  737. width: 100%;
  738. display: flex;
  739. align-items: stretch;
  740. justify-content: space-between;
  741. .type-box {
  742. flex: 1;
  743. display: flex;
  744. align-items: stretch;
  745. border-radius: 6rpx;
  746. overflow: hidden;
  747. .type-item {
  748. font-size: 24rpx;
  749. flex-shrink: 0;
  750. flex: 1;
  751. text-align: center;
  752. display: flex;
  753. align-items: center;
  754. justify-content: center;
  755. border: 1rpx solid $border-color6;
  756. color: $SizeColor;
  757. }
  758. .active-type-item {
  759. color: #fff;
  760. background-color: $Theme-Color;
  761. border: 1rpx solid $Theme-Color;
  762. }
  763. }
  764. .type-times {
  765. margin-left: 20rpx;
  766. width: 230rpx;
  767. height: 50rpx;
  768. line-height: 50rpx;
  769. border: 1rpx solid red;
  770. text-align: center;
  771. font-size: 26rpx;
  772. position: relative;
  773. color: $SizeColor;
  774. border: 1rpx solid $border-color6;
  775. border-radius: 6rpx;
  776. .iconfont {
  777. position: absolute;
  778. right: 10rpx;
  779. top: 50%;
  780. transform: translateY(-50%);
  781. font-size: 20rpx;
  782. color: $Theme-Color;
  783. }
  784. }
  785. }
  786. }
  787. .shortcut-price {
  788. width: 100%;
  789. padding-top: 60rpx;
  790. .price-box {
  791. width: 100%;
  792. height: 80rpx;
  793. border-radius: 10rpx;
  794. display: flex;
  795. justify-content: space-between;
  796. align-items: center;
  797. padding: 0 20rpx;
  798. background-color: $box-bg;
  799. font-size: 24rpx;
  800. color: $SizeColor2;
  801. .price-lable,
  802. .price-info {
  803. flex-shrink: 0;
  804. }
  805. .price-info {
  806. .price-num {
  807. color: #000;
  808. padding-right: 20rpx;
  809. }
  810. }
  811. .price-inp {
  812. flex: 1;
  813. height: 100%;
  814. padding: 0 10rpx;
  815. font-size: 24rpx;
  816. color: #000;
  817. text-align: right;
  818. }
  819. .price-inp-text {
  820. display: flex;
  821. align-items: center;
  822. justify-content: flex-end;
  823. }
  824. }
  825. .price-box+.price-box {
  826. background-color: #fff;
  827. margin-top: 20rpx;
  828. border: 1rpx solid $box-bg;
  829. }
  830. }
  831. .step-content {
  832. padding: 26rpx 0;
  833. }
  834. // <view class="shortcut-usable">
  835. // <view class="usable-info">
  836. // 可用:2927.81 USDT
  837. // </view>
  838. // <view class="usable-btn">
  839. // 充值
  840. // </view>
  841. // </view>
  842. .shortcut-usable {
  843. width: 100%;
  844. display: flex;
  845. justify-content: space-between;
  846. align-items: center;
  847. font-size: 24rpx;
  848. color: $SizeColor2;
  849. padding: 20rpx 0 40rpx;
  850. .usable-btn {
  851. color: $Theme-Color;
  852. }
  853. }
  854. // <view class="shortcut-btns">
  855. // <view class="shortcut-btn">
  856. // 买入/做多
  857. // </view>
  858. // <view class="shortcut-btn">
  859. // 卖出做空
  860. // </view>
  861. // </view>
  862. .shortcut-btns {
  863. display: flex;
  864. align-items: center;
  865. .shortcut-btn {
  866. flex: 1;
  867. height: 70rpx;
  868. line-height: 70rpx;
  869. text-align: center;
  870. font-size: 28rpx;
  871. color: #fff;
  872. background-color: $Theme-Color;
  873. &:nth-child(n + 2) {
  874. margin-left: 30rpx;
  875. background-color: $Theme-Color2;
  876. }
  877. }
  878. }
  879. .iframe-box {
  880. width: 100%;
  881. height: 50vh;
  882. }
  883. // <view class="set-stop">
  884. // <view class="stop-left">
  885. // <text>止盈/止损</text>
  886. // <text class="stop-num">{{ item.target_profit_price || '--' }}/{{ item.stop_loss_price || '--'}}</text>
  887. // <text class="iconfont">&#xe610;</text>
  888. // </view>
  889. // <view class="stop-right">
  890. // <text class="icon-size iconfont">&#xe8b0;</text>
  891. // <text class="icon-size">分享</text>
  892. // </view>
  893. // </view>
  894. .set-stop {
  895. width: 100%;
  896. display: flex;
  897. align-items: center;
  898. justify-content: space-between;
  899. font-size: 26rpx;
  900. padding: 30rpx $pages-padding 0;
  901. .stop-left {
  902. font-size: 24rpx;
  903. color: $SizeColor2;
  904. .stop-num {
  905. padding: 0 10rpx;
  906. }
  907. .iconfont {
  908. color: $Theme-Color;
  909. }
  910. }
  911. .stop-right {
  912. color: $Theme-Color;
  913. font-size: 26rpx;
  914. .iconfont {
  915. margin-right: 6rpx;
  916. }
  917. }
  918. }
  919. .account-box {
  920. width: 100%;
  921. min-height: 120rpx;
  922. display: flex;
  923. align-items: stretch;
  924. width: 100%;
  925. padding: 30rpx $pages-padding;
  926. border-bottom: 1rpx solid $border-color4;
  927. .account-item {
  928. display: flex;
  929. flex-direction: column;
  930. flex-shrink: 0;
  931. flex: 1;
  932. &:nth-child(3n) {
  933. text-align: right;
  934. }
  935. .account-title {
  936. font-size: 24rpx;
  937. font-family: PingFang SC, PingFang SC-Bold;
  938. font-weight: 600;
  939. color: #807e89;
  940. line-height: 30rpx;
  941. }
  942. .account-num {
  943. font-size: 22rpx;
  944. font-family: PingFang SC, PingFang SC-Bold;
  945. font-weight: 700;
  946. color: #1a1a1a;
  947. line-height: 33rpx;
  948. margin-top: 11rpx;
  949. }
  950. }
  951. }
  952. .set-node {
  953. width: 100%;
  954. display: flex;
  955. align-items: center;
  956. justify-content: space-between;
  957. .set-node-box {
  958. display: flex;
  959. align-items: center;
  960. }
  961. .set-node-high {
  962. font-size: 24rpx;
  963. font-family: PingFang SC, PingFang SC-Regular;
  964. font-weight: 400;
  965. color: $Theme-Color;
  966. line-height: 1.1;
  967. }
  968. .set-node-status {
  969. width: 27rpx;
  970. height: 27rpx;
  971. background: #e6e6e8;
  972. border-radius: 2rpx;
  973. }
  974. .active-set {
  975. background-color: $Theme-Color;
  976. display: flex;
  977. justify-content: center;
  978. align-items: center;
  979. .iconfont {
  980. font-size: 26rpx;
  981. color: #fff;
  982. }
  983. }
  984. .set-node-text {
  985. font-size: 24rpx;
  986. font-family: PingFang SC, PingFang SC-Regular;
  987. font-weight: 400;
  988. color: #808080;
  989. line-height: 1.1;
  990. margin-left: 14rpx;
  991. border-bottom: 2rpx dashed #707070;
  992. }
  993. }
  994. .set-profit-loss {
  995. width: 100%;
  996. // <view class="set-profit-loss-title">
  997. // <text class="title-name">止盈</text>
  998. // <view class="title-btn">
  999. // <text class="iconfont">&#xe672;</text>
  1000. // <text>按价格设置</text>
  1001. // </view>
  1002. // </view>
  1003. .set-profit-loss-title {
  1004. width: 100%;
  1005. display: flex;
  1006. align-items: center;
  1007. justify-content: space-between;
  1008. font-size: 26rpx;
  1009. padding: 30rpx 0;
  1010. .title-btn {
  1011. .iconfont {
  1012. font-size: 20rpx;
  1013. color: $Theme-Color;
  1014. margin-right: 4px;
  1015. }
  1016. }
  1017. }
  1018. .profit-loss-input {
  1019. width: 100%;
  1020. height: 76rpx;
  1021. border-radius: 8rpx;
  1022. display: flex;
  1023. justify-content: space-between;
  1024. align-items: center;
  1025. border: 1rpx solid $border-color6;
  1026. padding: 0 20rpx;
  1027. font-size: 24rpx;
  1028. text {
  1029. flex-shrink: 0;
  1030. color: $SizeColor3;
  1031. }
  1032. .input-item {
  1033. flex: 1;
  1034. height: 100%;
  1035. font-size: 24rpx;
  1036. text-align: right;
  1037. padding: 0 16rpx;
  1038. }
  1039. }
  1040. }
  1041. </style>