index.vue 2.9 KB

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