index.vue 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154
  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 , 1) }}%</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. },
  497. setInversion() {
  498. this.closeLeverItem = -1;
  499. this.unopenSolt = {
  500. title: '反向开仓',
  501. closeLeverContent: '如果存在平仓挂单(限价止盈止损),将会在全平前被撤单,确定反向开仓吗?',
  502. }
  503. this.setDepot();
  504. },
  505. setCloseLeverAll() {
  506. this.closeLeverItem = null;
  507. this.unopenSolt = {
  508. title: '全部平仓',
  509. closeLeverContent: '如果存在平仓挂单(限价止盈止损),将会在全平前被撤单,确定全部平仓吗?',
  510. }
  511. this.setDepot();
  512. // this.setDepot();
  513. // this.title = '全部平仓';
  514. // this.closeLeverContent = '';
  515. // this.closeLeverItem = null;
  516. // this.$refs.unopenRef.open();
  517. },
  518. // 平仓 - 反向开仓
  519. setDepot() {
  520. this.$nextTick(() => {
  521. this.$refs.unopenRef.open()
  522. })
  523. },
  524. confirm() {
  525. if (this.myFast.length > 0) {
  526. if (this.closeLeverItem && this.closeLeverItem !== -1) {
  527. // 平仓
  528. Api_setCloseLever({
  529. id: this.closeLeverItem.id
  530. }).then(res => {
  531. setTimeout(() => {
  532. uni.showToast({
  533. title: '平仓成功',
  534. icon: 'none'
  535. })
  536. setTimeout(() => {
  537. uni.hideToast();
  538. this.setSuccess()
  539. }, 300)
  540. }, 201)
  541. }).finally(() => {
  542. setTimeout(() => {
  543. uni.hideLoading()
  544. }, 200)
  545. })
  546. } else if (this.closeLeverItem == -1) {
  547. // 反向开仓
  548. } else {
  549. // 全部平仓
  550. Api_setBatchClose({
  551. type: 0,
  552. currency_id: this.currencyVal.currency_id
  553. }).then(res => {
  554. setTimeout(() => {
  555. uni.showToast({
  556. title: '平仓成功',
  557. icon: 'none'
  558. })
  559. setTimeout(() => {
  560. uni.hideToast();
  561. this.setSuccess()
  562. }, 300)
  563. }, 201)
  564. }).finally(() => {
  565. setTimeout(() => {
  566. uni.hideLoading()
  567. }, 200)
  568. })
  569. }
  570. }
  571. },
  572. adjustLever() {
  573. this.$nextTick(() => {
  574. this.$refs.leverRef.open()
  575. })
  576. },
  577. openPactPopup() {
  578. const readPactObj = this.$getStorageSync('contractReadPact');
  579. if (!readPactObj || !readPactObj.rapidPact) {
  580. this.readPact = false
  581. this.$nextTick(() => {
  582. this.$refs.hintRef.open()
  583. })
  584. }
  585. },
  586. // 提示弹框确认按钮
  587. confirmHiteBtn() {
  588. // t.readPact
  589. const readPactObj = this.$getStorageSync('contractReadPact') || {}
  590. readPactObj.rapidPact = this.readPact
  591. this.$setStorageSync('contractReadPact', readPactObj)
  592. this.$refs.hintRef.close();
  593. },
  594. // 阅读合约
  595. readPactInfo(id) {
  596. this.$readArticleInfo(id)
  597. },
  598. // 充值
  599. PayCurrency() {
  600. uni.navigateTo({
  601. url: '/pages/content/select-currency?type=recharge'
  602. })
  603. },
  604. // 获取历史
  605. getHistory() {
  606. uni.navigateTo({
  607. url: '/pages/contract/history/fast-history'
  608. })
  609. }
  610. }
  611. }
  612. </script>
  613. <style lang="scss" scoped>
  614. @import "~../sustainability/index.scss";
  615. .contract-title {
  616. padding: 5rpx $pages-padding 0;
  617. min-height: 90rpx;
  618. display: flex;
  619. align-items: center;
  620. justify-content: space-between;
  621. border-bottom: 1rpx solid $border-color;
  622. .contract-price {
  623. flex: 1;
  624. display: flex;
  625. justify-content: space-between;
  626. align-items: center;
  627. padding: 0 30rpx 0 20rpx;
  628. font-size: 28rpx;
  629. }
  630. .contract-item {
  631. flex-shrink: 0;
  632. display: flex;
  633. align-items: center;
  634. .title-iocn {
  635. width: 28rpx;
  636. height: 24rpx;
  637. display: flex;
  638. flex-direction: column;
  639. // align-items: center;
  640. justify-content: space-between;
  641. .title-iocn-item {
  642. width: 100%;
  643. height: 5rpx;
  644. border-radius: 3rpx;
  645. background: #111111;
  646. &:first-child {
  647. width: 50%;
  648. }
  649. }
  650. }
  651. .title-text {
  652. font-size: 34rpx;
  653. font-family: PingFang SC, PingFang SC-Bold;
  654. font-weight: 700;
  655. text-align: left;
  656. color: #141213;
  657. line-height: 1.2;
  658. letter-spacing: 0.74rpx;
  659. padding-left: 19rpx;
  660. }
  661. .title-ratio {
  662. font-size: 24rpx;
  663. font-family: PingFang SC, PingFang SC-Regular;
  664. font-weight: 400;
  665. color: #808080;
  666. line-height: 33rpx;
  667. }
  668. .ratio-icon {
  669. width: 31rpx;
  670. height: 33rpx;
  671. margin-left: 22rpx;
  672. }
  673. }
  674. }
  675. // <view class="lable-title">
  676. // <template v-for="(item , index) in lableList">
  677. // <text class="lable-item">{{ item }}</text>
  678. // </template>
  679. // </view>
  680. .swiper-title {
  681. padding: 0 $pages-padding;
  682. width: 100%;
  683. height: 100rpx;
  684. border-bottom: 1rpx solid $border-color;
  685. display: flex;
  686. align-items: center;
  687. justify-content: space-between;
  688. // width: 100%;
  689. // height: 100rpx;
  690. // border-bottom: 1rpx solid $border-color;
  691. // padding: 0 $pages-padding;
  692. // display: flex;
  693. // justify-content: space-between;
  694. // align-items: center;
  695. .swiper-lable {
  696. height: 100%;
  697. display: flex;
  698. align-items: center;
  699. justify-content: space-between;
  700. }
  701. .swiper-item {
  702. height: 100%;
  703. font-size: 28rpx;
  704. display: flex;
  705. align-items: center;
  706. &:nth-child(n + 2) {
  707. margin-left: 60rpx;
  708. }
  709. }
  710. .active-swiper-item {
  711. font-size: 34rpx;
  712. color: $Theme-Color;
  713. position: relative;
  714. &::before {
  715. content: '';
  716. position: absolute;
  717. left: 50%;
  718. bottom: 0;
  719. width: 30rpx;
  720. height: 5rpx;
  721. background-color: $Theme-Color;
  722. border-radius: 3rpx;
  723. transform: translateX(-50%);
  724. }
  725. }
  726. .iconfont {
  727. font-size: 30rpx;
  728. color: #878592;
  729. }
  730. }
  731. .shortcut {
  732. .shortcut-open {
  733. padding: 30rpx $pages-padding;
  734. }
  735. .shortcut-type {
  736. width: 100%;
  737. display: flex;
  738. align-items: stretch;
  739. justify-content: space-between;
  740. .type-box {
  741. flex: 1;
  742. display: flex;
  743. align-items: stretch;
  744. border-radius: 6rpx;
  745. overflow: hidden;
  746. .type-item {
  747. font-size: 24rpx;
  748. flex-shrink: 0;
  749. flex: 1;
  750. text-align: center;
  751. display: flex;
  752. align-items: center;
  753. justify-content: center;
  754. border: 1rpx solid $border-color6;
  755. color: $SizeColor;
  756. }
  757. .active-type-item {
  758. color: #fff;
  759. background-color: $Theme-Color;
  760. border: 1rpx solid $Theme-Color;
  761. }
  762. }
  763. .type-times {
  764. margin-left: 20rpx;
  765. width: 230rpx;
  766. height: 50rpx;
  767. line-height: 50rpx;
  768. border: 1rpx solid red;
  769. text-align: center;
  770. font-size: 26rpx;
  771. position: relative;
  772. color: $SizeColor;
  773. border: 1rpx solid $border-color6;
  774. border-radius: 6rpx;
  775. .iconfont {
  776. position: absolute;
  777. right: 10rpx;
  778. top: 50%;
  779. transform: translateY(-50%);
  780. font-size: 20rpx;
  781. color: $Theme-Color;
  782. }
  783. }
  784. }
  785. }
  786. .shortcut-price {
  787. width: 100%;
  788. padding-top: 60rpx;
  789. .price-box {
  790. width: 100%;
  791. height: 80rpx;
  792. border-radius: 10rpx;
  793. display: flex;
  794. justify-content: space-between;
  795. align-items: center;
  796. padding: 0 20rpx;
  797. background-color: $box-bg;
  798. font-size: 24rpx;
  799. color: $SizeColor2;
  800. .price-lable,
  801. .price-info {
  802. flex-shrink: 0;
  803. }
  804. .price-info {
  805. .price-num {
  806. color: #000;
  807. padding-right: 20rpx;
  808. }
  809. }
  810. .price-inp {
  811. flex: 1;
  812. height: 100%;
  813. padding: 0 10rpx;
  814. font-size: 24rpx;
  815. color: #000;
  816. text-align: right;
  817. }
  818. .price-inp-text {
  819. display: flex;
  820. align-items: center;
  821. justify-content: flex-end;
  822. }
  823. }
  824. .price-box+.price-box {
  825. background-color: #fff;
  826. margin-top: 20rpx;
  827. border: 1rpx solid $box-bg;
  828. }
  829. }
  830. .step-content {
  831. padding: 26rpx 0;
  832. }
  833. // <view class="shortcut-usable">
  834. // <view class="usable-info">
  835. // 可用:2927.81 USDT
  836. // </view>
  837. // <view class="usable-btn">
  838. // 充值
  839. // </view>
  840. // </view>
  841. .shortcut-usable {
  842. width: 100%;
  843. display: flex;
  844. justify-content: space-between;
  845. align-items: center;
  846. font-size: 24rpx;
  847. color: $SizeColor2;
  848. padding: 20rpx 0 40rpx;
  849. .usable-btn {
  850. color: $Theme-Color;
  851. }
  852. }
  853. // <view class="shortcut-btns">
  854. // <view class="shortcut-btn">
  855. // 买入/做多
  856. // </view>
  857. // <view class="shortcut-btn">
  858. // 卖出做空
  859. // </view>
  860. // </view>
  861. .shortcut-btns {
  862. display: flex;
  863. align-items: center;
  864. .shortcut-btn {
  865. flex: 1;
  866. height: 70rpx;
  867. line-height: 70rpx;
  868. text-align: center;
  869. font-size: 28rpx;
  870. color: #fff;
  871. background-color: $Theme-Color;
  872. &:nth-child(n + 2) {
  873. margin-left: 30rpx;
  874. background-color: $Theme-Color2;
  875. }
  876. }
  877. }
  878. .iframe-box {
  879. width: 100%;
  880. height: 50vh;
  881. }
  882. // <view class="set-stop">
  883. // <view class="stop-left">
  884. // <text>止盈/止损</text>
  885. // <text class="stop-num">{{ item.target_profit_price || '--' }}/{{ item.stop_loss_price || '--'}}</text>
  886. // <text class="iconfont">&#xe610;</text>
  887. // </view>
  888. // <view class="stop-right">
  889. // <text class="icon-size iconfont">&#xe8b0;</text>
  890. // <text class="icon-size">分享</text>
  891. // </view>
  892. // </view>
  893. .set-stop {
  894. width: 100%;
  895. display: flex;
  896. align-items: center;
  897. justify-content: space-between;
  898. font-size: 26rpx;
  899. padding: 30rpx $pages-padding 0;
  900. .stop-left {
  901. font-size: 24rpx;
  902. color: $SizeColor2;
  903. .stop-num {
  904. padding: 0 10rpx;
  905. }
  906. .iconfont {
  907. color: $Theme-Color;
  908. }
  909. }
  910. .stop-right {
  911. color: $Theme-Color;
  912. font-size: 26rpx;
  913. .iconfont {
  914. margin-right: 6rpx;
  915. }
  916. }
  917. }
  918. .account-box {
  919. width: 100%;
  920. min-height: 120rpx;
  921. display: flex;
  922. align-items: stretch;
  923. width: 100%;
  924. padding: 30rpx $pages-padding;
  925. border-bottom: 1rpx solid $border-color4;
  926. .account-item {
  927. display: flex;
  928. flex-direction: column;
  929. flex-shrink: 0;
  930. flex: 1;
  931. &:nth-child(3n) {
  932. text-align: right;
  933. }
  934. .account-title {
  935. font-size: 24rpx;
  936. font-family: PingFang SC, PingFang SC-Bold;
  937. font-weight: 600;
  938. color: #807e89;
  939. line-height: 30rpx;
  940. }
  941. .account-num {
  942. font-size: 22rpx;
  943. font-family: PingFang SC, PingFang SC-Bold;
  944. font-weight: 700;
  945. color: #1a1a1a;
  946. line-height: 33rpx;
  947. margin-top: 11rpx;
  948. }
  949. }
  950. }
  951. .set-node {
  952. width: 100%;
  953. display: flex;
  954. align-items: center;
  955. justify-content: space-between;
  956. .set-node-box {
  957. display: flex;
  958. align-items: center;
  959. }
  960. .set-node-high {
  961. font-size: 24rpx;
  962. font-family: PingFang SC, PingFang SC-Regular;
  963. font-weight: 400;
  964. color: $Theme-Color;
  965. line-height: 1.1;
  966. }
  967. .set-node-status {
  968. width: 27rpx;
  969. height: 27rpx;
  970. background: #e6e6e8;
  971. border-radius: 2rpx;
  972. }
  973. .active-set {
  974. background-color: $Theme-Color;
  975. display: flex;
  976. justify-content: center;
  977. align-items: center;
  978. .iconfont {
  979. font-size: 26rpx;
  980. color: #fff;
  981. }
  982. }
  983. .set-node-text {
  984. font-size: 24rpx;
  985. font-family: PingFang SC, PingFang SC-Regular;
  986. font-weight: 400;
  987. color: #808080;
  988. line-height: 1.1;
  989. margin-left: 14rpx;
  990. border-bottom: 2rpx dashed #707070;
  991. }
  992. }
  993. .set-profit-loss {
  994. width: 100%;
  995. // <view class="set-profit-loss-title">
  996. // <text class="title-name">止盈</text>
  997. // <view class="title-btn">
  998. // <text class="iconfont">&#xe672;</text>
  999. // <text>按价格设置</text>
  1000. // </view>
  1001. // </view>
  1002. .set-profit-loss-title {
  1003. width: 100%;
  1004. display: flex;
  1005. align-items: center;
  1006. justify-content: space-between;
  1007. font-size: 26rpx;
  1008. padding: 30rpx 0;
  1009. .title-btn {
  1010. .iconfont {
  1011. font-size: 20rpx;
  1012. color: $Theme-Color;
  1013. margin-right: 4px;
  1014. }
  1015. }
  1016. }
  1017. .profit-loss-input {
  1018. width: 100%;
  1019. height: 76rpx;
  1020. border-radius: 8rpx;
  1021. display: flex;
  1022. justify-content: space-between;
  1023. align-items: center;
  1024. border: 1rpx solid $border-color6;
  1025. padding: 0 20rpx;
  1026. font-size: 24rpx;
  1027. text {
  1028. flex-shrink: 0;
  1029. color: $SizeColor3;
  1030. }
  1031. .input-item {
  1032. flex: 1;
  1033. height: 100%;
  1034. font-size: 24rpx;
  1035. text-align: right;
  1036. padding: 0 16rpx;
  1037. }
  1038. }
  1039. }
  1040. </style>