requestaRefund.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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="volunteerPicture" 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 value1 = ref('');
  57. const expanded = ref(false);
  58. const refundReason = ref('');
  59. onLoad(async (options) => {
  60. mainOrderId.value = options.mainOrderId;
  61. const res = await userdictOrderInfo(mainOrderId.value)
  62. dataList.value = res.data;
  63. });
  64. const handlClick = async () => {
  65. const params = {
  66. mainOrderId: mainOrderId.value,
  67. volunteerPicture: dataList.value.volunteerPicture,
  68. refundReason: refundReason.value
  69. };
  70. const res = await refunDnewOrderRefund(params);
  71. if (res.data && res.code === 200) {
  72. uni.showToast({
  73. title: '提交成功',
  74. icon: 'success', // 或者 'none'
  75. duration: 1500, // 显示时间,单位毫秒,默认1500
  76. mask: true, // 是否显示透明蒙层,防止触摸穿透,默认false
  77. });
  78. uni.navigateTo({
  79. url: '/pages/classify'
  80. });
  81. }
  82. }
  83. </script>
  84. <style scoped>
  85. .volunteer-info {
  86. display: flex;
  87. align-items: center;
  88. border-bottom: 1rpx solid #ccc;
  89. padding: 20rpx;
  90. }
  91. .volunteer-image {
  92. width: 80rpx;
  93. height: 120rpx;
  94. margin-right: 20rpx;
  95. border-radius: 8rpx;
  96. }
  97. .volunteer-details {
  98. flex: 1;
  99. }
  100. .application-type {
  101. padding: 20rpx;
  102. border-bottom: 1rpx solid #ccc;
  103. }
  104. .volunteer-detail-section {
  105. padding: 20rpx;
  106. border-bottom: 1rpx solid #ccc;
  107. }
  108. .volunteer-detail {
  109. display: flex;
  110. align-items: center;
  111. }
  112. .volunteer-data {
  113. flex: 1;
  114. margin-left: 20rpx;
  115. }
  116. .refund-amount {
  117. color: red;
  118. font-weight: bold;
  119. }
  120. .expand-all {
  121. display: flex;
  122. align-items: center;
  123. justify-content: center;
  124. padding: 20rpx;
  125. cursor: pointer;
  126. }
  127. .expand-icon {
  128. width: 40rpx;
  129. height: 40rpx;
  130. margin-left: 10rpx;
  131. }
  132. .application-note {
  133. padding: 20rpx;
  134. }
  135. .submit-button {
  136. padding: 20rpx;
  137. text-align: center;
  138. }
  139. </style>