refund.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <view class="popup-mask" @click.stop="closeRefund">
  3. <view class="popup-content" @tap.stop>
  4. <view class="popup-header">
  5. <text>退款规则</text>
  6. </view>
  7. <view class="popup-body">
  8. <view class="refund-rule">
  9. <text class="label">退款标签</text>
  10. <view class="">
  11. 随时退
  12. </view>
  13. <view class="">
  14. 过期自动退
  15. </view>
  16. <!-- <radio-group @change="onRefundLabelChange">
  17. <label class="radio-item">
  18. <radio value="随时退" :checked="refundLabel === '随时退'" /> 随时退
  19. </label>
  20. <label class="radio-item">
  21. <radio value="过期自动退" :checked="refundLabel === '过期自动退'" /> 过期自动退
  22. </label>
  23. </radio-group> -->
  24. </view>
  25. <view class="refund-confirm">
  26. <text class="label">退款是否商家确认</text>
  27. <view class="">
  28. 需要确认
  29. </view>
  30. <view class="">
  31. 无需确认
  32. </view>
  33. <!-- <radio-group @change="onRefundConfirmChange">
  34. <label class="radio-item">
  35. <radio value="需要确认" :checked="refundConfirm === '需要确认'" /> 需要确认
  36. </label>
  37. <label class="radio-item">
  38. <radio value="无需确认" :checked="refundConfirm === '无需确认'" /> 无需确认
  39. </label>
  40. </radio-group> -->
  41. </view>
  42. </view>
  43. <view class="popup-footer">
  44. <!-- <button @tap="closePopup">取消</button> -->
  45. <button @tap.stop="save">确定</button>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. name: 'refund',
  53. data() {
  54. return {
  55. refundLabel: '随时退', // 默认选择的退款标签
  56. refundConfirm: '需要确认' // 默认选择的退款确认方式
  57. };
  58. },
  59. methods: {
  60. closeRefund() {
  61. this.$emit('closeRule');
  62. },
  63. save() {
  64. console.log('444')
  65. // 触发 confirm 事件,并传递选择的退款规则
  66. this.$emit('saveRule', {
  67. refundLabel: this.refundLabel,
  68. refundConfirm: this.refundConfirm
  69. });
  70. },
  71. }
  72. };
  73. </script>
  74. <style>
  75. .popup-mask {
  76. position: fixed;
  77. top: 0;
  78. left: 0;
  79. width: 100%;
  80. height: 100%;
  81. background-color: rgba(0, 0, 0, 0.5);
  82. display: flex;
  83. justify-content: center;
  84. align-items: center;
  85. z-index: 99;
  86. }
  87. .popup-content {
  88. background-color: #fff;
  89. width: 80%;
  90. border-radius: 10px;
  91. overflow: hidden;
  92. }
  93. .popup-header {
  94. padding: 20px;
  95. border-bottom: 1px solid #eee;
  96. text-align: center;
  97. font-size: 18px;
  98. font-weight: bold;
  99. }
  100. .popup-body {
  101. padding: 20px;
  102. }
  103. .refund-rule,
  104. .refund-confirm {
  105. margin-bottom: 20px;
  106. }
  107. .label {
  108. display: block;
  109. margin-bottom: 10px;
  110. font-size: 16px;
  111. font-weight: bold;
  112. }
  113. .radio-item {
  114. display: flex;
  115. align-items: center;
  116. margin-bottom: 10px;
  117. }
  118. .popup-footer {
  119. display: flex;
  120. justify-content: space-between;
  121. padding: 10px;
  122. border-top: 1px solid #eee;
  123. }
  124. .popup-footer button {
  125. flex: 1;
  126. margin: 0 5px;
  127. }
  128. </style>