history.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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*1}}</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: 10,
  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(res => {
  59. let list = res.data.list.map((res)=>{
  60. if(res.result){
  61. let arr = [];
  62. const ar =res.result.split(",")
  63. console.log(ar,'ar');
  64. for (let i = 0; i < ar.length; i++) {
  65. const s = ar[i].split(':');
  66. arr.push({
  67. type:s[0],
  68. value:s[1]
  69. })
  70. }
  71. res.arr = arr;
  72. }
  73. return res
  74. })
  75. that.list = that.list.concat(list)
  76. that.page++
  77. console.log('11111111', that.list);
  78. if (list.length == that.limit) {
  79. that.loadingType = 'more'
  80. } else {
  81. that.loadingType = 'noMore'
  82. }
  83. that.loaded = true
  84. })
  85. }
  86. },
  87. };
  88. </script>
  89. <style lang="scss">
  90. .list {
  91. line-height: 1;
  92. border-bottom: 1px solid $border-color-light;
  93. .le {
  94. font-weight: bold;
  95. .qs {
  96. font-size: 20rpx;
  97. color: #ffffff;
  98. }
  99. .dy {
  100. font-size: 46rpx;
  101. color: #fdb242;
  102. }
  103. }
  104. .ri {
  105. .sx {
  106. padding-left: 10rpx;
  107. font-size: 30rpx;
  108. font-weight: bold;
  109. color: #df5660;
  110. &.green{
  111. color: $color-green;
  112. }
  113. }
  114. }
  115. }
  116. </style>