giftPopup.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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/user/integral/integralGoodsList'), (isMore = false)">
  5. <image class="icon" src="/static/images/live/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="icon" src="/static/images/live/after_sales.png" />
  11. <view style="text-align: center">售后订单</view>
  12. </view>
  13. <view class="item" @click="goMiniProgram(), (isMore = false)">
  14. <image class="icon" src="/static/images/live/points.png" />
  15. <view style="text-align: center">兑换好礼</view>
  16. </view>
  17. <view class="item" @click="getMyLottery(), (isMore = false), (winning = true)">
  18. <image class="icon" src="/static/images/live/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. .icon {
  92. width: 48rpx;
  93. height:48rpx;
  94. }
  95. .winning_record {
  96. position: relative;
  97. height: 800rpx;
  98. .head_bg {
  99. position: absolute;
  100. top: -125rpx;
  101. left: 50%;
  102. width: 311rpx;
  103. transform: translateX(-50%);
  104. }
  105. .bg {
  106. width: 100%;
  107. height: 100%;
  108. }
  109. .winning_content {
  110. position: absolute;
  111. top: 50rpx;
  112. color: #fff;
  113. width: 100%;
  114. padding: 0 36rpx;
  115. box-sizing: border-box;
  116. .title {
  117. text-align: center;
  118. font-size: 40rpx;
  119. font-weight: 500;
  120. margin-bottom: 40rpx;
  121. }
  122. .row {
  123. display: flex;
  124. justify-content: space-between;
  125. text-align: center;
  126. .start {
  127. width: 40%;
  128. }
  129. .center {
  130. width: 20%;
  131. }
  132. .button {
  133. background-color: #fff;
  134. border-radius: 20rpx;
  135. color: #f4410b;
  136. padding: 4rpx 8rpx;
  137. }
  138. .end {
  139. width: 40%;
  140. }
  141. }
  142. }
  143. }
  144. </style>