history.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view class="all padding-v-30 padding-c-30">
  3. <view class="list padding-v-10 flex" v-for="(item,ind) in list" :key="ind">
  4. <view class="le">
  5. <view class="qs padding-b-10">{{$t('set.a7')}}{{item.no}}{{$t('set.a8')}}</view>
  6. <view class="dy padding-b-10" v-if="item.result_info">{{item.result_info.c}}</view>
  7. <view class="dy padding-b-10" v-else>{{ $t("enter.a2") }}</view>
  8. </view>
  9. <view class="ri flex" v-if="item.result">
  10. <template v-for="it in item.arr " v-if="it.value==1">
  11. <view class="sx green" v-if="it.type==1">{{ $t("enter.u6") }}</view>
  12. <view class="sx green" v-if="it.type==3">{{ $t("enter.u5") }}</view>
  13. <view class="sx " v-if="it.type==2">{{ $t("enter.u4") }}</view>
  14. <view class="sx" v-if="it.type==4">{{ $t("enter.u7") }}</view>
  15. </template>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import {
  22. getGame
  23. } from "@/api/game.js";
  24. import empty from '@/components/empty';
  25. export default {
  26. components: {
  27. empty
  28. },
  29. data() {
  30. return {
  31. id: '',
  32. page: 1,
  33. limit: 20,
  34. loadingType: 'more',
  35. loaded: false,
  36. list: []
  37. }
  38. },
  39. onLoad(option) {
  40. this.id = option.id;
  41. this.gameBetList()
  42. uni.setNavigationBarTitle({
  43. title: this.$t("tab.a2"),
  44. });
  45. },
  46. onReachBottom() {
  47. this.gameBetList()
  48. },
  49. methods: {
  50. gameBetList() {
  51. let that = this
  52. if (that.loadingType == 'loading' || that.loadingType == 'noMore') {
  53. return
  54. }
  55. getGame({
  56. page: that.page,
  57. limit: that.limit,
  58. },that.id).then(({data}) => {
  59. let list = data.list.map((res)=>{
  60. if(res.result_info){
  61. res.result_info.c = (Number(res.result_info.c).toFixed(data.game.decimal))
  62. }
  63. if(res.result){
  64. let arr = [];
  65. const ar =res.result.split(",")
  66. console.log(ar,'ar');
  67. for (let i = 0; i < ar.length; i++) {
  68. const s = ar[i].split(':');
  69. arr.push({
  70. type:s[0],
  71. value:s[1]
  72. })
  73. }
  74. res.arr = arr;
  75. }
  76. return res
  77. })
  78. that.list = that.list.concat(list)
  79. that.page++
  80. console.log('11111111', that.list);
  81. if (list.length == that.limit) {
  82. that.loadingType = 'more'
  83. } else {
  84. that.loadingType = 'noMore'
  85. }
  86. that.loaded = true
  87. })
  88. }
  89. },
  90. };
  91. </script>
  92. <style lang="scss">
  93. .list {
  94. line-height: 1;
  95. border-bottom: 1px solid $border-color-light;
  96. .le {
  97. font-weight: bold;
  98. .qs {
  99. font-size: 20rpx;
  100. color: #ffffff;
  101. }
  102. .dy {
  103. font-size: 46rpx;
  104. color: #fdb242;
  105. }
  106. }
  107. .ri {
  108. .sx {
  109. padding-left: 10rpx;
  110. font-size: 30rpx;
  111. font-weight: bold;
  112. color: #df5660;
  113. &.green{
  114. color: $color-green;
  115. }
  116. }
  117. }
  118. }
  119. </style>