index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view v-if="sharePacket.isState" class='sharing-packets' :class='sharePacket.isState && showAnimate ? "":"right"'>
  3. <view class='sharing-con' @click='goShare'>
  4. <image :src="imgHost + '/statics/images/red-packets.png'" />
  5. <view class='text font-color'>
  6. <view>{{$t(`最高返佣`)}}</view>
  7. <view class='money'><text class='label'>{{$t(`¥`)}}</text>{{sharePacket.priceName}}</view>
  8. <view class='tip'>{{$t(`推广享佣金`)}}</view>
  9. <view class='shareBut'>{{$t(`立即分享`)}}</view>
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import {HTTP_REQUEST_URL} from '@/config/app';
  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. imgHost:HTTP_REQUEST_URL,
  42. isAnimate: true
  43. };
  44. },
  45. methods: {
  46. closeShare: function() {
  47. this.$emit('closeChange');
  48. },
  49. goShare: function() {
  50. if (this.isAnimate) {
  51. this.$emit('listenerActionSheet');
  52. } else {
  53. this.isAnimate = true
  54. this.$emit('boxStatus', true);
  55. }
  56. }
  57. }
  58. }
  59. </script>
  60. <style scoped lang="scss">
  61. .sharing-packets {
  62. position: fixed;
  63. left: 30rpx;
  64. bottom: 200rpx;
  65. z-index: 5;
  66. transition: all 0.3s ease-in-out 0s;
  67. opacity: 1;
  68. transform: scale(1);
  69. &.right {
  70. left: -170rpx;
  71. }
  72. }
  73. // .sharing-packets.on {
  74. // transform: scale(0);
  75. // opacity: 0;
  76. // }
  77. .sharing-packets .iconfont {
  78. width: 44rpx;
  79. height: 44rpx;
  80. border-radius: 50%;
  81. text-align: center;
  82. line-height: 44rpx;
  83. background-color: #999;
  84. font-size: 20rpx;
  85. color: #fff;
  86. margin: 0 auto;
  87. box-sizing: border-box;
  88. padding-left: 1px;
  89. }
  90. .sharing-packets .line {
  91. width: 2rpx;
  92. height: 40rpx;
  93. background-color: #999;
  94. margin: 0 auto;
  95. }
  96. .sharing-packets .sharing-con {
  97. width: 187rpx;
  98. height: 210rpx;
  99. position: relative;
  100. }
  101. .sharing-packets .sharing-con image {
  102. width: 100%;
  103. height: 100%;
  104. }
  105. .sharing-packets .sharing-con .text {
  106. position: absolute;
  107. top: 30rpx;
  108. font-size: 20rpx;
  109. width: 100%;
  110. text-align: center;
  111. }
  112. .sharing-packets .sharing-con .text .money {
  113. font-size: 32rpx;
  114. font-weight: bold;
  115. margin-top: 5rpx;
  116. }
  117. .sharing-packets .sharing-con .text .money .label {
  118. font-size: 20rpx;
  119. }
  120. .sharing-packets .sharing-con .text .tip {
  121. font-size: 18rpx;
  122. color: #999;
  123. margin-top: 5rpx;
  124. }
  125. .sharing-packets .sharing-con .text .shareBut {
  126. font-size: 22rpx;
  127. color: #fff;
  128. margin-top: 14rpx;
  129. height: 50rpx;
  130. line-height: 50rpx;
  131. }
  132. </style>