footer-share.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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" style="background: transparent;"
  7. @click="sharePage()"
  8. >
  9. <view style="margin-right: 15rpx; font-size: 26rpx">分享</view>
  10. <image
  11. src="../../static/share_icon.svg"
  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="
  24. isCollectedIcon
  25. ? '../../static/collected.png'
  26. : '../../static/collection.png'
  27. "
  28. mode="aspectFill"
  29. style="width: 40rpx; height: 40rpx"
  30. ></image>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. name: "footer-share",
  37. props: {
  38. isCollection: {
  39. type: Boolean,
  40. default: false,
  41. },
  42. isCollectedIcon: {
  43. type: Boolean,
  44. default: false,
  45. },
  46. },
  47. data() {
  48. return {};
  49. },
  50. methods: {
  51. sharePage() {
  52. this.$emit("sharePages");
  53. },
  54. collectionPage() {
  55. this.$emit("collectionPages");
  56. },
  57. },
  58. };
  59. </script>
  60. <style>
  61. .footer-share-box {
  62. box-sizing: border-box;
  63. height: 70rpx;
  64. position: fixed;
  65. bottom: 0;
  66. width: 100%;
  67. border-radius: 10rpx;
  68. box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.1);
  69. padding: 20rpx;
  70. background: #fff;
  71. left: 0;
  72. }
  73. .share-font {
  74. width: 50%;
  75. justify-content: center;
  76. }
  77. .footer-share-box button {
  78. background-color: #fff;
  79. border-radius: 0;
  80. }
  81. .footer-share-box button::after {
  82. border: none;
  83. }
  84. </style>