balance.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <!-- 我的钱包页面 -->
  2. <template>
  3. <view class="container">
  4. <view class="content">
  5. <image class="bg" :src="imgUrl+'/balance_bg.png'" />
  6. <view class="detail flex_column_start_start">
  7. <text class="balance_title">{{$L('可用余额(元)')}}</text>
  8. <view class="balance_num flex_row_start_end">
  9. <text class="unit">¥</text>
  10. <text class="amount">{{$getPartNumber(balanceData.balanceAvailable,'int')}}</text>
  11. <text class="unit">{{$getPartNumber(balanceData.balanceAvailable,'decimal')}}</text>
  12. </view>
  13. <view class="total_amount flex_row_start_center">
  14. <image class="amount_icon" :src="imgUrl+'amount_icon.png'" />
  15. <text class="con tit">{{$L('账户总额 (元)')}}</text>
  16. <text class="con unit">¥</text>
  17. <text class="con amount">{{balanceData.rechargeSum}}</text>
  18. </view>
  19. </view>
  20. <view class="recharge_btn flex_row_center_center" @click="navTo('/pages/recharge/recharge?balance='+balanceData.rechargeSum + '&payMethodType=rechargeBalance')">
  21. <text class="con">{{$L('充值')}}</text>
  22. <text class="iconfont iconziyuan11"></text>
  23. </view>
  24. </view>
  25. <view class="detail_list flex_column_start_start">
  26. <view class="item flex_row_between_center b_b" @click="navTo('/pages/balance/list')">
  27. <view class="left flex_row_start_center">
  28. <image class="icon" :src="imgUrl+'balance_icon.png'" />
  29. <text class="tit">{{$L('余额明细')}}</text>
  30. </view>
  31. <text class="iconfont iconziyuan11"></text>
  32. </view>
  33. <view class="item flex_row_between_center" @click="navTo('/pages/recharge/list')">
  34. <view class="left flex_row_start_center">
  35. <image class="icon" :src="imgUrl+'recharge_icon.png'" />
  36. <text class="tit">{{$L('充值明细')}}</text>
  37. </view>
  38. <text class="iconfont iconziyuan11"></text>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import {
  45. mapState
  46. } from 'vuex';
  47. export default {
  48. data() {
  49. return {
  50. imgUrl: getApp().globalData.imgUrl,
  51. balanceData: {}, //余额
  52. }
  53. },
  54. onLoad() {
  55. this.getInfo()
  56. },
  57. computed: {
  58. ...mapState(['hasLogin', 'userInfo'])
  59. },
  60. methods: {
  61. //获取会员账户余额
  62. getInfo() {
  63. this.$request({
  64. url: 'v3/member/front/balanceRecharge/getMemberBalance',
  65. // data: {
  66. // key: this.userInfo.access_token
  67. // },
  68. method: 'GET'
  69. }).then(res => {
  70. if (res.state == 200) {
  71. this.balanceData = res.data;
  72. } else {
  73. this.$api.msg(res.msg);
  74. }
  75. }).catch((e) => {})
  76. },
  77. navTo(url) {
  78. uni.navigateTo({
  79. url
  80. })
  81. },
  82. }
  83. }
  84. </script>
  85. <style lang="scss">
  86. uni-page-body {
  87. display: flex;
  88. height: 100%;
  89. }
  90. page {
  91. background: $bg-color-split;
  92. width: 750rpx;
  93. margin: 0 auto;
  94. .container {
  95. margin-top: 20rpx;
  96. display: flex;
  97. flex-direction: column;
  98. flex: 1;
  99. background: #fff;
  100. .content {
  101. margin-top: 30rpx;
  102. width: 690rpx;
  103. height: 340rpx;
  104. margin-left: 30rpx;
  105. position: relative;
  106. .recharge_btn {
  107. position: absolute;
  108. z-index: 2;
  109. right: 0;
  110. top: 111rpx;
  111. width: 142rpx;
  112. height: 60rpx;
  113. background: linear-gradient(90deg, rgba(238, 238, 238, .5) 0%, rgba(238, 238, 238, 0) 100%);
  114. // opacity:0.5;
  115. border-radius: 30rpx;
  116. color: #fff;
  117. font-size: 30rpx;
  118. .iconfont {
  119. font-size: 16rpx;
  120. transform: scale(0.75);
  121. display: inline-block;
  122. margin-left: 5rpx;
  123. }
  124. }
  125. .bg {
  126. width: 100%;
  127. height: 100%;
  128. }
  129. .detail {
  130. position: absolute;
  131. left: 0;
  132. right: 0;
  133. top: 0;
  134. bottom: 0;
  135. z-index: 2;
  136. padding: 45rpx 40rpx;
  137. color: #fff;
  138. .balance_title {
  139. font-size: 26rpx;
  140. }
  141. .balance_num {
  142. font-weight: bold;
  143. margin-top: 41rpx;
  144. color: #fff;
  145. .unit {
  146. font-size: 46rpx;
  147. font-weight: bold;
  148. }
  149. .amount {
  150. font-size: 66rpx;
  151. font-weight: bold;
  152. line-height: 66rpx;
  153. }
  154. }
  155. .total_amount {
  156. margin-top: 84rpx;
  157. .amount_icon {
  158. width: 27rpx;
  159. height: 23rpx;
  160. margin-right: 9rpx;
  161. }
  162. .con {
  163. color: rgba(255, 255, 255, .8);
  164. }
  165. .tit,
  166. .amount {
  167. font-size: 26rpx;
  168. }
  169. .unit {
  170. font-size: 22rpx;
  171. margin-left: 5rpx;
  172. }
  173. }
  174. }
  175. }
  176. .detail_list {
  177. padding: 0 30rpx;
  178. .item {
  179. width: 100%;
  180. height: 141rpx;
  181. position: relative;
  182. .left {
  183. .icon {
  184. width: 80rpx;
  185. height: 80rpx;
  186. margin-right: 20rpx;
  187. }
  188. .tit {
  189. color: $main-font-color;
  190. font-size: 30rpx;
  191. }
  192. }
  193. .iconfont {
  194. color: $main-third-color;
  195. font-size: 32rpx;
  196. transform: scale(0.75);
  197. display: inline-block;
  198. }
  199. }
  200. }
  201. }
  202. }
  203. </style>