You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

149 lines
3.3 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="winningRecord bx">
  3. <navbar :leftClick="leftClick" :title="$t('page.winningRecord.title')"></navbar>
  4. <view v-if="turntableRecord.length > 0" class="winningRecord-list">
  5. <view v-for="item in turntableRecord" :key="item.id" class="winningRecord-item">
  6. <view class="winningRecord-item-left">
  7. <image src="@/static/winningRecord/gift.png" mode="aspectFit"></image>
  8. <view class="detail">
  9. <view class="title">{{ $t(`page.winningRecord.${getTurntableDetail(item.bigId,'name')}`) }}</view>
  10. <view class="money">{{ $t('page.winningRecord.money') }}:{{ getTurntableDetail(item.bigId,'money') }}</view>
  11. </view>
  12. </view>
  13. <view class="winningRecord-item-right">
  14. {{ item.createTime}}
  15. </view>
  16. </view>
  17. </view>
  18. <!-- 无粉丝 -->
  19. <view v-else class="noFans">{{ $t('page.winningRecord.noPrizesHaveBeenWon') }}</view>
  20. </view>
  21. </template>
  22. <script>
  23. import navbar from '@/components/base/m-navbar.vue'
  24. export default {
  25. components : { navbar },
  26. data(){
  27. return {
  28. winningRecordList : [],
  29. turntableRecord : []
  30. }
  31. },
  32. onShow(){
  33. this.getTurntable()
  34. },
  35. methods: {
  36. leftClick() {
  37. uni.navigateTo({
  38. url: '/pages/home/home'
  39. })
  40. },
  41. //大转盘记录
  42. getTurntableRecord(){
  43. this.request('getTurntableRecord').then(res => {
  44. if (res.code == 200) {
  45. this.turntableRecord = res.result
  46. }
  47. })
  48. },
  49. //获取大转盘列表
  50. getTurntable(){
  51. this.request('getTurntableList').then(res => {
  52. if(res.code == 200){
  53. this.winningRecordList = res.result
  54. this.getTurntableRecord()
  55. }
  56. })
  57. },
  58. //获取中奖详情
  59. getTurntableDetail(id, key) {
  60. const item = this.winningRecordList.find(item => item.id === id);
  61. return item ? item[key] : {}; // 如果没有找到,可以返回一个默认值
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. .winningRecord{
  68. width: 750rpx;
  69. min-height: 100vh;
  70. // background-color: black;
  71. margin: 0 auto;
  72. background-size: 100%;
  73. background-repeat: no-repeat;
  74. color: $uni-text-color;
  75. .winningRecord-list{
  76. width: 96%;
  77. margin: 0rpx auto;
  78. margin-top: 20rpx;
  79. .winningRecord-item{
  80. background: $uni-bg-color-app;
  81. color: $uni-text-color-inverse;
  82. padding: 10rpx 20rpx;
  83. border-radius: 10rpx;
  84. display: flex;
  85. justify-content: space-between;
  86. margin-bottom: 20rpx;
  87. .winningRecord-item-left{
  88. display: flex;
  89. width: 70%;
  90. overflow: hidden;
  91. image{
  92. width: 130rpx;
  93. height: 130rpx;
  94. }
  95. .detail{
  96. width: calc(100% - 130rpx);
  97. display: flex;
  98. flex-direction: column;
  99. justify-content: space-around;
  100. padding: 20rpx 0rpx;
  101. padding-right: 15rpx;
  102. box-sizing: border-box;
  103. .title{
  104. white-space: nowrap;
  105. text-overflow: ellipsis;
  106. overflow: hidden;
  107. font-size: 30rpx;
  108. }
  109. .money{
  110. color: #ccc;
  111. font-size: 26rpx;
  112. }
  113. }
  114. }
  115. .winningRecord-item-right{
  116. display: flex;
  117. align-items: center;
  118. justify-content: flex-end;
  119. font-size: 20rpx;
  120. color: #ccc;
  121. width: 30%;
  122. }
  123. }
  124. }
  125. .noFans{
  126. height: 100vh;
  127. display: flex;
  128. align-items: center;
  129. justify-content: center;
  130. color: #ffffff80;
  131. }
  132. }
  133. </style>