您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

refund-deposit-card.vue 4.6KB

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