gift-over.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <view class="page-width gift-over">
  3. <view class="title" v-if="type === 'direct_open' && open_type == 1 && winUser.length >=1 && is_status === 1">{{num}}份礼物已被领取{{winUser.length}}份</view>
  4. <view class="title" v-if="type === 'direct_open' && open_type == 0 && winUser.length >=1 && is_status === 1">
  5. {{num}}份礼物已被领取
  6. </view>
  7. <view class="title" v-if="type === 'direct_open' && open_type == 1 && is_status === 0 && winUser.length >=1">
  8. {{num}}份礼物{{win_time}}被抢光
  9. </view>
  10. <view class="title" v-if="type === 'direct_open' && open_type == 0 && is_status === 0 && winUser.length >=1">
  11. {{num}}份礼物{{win_time}}被抢光
  12. </view>
  13. <view class="title" v-if="type !== 'direct_open'">
  14. 共{{userOrder.length}}人参与 {{winUser.length}}人中奖
  15. </view>
  16. <view class="content" :class="[`${winUser.length > 3 && len <= 3 ? 'margin' : ''}`]">
  17. <view class="item dir-left-nowrap cross-center" v-for="(item, index) in newWinUser" :key="index">
  18. <image class="avatar" :src="item.user.userInfo.avatar"></image>
  19. <view class="name t-omit">{{item.user.nickname}}</view>
  20. </view>
  21. <view class="more" v-if="winUser.length > 3 && len <= 3" @click="len = winUser.length">加载更多</view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. name: 'gift-over',
  28. props: [ `num`, `winUser`, `open_type`, `type`, `userOrder`, `is_status`, `win_time`],
  29. data() {
  30. return {
  31. len: 3,
  32. }
  33. },
  34. computed: {
  35. newWinUser:function() {
  36. return this.winUser.slice(0, this.len);
  37. }
  38. }
  39. }
  40. </script>
  41. <style scoped lang="scss">
  42. @import "../../css/gift.scss";
  43. .gift-over {
  44. width: #{638upx};
  45. border-radius: #{16upx};
  46. background-color: #f7f7f7;
  47. .title {
  48. font-size: #{28upx};
  49. color: #353535;
  50. height: #{88upx};
  51. line-height: #{88upx};
  52. text-align: center;
  53. border-bottom: #{1upx} solid #e2e2e2;
  54. }
  55. .content {
  56. padding-top: #{32upx};
  57. overflow: hidden;
  58. .more {
  59. font-size: #{24upx};
  60. line-height: 1;
  61. text-align: center;
  62. color: #999999;
  63. margin-bottom: #{32upx};
  64. }
  65. .item {
  66. padding-left: #{40upx};
  67. margin-bottom: #{32upx};
  68. }
  69. .avatar {
  70. width: #{64upx};
  71. height: #{64upx};
  72. border-radius: 50%;
  73. background-color: blue;
  74. margin-right: #{32upx};
  75. }
  76. .name {
  77. width: calc(100% - #{136upx});
  78. font-size: #{28upx};
  79. color: #353535;
  80. }
  81. }
  82. }
  83. .margin {
  84. margin-bottom: #{250upx};
  85. }
  86. </style>