withdrawal-confirm.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <floating-drag
  3. :visible="visible"
  4. :initialPosition="initialPosition"
  5. :width="120"
  6. :height="120"
  7. @click="handleClick"
  8. @position-change="onPositionChange"
  9. >
  10. <view class="confirm-btn">
  11. <text>提现</text>
  12. <text>确认</text>
  13. </view>
  14. </floating-drag>
  15. </template>
  16. <script>
  17. import FloatingDrag from './floating-drag.vue';
  18. export default {
  19. name: 'WithdrawalConfirm',
  20. components: {
  21. FloatingDrag
  22. },
  23. props: {
  24. // 是否显示
  25. visible: {
  26. type: Boolean,
  27. default: true
  28. },
  29. // 初始位置
  30. initialPosition: {
  31. type: Object,
  32. default: () => ({
  33. left: 'auto',
  34. right: 0,
  35. bottom: '20%'
  36. })
  37. }
  38. },
  39. methods: {
  40. // 处理点击事件
  41. handleClick() {
  42. this.$emit('click');
  43. },
  44. // 处理位置变更事件
  45. onPositionChange(position) {
  46. this.$emit('position-change', position);
  47. }
  48. }
  49. };
  50. </script>
  51. <style lang="scss" scoped>
  52. .confirm-btn {
  53. width: 100%;
  54. height: 100%;
  55. background-color: #4cd964;
  56. border-radius: 50%;
  57. display: flex;
  58. flex-direction: column;
  59. align-items: center;
  60. justify-content: center;
  61. border: 4rpx solid #fff;
  62. box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.2);
  63. text {
  64. color: #ffffff;
  65. font-size: 34rpx;
  66. text-align: center;
  67. font-weight: 500;
  68. padding: 0 10rpx;
  69. line-height: 1.2;
  70. }
  71. }
  72. </style>