Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

refund-order-balance.vue 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <view class="oderPage">
  3. <view v-for="(item,index) in state.list" class="details">
  4. <view class="header">
  5. <image :src="`${$imgUrl}order/no1.png`" mode=""></image>
  6. <text>{{item.id}}</text>
  7. </view>
  8. <view class="hr">
  9. </view>
  10. <view class="row">
  11. <view class="">
  12. 订单车牌号:
  13. </view>
  14. <text>{{item.vehiclePlate}}</text>
  15. </view>
  16. <view class="row">
  17. <view class="">
  18. 旧卡号:
  19. </view>
  20. <text>{{item.cardId}}</text>
  21. </view>
  22. <view class="row">
  23. <view class="">
  24. 旧卡金额:
  25. </view>
  26. <text>{{item.cardBalance}}</text>
  27. </view>
  28. <view class="line">
  29. </view>
  30. <button @click="refundTypeAction(item)">余额补领</button>
  31. </view>
  32. </view>
  33. </template>
  34. <script setup lang="ts">
  35. import {
  36. reactive,
  37. ref
  38. } from "vue"
  39. import {
  40. navTo
  41. } from "@/utils/utils"
  42. import {
  43. onLoad,
  44. onShow
  45. } from "@dcloudio/uni-app";
  46. import {
  47. queryRefund,
  48. queryRefundApply
  49. } from "@/utils/network/api.js";
  50. import {
  51. request
  52. } from "@/utils/network/request.js";
  53. import {
  54. msg
  55. } from "@/utils/utils";
  56. import {
  57. stringToJson
  58. } from "@/utils/network/encryption";
  59. const state = reactive({
  60. vehicleId: '',
  61. list: []
  62. });
  63. /*视图进入后操作*/
  64. onLoad((option) => {
  65. state.vehicleId = option.vehicleId
  66. queryRefundAction().then(val => {
  67. state.list = val.data
  68. })
  69. });
  70. const reason = ref('')
  71. // 单选数据列表
  72. const radiolist1 = reactive([{
  73. name: '退货原因1',
  74. disabled: false
  75. },
  76. {
  77. name: '退货原因2',
  78. disabled: false
  79. },
  80. {
  81. name: '退货原因3',
  82. disabled: false
  83. },
  84. {
  85. name: '退货原因4',
  86. disabled: false
  87. },
  88. {
  89. name: '退货原因5',
  90. disabled: false
  91. },
  92. ], )
  93. const refundTypeAction = (val) => {
  94. if (val.refundType === 'GLYQR') {
  95. queryRefundApplyAction(val.id).then(value => {
  96. console.log(value)
  97. })
  98. }
  99. }
  100. // 单选
  101. const radioChange = (n) => {
  102. console.log('radioChange', n);
  103. }
  104. const queryRefundAction = () => {
  105. var data = {
  106. vehicleId: state.vehicleId
  107. };
  108. const options = {
  109. type: 2,
  110. data: data,
  111. method: "POST",
  112. showLoading: true,
  113. };
  114. return new Promise(async (resolve, reject) => {
  115. const res = await request(queryRefund, options);
  116. const data = stringToJson(res.bizContent);
  117. resolve(data);
  118. }).catch((error) => {
  119. reject(error);
  120. });
  121. }
  122. const queryRefundApplyAction = (id) => {
  123. var data = {
  124. id: id
  125. };
  126. const options = {
  127. type: 2,
  128. data: data,
  129. method: "POST",
  130. showLoading: true,
  131. };
  132. return new Promise(async (resolve, reject) => {
  133. const res = await request(queryRefundApply, options);
  134. const data = stringToJson(res.bizContent);
  135. resolve(data);
  136. }).catch((error) => {
  137. reject(error);
  138. });
  139. }
  140. </script>
  141. <style>
  142. page {
  143. /* width: 100%;
  144. height: 100%; */
  145. display: flex;
  146. flex-direction: column;
  147. background-color: #F3F3F3;
  148. box-sizing: border-box;
  149. }
  150. </style>
  151. <style lang="scss" scoped>
  152. .oderPage {
  153. background-color: #EEF7F7;
  154. margin: 30rpx;
  155. .details {
  156. margin-top: 30rpx;
  157. position: relative;
  158. background: #fff;
  159. border-radius: 20rpx;
  160. padding: 30rpx;
  161. height: 370rpx;
  162. background: #FFFFFF;
  163. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  164. border-radius: 20rpx;
  165. .header {
  166. align-items: center;
  167. display: flex;
  168. padding-bottom: 30rpx;
  169. // border-bottom: 1px solid #DCDCDC;
  170. image {
  171. width: 51rpx;
  172. height: 31rpx;
  173. }
  174. text {
  175. font-size: 30rpx;
  176. margin-left: 20rpx;
  177. font-weight: 600;
  178. }
  179. }
  180. .hr {
  181. height: 1rpx;
  182. background: #DCDCDC;
  183. width: 100%;
  184. position: absolute;
  185. left: 50%;
  186. transform: translate(-50%);
  187. }
  188. .row {
  189. display: flex;
  190. margin: 34rpx 0;
  191. font-size: 26rpx;
  192. font-family: Noto Sans S Chinese;
  193. font-weight: 400;
  194. color: #333333;
  195. line-height: 30rpx;
  196. view {
  197. font-size: 26rpx;
  198. font-family: Noto Sans S Chinese;
  199. font-weight: 400;
  200. color: #999999;
  201. line-height: 30rpx;
  202. }
  203. }
  204. .line {
  205. width: 100%;
  206. height: 1rpx;
  207. background: #DCDCDC;
  208. }
  209. button {
  210. width: 141rpx;
  211. height: 61rpx;
  212. background: #FFFFFF;
  213. border: 1px solid #00B38B;
  214. border-radius: 30rpx;
  215. font-size: 26rpx;
  216. font-family: Noto Sans S Chinese;
  217. font-weight: 400;
  218. color: #00B38B;
  219. line-height: 61rpx;
  220. position: absolute;
  221. right: 30rpx;
  222. bottom: 20rpx;
  223. padding: 0;
  224. }
  225. }
  226. }
  227. </style>