index.vue 5.9 KB

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