fast-refund-dialog.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <common-dialog ref="refundDialog" :showTitle="false" :showFooter="false" :showCancel="false" width="620rpx"
  3. :custom-style="{ padding: '0', borderRadius: '20rpx' }">
  4. <view class="refund-dialog-box">
  5. <view class="icon-area">
  6. <u-icon name="checkmark-circle-fill" size="100" color="#ff9900"></u-icon>
  7. </view>
  8. <view class="refund-title">
  9. 尊敬的用户 您可享极速到账
  10. </view>
  11. <view class="refund-desc">
  12. 商品未发货,本次退款尊享未发秒退服务
  13. </view>
  14. <button class="confirm-refund-btn" @click="confirmRefund">
  15. 确认退款 ¥ {{ order ? order.payMoney : '0.00' }}
  16. </button>
  17. </view>
  18. </common-dialog>
  19. </template>
  20. <script>
  21. import CommonDialog from '@/components/common-dialog.vue';
  22. export default {
  23. components: {
  24. CommonDialog
  25. },
  26. data() {
  27. return {
  28. order: null
  29. };
  30. },
  31. methods: {
  32. open(order) {
  33. this.order = order;
  34. this.$refs.refundDialog.openPopup();
  35. },
  36. closePopup() {
  37. this.$refs.refundDialog.closePopup();
  38. },
  39. confirmRefund() {
  40. if (!this.order) return;
  41. this.$u.api.fastRefundAjax({
  42. orderId: this.order.orderId
  43. }).then(res => {
  44. if (res.code == 200) {
  45. this.$u.toast('退款申请提交成功');
  46. this.closePopup();
  47. this.$emit('refresh');
  48. } else {
  49. this.$u.toast(res.msg || '退款申请失败');
  50. }
  51. });
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .refund-dialog-box {
  58. padding: 50rpx 40rpx 80rpx;
  59. position: relative;
  60. background: #fff;
  61. .close-btn {
  62. position: absolute;
  63. top: 20rpx;
  64. right: 20rpx;
  65. padding: 10rpx;
  66. z-index: 10;
  67. }
  68. .icon-area {
  69. display: flex;
  70. justify-content: center;
  71. margin-bottom: 30rpx;
  72. }
  73. .refund-title {
  74. font-size: 36rpx;
  75. font-weight: bold;
  76. color: #333;
  77. margin-bottom: 20rpx;
  78. text-align: center;
  79. }
  80. .refund-desc {
  81. font-size: 26rpx;
  82. color: #999;
  83. margin-bottom: 50rpx;
  84. text-align: center;
  85. }
  86. .confirm-refund-btn {
  87. background: #333;
  88. color: #FFE4B5;
  89. font-size: 30rpx;
  90. border-radius: 44rpx;
  91. height: 88rpx;
  92. line-height: 88rpx;
  93. font-weight: 500;
  94. &::after {
  95. border: none;
  96. }
  97. &:active {
  98. opacity: 0.9;
  99. }
  100. }
  101. }
  102. </style>