requestaRefund.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view>
  3. <!-- 志愿者信息 -->
  4. <view class="volunteer-info">
  5. <image :src="dataList.volunteerPicture" class="volunteer-image"></image>
  6. <view class="volunteer-details">
  7. <view style="display: flex; justify-content: space-between; width: 100%;">
  8. <view>
  9. <view>{{dataList.volunteerName}}</view>
  10. <view>{{dataList.businessTierName}}</view>
  11. </view>
  12. <view>可退:{{dataList.refundAmount}}</view>
  13. </view>
  14. </view>
  15. </view>
  16. <!-- 申请类型 -->
  17. <view class="application-type">
  18. 申请类型:申请退款
  19. </view>
  20. <!-- 志愿者详细信息 -->
  21. <view class="volunteer-detail-section">
  22. <view class="volunteer-detail">
  23. <image :src="dataList.volunteerPicture" class="volunteer-image"></image>
  24. <view class="volunteer-data">
  25. <view>姓名:{{dataList.volunteerName}}</view>
  26. <view>类别:{{dataList.businessTierName}}</view>
  27. <view>技能简介:</view>
  28. </view>
  29. <view class="refund-amount">¥{{dataList.refundAmount}}</view>
  30. </view>
  31. </view>
  32. <!-- 申请说明 -->
  33. <view class="application-note">
  34. <up-textarea v-model="refundReason" placeholder="请详细填写申请申请说明"></up-textarea>
  35. </view>
  36. <!-- 提交申请按钮 -->
  37. <view class="submit-button">
  38. <up-button type="error" text="提交申请" @click="handlClick"></up-button>
  39. </view>
  40. </view>
  41. </template>
  42. <script setup>
  43. import {
  44. onMounted,
  45. ref
  46. } from "vue";
  47. import {
  48. onLoad
  49. } from '@dcloudio/uni-app'
  50. import {
  51. userdictOrderInfo,
  52. refunDnewOrderRefund
  53. } from "@/api/userList.js"
  54. const dataList = ref([])
  55. const mainOrderId = ref(''); //志愿者ID
  56. const refundReason = ref('');
  57. onLoad(async (options) => {
  58. mainOrderId.value = options.mainOrderId;
  59. const res = await userdictOrderInfo(mainOrderId.value)
  60. dataList.value = res.data;
  61. });
  62. const handlClick = async () => {
  63. const params = {
  64. mainOrderId: mainOrderId.value,
  65. volunteerPicture: dataList.value.volunteerPicture,
  66. refundReason: refundReason.value
  67. };
  68. const res = await refunDnewOrderRefund(params);
  69. if (res.code == 200) {
  70. uni.showModal({
  71. title: '退款成功',
  72. content: '钱款将在三个工作日内返回到您的钱包中',
  73. showCancel: false,
  74. success: function () {
  75. setTimeout(() => {
  76. uni.navigateBack({
  77. delta: 1
  78. });
  79. }, 1500);
  80. }
  81. });
  82. }
  83. }
  84. </script>
  85. <style scoped>
  86. .volunteer-info {
  87. display: flex;
  88. align-items: center;
  89. border-bottom: 1rpx solid #ccc;
  90. padding: 20rpx;
  91. }
  92. .volunteer-image {
  93. width: 120rpx;
  94. height: 140rpx;
  95. margin-right: 20rpx;
  96. border-radius: 8rpx;
  97. }
  98. .volunteer-details {
  99. flex: 1;
  100. }
  101. .application-type {
  102. padding: 20rpx;
  103. border-bottom: 1rpx solid #ccc;
  104. }
  105. .volunteer-detail-section {
  106. padding: 20rpx;
  107. border-bottom: 1rpx solid #ccc;
  108. }
  109. .volunteer-detail {
  110. display: flex;
  111. align-items: center;
  112. }
  113. .volunteer-data {
  114. flex: 1;
  115. margin-left: 20rpx;
  116. }
  117. .refund-amount {
  118. color: red;
  119. font-weight: bold;
  120. }
  121. .expand-all {
  122. display: flex;
  123. align-items: center;
  124. justify-content: center;
  125. padding: 20rpx;
  126. cursor: pointer;
  127. }
  128. .expand-icon {
  129. width: 40rpx;
  130. height: 40rpx;
  131. margin-left: 10rpx;
  132. }
  133. .application-note {
  134. padding: 20rpx;
  135. }
  136. .submit-button {
  137. padding: 20rpx;
  138. text-align: center;
  139. }
  140. </style>