You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

result.vue 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view class="wrapper">
  3. <image :src="`${$imgUrl}common/reharge-success.png`" class="pic-status" mode="widthFix"></image>
  4. <view class="sub-text"><text>修复前前余额:</text><text>¥{{state.preBalance/100}}</text></view>
  5. <view class="sub-text"><text>修复金额:</text><text>¥{{state.rechargeAmount/100}}</text></view>
  6. <view class="sub-text"><text>修复后余额:</text><text>¥{{state.afterMoney/100}}</text></view>
  7. <view class="btn btn-primary" @click="view">返回查看</view>
  8. </view>
  9. </template>
  10. <script lang="ts" setup>
  11. import { reactive } from "vue";
  12. import {
  13. rechargeMoneyApi
  14. } from "@/utils/network/api.js";
  15. import {
  16. onLoad
  17. } from "@dcloudio/uni-app";
  18. import {
  19. request
  20. } from "@/utils/network/request.js";
  21. import {
  22. stringToJson
  23. } from "@/utils/network/encryption.js";
  24. const state = reactive({
  25. cardId: "",
  26. preBalance: 0, //充值前余额
  27. rechargeAmount: 0,//充值金额
  28. afterMoney: 0 //充值后金额
  29. })
  30. onLoad((option) => {
  31. state.cardId = option.cardId
  32. money()
  33. })
  34. const money = () => {
  35. const options = {
  36. type: 2,
  37. data: {
  38. "cardId": state.cardId,
  39. },
  40. method: 'POST',
  41. showLoading: true,
  42. }
  43. request(rechargeMoneyApi, options).then((res) => {
  44. const data = stringToJson(res.bizContent);
  45. state.preBalance = data.preBalance
  46. state.rechargeAmount = data.rechargeAmount
  47. state.afterMoney = Number(data.rechargeAmount) + Number(data.preBalance)
  48. console.log("圈存金额查询2", data)
  49. })
  50. }
  51. const view = () => {
  52. uni.navigateBack({
  53. delta: 3
  54. })
  55. }
  56. </script>
  57. <style>
  58. .wrapper {
  59. display: flex;
  60. flex-direction: column;
  61. justify-content: center;
  62. text-align: center;
  63. }
  64. .text-result {
  65. font-size: 36rpx;
  66. color: #333;
  67. font-weight: 400;
  68. }
  69. .sub-text {
  70. font-size: 26rpx;
  71. font-weight: 400;
  72. color: #999999;
  73. padding-top: 40rpx;
  74. }
  75. .pic-status {
  76. width: 690rpx;
  77. height: 300rpx;
  78. margin: 98rpx 30rpx 25rpx;
  79. }
  80. .btn-primary {
  81. width: 670rpx;
  82. height: 80rpx;
  83. line-height: 80rpx;
  84. background: linear-gradient(-90deg, #43A1E0 0%, #13E7C1 100%);
  85. border-radius: 40rpx;
  86. font-size: 32rpx;
  87. color: #ffffff;
  88. margin: 300rpx 40rpx 0;
  89. text-align: center;
  90. }
  91. </style>