buy-option.vue 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view>
  3. <view class="time-box">
  4. <table class="w-max color-light fn-sm">
  5. <tr>
  6. <td class="p-l-md p-y-xs">{{$t('option.a8')}}:{{$date(current_scene.begin_time_text)}}</td>
  7. <td>{{current_scene.status_text}}</td>
  8. <td class="p-r-md">
  9. <view class="d-flex justify-end align-center">
  10. <van-icon name="clock-o m-r-xs" />
  11. <van-count-down
  12. @finish="$emit('change-venue')"
  13. :time="current_scene.lottery_time*1000"
  14. />
  15. </view>
  16. </td>
  17. </tr>
  18. <tr class="bg-panel-3">
  19. <td class="p-l-md p-y-xs">{{$t('option.a9')}}:{{$date(next_scene.begin_time_text)}}</td>
  20. <td>
  21. <van-tag plain type="success">{{next_scene.status_text}}</van-tag>
  22. </td>
  23. <td class="p-r-md">
  24. <view class="d-flex justify-end align-center">
  25. <van-icon name="clock-o m-r-xs" />
  26. <van-count-down @finish="$emit('change-venue')" :time="next_scene.lottery_time*1000" />
  27. </view>
  28. </td>
  29. </tr>
  30. </table>
  31. </view>
  32. <view class="bg-panel-3 p-b-lg">
  33. <!-- <view class="porgress">
  34. <view class="m-x-md p-y-xs">
  35. <view
  36. class="h-14 bg-panel-4 rounded-lg overflow-hidden d-flex justify-between fn-14 color-gray-1"
  37. >
  38. <view class="h-max bg-buy rounded-lg p-l-xs transition-default d-flex align-center" :style="{width:socketData.trend_up*100+'%'}">&emsp;{{multiple(socketData.trend_up,100,2)}}%</view>
  39. <view class="p-r-xs d-flex align-center">{{multiple(socketData.trend_down,100,2)}}%</view>
  40. </view>
  41. </view>
  42. </view> -->
  43. <view class="btn-group d-flex p-x-md p-y-xs">
  44. <v-button type="green" block class="flex-fill rounded-xs btn" @click="$emit('buy-show',1)">{{$t('option.a2')}}</v-button>
  45. <button class="m-x-md flat btn border-original-0" @click="$emit('buy-show',2)">{{$t('option.b0')}}</button>
  46. <v-button type="red" block class="flex-fill rounded-xs btn" @click="$emit('buy-show',3)">{{$t('option.a3')}}</v-button>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. import math from "@/utils/class/math";
  53. import { mapState } from "vuex";
  54. export default {
  55. props: ["currentAndNext","query"],
  56. data() {
  57. return {
  58. detail: {},
  59. isAjax: false,
  60. socketData: {},
  61. };
  62. },
  63. computed: {
  64. current_scene() {
  65. return this.currentAndNext.current_scene || {};
  66. },
  67. next_scene() {
  68. return this.currentAndNext.next_scene || {};
  69. },
  70. ...mapState({
  71. ws: "ws",
  72. }),
  73. },
  74. methods: {
  75. multiple: math.multiple,
  76. },
  77. created() {
  78. this.ws.on("message", (res) => {
  79. let { data, sub } = res;
  80. if (sub == "sceneListNewPrice") {
  81. if (data.pair_time_name == this.query.pair_time_name) {
  82. this.socketData = data;
  83. }
  84. }
  85. });
  86. },
  87. };
  88. </script>
  89. <style lang="scss" scoped>
  90. .flat {
  91. border-radius: 50%;
  92. background: rgba($blue, 0.1);
  93. color: $blue;
  94. width: 45px;
  95. height: 45px;
  96. padding:0;
  97. }
  98. </style>