index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. <image src="@/static/images/red-packets.png" />
  6. <view class='text font-color'>
  7. <view>{{$t(`共富1580`)}}</view>
  8. <view class='money'><text class='label'></text>{{sharePacket.priceName}}</view>
  9. <view class='tip'>{{$t(`推广享红积分`)}}</view>
  10. <view class='shareBut'>{{$t(`立即分享`)}}</view>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import {HTTP_REQUEST_URL} from '@/config/app';
  17. export default {
  18. props: {
  19. sharePacket: {
  20. type: Object,
  21. default: function() {
  22. return {
  23. isState: true,
  24. priceName: ''
  25. }
  26. }
  27. },
  28. showAnimate: {
  29. type: Boolean,
  30. default: true
  31. },
  32. },
  33. watch: {
  34. showAnimate(nVal, oVal) {
  35. setTimeout(res => {
  36. this.isAnimate = nVal
  37. }, 1000)
  38. }
  39. },
  40. data() {
  41. return {
  42. imgHost:HTTP_REQUEST_URL,
  43. isAnimate: true
  44. };
  45. },
  46. methods: {
  47. closeShare: function() {
  48. this.$emit('closeChange');
  49. },
  50. goShare: function() {
  51. console.log(this.isAnimate)
  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. width: 100%;
  112. text-align: center;
  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 .text .shareBut {
  128. font-size: 22rpx;
  129. color: #fff;
  130. margin-top: 14rpx;
  131. height: 50rpx;
  132. line-height: 50rpx;
  133. }
  134. </style>