requestaRefund.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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
  8. style="display: flex; justify-content: space-between; width: 100%"
  9. >
  10. <view>
  11. <view>{{ dataList.volunteerName }}</view>
  12. <view>{{ dataList.businessTierName }}</view>
  13. </view>
  14. <view>可退:{{ dataList.refundAmount }}</view>
  15. </view>
  16. </view>
  17. </view>
  18. <!-- 申请类型 -->
  19. <view class="application-type"> 申请类型:申请退款 </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
  35. v-model="refundReason"
  36. placeholder="请详细填写申请申请说明"
  37. ></up-textarea>
  38. </view>
  39. <!-- 提交申请按钮 -->
  40. <view class="submit-button">
  41. <up-button type="error" text="提交申请" @click="handlClick"></up-button>
  42. </view>
  43. </view>
  44. </template>
  45. <script setup>
  46. import { onMounted, ref } from 'vue'
  47. import { onLoad } from '@dcloudio/uni-app'
  48. import { userdictOrderInfo, refunDnewOrderRefund } from '@/api/userList.js'
  49. const dataList = ref([])
  50. const mainOrderId = ref('') //志愿者ID
  51. const refundReason = ref('')
  52. onLoad(async (options) => {
  53. mainOrderId.value = options.mainOrderId
  54. const res = await userdictOrderInfo(mainOrderId.value)
  55. dataList.value = res.data
  56. })
  57. const handlClick = async () => {
  58. const params = {
  59. mainOrderId: mainOrderId.value,
  60. volunteerPicture: dataList.value.volunteerPicture,
  61. refundReason: refundReason.value,
  62. }
  63. const res = await refunDnewOrderRefund(params)
  64. if (res.code == 200) {
  65. uni.showToast({
  66. title: res.msg,
  67. icon: 'success',
  68. duration: 1500,
  69. mask: true,
  70. })
  71. setTimeout(() => {
  72. uni.navigateBack({
  73. delta: 1,
  74. })
  75. }, 1500)
  76. }
  77. }
  78. </script>
  79. <style scoped>
  80. .volunteer-info {
  81. display: flex;
  82. align-items: center;
  83. border-bottom: 1rpx solid #ccc;
  84. padding: 20rpx;
  85. }
  86. .volunteer-image {
  87. width: 120rpx;
  88. height: 140rpx;
  89. margin-right: 20rpx;
  90. border-radius: 8rpx;
  91. }
  92. .volunteer-details {
  93. flex: 1;
  94. }
  95. .application-type {
  96. padding: 20rpx;
  97. border-bottom: 1rpx solid #ccc;
  98. }
  99. .volunteer-detail-section {
  100. padding: 20rpx;
  101. border-bottom: 1rpx solid #ccc;
  102. }
  103. .volunteer-detail {
  104. display: flex;
  105. align-items: center;
  106. }
  107. .volunteer-data {
  108. flex: 1;
  109. margin-left: 20rpx;
  110. }
  111. .refund-amount {
  112. color: red;
  113. font-weight: bold;
  114. }
  115. .expand-all {
  116. display: flex;
  117. align-items: center;
  118. justify-content: center;
  119. padding: 20rpx;
  120. cursor: pointer;
  121. }
  122. .expand-icon {
  123. width: 40rpx;
  124. height: 40rpx;
  125. margin-left: 10rpx;
  126. }
  127. .application-note {
  128. padding: 20rpx;
  129. }
  130. .submit-button {
  131. padding: 20rpx;
  132. text-align: center;
  133. }
  134. </style>