index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <!-- 悬浮红包 -->
  3. <view class='sharing-packets' :class='showAnimate?"":"right"' v-if="sharePacket.isState==false">
  4. <view class='sharing-con' @click='goShare'>
  5. <image src='../../static/red-packets.png'></image>
  6. <view class='text'>
  7. <view>最高返佣</view>
  8. <view class='money'><text class='label'>¥</text>{{sharePacket.priceName}}</view>
  9. <view class='tip'>推广好友享佣金</view>
  10. </view>
  11. <view class='shareBut'>立即分享</view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. props: {
  18. sharePacket: {
  19. type: Object,
  20. default: function() {
  21. return {
  22. isState: true,
  23. priceName: ''
  24. }
  25. }
  26. },
  27. showAnimate: {
  28. type: Boolean,
  29. default: true
  30. }
  31. },
  32. watch: {
  33. showAnimate(nVal, oVal) {
  34. setTimeout(res => {
  35. this.isAnimate = nVal
  36. }, 1000)
  37. }
  38. },
  39. data() {
  40. return {
  41. isAnimate: true
  42. };
  43. },
  44. mounted(){
  45. },
  46. methods: {
  47. closeShare: function() {
  48. this.$emit('closeChange');
  49. },
  50. goShare: function() {
  51. if (this.isAnimate) {
  52. this.$emit('listenerActionSheet');
  53. } else {
  54. this.isAnimate = true
  55. this.$emit('boxStatus', true);
  56. }
  57. }
  58. }
  59. }
  60. </script>
  61. <style scoped lang="scss">
  62. .sharing-packets {
  63. position: fixed;
  64. left: 30rpx;
  65. bottom: 200rpx;
  66. z-index: 5;
  67. transition: all 0.3s ease-in-out 0s;
  68. opacity: 1;
  69. transform: scale(1);
  70. &.right {
  71. left: -160rpx;
  72. }
  73. }
  74. // .sharing-packets.on {
  75. // transform: scale(0);
  76. // opacity: 0;
  77. // }
  78. .sharing-packets .iconfont {
  79. width: 44rpx;
  80. height: 44rpx;
  81. border-radius: 50%;
  82. text-align: center;
  83. line-height: 44rpx;
  84. background-color: #999;
  85. font-size: 20rpx;
  86. color: #fff;
  87. margin: 0 auto;
  88. box-sizing: border-box;
  89. padding-left: 1px;
  90. }
  91. .sharing-packets .line {
  92. width: 2rpx;
  93. height: 40rpx;
  94. background-color: #999;
  95. margin: 0 auto;
  96. }
  97. .sharing-packets .sharing-con {
  98. width: 187rpx;
  99. height: 210rpx;
  100. position: relative;
  101. }
  102. .sharing-packets .sharing-con image {
  103. width: 100%;
  104. height: 100%;
  105. }
  106. .sharing-packets .sharing-con .text {
  107. position: absolute;
  108. top: 30rpx;
  109. font-size: 20rpx;
  110. width: 100%;
  111. text-align: center;
  112. color: #FE5C2D;
  113. }
  114. .sharing-packets .sharing-con .text .money {
  115. font-size: 32rpx;
  116. font-weight: bold;
  117. margin-top: 5rpx;
  118. }
  119. .sharing-packets .sharing-con .text .money .label {
  120. font-size: 20rpx;
  121. }
  122. .sharing-packets .sharing-con .text .tip {
  123. font-size: 18rpx;
  124. color: #999;
  125. margin-top: 5rpx;
  126. }
  127. .sharing-packets .sharing-con .shareBut {
  128. font-size: 22rpx;
  129. color: #fff;
  130. height: 51rpx;
  131. line-height: 50rpx;
  132. position: absolute;
  133. left: 50%;
  134. margin-left: -48rpx;
  135. bottom: 0;
  136. }
  137. </style>