Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

refund-deposit-card.vue 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <!-- <nav-bar title="申请退款"></nav-bar> -->
  3. <view class="selectCar-box">
  4. <view v-if="state.list&&state.list.length>0" @click="choose(i,item)" class="item" v-for="(item,i) in state.list" :key="i">
  5. <view class="iten-left">
  6. <!-- <image :src="`${$imgUrl}che.png`" mode=""></image> -->
  7. <text>订单编号:{{item.orderId}}</text>
  8. </view>
  9. <view class="choose-item">
  10. <view class="active" v-if="flag==i">
  11. </view>
  12. </view>
  13. </view>
  14. <view v-else>
  15. <empty title='暂无找到相关储值卡圈存信息' />
  16. </view>
  17. <view class="submit" @click="apply()">申请退款</view>
  18. </view>
  19. </template>
  20. <script setup lang="ts">
  21. import empty from "@/components/empty/empty.vue";
  22. import {
  23. reactive,
  24. ref
  25. } from "vue"
  26. import {
  27. navTo,msg
  28. } from "@/utils/utils"
  29. import {
  30. onLoad,
  31. } from "@dcloudio/uni-app";
  32. import {
  33. refundQuan,queryRefoundResult,queryStoredQuan
  34. } from "@/utils/network/api.js";
  35. import {
  36. request
  37. } from "@/utils/network/request.js";
  38. import {
  39. getItem,
  40. StorageKeys,
  41. } from "@/utils/storage";
  42. import {
  43. stringToJson
  44. } from "@/utils/network/encryption";
  45. const state = reactive({
  46. list: [] ,//车辆list
  47. choiceItem:{}, //选择退款的某一条数据
  48. });
  49. const flag = ref('-1') //默认选择0
  50. onLoad((option:any) => {
  51. console.log("option",option)
  52. StoredQuan(option.cardId);
  53. });
  54. const StoredQuan=(cardId)=>{
  55. const options = {
  56. type: 2,
  57. data: {
  58. "status":0,
  59. "cardId":cardId,
  60. },
  61. method: 'POST',
  62. showLoading: true,
  63. }
  64. request(queryStoredQuan, options).then((res) => {
  65. const data=stringToJson(res.bizContent);
  66. state.list=data.data
  67. console.log("1111",data)
  68. })
  69. }
  70. const choose = (i, item) => {
  71. flag.value = i
  72. console.log("item",item)
  73. state.choiceItem=item
  74. }
  75. const apply=()=>{
  76. if(flag.value=='-1'){
  77. msg("请选择退款订单")
  78. return;
  79. }
  80. queryRefound();
  81. console.log("提交")
  82. }
  83. const queryRefound=()=>{
  84. const options = {
  85. type: 2,
  86. data: {
  87. "orderId":state.choiceItem.orderId,
  88. "cardId":state.choiceItem.cardId,
  89. "openId": getItem(StorageKeys.OpenId),
  90. },
  91. method: 'POST',
  92. showLoading: true,
  93. }
  94. request(refundQuan, options).then((res) => {
  95. const data=stringToJson(res.bizContent);
  96. refoundResult();
  97. console.log("222",data)
  98. })
  99. }
  100. const refoundResult=()=>{
  101. const options = {
  102. type: 2,
  103. data: {
  104. "orderId":state.choiceItem.orderId,
  105. "cardId":state.choiceItem.cardId,
  106. },
  107. method: 'POST',
  108. showLoading: true,
  109. }
  110. request(queryRefoundResult, options).then((res) => {
  111. const data=stringToJson(res.bizContent);
  112. if(data.refundStatus=="SUCCESS"){
  113. uni.navigateBack({
  114. delta:2
  115. })
  116. }else if(data.refundStatus=="CLOSED"){
  117. msg('退款关闭')
  118. }else if(data.refundStatus=="HANDLING"){
  119. msg('退款处理中')
  120. }else if(data.refundStatus=="EXCEPTION"){
  121. msg('退款异常')
  122. }
  123. })
  124. }
  125. </script>
  126. <style>
  127. page {
  128. width: 100%;
  129. height: 100%;
  130. display: flex;
  131. flex-direction: column;
  132. background-color: #F3F3F3;
  133. }
  134. </style>
  135. <style lang="scss" scoped>
  136. .flex {
  137. display: flex;
  138. justify-content: center;
  139. }
  140. .selectCar-box {
  141. // width: 100%;
  142. height: 100%;
  143. padding: 30rpx;
  144. .item {
  145. padding: 20rpx;
  146. display: flex;
  147. justify-content: space-between;
  148. align-items: center;
  149. height: 130rpx;
  150. background: #FFFFFF;
  151. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  152. border-radius: 20rpx;
  153. margin-bottom: 30rpx;
  154. .iten-left {
  155. display: flex;
  156. align-items: center;
  157. image {
  158. width: 150rpx;
  159. height: 90rpx;
  160. }
  161. text {
  162. margin-left: 20rpx;
  163. font-size: 32rpx;
  164. font-family: Noto Sans S Chinese;
  165. font-weight: 400;
  166. color: #333333;
  167. }
  168. }
  169. .choose-item {
  170. width: 44rpx;
  171. height: 44rpx;
  172. background: #FFFFFF;
  173. border: 2rpx solid #00B38B;
  174. border-radius: 50%;
  175. margin-right: 20rpx;
  176. display: flex;
  177. justify-content: center;
  178. align-items: center;
  179. box-sizing: content-box;
  180. }
  181. .active {
  182. width: 34rpx;
  183. height: 34rpx;
  184. background: #00B38B;
  185. border-radius: 50%;
  186. }
  187. }
  188. }
  189. .submit {
  190. height: 80rpx;
  191. background: linear-gradient(-90deg, #43A1E0 0%, #13E7C1 100%);
  192. box-shadow: 0rpx 4rpx 11rpx 1rpx rgba(223, 223, 223, 0.5);
  193. border-radius: 40rpx;
  194. font-size: 32rpx;
  195. font-family: Microsoft YaHei;
  196. font-weight: 400;
  197. color: #FFFFFF;
  198. line-height: 80rpx;
  199. position: fixed;
  200. bottom: 70rpx;
  201. width: 670rpx;
  202. left: 50%;
  203. transform: translate(-50%);
  204. text-align: center;
  205. }
  206. </style>