選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

refund-deposit-card.vue 4.8KB

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