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.

234 lines
4.8 KiB

10 months ago
  1. <template>
  2. <view class="balance">
  3. <u-navbar
  4. :title="$t('page.balance.balance-detail')"
  5. :safeAreaInsetTop="false"
  6. placeholder
  7. @leftClick="leftClick"
  8. >
  9. <!-- <view
  10. slot="right"
  11. >
  12. <img src="/static/payOrder/46664.png" alt="" />
  13. </view> -->
  14. </u-navbar>
  15. <view class="price-box">
  16. <view class="img">
  17. <img src="/static/balance/1.png" alt="" />
  18. </view>
  19. <view class="price">
  20. <text class="text">{{ balance.money || 0 }}</text>
  21. </view>
  22. </view>
  23. <view class="line">
  24. <u-cell class="ceil"
  25. :title="$t('page.balance.wallet-recharge')"
  26. @click="toRecharge"
  27. isLink>
  28. <img style="width: 25px;"
  29. src="/static/usercenter/purse 1024@3x.png" alt=""
  30. slot="icon"/>
  31. </u-cell>
  32. <u-cell class="ceil"
  33. @click="toBankCardWithdrawal"
  34. :title="$t('page.balance.bank-card-withdrawal')"
  35. isLink>
  36. <img style="width: 25px;" src="/static/usercenter/card@3x.png" alt="" slot="icon"/>
  37. </u-cell>
  38. </view>
  39. <view class="line balance-info">
  40. <u-list
  41. @scrolltolower="scrolltolower"
  42. >
  43. <view class="title">
  44. {{ $t('page.balance.transaction-record') }}
  45. </view>
  46. <u-list-item
  47. v-for="(item, index) in list"
  48. :key="index"
  49. >
  50. <view class="item">
  51. <view class="left">
  52. <view class="info">
  53. <view class="">
  54. <!-- {{item.type == 0 ? $t('page.balance.top-up') : $t('page.balance.withdraw')}} -->
  55. {{ type[item.type].info }}
  56. </view>
  57. <!-- <u-tag
  58. v-if="type[item.type].tag"
  59. :text="$t(item.status == 0 ? 'page.balance.completed' : 'page.balance.under-review')"
  60. size="mini"
  61. style="margin-left: 10px;"
  62. :type="item.status == 0 ? 'success' : 'warning'"></u-tag> -->
  63. </view>
  64. <view class="bank" v-if="item.bank">
  65. {{ $t('page.bankCart.title') }} {{ item.bank.no }}
  66. </view>
  67. <!-- <view class="date">
  68. {{ item.createTime }}
  69. </view> -->
  70. </view>
  71. <view class="right" :style="{color : type[item.type].color}">
  72. {{ type[item.type].no }}{{ item.money }}
  73. </view>
  74. </view>
  75. </u-list-item>
  76. </u-list>
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. import UniDateformat from '@/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js'
  82. export default {
  83. components : {
  84. UniDateformat
  85. },
  86. data() {
  87. return {
  88. balance : {},
  89. list : [],
  90. type : [//0充值1提现2购买3回购
  91. {
  92. no : '+',
  93. color : '#5EA649',
  94. info : this.$t('page.balance.top-up'),
  95. tag : true
  96. },
  97. {
  98. no : '-',
  99. color : '#E45338',
  100. info : this.$t('page.balance.withdraw'),
  101. tag : true
  102. },
  103. {
  104. no : '-',
  105. color : '#E45338',
  106. info : this.$t('page.cart.buy')
  107. },
  108. {
  109. no : '+',
  110. color : '#5EA649',
  111. info : this.$t('page.repurchase.repurchase'),
  112. tag : true
  113. },
  114. ]
  115. };
  116. },
  117. onShow() {
  118. this.getData()
  119. this.getInfo()
  120. },
  121. methods : {
  122. getInfo(){
  123. this.request('getInfo')
  124. .then(res => {
  125. if(res.code == 200){
  126. this.balance = res.result
  127. localStorage.setItem('uid', res.result.id)
  128. localStorage.setItem('money', res.result.money || 0)
  129. localStorage.setItem('account', res.result.account)
  130. }
  131. })
  132. },
  133. getData(){
  134. this.request('waterList', {}, {
  135. "pageSize":999,
  136. "currentPage": 0
  137. }).then(res => {
  138. if(res.code == 200){
  139. this.list = res.result.records
  140. }
  141. })
  142. },
  143. leftClick(){
  144. uni.switchTab({
  145. url: '/pages/user/user'
  146. })
  147. },
  148. scrolltolower(){
  149. console.log('到底了');
  150. },
  151. toRecharge(){
  152. uni.navigateTo({
  153. url : '/pages/user/walletRecharge/walletRecharge'
  154. })
  155. },
  156. toBankCardWithdrawal(){
  157. uni.navigateTo({
  158. url : '/pages/user/bankCardWithdrawal/bankCardWithdrawal'
  159. })
  160. },
  161. }
  162. }
  163. </script>
  164. <style lang="scss" scoped>
  165. .balance{
  166. .price-box{
  167. background-color: #E45338;
  168. display: flex;
  169. flex-direction: column;
  170. justify-content: center;
  171. align-items: center;
  172. padding: 30px 20px;
  173. .price{
  174. color: #fff;
  175. margin-top: 20px;
  176. .text{
  177. font-size: 50rpx;
  178. }
  179. }
  180. }
  181. .line{
  182. background-color: #fff;
  183. .ceil{
  184. margin: 10px 0;
  185. }
  186. }
  187. .balance-info{
  188. padding: 10px;
  189. .title{
  190. border-left: 3px solid #E3392F;
  191. margin: 10px;
  192. padding: 0 5px;
  193. display: flex;
  194. align-items: center;
  195. color: #E3392F;
  196. font-size: 28rpx;
  197. margin-bottom: 10px;
  198. }
  199. .item{
  200. display: flex;
  201. border-top: 1px solid #00000033;
  202. margin: 10px 0;
  203. padding-top: 10px;
  204. .left{
  205. color: #666;
  206. flex: 4;
  207. .info{
  208. font-size: 28rpx;
  209. display: flex;
  210. }
  211. .bank{
  212. font-size: 13px;
  213. margin-top: 5px;
  214. }
  215. .date{
  216. color: #777;
  217. font-size: 25rpx;
  218. margin-top: 10px;
  219. }
  220. }
  221. .right{
  222. flex: 1;
  223. display: flex;
  224. justify-content: center;
  225. align-items: center;
  226. font-size: 28rpx;
  227. }
  228. }
  229. }
  230. }
  231. </style>