wallet.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="my_account">
  3. <view class="account_top">
  4. <view class="account_name">账户余额</view>
  5. <view class="account_price">{{moneys}}<text>元</text></view>
  6. <view class="account_btn" @click="bindTxmoney">立即充值</view>
  7. </view>
  8. <!-- 我的列表 -->
  9. <view class="mylist">
  10. <view class="list_box" v-for="(item,index) in mylist" :key="index" @click="bindTomy(item.name)">
  11. <view class="list_left">
  12. <view class="list_img">
  13. <image :src="item.image"></image>
  14. </view>
  15. <view class="list_name">{{item.name}}</view>
  16. </view>
  17. <view class="list_right">
  18. <image v-if="globalImages" :src="globalImages + 'images/static/my/icon_go.png'"></image>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import { waitForGlobalImages } from '@/utils/globalImageLoader'
  26. export default {
  27. data() {
  28. return {
  29. moneys:0,
  30. mylist: [{
  31. id: 1,
  32. name: '申请发票',
  33. image: '../../static/image/qqq.png'
  34. }, {
  35. id: 2,
  36. name: '钱包明细',
  37. image: '../../static/image/qq.png'
  38. }],
  39. xcxSelect: '是',
  40. globalImages: '',
  41. }
  42. },
  43. onLoad() {
  44. waitForGlobalImages().then((path) => {
  45. console.log('✅ 全局图片路径:', path)
  46. this.globalImages = path
  47. })
  48. },
  49. onShow() {
  50. this.taskData()
  51. },
  52. methods: {
  53. // 获取余额
  54. taskData() {
  55. this.$Request.getT('/app/userMoney/selectMyMoney').then(res => {
  56. if(res.code==0){
  57. if(res.data){
  58. this.moneys = res.data.money
  59. }
  60. }
  61. });
  62. },
  63. //充值
  64. bindTxmoney() {
  65. uni.navigateTo({
  66. url: '/pageA/Txmoney/Txmoney'
  67. })
  68. },
  69. bindTomy(name) {
  70. console.log(name)
  71. if (name == '申请发票') {
  72. uni.navigateTo({
  73. url: '/pageA/invoice/invoice'
  74. })
  75. } else if (name == '钱包明细') {
  76. uni.navigateTo({
  77. url: '/pageA/mymoneydetail/mymoneydetail'
  78. })
  79. }
  80. }
  81. }
  82. }
  83. </script>
  84. <style>
  85. .my_account {
  86. width: 100%;
  87. }
  88. .account_top {
  89. width: 100%;
  90. height: 280rpx;
  91. background: #FF7F00;
  92. position: relative;
  93. }
  94. .account_name {
  95. position: absolute;
  96. top: 80rpx;
  97. left: 80rpx;
  98. color: white;
  99. font-size: 30rpx;
  100. letter-spacing: 2rpx;
  101. }
  102. .account_price {
  103. position: absolute;
  104. top: 140rpx;
  105. left: 80rpx;
  106. color: white;
  107. font-size: 50rpx;
  108. letter-spacing: 2rpx;
  109. }
  110. .account_price text {
  111. font-size: 25rpx;
  112. margin-left: 10rpx;
  113. }
  114. .account_btn {
  115. width: 190rpx;
  116. height: 66rpx;
  117. background: #ffffff;
  118. color: #FF7F00;
  119. border-radius: 66rpx;
  120. text-align: center;
  121. line-height: 66rpx;
  122. position: absolute;
  123. top: 140rpx;
  124. right: 40rpx;
  125. font-size: 24rpx;
  126. }
  127. /* 我的列表 */
  128. .mylist {
  129. width: 93%;
  130. margin: 0 auto;
  131. background-color: #FFFFFF;
  132. margin-top: 10rpx;
  133. border-radius: 23rpx;
  134. }
  135. .list_box {
  136. width: 90%;
  137. margin: 0 auto;
  138. display: flex;
  139. height: 95rpx;
  140. }
  141. .list_left {
  142. flex: 1;
  143. display: flex;
  144. justify-content: left;
  145. align-items: center;
  146. }
  147. .list_img {
  148. margin-right: 10rpx;
  149. }
  150. .list_img image {
  151. width: 50rpx;
  152. height: 50rpx;
  153. }
  154. .list_name {
  155. font-size: 25rpx;
  156. letter-spacing: 2rpx;
  157. }
  158. .list_right {
  159. flex: 1;
  160. display: flex;
  161. justify-content: flex-end;
  162. align-items: center;
  163. }
  164. .list_right image {
  165. width: 12rpx;
  166. height: 20rpx;
  167. }
  168. </style>