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.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. }
  54. </script>
  55. <style>
  56. .wrapper {
  57. display: flex;
  58. flex-direction: column;
  59. justify-content: center;
  60. }
  61. .text-result {
  62. font-size: 36rpx;
  63. color: #333;
  64. font-weight: 400;
  65. }
  66. .sub-text {
  67. font-size: 30rpx;
  68. font-weight: 400;
  69. color: black;
  70. padding-top: 40rpx;
  71. margin-left: 250rpx;
  72. }
  73. .sub-text>text:first-child {
  74. width: 36%;
  75. display: inline-block;
  76. }
  77. .pic-status {
  78. width: 690rpx;
  79. height: 300rpx;
  80. margin: 98rpx 30rpx 25rpx;
  81. }
  82. .btn-primary {
  83. width: 670rpx;
  84. height: 80rpx;
  85. line-height: 80rpx;
  86. background: linear-gradient(-90deg, #43A1E0 0%, #13E7C1 100%);
  87. border-radius: 40rpx;
  88. font-size: 32rpx;
  89. color: #ffffff;
  90. margin: 300rpx 40rpx 0;
  91. text-align: center;
  92. }
  93. </style>