bag.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <!-- 钱包 -->
  2. <template>
  3. <view class="page page--viewider">
  4. <view class="widget">
  5. <view class="moneybox widget-inner">
  6. <view class="balance1">
  7. <image class="moneyimage" src="../../static/money/money.png" alt="">
  8. </view>
  9. <view class="balance2">
  10. 我的余额
  11. </view>
  12. <view class="moneys">
  13. <view class="rmb">¥</view>
  14. {{user.money||0.00}}
  15. </view>
  16. <view class="balance" @click="$jump('mine.order')">
  17. 查看账单
  18. </view>
  19. </view>
  20. <view class="widget-inner1">
  21. <view class="submitBtn btn btn-primary" @click="$jump('mine.recharge')">充值</view>
  22. <view class="submitBtn btn btn-error" @click="cash()">提现</view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import {mapState} from 'vuex'
  29. import http from '../../library/http.js'
  30. export default {
  31. data(){
  32. return{
  33. user:uni.getStorageSync('userInfo')
  34. }
  35. },
  36. methods:{
  37. getuserinfo(){
  38. var postdata={
  39. id: uni.getStorageSync('access_token')
  40. };
  41. http.setWait(false).post('user.php?act=userinfo',postdata).then(res=>{
  42. this.user=res.data;
  43. uni.setStorageSync('userInfo',this.user)
  44. })
  45. },
  46. cash(){
  47. if(this.user.banknum>0){
  48. this.$jump('mine.cash',{});
  49. }
  50. else{
  51. uni.showModal({
  52. title: '提示',
  53. content: "请先绑定银行卡,才能申请提现",
  54. showCancel: true,
  55. cancelText: '关闭',
  56. confirmText: '绑定银行卡',
  57. success: res => {
  58. if(res.confirm) {
  59. uni.navigateTo({
  60. url:"/pages/mine/bank"
  61. })
  62. }
  63. }
  64. });
  65. }
  66. },
  67. },
  68. onShow() {
  69. this.getuserinfo();
  70. }
  71. }
  72. </script>
  73. <style scoped>
  74. .page{
  75. overflow: hidden;
  76. }
  77. .moneyIcon{
  78. width: 0.75rem;
  79. height: 0.75rem;
  80. align-items: center;
  81. margin-right: 0.3125rem;
  82. }
  83. .widget-inner {
  84. display: flex;
  85. flex-direction: column;
  86. justify-content: center;
  87. align-items: center;
  88. background-color: inherit;
  89. }
  90. .balance1{
  91. display: flex;
  92. align-items: center;
  93. margin-bottom: 1rem;
  94. }
  95. .balance2{
  96. display: flex;
  97. align-items: center;
  98. font-size: 14px;
  99. margin-top: 1rem;
  100. }
  101. .moneyimage{
  102. width: 4rem;
  103. height: 4rem;
  104. align-items: center;
  105. }
  106. .moneybox {
  107. padding: 120upx 20upx;
  108. text-align: center;
  109. background-color: inherit;
  110. }
  111. .moneys{
  112. color: #333333;
  113. font-size: 2.8rem;
  114. display: flex;
  115. flex-direction: row;
  116. justify-content: center;
  117. align-items: center;
  118. font-weight: 600;
  119. line-height: 3.2rem;
  120. height: 3.2rem;
  121. }
  122. .moneys .rmb{
  123. font-size: 1.6rem;
  124. margin-right: 5px;
  125. }
  126. .balance{
  127. display: flex;
  128. align-items: center;
  129. color: #FF7600;
  130. font-size: 14px;
  131. margin-top: 5px;
  132. line-height: 20px;
  133. }
  134. .widget-inner1 {
  135. display: flex;
  136. flex-direction: row;
  137. justify-content: center;
  138. align-items: center;
  139. background-color: inherit;
  140. }
  141. .submitBtn{
  142. width: 38%;
  143. justify-content: center;
  144. align-items: center;
  145. margin-left: 5%;
  146. color: #1aae61;
  147. background-color:#f2f2f2 ;
  148. height: 40px;
  149. line-height: 40px;
  150. border-radius: 5px;
  151. padding: 0px 0px !important;
  152. }
  153. .btn-primary{
  154. background-color: #07c160;
  155. color: #fff;
  156. }
  157. .withdraw{
  158. width: 80%;
  159. }
  160. </style>