footer-share.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="footer-share-box display-around">
  3. <button
  4. class="display-flex-start items-center share-font"
  5. :style="{ 'border-right': isCollection ? '1px solid #d8d8d8' : 'none' }"
  6. open-type="share"
  7. @click="sharePage()"
  8. >
  9. <view style="margin-right: 15rpx; font-size: 26rpx">分享</view>
  10. <image
  11. src="../../static/share_icon.png"
  12. mode="aspectFill"
  13. style="width: 30rpx; height: 30rpx"
  14. ></image>
  15. </button>
  16. <view
  17. class="display-flex-start items-center share-font"
  18. v-if="isCollection"
  19. @click="collectionPage()"
  20. >
  21. <view style="margin-right: 15rpx; font-size: 26rpx">收藏</view>
  22. <image
  23. src="../../static/collection.png"
  24. mode="aspectFill"
  25. style="width: 40rpx; height: 40rpx"
  26. ></image>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. name: "footer-share",
  33. props: {
  34. isCollection: {
  35. type: Boolean,
  36. default: false,
  37. },
  38. },
  39. data() {
  40. return {};
  41. },
  42. methods: {
  43. sharePage() {
  44. this.$emit("sharePages");
  45. },
  46. collectionPage() {
  47. this.$emit("collectionPages");
  48. },
  49. },
  50. };
  51. </script>
  52. <style>
  53. .footer-share-box {
  54. height: 50rpx;
  55. position: fixed;
  56. bottom: 0;
  57. width: 100%;
  58. border-radius: 10rpx;
  59. box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.1);
  60. padding: 20rpx;
  61. background: #fff;
  62. margin-left: -20rpx;
  63. }
  64. .share-font {
  65. width: 45%;
  66. justify-content: center;
  67. }
  68. .footer-share-box button {
  69. background-color: #fff;
  70. border-radius: 0;
  71. }
  72. .footer-share-box button::after {
  73. border: none;
  74. }
  75. </style>