productBottom.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <view class="page-bottom">
  3. <view class="p-b-btn" v-if="!product_id" :class="{ active: goodsObjact.userCollect }" @click="tocall()">
  4. <!-- <text class="iconfont " :class="{ iconlike: !goodsObjact.userCollect, iconlikefill: goodsObjact.userCollect }"></text> -->
  5. <image src="../../../static/icon/kf.png" mode="widthFix"></image>
  6. <text>售后</text>
  7. </view>
  8. <view class="action-btn-group" v-if="!product_id" >
  9. <button v-if="isVip!=8 && isVip!=3" type="primary" class=" action-btn no-border add-cart-btn" @click="buy(2)">加入购物车</button>
  10. <button type="primary" class=" action-btn no-border buy-now-btn" @click="buy(1)">立即购买</button>
  11. </view>
  12. <view class="action-btn-group" v-else>
  13. <button type="primary" class="botton" @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. isVip:{
  22. },
  23. many: {
  24. default: 9
  25. },
  26. goodsObjact: {
  27. default: function() {
  28. return {};
  29. }
  30. },
  31. goodsid:{
  32. default: ''
  33. },
  34. product_id:{
  35. }
  36. },
  37. data() {
  38. return {
  39. };
  40. },
  41. onLoad(){
  42. // seckillGoods({}, this.goodsid).then(function({ data }) {
  43. // obj.list = data;
  44. // console.log(obj.list,'list');
  45. // obj.product_id = data.productValue["默认"].product_id
  46. // console.log(obj.product_id,'徐浩岚');
  47. // });
  48. },
  49. methods: {
  50. tocall() {
  51. uni.makePhoneCall({
  52. phoneNumber: '18088138806'
  53. })
  54. },
  55. buy(type) {
  56. this.$emit('specOPne',type);
  57. },
  58. //收藏
  59. toFavorite(item) {
  60. let obj = this;
  61. console.log(obj.goodsObjact,'信息');
  62. item.userCollect = !item.userCollect;
  63. if (!item.userCollect) {
  64. collectDel({ id: obj.goodsid, category: 'product' }).then(function(e) {
  65. uni.showToast({
  66. title: '成功取消收藏',
  67. type: 'top',
  68. duration: 1500
  69. });
  70. });
  71. } else {
  72. collectAdd({ id: obj.goodsid, category: 'product' }).then(function(e) {
  73. uni.showToast({
  74. title: '成功加入收藏',
  75. type: 'top',
  76. duration: 1500
  77. });
  78. });
  79. }
  80. }
  81. }
  82. };
  83. </script>
  84. <style lang="scss">
  85. /* 底部操作菜单 */
  86. .page-bottom {
  87. position: fixed;
  88. bottom: 0rpx;
  89. z-index: 95;
  90. display: flex;
  91. justify-content: space-between;
  92. padding-left: 20rpx;
  93. align-items: center;
  94. width: 750rpx;
  95. height: 96rpx;
  96. background-color: #ffffff;
  97. /* box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, 0.5);
  98. border-radius: 16rpx; */
  99. .p-b-btn {
  100. display: flex;
  101. flex-direction: column;
  102. align-items: center;
  103. justify-content: center;
  104. font-size: $font-sm;
  105. color: $font-color-base;
  106. width: 96rpx;
  107. height: 80rpx;
  108. .iconfont {
  109. font-size: 40rpx;
  110. line-height: 48rpx;
  111. color: $font-color-light;
  112. }
  113. &.active,
  114. &.active .iconfont {
  115. color: #FF4C4C;
  116. }
  117. .iconlikefill {
  118. font-size: 46rpx;
  119. }
  120. image {
  121. width: 56rpx;
  122. // height: 58rpx;
  123. }
  124. }
  125. .action-btn-group {
  126. display: flex;
  127. height: 85rpx;
  128. overflow: hidden;
  129. margin-left: 20rpx;
  130. position: relative;
  131. &:after {
  132. content: '';
  133. position: absolute;
  134. top: 50%;
  135. right: 50%;
  136. transform: translateY(-50%);
  137. height: 28rpx;
  138. width: 0;
  139. }
  140. .action-btn {
  141. display: flex;
  142. align-items: center;
  143. justify-content: center;
  144. width: 300rpx;
  145. height: 100%;
  146. font-size: $font-base;
  147. padding: 0;
  148. border-radius: 0;
  149. background: transparent;
  150. &.buy-now-btn {
  151. width: 600rpx;
  152. background-color: #FF4C4C;
  153. }
  154. &.add-cart-btn {
  155. width: 600rpx;
  156. background-color: #FFB238;
  157. }
  158. }
  159. }
  160. .botton{
  161. width: 691rpx;
  162. height: 85rpx;
  163. background: linear-gradient(90deg, #FE6F61 0%, #FF4343 100%);
  164. border-radius: 43rpx;
  165. line-height: 85rpx;
  166. margin: 0 auto;
  167. font-size: 36rpx;
  168. font-weight: 500;
  169. color: #FFFFFF;
  170. }
  171. }
  172. .p-b-btn {
  173. display: flex;
  174. flex-direction: column;
  175. align-items: center;
  176. justify-content: center;
  177. font-size: $font-sm;
  178. color: $font-color-base;
  179. width: 96rpx;
  180. height: 80rpx;
  181. .iconfont {
  182. font-size: 40rpx;
  183. line-height: 48rpx;
  184. color: $font-color-light;
  185. }
  186. &.active,
  187. &.active .iconfont {
  188. color: $uni-color-primary;
  189. }
  190. .icon-fenxiang2 {
  191. font-size: 42rpx;
  192. transform: translateY(-2rpx);
  193. }
  194. .iconlikefill {
  195. font-size: 46rpx;
  196. }
  197. }
  198. </style>