JRedEnvelope.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view class="j-red-envelope">
  3. <tui-landscape
  4. :show="isShow" :position="1" :close-icon="showType === 0 ? false : true"
  5. :mask-closable="showType === 0 ? true : false" icon-left="50rpx" icon-right="50rpx" @close="$emit('close')"
  6. >
  7. <view>
  8. <view v-if="showType === 0">
  9. <view @click="$emit('click-red')">
  10. <image
  11. mode="heightFix" src="../../static/images/index/red-wrap.png"
  12. style="min-height: 45vh;max-height: 5vh;"
  13. />
  14. </view>
  15. </view>
  16. <view v-else-if="showType === 1">
  17. <view
  18. style="padding-bottom: 22upx;background: linear-gradient(180deg, #70391C 93%, #8E2216 99%);border-radius: 48upx;"
  19. >
  20. <view class="j-red-envelope-container">
  21. <view style="display: flex;align-items: center;">
  22. <JAvatar
  23. :size="82"
  24. :src="data.brandAvatar || data.userAvatar || '../../static/images/icon/avatar.png'"
  25. >
  26. </JAvatar>
  27. <view style="flex: 1;margin-left: 28upx;color: #FFFFFF;">
  28. <view style="font-size: 38upx;font-weight: bold;">
  29. {{ data.brandName || data.username || '--' }}的红包
  30. </view>
  31. <view
  32. style="width: 100%;word-break: break-all;display: -webkit-box;overflow: hidden;-webkit-box-orient: vertical;-webkit-line-clamp: 2;"
  33. >
  34. {{ data.wrapRedText.publisherText || "恭喜发财,财源滚滚" }}
  35. </view>
  36. </view>
  37. </view>
  38. <view v-if="data.wrapRedText.bindLink" style="margin-top: 20upx;text-align: center;">
  39. <tui-button
  40. type="white" plain width="340rpx" height="60rpx"
  41. shape="circle" style="display: inline-block;"
  42. @click="$jump(`/goodsModule/goodsDetails?shopId=${data.wrapRedText.bindLink.shopId}&productId=${data.wrapRedText.bindLink.productId}&skuId=${data.wrapRedText.bindLink.skuId}`)"
  43. >
  44. 导航到商品→
  45. </tui-button>
  46. </view>
  47. <view style="margin-top: 34upx;margin-bottom: 38upx;text-align: center;">
  48. <view style="font-size: 34upx;color: #FFCC66;">
  49. 恭喜你获得{{ data.wrapRedText.business ? '携带优惠券' : '现金' }}红包
  50. </view>
  51. <view style="margin-top: 20upx;color: #FFE019;">
  52. <text style="font-size: 54upx;font-weight: bold;">{{ data.wrapRedText.redpackMonkey || '--' }}</text>
  53. <text style="margin-left: 6upx;font-size: 34upx;">元</text>
  54. </view>
  55. <view style="margin-top: 28upx;font-size: 26upx;color: #ffffff;">
  56. <view>红包已自动存入余额</view>
  57. <view v-if="data.wrapRedText.business">商家优惠券已自动放入券包</view>
  58. </view>
  59. </view>
  60. <view style="max-height: 38vh;overflow-y: auto;">
  61. <view style="border: 2upx solid #FFFFFF;border-radius: 28upx;overflow: hidden;">
  62. <image
  63. mode="widthFix" :src="data.wrapRedText.picUrl || '../../static/images/index/red-pic.png'"
  64. style="min-width: 450upx;max-width: 550upx;max-height: 50vh;vertical-align: middle;"
  65. />
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </tui-landscape>
  73. </view>
  74. </template>
  75. <script>
  76. export default {
  77. name: 'JRedEnvelope',
  78. props: {
  79. isShow: Boolean,
  80. showType: Number,
  81. data: {
  82. type: Object,
  83. default() {
  84. return {
  85. wrapRedText: {}
  86. }
  87. }
  88. }
  89. },
  90. data() {
  91. return {
  92. }
  93. }
  94. }
  95. </script>
  96. <style lang="less" scoped>
  97. .j-red-envelope {
  98. .j-red-envelope-container {
  99. width: 100%;
  100. padding: 48upx 40upx 36upx 40upx;
  101. background: linear-gradient(180deg, #F58F5A 0%, #F53F2A 100%);
  102. border-radius: 38upx 38upx 48upx 48upx;
  103. box-sizing: border-box;
  104. }
  105. /deep/ .tui-landscape__inner {
  106. top: 45%;
  107. }
  108. }
  109. </style>