index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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. <iframe
  24. :src="`https://doc.okenx.com/biking/kline.html?legal_id=${currencyVal.legal_id}&currency_id=${currencyVal.currency_id}&symbol=${currencyVal.currency_name}/${currencyVal.legal_name}`"
  25. frameborder="0"></iframe>
  26. </template>
  27. </view>
  28. <gap />
  29. <drawer ref="drawerRef" />
  30. <restrictPopup ref="restrictRef" @setSuccess="setSuccess" />
  31. <lever ref="leverRef" :leverNum.sync="multiple" :leverName.sync="leverName" />
  32. <unopen ref="placeOrderRef" @confirm="confirmPlaceOrder" title="下单确认" cancelBtn content="确定要下单吗?" />
  33. <unopen ref="unopenRef" @confirm="confirm" textAlign="left" :title="unopenSolt.title" cancelBtn
  34. :content="unopenSolt.closeLeverContent" />
  35. <popupHint ref="hintRef" title="赠金交易">
  36. <template #hintContent>
  37. <view class="">
  38. 赠金交易是BiKing交易所的赠品交易系统,交易盈利部分可实时划转至合约钱包。
  39. </view>
  40. <view class="">
  41. 赠金获取方式:
  42. </view>
  43. <view class="content-list">
  44. <text>1. 完成任务中心的各项任务</text>
  45. <text>2. 参与平台活动</text>
  46. <text>3. 不定期新老用户赠金空投</text>
  47. </view>
  48. <view class="">
  49. 更多内容请点击<text class="explain">《赠金交易》</text>
  50. </view>
  51. <view class="hite-box" @click.stop="readPact = !readPact">
  52. <text class="box">
  53. <text v-show="readPact" class="iconfont2">&#xe6c5;</text>
  54. </text>
  55. <text>不在提示</text>
  56. </view>
  57. <view class="confirm-btn" @click.stop="confirmHiteBtn">
  58. 确定
  59. </view>
  60. </template>
  61. </popupHint>
  62. </view>
  63. </template>
  64. <script>
  65. import {
  66. mapGetters
  67. } from 'vuex'
  68. import {
  69. Api_setSubmitLever,
  70. Api_getLeverDeal,
  71. Api_getRegister,
  72. Api_setBatchClose,
  73. Api_setCloseLever
  74. } from "@/api/index.js"
  75. import lever from "../sustainability/lever.vue"
  76. import drawer from "./../modules/drawer.vue"
  77. import popupHint from "../modules/popup-hint.vue"
  78. import {
  79. startWebSocket
  80. } from "@/utils/websock.js"
  81. import restrictPopup from "./../modules/restrict.vue"
  82. export default {
  83. name: 'shortcut',
  84. components: {
  85. lever,
  86. drawer,
  87. restrictPopup,
  88. popupHint
  89. },
  90. data() {
  91. return {
  92. readPact: false,
  93. closeLeverItem: null,
  94. lableList: [
  95. '开仓',
  96. '当前持仓'
  97. ],
  98. lableIndex: 1,
  99. leverName: '逐仓',
  100. multiple: 100, // 逐仓倍数
  101. caution_money: '',
  102. status: 1, // 状态,填1. 1市价交易,为0则是挂单交易
  103. scrollHeight: 0,
  104. unopenSolt: {
  105. title: '',
  106. content: ''
  107. }
  108. };
  109. },
  110. props: {
  111. leverTransaction: {
  112. type: Array,
  113. default: () => {
  114. return []
  115. }
  116. },
  117. pagesInfo: {
  118. type: Object,
  119. default: () => {
  120. return {}
  121. }
  122. }
  123. },
  124. computed: {
  125. ...mapGetters([
  126. 'currencyVal',
  127. 'daymarket',
  128. 'stocksColor',
  129. 'PageContentHeight',
  130. 'tabBarHeight'
  131. ]),
  132. },
  133. mounted() {
  134. // startWebSocket()
  135. },
  136. watch: {
  137. currencyVal: {
  138. handler(newCurrency) {
  139. if (newCurrency && newCurrency?.legal_id) {
  140. }
  141. },
  142. deep: true,
  143. immediate: true
  144. },
  145. PageContentHeight: {
  146. handler(newHeigth) {
  147. if (newHeigth) {
  148. this.scrollHeight = newHeigth - uni.upx2px(100) - this.tabBarHeight;
  149. }
  150. },
  151. deep: true,
  152. immediate: true
  153. },
  154. },
  155. created() {
  156. // this.openPactPopup()
  157. },
  158. methods: {
  159. openDrawer() {
  160. this.$nextTick(() => {
  161. this.$refs.drawerRef.open();
  162. })
  163. },
  164. openPactPopup() {
  165. const readPactObj = this.$getStorageSync('contractReadPact');
  166. if (readPactObj && !readPactObj.capitalPact) {
  167. this.readPact = false
  168. this.$nextTick(() => {
  169. this.$refs.hintRef.open()
  170. })
  171. }
  172. },
  173. // 提示弹框确认按钮
  174. confirmHiteBtn() {
  175. // t.readPact
  176. const readPactObj = this.$getStorageSync('contractReadPact') || {}
  177. readPactObj.capitalPact = this.readPact
  178. this.$setStorageSync('contractReadPact', readPactObj)
  179. this.$refs.hintRef.close();
  180. },
  181. // 阅读合约
  182. readPactInfo(id){
  183. this.$readArticleInfo(id)
  184. }
  185. }
  186. }
  187. </script>
  188. <style lang="scss" scoped>
  189. @import "~../sustainability/index.scss";
  190. .contract-title {
  191. padding: 5rpx $pages-padding 0;
  192. min-height: 90rpx;
  193. display: flex;
  194. align-items: center;
  195. justify-content: space-between;
  196. border-bottom: 1rpx solid $border-color;
  197. .contract-price {
  198. flex: 1;
  199. display: flex;
  200. justify-content: space-between;
  201. align-items: center;
  202. padding: 0 30rpx 0 20rpx;
  203. font-size: 28rpx;
  204. }
  205. .contract-item {
  206. flex-shrink: 0;
  207. display: flex;
  208. align-items: center;
  209. .title-iocn {
  210. width: 28rpx;
  211. height: 24rpx;
  212. display: flex;
  213. flex-direction: column;
  214. // align-items: center;
  215. justify-content: space-between;
  216. .title-iocn-item {
  217. width: 100%;
  218. height: 5rpx;
  219. border-radius: 3rpx;
  220. background: #111111;
  221. &:first-child {
  222. width: 50%;
  223. }
  224. }
  225. }
  226. .title-text {
  227. font-size: 34rpx;
  228. font-family: PingFang SC, PingFang SC-Bold;
  229. font-weight: 700;
  230. text-align: left;
  231. color: #141213;
  232. line-height: 1.2;
  233. letter-spacing: 0.74rpx;
  234. padding-left: 19rpx;
  235. }
  236. .title-ratio {
  237. font-size: 24rpx;
  238. font-family: PingFang SC, PingFang SC-Regular;
  239. font-weight: 400;
  240. color: #808080;
  241. line-height: 33rpx;
  242. }
  243. .ratio-icon {
  244. width: 31rpx;
  245. height: 33rpx;
  246. margin-left: 22rpx;
  247. }
  248. }
  249. }
  250. .iframe-box {
  251. width: 100%;
  252. height: 60vh;
  253. iframe {
  254. width: 100%;
  255. height: 100%;
  256. }
  257. }
  258. </style>