cancelationOforder.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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="application-note">
  22. <up-textarea
  23. v-model="refundReason"
  24. placeholder="请详细填写申请申请说明"
  25. ></up-textarea>
  26. </view>
  27. <!-- 提交申请按钮 -->
  28. <view class="submit-button">
  29. <up-button type="error" text="提交申请" @click="handlClick"></up-button>
  30. </view>
  31. </view>
  32. </template>
  33. <script setup>
  34. import { onMounted, ref } from 'vue'
  35. import { onLoad } from '@dcloudio/uni-app'
  36. import { userdictOrderInfo, refunDnewOrderRefund } from '@/api/userList.js'
  37. const dataList = ref([])
  38. const mainOrderId = ref('') //志愿者ID
  39. const refundReason = ref('')
  40. const expanded = ref(false)
  41. onLoad(async (options) => {
  42. mainOrderId.value = options.mainOrderId
  43. const res = await userdictOrderInfo(mainOrderId.value)
  44. dataList.value = res.data
  45. })
  46. const toggleExpand = () => {
  47. expanded.value = !expanded.value
  48. }
  49. const handlClick = async () => {
  50. const params = {
  51. mainOrderId: mainOrderId.value,
  52. volunteerPicture: dataList.value.volunteerPicture,
  53. refundReason: refundReason.value,
  54. }
  55. const res = await refunDnewOrderRefund(params)
  56. if (res.code === 200) {
  57. uni.showModal({
  58. title: '提示',
  59. content: res.msg,
  60. showCancel: false,
  61. success: function (modalRes) {
  62. if (modalRes.confirm) {
  63. uni.navigateBack({
  64. delta: 1,
  65. })
  66. }
  67. },
  68. })
  69. }
  70. }
  71. </script>
  72. <style scoped>
  73. .volunteer-info {
  74. display: flex;
  75. align-items: center;
  76. border-bottom: 1rpx solid #ccc;
  77. padding: 20rpx;
  78. }
  79. .volunteer-image {
  80. width: 120rpx;
  81. height: 140rpx;
  82. margin-right: 20rpx;
  83. border-radius: 8rpx;
  84. }
  85. .volunteer-details {
  86. flex: 1;
  87. }
  88. .application-type {
  89. padding: 20rpx;
  90. border-bottom: 1rpx solid #ccc;
  91. }
  92. .volunteer-detail-section {
  93. padding: 20rpx;
  94. border-bottom: 1rpx solid #ccc;
  95. }
  96. .volunteer-detail {
  97. display: flex;
  98. align-items: center;
  99. }
  100. .volunteer-data {
  101. flex: 1;
  102. margin-left: 20rpx;
  103. }
  104. .refund-amount {
  105. color: red;
  106. font-weight: bold;
  107. }
  108. .expand-all {
  109. display: flex;
  110. align-items: center;
  111. justify-content: center;
  112. padding: 20rpx;
  113. cursor: pointer;
  114. }
  115. .expand-icon {
  116. width: 40rpx;
  117. height: 40rpx;
  118. margin-left: 10rpx;
  119. }
  120. .application-note {
  121. padding: 20rpx;
  122. }
  123. .submit-button {
  124. padding: 20rpx;
  125. text-align: center;
  126. }
  127. </style>