wallet - 副本.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <view class="container index">
  3. <nav-header>我的账户</nav-header>
  4. <!-- 我的余额 -->
  5. <view class="mymoney">
  6. <view class="">
  7. 我的余额
  8. </view>
  9. <view class="systemColor">
  10. {{money}} <text>元</text>
  11. </view>
  12. <view>付款时将优先使用余额抵扣</view>
  13. <view class="btn_box">
  14. <view class="" @click="table()">
  15. <view class="">
  16. <image src="/static/my/6014@2x.png" /> 充值
  17. <image src="/static/my/5730@2x.png" />
  18. </view>
  19. </view>
  20. <view class="" @click="href('/pages/my/wallet/whit')">
  21. <view class="">
  22. <image src="/static/my/6013@2x.png" /> 提现
  23. <image src="/static/my/5730@2x.png" />
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <!-- 我的余额 结束-->
  29. <!-- 明细列表 -->
  30. <!-- <scroll-view scroll-y="true" @scrolltolower="lower" style="height: 100%;"> -->
  31. <view class="content">
  32. <view class="title">
  33. <view class="" @click="moneyClic">账单明细</view>
  34. <image src="@/static/my/icon3.png" mode="widthFix" style="width: 24rpx;"></image>
  35. </view>
  36. <!-- <view class="title">
  37. <view class="" @click="moneyClick">账单明细</view>
  38. <image src="@/static/my/icon3.png" mode="widthFix" style="width: 24rpx;"></image>
  39. </view> -->
  40. <view class="item" v-for="(item,index) in list" :key="index" >
  41. <view class="">
  42. <view class="">
  43. {{item.name}}
  44. </view>
  45. <view class="">
  46. {{item.create_at}}
  47. </view>
  48. </view>
  49. <view class="orange" v-if="item.amount>0">
  50. {{item.amount}}
  51. </view>
  52. <view class="fff" v-else>
  53. {{item.amount}}
  54. </view>
  55. </view>
  56. </view>
  57. <!-- 明细列表 结束-->
  58. <!-- </scroll-view> -->
  59. </view>
  60. </template>
  61. <script>
  62. import navHeader from "@/components/my/nav_header.vue"
  63. export default {
  64. components: {
  65. navHeader
  66. },
  67. data() {
  68. return {
  69. money: "",
  70. page: 0,
  71. list: [],
  72. mx: false,
  73. is_cert: ''
  74. }
  75. },
  76. onReachBottom() {
  77. this.get_mx()
  78. // console.log(1)
  79. },
  80. onShow() {
  81. this.api.get_user_info()
  82. this.money = uni.getStorageSync("user_info").balance
  83. this.get_mx()
  84. this.is_cert = uni.getStorageSync("user_info").is_cert
  85. },
  86. methods: {
  87. // href('/pages/my/wallet/recharge')
  88. table() {
  89. if (this.is_cert == 1) {
  90. this.$api.to('/pages/my/wallet/recharge')
  91. } else {
  92. this.$api.pop('请先实名之后充值')
  93. }
  94. },
  95. moneyClick() {
  96. this.mx = true
  97. },
  98. moneyClic() {
  99. this.mx = false
  100. },
  101. lower() {
  102. this.get_mx()
  103. },
  104. get_mx() {
  105. this.api.mx(30, ++this.page).then(res => {
  106. res.data.data.forEach(ele => {
  107. this.list.push(ele)
  108. })
  109. })
  110. }
  111. }
  112. }
  113. </script>
  114. <style scoped>
  115. .index {
  116. box-sizing: border-box;
  117. padding-top: 100rpx;
  118. }
  119. .mymoney {
  120. width: 710rpx;
  121. height: 382rpx;
  122. background: #fff;
  123. margin: 24rpx auto;
  124. border-radius: 16rpx;
  125. box-sizing: border-box;
  126. background: linear-gradient(225deg, #F2CF9C 0%, #794013 100%);
  127. border-radius: 40rpx;
  128. position: relative;
  129. }
  130. .mymoney>view:first-child {
  131. padding-top: 60rpx;
  132. font-size: 28rpx;
  133. font-weight: 400;
  134. text-align: center;
  135. color: #fff;
  136. }
  137. .mymoney>view:nth-child(2) {
  138. margin-top: 30rpx;
  139. text-align: center;
  140. font-size: 44rpx;
  141. font-weight: 400;
  142. color: #FFFFFF;
  143. }
  144. .mymoney>view:nth-child(2) text {
  145. font-size: 24rpx;
  146. }
  147. .mymoney>view:nth-child(3) {
  148. color: #FFFFFF;
  149. font-size: 24rpx;
  150. text-align: center;
  151. margin-top: 20rpx;
  152. }
  153. .btn_box {
  154. position: absolute;
  155. left: 0;
  156. bottom: 0;
  157. font-size: 24rpx;
  158. display: flex;
  159. justify-content: space-between;
  160. align-items: center;
  161. box-sizing: border-box;
  162. width: 100%;
  163. height: 100rpx;
  164. background: linear-gradient(225deg, #794013 0%, #F2CF9C 100%);
  165. border-radius: 0px 0px 16px 16px;
  166. }
  167. .btn_box>view {
  168. flex: 1;
  169. text-align: center;
  170. font-size: 28rpx;
  171. color: #FFFFFF;
  172. }
  173. .btn_box image:first-child {
  174. width: 54rpx;
  175. height: 54rpx;
  176. vertical-align: middle;
  177. margin-right: 10rpx;
  178. }
  179. .btn_box image:last-child {
  180. width: 34rpx;
  181. height: 34rpx;
  182. vertical-align: middle;
  183. margin-left: 10rpx;
  184. }
  185. .btn_box>view:nth-child(1) {
  186. position: relative;
  187. }
  188. .btn_box>view:nth-child(1)::after {
  189. content: '';
  190. position: absolute;
  191. top: 50%;
  192. right: 0;
  193. width: 3rpx;
  194. height: 40rpx;
  195. background: #fff;
  196. display: inline-block;
  197. transform: translateY(-50%);
  198. }
  199. .content {
  200. width: 710rpx;
  201. box-sizing: border-box;
  202. padding: 0 32rpx;
  203. margin: 0 auto;
  204. margin-top: 20rpx;
  205. }
  206. .content .title {
  207. font-size: 30rpx;
  208. font-weight: 400;
  209. color: #000000;
  210. padding: 30rpx 0;
  211. border-bottom: 1rpx solid #cacaca;
  212. display: flex;
  213. align-items: center;
  214. }
  215. .content .item {
  216. display: flex;
  217. justify-content: space-between;
  218. box-sizing: border-box;
  219. padding-top: 20rpx;
  220. padding-bottom: 20rpx;
  221. }
  222. .item:last-of-type {
  223. border: none;
  224. }
  225. .item>view:first-child>view:last-child {
  226. margin-top: 10rpx;
  227. color: #999;
  228. font-size: 24rpx;
  229. }
  230. .item>view:first-child>view:first-child {
  231. font-size: 28rpx;
  232. }
  233. .item>view:last-child {
  234. align-self: center;
  235. font-size: 32rpx;
  236. color: #000000;
  237. font-weight: bold;
  238. }
  239. </style>