giftPopup.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <u-popup :show="show" @close="handleClose" round="20rpx" bgColor="#f3f5f9" zIndex="10076">
  3. <view class="more-block">
  4. <view class="item" @click="navgetTo('/pages_shopping/live/integral'), (isMore = false)">
  5. <image class="w48 h48" src="/static/images/order.png" />
  6. <view style="text-align: center">芳华币</view>
  7. </view>
  8. <view class="item"
  9. @click="navgetTo('/pages_shopping/live/storeOrderRefundList?liveId=' + liveId), (isMore = false)">
  10. <image class="w48 h48" src="/static/images/after_sales.png" />
  11. <view style="text-align: center">售后订单</view>
  12. </view>
  13. <view class="item" @click="goMiniProgram(), (isMore = false)">
  14. <image class="w48 h48" src="/static/images/points.png" />
  15. <view style="text-align: center">兑换好礼</view>
  16. </view>
  17. <view class="item" @click="getMyLottery(), (isMore = false), (winning = true)">
  18. <image class="w48 h48" src="/static/images/health_sel.png" />
  19. <view style="text-align: center">中奖记录</view>
  20. </view>
  21. </view>
  22. </u-popup>
  23. </template>
  24. <script>
  25. export default {
  26. // name: 'giftPopup',
  27. props: {
  28. // 控制显示/隐藏
  29. show: {
  30. type: Boolean,
  31. default: false
  32. },
  33. // 中奖记录列表
  34. prizeList: {
  35. type: Array,
  36. default: () => []
  37. },
  38. // 直播间ID
  39. liveId: {
  40. type: [String, Number],
  41. default: ''
  42. },
  43. // 滚动区域高度
  44. scrollHeight: {
  45. type: Number,
  46. default: 500
  47. }
  48. },
  49. data() {
  50. return {};
  51. },
  52. methods: {
  53. /**
  54. * 关闭弹窗
  55. */
  56. handleClose() {
  57. this.$emit('close');
  58. },
  59. /**
  60. * 处理填写地址
  61. */
  62. handleFillAddress(item) {
  63. this.$emit('fill-address', {
  64. productId: item.productId,
  65. recordId: item.id,
  66. liveId: this.liveId,
  67. item: item
  68. });
  69. },
  70. /**
  71. * 格式化时间显示
  72. */
  73. formatTime(timeStr) {
  74. if (!timeStr) return '';
  75. // 简单的格式化,可以根据需要调整
  76. return timeStr.length > 10 ? timeStr.substring(5, 16) : timeStr;
  77. },
  78. /**
  79. * 截断字符串
  80. */
  81. truncateString(str, maxLength) {
  82. if (typeof str !== 'string' || str.length <= maxLength) {
  83. return str || '';
  84. }
  85. return str.slice(0, maxLength) + '...';
  86. }
  87. }
  88. };
  89. </script>
  90. <style scoped lang="scss">
  91. .winning_record {
  92. position: relative;
  93. height: 800rpx;
  94. .head_bg {
  95. position: absolute;
  96. top: -125rpx;
  97. left: 50%;
  98. width: 311rpx;
  99. transform: translateX(-50%);
  100. }
  101. .bg {
  102. width: 100%;
  103. height: 100%;
  104. }
  105. .winning_content {
  106. position: absolute;
  107. top: 50rpx;
  108. color: #fff;
  109. width: 100%;
  110. padding: 0 36rpx;
  111. box-sizing: border-box;
  112. .title {
  113. text-align: center;
  114. font-size: 40rpx;
  115. font-weight: 500;
  116. margin-bottom: 40rpx;
  117. }
  118. .row {
  119. display: flex;
  120. justify-content: space-between;
  121. text-align: center;
  122. .start {
  123. width: 40%;
  124. }
  125. .center {
  126. width: 20%;
  127. }
  128. .button {
  129. background-color: #fff;
  130. border-radius: 20rpx;
  131. color: #f4410b;
  132. padding: 4rpx 8rpx;
  133. }
  134. .end {
  135. width: 40%;
  136. }
  137. }
  138. }
  139. }
  140. </style>