index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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 {
  16. HTTP_REQUEST_URL
  17. } from '@/config/app';
  18. export default {
  19. props: {
  20. sharePacket: {
  21. type: Object,
  22. default: function() {
  23. return {
  24. isState: true,
  25. priceName: ''
  26. }
  27. }
  28. },
  29. showAnimate: {
  30. type: Boolean,
  31. default: true
  32. },
  33. },
  34. watch: {
  35. showAnimate(nVal, oVal) {
  36. setTimeout(res => {
  37. this.isAnimate = nVal
  38. }, 1000)
  39. }
  40. },
  41. data() {
  42. return {
  43. imgHost: HTTP_REQUEST_URL,
  44. isAnimate: true
  45. };
  46. },
  47. methods: {
  48. closeShare: function() {
  49. this.$emit('closeChange');
  50. },
  51. goShare: function() {
  52. if (this.isAnimate) {
  53. this.$emit('listenerActionSheet');
  54. } else {
  55. this.isAnimate = true
  56. this.$emit('boxStatus', true);
  57. }
  58. }
  59. }
  60. }
  61. </script>
  62. <style scoped lang="scss">
  63. .sharing-packets {
  64. position: fixed;
  65. left: 30rpx;
  66. bottom: 200rpx;
  67. z-index: 5;
  68. transition: all 0.3s ease-in-out 0s;
  69. opacity: 1;
  70. transform: scale(1);
  71. &.right {
  72. left: -170rpx;
  73. }
  74. }
  75. // .sharing-packets.on {
  76. // transform: scale(0);
  77. // opacity: 0;
  78. // }
  79. .sharing-packets .iconfont {
  80. width: 44rpx;
  81. height: 44rpx;
  82. border-radius: 50%;
  83. text-align: center;
  84. line-height: 44rpx;
  85. background-color: #999;
  86. font-size: 20rpx;
  87. color: #fff;
  88. margin: 0 auto;
  89. box-sizing: border-box;
  90. padding-left: 1px;
  91. }
  92. .sharing-packets .line {
  93. width: 2rpx;
  94. height: 40rpx;
  95. background-color: #999;
  96. margin: 0 auto;
  97. }
  98. .sharing-packets .sharing-con {
  99. width: 187rpx;
  100. height: 210rpx;
  101. position: relative;
  102. }
  103. .sharing-packets .sharing-con image {
  104. width: 100%;
  105. height: 100%;
  106. }
  107. .sharing-packets .sharing-con .text {
  108. position: absolute;
  109. top: 30rpx;
  110. font-size: 20rpx;
  111. line-height: 30rpx;
  112. width: 100%;
  113. text-align: center;
  114. }
  115. .sharing-packets .sharing-con .text .money {
  116. font-size: 32rpx;
  117. line-height: 42rpx;
  118. font-weight: bold;
  119. margin-top: 5rpx;
  120. }
  121. .sharing-packets .sharing-con .text .money .label {
  122. font-size: 20rpx;
  123. }
  124. .sharing-packets .sharing-con .text .tip {
  125. font-size: 18rpx;
  126. line-height: 18rpx;
  127. color: #999;
  128. margin-top: 5rpx;
  129. }
  130. .sharing-packets .sharing-con .text .shareBut {
  131. font-size: 22rpx;
  132. line-height: 48rpx;
  133. color: #fff;
  134. /* #ifdef H5 */
  135. margin-top: 28rpx;
  136. /* #endif */
  137. /* #ifndef H5 */
  138. margin-top: 26rpx;
  139. /* #endif */
  140. }
  141. </style>