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.

index.vue 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view class='content'>
  3. <view class="money_wrap">
  4. <view>账户余额</view>
  5. <view>¥{{state.money/100}}</view>
  6. </view>
  7. <view class='item_wrap'>
  8. <view class='item' @click='navTo(`/pages/bluetooth/bluetooth?routeType=8&&accountId=${state.name}`)'>
  9. <view class='left_content'>
  10. <image :src="fileURL + 'image/index/item-1.png'" mode="aspectFill"></image>
  11. <view>去圈存</view>
  12. </view>
  13. <u-icon name="arrow-right" color='#ccc'></u-icon>
  14. </view>
  15. <view class='item'
  16. @click='navTo(`/subpackage/after-sale/account-recharge/consumption-record?name=${state.name}`)'>
  17. <view class='left_content'>
  18. <image :src="fileURL + 'image/index/item-1.png'" mode="aspectFill"></image>
  19. <view>消费明细</view>
  20. </view>
  21. <u-icon name="arrow-right" color='#ccc'></u-icon>
  22. </view>
  23. <view class='item'
  24. @click='navTo(`/subpackage/after-sale/account-recharge/recharge-record?name=${state.name}`)'>
  25. <view class='left_content'>
  26. <image :src="fileURL + 'image/index/item-1.png'" mode="aspectFill"></image>
  27. <view>充值明细</view>
  28. </view>
  29. <u-icon name="arrow-right" color='#ccc'></u-icon>
  30. </view>
  31. <view class='item'
  32. @click='navTo(`/subpackage/personal-center/setting/bank-card/bank-card?name=${state.name}`)'>
  33. <view class='left_content'>
  34. <image :src="fileURL + 'image/index/item-1.png'" mode="aspectFill"></image>
  35. <view>银行卡管理</view>
  36. </view>
  37. <u-icon name="arrow-right" color='#ccc'></u-icon>
  38. </view>
  39. <view class='item' @click='navTo(`/subpackage/after-sale/account-recharge/recharge?name=${state.name}`)'>
  40. <view class='left_content'>
  41. <image :src="fileURL + 'image/index/item-1.png'" mode="aspectFill"></image>
  42. <view>充值服务</view>
  43. </view>
  44. <u-icon name="arrow-right" color='#ccc'></u-icon>
  45. </view>
  46. </view>
  47. <view class='item item_wrap' @click='navTo(`/subpackage/after-sale/account-recharge/login`)'>
  48. <view class='left_content'>
  49. <image :src="fileURL + 'image/index/item-1.png'" mode="aspectFill"></image>
  50. <view>退出</view>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script setup lang='ts'>
  56. import {
  57. navTo
  58. } from "@/utils/utils";
  59. import {
  60. fileURL
  61. } from "@/datas/fileURL.js";
  62. import {
  63. onLoad,
  64. onShow
  65. } from "@dcloudio/uni-app";
  66. import {
  67. reactive
  68. } from "vue";
  69. import {
  70. request
  71. } from "@/utils/network/request.js";
  72. import {
  73. accountMoneyApi
  74. } from "@/utils/network/api.js";
  75. import {
  76. stringToJson
  77. } from "@/utils/network/encryption";
  78. const state = reactive({
  79. money: 0,
  80. name: '' //name就是accountId
  81. })
  82. onLoad((option: any) => {
  83. state.name = option.name;
  84. console.log("option", option)
  85. getMoney()
  86. })
  87. onShow(() => {
  88. getMoney()
  89. })
  90. const getMoney = () => {
  91. let options = {
  92. type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
  93. data: {
  94. accountId: state.name
  95. }, //请求参数
  96. method: "POST", //提交方式(默认POST)
  97. showLoading: true, //是否显示加载中(默认显示)
  98. };
  99. //调用方式
  100. request(accountMoneyApi, options).then((res) => {
  101. const data = stringToJson(res.bizContent);
  102. state.money = data.money
  103. })
  104. .catch((err) => {
  105. console.log(err);
  106. });
  107. }
  108. </script>
  109. <style scoped>
  110. .content {
  111. background-color: #EEF7F7;
  112. width: 100%;
  113. height: 100vh;
  114. overflow: hidden;
  115. }
  116. .money_wrap {
  117. background-color: white;
  118. padding: 8rpx 0 16rpx 0;
  119. }
  120. .money_wrap>view:first-child {
  121. text-align: center;
  122. font-size: 30rpx;
  123. }
  124. .money_wrap>view:last-child {
  125. text-align: center;
  126. font-size: 44rpx;
  127. margin-top: 14rpx;
  128. color: red;
  129. }
  130. .item_wrap {
  131. margin-top: 26rpx;
  132. }
  133. .item {
  134. background-color: white;
  135. border-bottom: 1rpx solid rgb(239, 239, 239);
  136. display: flex;
  137. font-size: 30rpx;
  138. padding: 34rpx 30rpx;
  139. align-items: center;
  140. justify-content: space-between;
  141. }
  142. .item image {
  143. width: 60rpx;
  144. height: 60rpx;
  145. margin-right: 30rpx;
  146. }
  147. .left_content {
  148. display: flex;
  149. align-items: center;
  150. }
  151. </style>