bottom-button.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="bd-bottom dir-left-nowrap cross-center">
  3. <view
  4. v-if="!attr_bool"
  5. @click="routeGo()"
  6. class="bd-back box-grow-0 dir-top-nowrap main-center cross-center"
  7. >
  8. <image class="bd-icon" src="/static/image/icon/index.png"></image>
  9. <text class="bd-text">首页</text>
  10. </view>
  11. <bd-service :name="name" :url="url"></bd-service>
  12. <view class="box-grow-1 bd-btn bd-oversell-btn bd-btn-color" v-if="goods_stock == 0">已售罄</view>
  13. <button v-else :disabled="attr_bool && join_disabled" :style="{'background': theme.background_gradient_btn}" class="bd-btn box-grow-1 bd-btn-color" @click="joinGift">加入礼包</button>
  14. </view>
  15. </template>
  16. <script>
  17. import bdService from '@/components/page-component/goods/bd-service.vue';
  18. export default {
  19. name: 'bottom-button',
  20. props: [`theme`, `attr_bool`, `goods_stock`, `join_disabled`, `name`, `url`],
  21. methods: {
  22. joinGift() {
  23. this.$emit('attrSwitch', true);
  24. },
  25. // 返回首页
  26. routeGo() {
  27. uni.reLaunch({
  28. url: `/pages/index/index`
  29. })
  30. }
  31. },
  32. components: {
  33. bdService
  34. }
  35. }
  36. </script>
  37. <style scoped lang="scss">
  38. @import "../../css/gift.scss";
  39. .bd-bottom {
  40. width: 750upx;
  41. height: 110upx;
  42. padding: 20upx 24upx;
  43. }
  44. .bd-back {
  45. width: 66upx;
  46. height: 100%;
  47. margin-right: 20upx;
  48. }
  49. .bd-icon {
  50. width: 30upx;
  51. height: 30upx;
  52. margin-bottom: 8upx;
  53. }
  54. .bd-text {
  55. font-size: 20upx;
  56. color: #888888;
  57. line-height: 1;
  58. }
  59. .bd-btn {
  60. text-align: center;
  61. line-height: 70upx;
  62. height: 70upx;
  63. font-size: 28upx;
  64. border-radius: 35upx;
  65. }
  66. .bd-btn-color {
  67. color: #ffffff;
  68. }
  69. .bd-oversell-btn {
  70. background-color: #CDCDCD;
  71. }
  72. </style>