coininfo.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <view class="content">
  3. <view class="top-base">
  4. <view class="contentbox_top">
  5. {{info.name}}
  6. </view>
  7. <view class="base-info flex">
  8. <view class="info-item">
  9. <view class="item-name">
  10. 可用
  11. </view>
  12. <view class="item-val">
  13. {{info.num}}
  14. </view>
  15. </view>
  16. <view class="info-item">
  17. <view class="item-name">
  18. 凍結
  19. </view>
  20. <view class="item-val">
  21. {{info.numd}}
  22. </view>
  23. </view>
  24. <view class="info-item">
  25. <view class="item-name" style="text-align: right;">
  26. 折合(USDT)
  27. </view>
  28. <view class="item-val" style="text-align: right;">
  29. {{info.zhe}}
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="" style="height: 20rpx;background-color: #f5f5f5;">
  35. </view>
  36. <view class="tit">
  37. 財務記錄
  38. </view>
  39. <view class="cwjl-wrap" v-for="item in list">
  40. <view class="jl-tit">
  41. {{item.remark}}
  42. </view>
  43. <view class="jl-info flex" >
  44. <view class="info-item">
  45. <view class="item-name">
  46. 數量
  47. </view>
  48. <view class="item-val">
  49. {{item.num}}
  50. </view>
  51. </view>
  52. <view class="info-item">
  53. <view class="item-name" >
  54. 狀態
  55. </view>
  56. <view class="item-val">
  57. {{item.st == 1? '增加': (item.st == 2 ? '減少': '')}}
  58. </view>
  59. </view>
  60. <view class="info-item">
  61. <view class="item-name" style="text-align: right;">
  62. 時間
  63. </view>
  64. <view class="item-val" style="text-align: right;">
  65. {{item.addtime}}
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <uni-load-more :status="loadingType"></uni-load-more>
  71. <view class="tianc" style="height: 120rpx;background-color: #fff;">
  72. </view>
  73. <view class="btm-btn flex">
  74. <view class="btnbox_a " @click="navto('/pages/transaction/cbdetail?type=' + id)">
  75. 充幣
  76. </view>
  77. <view class="btnbox_b " @click="navto('/pages/transaction/tbdetail?type=' + id)">
  78. 提幣
  79. </view>
  80. <view class="btnbox_b " v-if="id == 4" @click="navto('/pages/transaction/transfer')">
  81. 劃轉
  82. </view>
  83. </view>
  84. </view>
  85. </template>
  86. <script>
  87. import {
  88. coininfo,
  89. bill
  90. } from '@/api/login.js'
  91. export default {
  92. data() {
  93. return {
  94. id: '',
  95. info: {},
  96. page: 1,
  97. limit: 10,
  98. loadingType: 'more',
  99. loaded: false,
  100. list: []
  101. }
  102. },
  103. onLoad(opt) {
  104. if (opt.id) {
  105. this.id = opt.id
  106. this.coininfo()
  107. }
  108. },
  109. onShow() {
  110. },
  111. onReachBottom() {
  112. console.log('dao')
  113. this.bill()
  114. },
  115. onReady() {
  116. },
  117. methods: {
  118. navto(url) {
  119. uni.navigateTo({
  120. url
  121. })
  122. },
  123. coininfo() {
  124. let obj = this
  125. coininfo({
  126. cid: obj.id
  127. }).then(res => {
  128. console.log(res)
  129. obj.info = res.data
  130. obj.bill()
  131. })
  132. },
  133. bill() {
  134. let obj = this
  135. if(obj.loadingType == 'loading' || obj.loadingType == 'noMore') {
  136. return
  137. }
  138. obj.loadingType = 'loading'
  139. bill({
  140. name: obj.info.name,
  141. page: obj.page,
  142. limit: obj.limit
  143. }).then(res => {
  144. console.log(res)
  145. // if()
  146. obj.list = obj.list.concat(res.data)
  147. if(obj.limit == res.data.length) {
  148. obj.loadingType = 'more'
  149. }else {
  150. obj.loadingType = 'noMore'
  151. }
  152. obj.loaded = true
  153. })
  154. }
  155. }
  156. }
  157. </script>
  158. <style lang="scss">
  159. page {
  160. background-color: #fff;
  161. height: 100%;
  162. }
  163. .top-base {
  164. width: 750rpx;
  165. height: 240rpx;
  166. background-color: #fff;
  167. padding: 10rpx 30rpx;
  168. }
  169. .contentbox_top {
  170. color: #FCD535;
  171. height: 100rpx;
  172. line-height: 100rpx;
  173. font-size: 52rpx;
  174. }
  175. .base-info {
  176. width: 100%;
  177. justify-content: space-between;
  178. .info-item {
  179. width: 33%;
  180. height: 100rpx;
  181. color: #000;
  182. font-size: 28rpx;
  183. .item-name {
  184. color: #707A8A;
  185. }
  186. }
  187. }
  188. .tit {
  189. height: 100rpx;
  190. line-height: 100rpx;
  191. padding: 20rpx;
  192. color: #000;
  193. font-size: 40rpx;
  194. }
  195. .cwjl-wrap {
  196. width: 660rpx;
  197. height: 180rpx;
  198. border-bottom: 1px solid #f5f5f5;
  199. margin: auto;
  200. padding: 10rpx 20rpx;
  201. color: #000;
  202. font-size: 28rpx;
  203. .jl-tit {
  204. }
  205. .jl-info {
  206. justify-content: space-between;
  207. .info-item {
  208. width: 33%;
  209. .item-name {
  210. color: #707A8A;
  211. padding: 20rpx 0 10rpx;
  212. }
  213. .item-val {
  214. padding: 10rpx 0;
  215. }
  216. }
  217. }
  218. }
  219. .btm-btn {
  220. width: 750rpx;
  221. height: 120rpx;
  222. padding: 20rpx;
  223. font-size: 28rpx;
  224. color: #000;
  225. justify-content: flex-start;
  226. position: fixed;
  227. bottom: 0;
  228. background-color: #fff;
  229. .btnbox_a {
  230. width: 198rpx;
  231. height: 80rpx;
  232. line-height: 80rpx;
  233. text-align: center;
  234. background: linear-gradient(to left,#eeb80d,#ffe35b);
  235. margin-right: 20rpx;
  236. border-radius: 20rpx;
  237. }
  238. .btnbox_b {
  239. width: 198rpx;
  240. height: 80rpx;
  241. line-height: 80rpx;
  242. text-align: center;
  243. background: #f5f5f5;
  244. margin-right: 20rpx;
  245. border-radius: 20rpx;
  246. }
  247. }
  248. </style>