index.vue 2.7 KB

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