erp-submit-bar.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <view class="erp-submit-bar">
  3. <button class="submit-btn" :disabled="disabled" @click="handleClick">
  4. <slot>{{ text }}</slot>
  5. </button>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. name: 'ErpSubmitBar',
  11. props: {
  12. text: { type: String, default: '' },
  13. disabled: { type: Boolean, default: false }
  14. },
  15. methods: {
  16. handleClick() {
  17. if (!this.disabled) {
  18. this.$emit('click');
  19. }
  20. }
  21. }
  22. }
  23. </script>
  24. <style scoped>
  25. .erp-submit-bar {
  26. position: fixed;
  27. bottom: 0;
  28. left: 0;
  29. width: 100%;
  30. background: #fff;
  31. padding: 20rpx 30rpx calc(env(safe-area-inset-bottom) + 20rpx);
  32. box-sizing: border-box;
  33. box-shadow: 0 -10rpx 30rpx rgba(0, 0, 0, 0.05);
  34. z-index: 100;
  35. }
  36. .submit-btn {
  37. background: #C1001C;
  38. color: #fff;
  39. height: 100rpx;
  40. border-radius: 50rpx;
  41. display: flex;
  42. align-items: center;
  43. justify-content: center;
  44. font-size: 34rpx;
  45. font-weight: bold;
  46. border: none;
  47. }
  48. .submit-btn:active {
  49. opacity: 0.9;
  50. transform: scale(0.98);
  51. }
  52. .submit-btn[disabled] {
  53. background: #e0e0e0;
  54. color: #999;
  55. }
  56. </style>