option-nav-list.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div class="p-md">
  3. <view :style="{height:taskHeight+'px'}"></view>
  4. <div class="title fn-22 color-light">Option</div>
  5. <div class="group">
  6. <table class="w-max">
  7. <thead>
  8. <tr class="fn-sm">
  9. <th class="fn-left">{{$t('option.a0')}}</th>
  10. <th>{{$t('option.e4')}}</th>
  11. <th class="fn-right">{{$t('option.a1')}}</th>
  12. </tr>
  13. </thead>
  14. <template v-for="parentItem in list">
  15. <thead :key="parentItem.guessPairsName">
  16. <tr>
  17. <th colspan="3" class="fn-left color-light p-y-md">
  18. <div class="d-inline-block h-10 w-4 bg-danger"></div>
  19. {{parentItem.guessPairsName}}
  20. </th>
  21. </tr>
  22. </thead>
  23. <tbody :key="parentItem.guessPairsName+'1'">
  24. <tr v-for="item in parentItem.scenePairList" :key="item.pair_time_name" class="link-active" @click="$emit('check',item);$emit('close')">
  25. <td class="color-light">
  26. {{item.pair_time_name|coinText}}
  27. </td>
  28. <td>
  29. <span :class="item.increase>=0?'color-buy':'color-sell'">{{item.increaseStr}}</span>
  30. </td>
  31. <td class="fn-right">
  32. <van-count-down :time="item.seconds*1000">
  33. </van-count-down>
  34. </td>
  35. </tr>
  36. </tbody>
  37. </template>
  38. </table>
  39. </div>
  40. </div>
  41. </template>
  42. <script>
  43. import Option from '@/api/option'
  44. import { mapState } from "vuex";
  45. export default {
  46. data(){
  47. return {
  48. list:[],
  49. taskHeight:0
  50. }
  51. },
  52. filters:{
  53. coinText(str){
  54. return str.replace('/USDT','').replace('-','·')
  55. }
  56. },
  57. computed:{
  58. ...mapState({
  59. ws:'ws'
  60. })
  61. },
  62. methods:{
  63. // 获取交易对
  64. sceneListByPairs(){
  65. Option.sceneListByPairs().then(res=>{
  66. this.list = res.data
  67. })
  68. }
  69. },
  70. created(){
  71. this.sceneListByPairs()
  72. uni.getSystemInfo({
  73. success:(obj)=>{
  74. this.taskHeight = obj.statusBarHeight
  75. }
  76. })
  77. }
  78. }
  79. </script>