requestaRefund.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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="expand-all">
  34. <text @click="toggleExpand">展开全部</text>
  35. <image :src="expanded ? '/path/to/up-icon.png' : '/path/to/down-icon.png'" class="expand-icon"></image>
  36. </view>
  37. <!-- 申请说明 -->
  38. <view class="application-note">
  39. <up-textarea v-model="value1" placeholder="请详细填写申请申请说明"></up-textarea>
  40. </view>
  41. <!-- 提交申请按钮 -->
  42. <view class="submit-button">
  43. <up-button type="error" text="提交申请" @click="handlClick"></up-button>
  44. </view>
  45. </view>
  46. </template>
  47. <script setup>
  48. import {
  49. onMounted,
  50. ref
  51. } from "vue";
  52. import {
  53. onLoad
  54. } from '@dcloudio/uni-app'
  55. import {
  56. userdictOrderInfo,
  57. refunDnewOrderRefund
  58. } from "@/api/userList.js"
  59. const dataList = ref([])
  60. const mainOrderId = ref(''); //志愿者ID
  61. const value1 = ref('');
  62. const expanded = ref(false);
  63. onLoad(async (options) => {
  64. mainOrderId.value = options.mainOrderId;
  65. const res = await userdictOrderInfo(mainOrderId.value)
  66. dataList.value = res.data;
  67. });
  68. const toggleExpand = () => {
  69. expanded.value = !expanded.value;
  70. };
  71. const handlClick = async () => {
  72. const params = {
  73. mainOrderId: mainOrderId.value,
  74. volunteerPicture: dataList.value.volunteerPicture
  75. };
  76. const res = await refunDnewOrderRefund(params);
  77. if (res.status === 200) {
  78. uni.showToast({
  79. title: '提交成功',
  80. icon: 'success', // 或者 'none'
  81. duration: 1500, // 显示时间,单位毫秒,默认1500
  82. mask: true, // 是否显示透明蒙层,防止触摸穿透,默认false
  83. });
  84. uni.navigateTo({
  85. url: '/pages/classify'
  86. });
  87. }
  88. }
  89. </script>
  90. <style scoped>
  91. .volunteer-info {
  92. display: flex;
  93. align-items: center;
  94. border-bottom: 1rpx solid #ccc;
  95. padding: 20rpx;
  96. }
  97. .volunteer-image {
  98. width: 80rpx;
  99. height: 120rpx;
  100. margin-right: 20rpx;
  101. border-radius: 8rpx;
  102. }
  103. .volunteer-details {
  104. flex: 1;
  105. }
  106. .application-type {
  107. padding: 20rpx;
  108. border-bottom: 1rpx solid #ccc;
  109. }
  110. .volunteer-detail-section {
  111. padding: 20rpx;
  112. border-bottom: 1rpx solid #ccc;
  113. }
  114. .volunteer-detail {
  115. display: flex;
  116. align-items: center;
  117. }
  118. .volunteer-data {
  119. flex: 1;
  120. margin-left: 20rpx;
  121. }
  122. .refund-amount {
  123. color: red;
  124. font-weight: bold;
  125. }
  126. .expand-all {
  127. display: flex;
  128. align-items: center;
  129. justify-content: center;
  130. padding: 20rpx;
  131. cursor: pointer;
  132. }
  133. .expand-icon {
  134. width: 40rpx;
  135. height: 40rpx;
  136. margin-left: 10rpx;
  137. }
  138. .application-note {
  139. padding: 20rpx;
  140. }
  141. .submit-button {
  142. padding: 20rpx;
  143. text-align: center;
  144. }
  145. </style>