index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class='sharing-packets' :class='!enabled ? "on":""'>
  3. <view class='iconfont icon-guanbi' @click="closeShare"></view>
  4. <view class='line'></view>
  5. <view class='sharing-con' @click='goShare'>
  6. <image src='../../static/images/red-packets.png'></image>
  7. <view class='text font-color'>
  8. <view>会员分享返</view>
  9. <view class='money' v-if="sharePacket.brokerageMinPrice && sharePacket.brokerageMaxPrice">
  10. <text class='label'>¥</text>{{ fen2yuan(sharePacket.brokerageMinPrice) }}~{{ fen2yuan(sharePacket.brokerageMaxPrice) }}
  11. </view>
  12. <view class='money' v-else-if="sharePacket.brokerageMinPrice">
  13. <text class='label'>¥</text>{{ fen2yuan(sharePacket.brokerageMinPrice) }}
  14. </view>
  15. <view class='money' v-else-if="sharePacket.brokerageMaxPrice">
  16. <text class='label'>¥</text>{{ fen2yuan(sharePacket.brokerageMaxPrice) }}
  17. </view>
  18. <view class='tip'>下单即返佣金</view>
  19. <view class='shareBut'>立即分享</view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import * as Util from '@/utils/util.js';
  26. export default {
  27. props: {
  28. sharePacket: {
  29. type: Object,
  30. default: function() {
  31. return {
  32. enabled: true,
  33. brokerageMinPrice: undefined,
  34. brokerageMaxPrice: undefined,
  35. }
  36. }
  37. }
  38. },
  39. data() {
  40. return {
  41. };
  42. },
  43. computed: {
  44. enabled() {
  45. return this.sharePacket.enabled && (this.sharePacket.brokerageMinPrice || this.sharePacket.brokerageMaxPrice)
  46. }
  47. },
  48. methods: {
  49. closeShare:function(){
  50. this.$emit('closeChange');
  51. },
  52. goShare:function(){
  53. this.$emit('listenerActionSheet');
  54. },
  55. fen2yuan(price) {
  56. return Util.fen2yuan(price)
  57. }
  58. }
  59. }
  60. </script>
  61. <style scoped lang="scss">
  62. .sharing-packets{position:fixed;left:30rpx;bottom:200rpx;z-index:5;transition:all 0.3s ease-in-out 0s;opacity:1;transform: scale(1);}
  63. .sharing-packets.on{transform: scale(0);opacity:0;}
  64. .sharing-packets .iconfont{width:44rpx;height:44rpx;border-radius:50%;text-align:center;line-height:44rpx;background-color:#999;font-size:20rpx;color:#fff;margin:0 auto;box-sizing:border-box;padding-left:1px;}
  65. .sharing-packets .line{width:2rpx;height:40rpx;background-color:#999;margin:0 auto;}
  66. .sharing-packets .sharing-con{width:187rpx;height:210rpx;position:relative;}
  67. .sharing-packets .sharing-con image{width:100%;height:100%;}
  68. .sharing-packets .sharing-con .text{position:absolute;top:30rpx;font-size:20rpx;width:100%;text-align:center;}
  69. .sharing-packets .sharing-con .text .money{font-size:32rpx;font-weight:bold;margin-top:5rpx;white-space: nowrap}
  70. .sharing-packets .sharing-con .text .money .label{font-size:20rpx;}
  71. .sharing-packets .sharing-con .text .tip{font-size:18rpx;color:#999;margin-top:5rpx;}
  72. .sharing-packets .sharing-con .text .shareBut{font-size:22rpx;color:#fff;margin-top:18rpx;height:50rpx;line-height:50rpx;}
  73. </style>