productBottom.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <view class="page-bottom">
  3. <navigator url="/pages/cart/cart" open-type="switchTab" class="p-b-btn"><image src="/static/img/img23.png"></image></navigator>
  4. <view class="action-btn-group">
  5. <button type="primary" class=" action-btn no-border add-cart-btn" @click="buy(2)">加入购物车</button>
  6. <button type="primary" class=" action-btn no-border buy-now-btn" @click="buy(1)">立即购买</button>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. data() {
  13. return {
  14. };
  15. },
  16. methods: {
  17. buy(data){
  18. this.$emit('buy',data)
  19. }
  20. }
  21. };
  22. </script>
  23. <style lang="scss">
  24. /* 底部操作菜单 */
  25. .page-bottom {
  26. position: fixed;
  27. bottom: 0rpx;
  28. z-index: 95;
  29. display: flex;
  30. justify-content: center;
  31. align-items: center;
  32. width: 750rpx;
  33. height: 120rpx;
  34. background-color: #ffffff;
  35. /* box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.5);
  36. border-radius: 16rpx; */
  37. .p-b-btn {
  38. display: flex;
  39. flex-direction: column;
  40. align-items: center;
  41. justify-content: center;
  42. font-size: $font-sm;
  43. color: $font-color-base;
  44. width: 96rpx;
  45. height: 80rpx;
  46. .iconfont {
  47. font-size: 40rpx;
  48. line-height: 48rpx;
  49. color: $font-color-light;
  50. }
  51. &.active,
  52. &.active .iconfont {
  53. color: $uni-color-primary;
  54. }
  55. .iconlikefill {
  56. font-size: 46rpx;
  57. }
  58. image {
  59. width: 56rpx;
  60. height: 58rpx;
  61. }
  62. }
  63. .action-btn-group {
  64. display: flex;
  65. height: 76rpx;
  66. border-radius: 100px;
  67. overflow: hidden;
  68. margin-left: 20rpx;
  69. position: relative;
  70. &:after {
  71. content: '';
  72. position: absolute;
  73. top: 50%;
  74. right: 50%;
  75. transform: translateY(-50%);
  76. height: 28rpx;
  77. width: 0;
  78. border-right: 1px solid rgba(255, 255, 255, 0.5);
  79. }
  80. .action-btn {
  81. display: flex;
  82. align-items: center;
  83. justify-content: center;
  84. width: 270rpx;
  85. height: 100%;
  86. font-size: $font-base;
  87. padding: 0;
  88. border-radius: 0;
  89. background: transparent;
  90. &.buy-now-btn {
  91. background-color: #303e49;
  92. }
  93. &.add-cart-btn {
  94. background-color: $base-color;
  95. }
  96. }
  97. }
  98. }
  99. </style>