productBottom.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <view class="page-bottom">
  3. <view class="btm-btn">
  4. <view class="add-btn" @click="buy(2)" v-if="showAdd">加入购物车</view>
  5. <view class="buy-btn" @click="buy(1)" :class="{'quck':!showAdd }">{{showAdd? '立即购买': '立即兑换'}}</view>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import { collectAdd, collectDel } from '@/api/product.js';
  11. export default {
  12. props: {
  13. many: {
  14. default: 9
  15. },
  16. goodsObjact: {
  17. default: function() {
  18. return {};
  19. }
  20. },
  21. goodsid: {
  22. default: ''
  23. },
  24. showAdd: {
  25. type: Boolean,
  26. default: true
  27. }
  28. },
  29. data() {
  30. return {};
  31. },
  32. methods: {
  33. buy(type) {
  34. this.$emit('specOPne', type);
  35. }
  36. }
  37. };
  38. </script>
  39. <style lang="scss">
  40. /* 底部操作菜单 */
  41. .page-bottom {
  42. position: fixed;
  43. bottom: 0rpx;
  44. z-index: 95;
  45. display: flex;
  46. justify-content: center;
  47. align-items: center;
  48. width: 750rpx;
  49. height: 97rpx;
  50. background-color: #ffffff;
  51. /* box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.5);
  52. border-radius: 16rpx; */
  53. .p-b-btn {
  54. display: flex;
  55. flex-direction: column;
  56. align-items: center;
  57. justify-content: center;
  58. font-size: $font-sm;
  59. color: $font-color-base;
  60. width: 96rpx;
  61. height: 80rpx;
  62. .iconfont {
  63. font-size: 40rpx;
  64. line-height: 48rpx;
  65. color: $font-color-light;
  66. }
  67. &.active,
  68. &.active .iconfont {
  69. color: $uni-color-primary;
  70. }
  71. .iconlikefill {
  72. font-size: 46rpx;
  73. }
  74. image {
  75. width: 56rpx;
  76. height: 58rpx;
  77. }
  78. }
  79. .action-btn-group {
  80. display: flex;
  81. height: 76rpx;
  82. border-radius: 100px;
  83. overflow: hidden;
  84. margin-left: 20rpx;
  85. position: relative;
  86. &:after {
  87. content: '';
  88. position: absolute;
  89. top: 50%;
  90. right: 50%;
  91. transform: translateY(-50%);
  92. height: 28rpx;
  93. width: 0;
  94. border-right: 1px solid rgba(255, 255, 255, 0.5);
  95. }
  96. .action-btn {
  97. display: flex;
  98. align-items: center;
  99. justify-content: center;
  100. // width: 270rpx;
  101. // height: 100%;
  102. font-size: $font-base;
  103. padding: 0;
  104. border-radius: 0;
  105. background: transparent;
  106. width: 339rpx;
  107. height: 90rpx;
  108. &.buy-now-btn {
  109. background-color: #303e49;
  110. }
  111. &.add-cart-btn {
  112. background-color: #fff;
  113. color: #ff4c4c;
  114. border: #ff4c4c 1px solid;
  115. }
  116. }
  117. }
  118. }
  119. .p-b-btn {
  120. display: flex;
  121. flex-direction: column;
  122. align-items: center;
  123. justify-content: center;
  124. font-size: $font-sm;
  125. color: $font-color-base;
  126. width: 96rpx;
  127. height: 80rpx;
  128. .iconfont {
  129. font-size: 40rpx;
  130. line-height: 48rpx;
  131. color: $font-color-light;
  132. }
  133. &.active,
  134. &.active .iconfont {
  135. color: $uni-color-primary;
  136. }
  137. .icon-fenxiang2 {
  138. font-size: 42rpx;
  139. transform: translateY(-2rpx);
  140. }
  141. .iconlikefill {
  142. font-size: 46rpx;
  143. }
  144. }
  145. .btm-btn {
  146. z-index: 2;
  147. width: 750rpx;
  148. height: 97rpx;
  149. display: flex;
  150. // justify-content: space-between;
  151. position: fixed;
  152. bottom: 0;
  153. background-color: #fff;
  154. text-align: center;
  155. .add-btn {
  156. text-align: center;
  157. width: 375rpx;
  158. height: 97rpx;
  159. background: #FFB238;
  160. font-size: 36rpx;
  161. font-weight: 500;
  162. color: #fff;
  163. line-height: 97rpx;
  164. }
  165. .buy-btn {
  166. text-align: center;
  167. border: none;
  168. width: 375rpx;
  169. height: 97rpx;
  170. background: #6EAB4E;
  171. font-size: 36rpx;
  172. font-weight: 500;
  173. color: #fff;
  174. line-height: 97rpx;
  175. color: #fff;
  176. }
  177. .quck {
  178. width: 699rpx;
  179. height: 90rpx;
  180. background: #6EAB4E;
  181. border-radius: 45rpx;
  182. margin: auto;
  183. }
  184. }
  185. </style>