productBottom.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view class="page-bottom">
  3. <!-- <view class="p-b-btn" @click="shopLi">
  4. <image class="icon" src="../../../static/icon/goodsServer.png" mode="widthFix"></image>
  5. <text>客服</text>
  6. </view>
  7. <view class="p-b-btn" :class="{ active: goodsObjact.userCollect }" @click="setCart(goodsObjact)">
  8. <image class="icon" src="../../../static/icon/goodsAddCart.png" mode="widthFix"></image>
  9. <text>购物车</text>
  10. </view> -->
  11. <view class="action-btn-group flex" >
  12. <button type="primary" v-if="goodsObjact.is_barrel==0" class=" action-btn add-cart-btn" @click="buy(2)">加入购物车</button>
  13. <button type="primary" class=" action-btn buy-now-btn" @click="buy(1)">立即购买</button>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. import { collectAdd, collectDel } from '@/api/product.js';
  19. export default {
  20. props: {
  21. many: {
  22. default: 9
  23. },
  24. goodsObjact: {
  25. default: function() {
  26. return {};
  27. }
  28. },
  29. goodsid:{
  30. default: ''
  31. },
  32. systemStore:{
  33. default: function() {
  34. return {};
  35. }
  36. }
  37. },
  38. data() {
  39. return {};
  40. },
  41. methods: {
  42. // 联系商家
  43. shopLi() {
  44. uni.makePhoneCall({
  45. phoneNumber: this.systemStore.phone //仅为示例
  46. });
  47. },
  48. buy(type) {
  49. this.$emit('specOPne',type);
  50. },
  51. }
  52. };
  53. </script>
  54. <style lang="scss">
  55. /* 底部操作菜单 */
  56. .page-bottom {
  57. position: fixed;
  58. bottom: 0rpx;
  59. z-index: 95;
  60. display: flex;
  61. justify-content: center;
  62. align-items: center;
  63. width: 750rpx;
  64. height: 120rpx;
  65. background-color: #ffffff;
  66. /* box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.5);
  67. border-radius: 16rpx; */
  68. .icon{
  69. width: 50rpx ;
  70. }
  71. .action-btn-group {
  72. height: 76rpx;
  73. padding-right:30rpx;
  74. flex-grow: 1;
  75. &:after {
  76. content: '';
  77. position: absolute;
  78. top: 50%;
  79. right: 50%;
  80. transform: translateY(-50%);
  81. height: 28rpx;
  82. width: 0;
  83. border-right: 1px solid rgba(255, 255, 255, 0.5);
  84. }
  85. .action-btn {
  86. width: 250rpx;
  87. height: 100%;
  88. font-size: $font-base;
  89. border-radius: 100px;
  90. flex-grow: 1;
  91. margin-left: 30rpx;
  92. &.buy-now-btn {
  93. background: linear-gradient(90deg, #3C82E6, #5395F5);
  94. color: #FFFFFF;
  95. }
  96. &.add-cart-btn {
  97. background: transparent;
  98. color: #5395F5;
  99. border: 1px solid #5395F5;
  100. }
  101. }
  102. }
  103. }
  104. .p-b-btn {
  105. display: flex;
  106. flex-direction: column;
  107. align-items: center;
  108. justify-content: center;
  109. font-size: $font-sm;
  110. color: $font-color-base;
  111. width: 96rpx;
  112. height: 80rpx;
  113. .iconfont {
  114. font-size: 40rpx;
  115. line-height: 48rpx;
  116. color: $font-color-light;
  117. }
  118. &.active,
  119. &.active .iconfont {
  120. color: $uni-color-primary;
  121. }
  122. .icon-fenxiang2 {
  123. font-size: 42rpx;
  124. transform: translateY(-2rpx);
  125. }
  126. .iconlikefill {
  127. font-size: 46rpx;
  128. }
  129. }
  130. </style>