fhlist.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <template>
  2. <view class="content">
  3. <view class="wrap fhlist" >
  4. <view class="title flex">節點詳情 </view>
  5. <view class="fhbox flex">
  6. <view class="flex boxnum">
  7. 今日加權 <p class="p">{{fhNums.jinri}}VGT</p>
  8. </view>
  9. <view class="fg"></view>
  10. <view class="flex boxnum">
  11. 總加權 <p class="p">{{fhNums.zong}}VGT</p>
  12. </view>
  13. </view>
  14. <view class="mylist">
  15. <view class="Listbox">
  16. <view class="listTop flex" >
  17. <p style="width: 30%;">地址</p>
  18. <p style="width: 30%;">金額</p>
  19. <p style="width: 40%;">時間</p>
  20. </view>
  21. <view class="listrow" v-if="lists.length>0">
  22. <view class="rowli flex" v-for="(items,indexs) in lists" :key="indexs">
  23. <p style="width: 30%;color: #2F80ED;" >{{items.walletAddress}}</p>
  24. <p style="width: 30%;" >{{items.money}}</p>
  25. <p style="width: 40%;" >{{items.shijian}}</p>
  26. </view>
  27. <uni-load-more :status="status" :icon-size="14" :content-text="contentText"
  28. v-if="totalCount > 10" />
  29. </view>
  30. <view class="noMore" v-else>暫無數據</view>
  31. </view>
  32. </view>
  33. </view>
  34. <!-- <view class="noMore" v-else>暫無數據</view> -->
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. return {
  41. statusBarHeight:'',
  42. content:'' ,
  43. fhNums:{},
  44. lists:[],
  45. type:'',
  46. status: 'more',//'上拉加載更多','加載中','沒有更多'
  47. contentText: {
  48. contentdown: '上拉加載更多',
  49. contentrefresh:'加載中',
  50. contentnomore:'沒有更多'
  51. },
  52. page: '1',
  53. totalCount: '',//总条数
  54. }
  55. },
  56. computed: {
  57. i18n() {
  58. return this.$t('lang')
  59. }
  60. },
  61. onLoad(option) {
  62. this.type=option.type
  63. this.getList()
  64. //获取状态栏+导航栏的高度
  65. let _that = this;
  66. uni.getSystemInfo({
  67. success(e) {
  68. if (e.platform == "ios") {
  69. _that.statusBarHeight = e.statusBarHeight + 45;
  70. } else {
  71. _that.statusBarHeight = e.statusBarHeight + 50;
  72. }
  73. }
  74. })
  75. },
  76. //上拉加载更多,onReachBottom上拉触底函数
  77. onReachBottom() {
  78. if (this.totalCount > this.lists.length) {
  79. this.status = 'loading';
  80. setTimeout(() => {
  81. this.page++
  82. this.getList(); //执行的方法
  83. }, 1000) //这里我是延迟一秒在加载方法有个loading效果,如果接口请求慢的话可以去掉
  84. } else { //停止加载
  85. this.status = 'noMore'
  86. }
  87. },
  88. methods: {
  89. getList(){
  90. let data={
  91. walletAddress:uni.getStorageSync('walletAddress'),
  92. cType:uni.getStorageSync('cType'),
  93. type:this.type,
  94. page:this.page
  95. }
  96. this.$http.jiedianxq(data).then(res => {
  97. var datas =res.data
  98. if(datas.code == 200 ){
  99. this.fhNums=datas.data
  100. this.totalCount = datas.data.list.total
  101. if (datas.data.list.total > 0) {
  102. const dataMap = datas.data.list.data
  103. this.lists = this.reload ? dataMap : this.lists.concat(dataMap);
  104. this.reload = false;
  105. } else {
  106. this.lists = [];
  107. }
  108. if (this.totalCount == this.lists.length) {
  109. this.reload = false;
  110. this.status = 'noMore'
  111. }
  112. }else{
  113. uni.showToast({
  114. title:datas.msg,
  115. icon:'none',
  116. })
  117. }
  118. }).catch(err => {
  119. uni.showToast({
  120. title:err,
  121. icon:'none',
  122. })
  123. })
  124. },
  125. back(){
  126. uni.navigateBack()
  127. }
  128. },
  129. }
  130. </script>
  131. <style scoped lang="scss">
  132. .fhlist{
  133. padding-top: 100rpx;
  134. .title{
  135. color: #000;
  136. font-size: 36rpx;
  137. margin-left: 10rpx;
  138. align-items: flex-end;
  139. .p{
  140. color: #333;
  141. font-size: 24rpx;
  142. margin-left: 12rpx;
  143. }
  144. }
  145. .fhbox{
  146. width:94%;
  147. background-color: #fff;
  148. padding: 32rpx 3%;
  149. margin-top:24rpx ;
  150. justify-content: space-around;
  151. .fg{
  152. height: 52rpx;
  153. width: 1rpx;
  154. background-color: #333;
  155. }
  156. .boxnum{
  157. width: 40%;
  158. font-size: 24rpx;
  159. color: #333333;
  160. .p{
  161. font-size: 36rpx;
  162. font-weight: bold;
  163. margin-left: 10rpx;
  164. }
  165. }
  166. }
  167. .mylist{
  168. background-color: #fff;
  169. border-radius: 20rpx;
  170. padding: 24rpx 0;
  171. margin: 40rpx 0; }
  172. .Listbox{
  173. margin: 0 24rpx;
  174. .listTop{
  175. padding: 20rpx 0;
  176. border-bottom: 1rpx solid #DCE1F6;
  177. font-size: 28rpx;
  178. color: #828282;
  179. text-align: center;
  180. }
  181. .listrow{
  182. margin: 20rpx 0;
  183. .rowli{
  184. padding-bottom: 48rpx;
  185. font-size: 28rpx;
  186. color: #4F4F4F;
  187. text-align: center;
  188. flex-wrap:wrap;
  189. .yuyin{
  190. margin-top:20rpx ;
  191. padding: 10rpx 20rpx;
  192. font-size: 28rpx;
  193. color: #828282;
  194. }
  195. }
  196. }
  197. }
  198. }
  199. .leakagebox{
  200. position: relative;
  201. font-size: 28rpx;
  202. color: #333;
  203. line-height: 80rpx;
  204. }
  205. .mallList{
  206. margin-top: 40rpx;
  207. flex-wrap: wrap;
  208. .listli{
  209. width: 41%;
  210. padding:30rpx 24rpx;
  211. // border-radius: 8rpx;
  212. // background-color: #fff;
  213. // box-shadow: 0px 1px 5px 0px #C9D9F199;
  214. margin-bottom: 30rpx;
  215. margin-right: 28rpx;
  216. }
  217. .listli:nth-child(2n){
  218. margin-right: 0;
  219. }
  220. .rows {
  221. background-color: #fff;
  222. border-radius: 20rpx;
  223. //padding: 32rpx 0;
  224. .title {
  225. margin-bottom: 20rpx;
  226. .titfl {
  227. color: #333333;
  228. font-size: 32rpx;
  229. font-weight: 700;
  230. .typeTips{
  231. width: 20rpx;
  232. height: 20rpx;
  233. border-radius: 50rpx;
  234. margin-left: 20rpx;
  235. }
  236. .red{
  237. background-color: red;
  238. }
  239. .green{
  240. background-color: #14C670;
  241. }
  242. }
  243. .price {
  244. color: #F5A94F;
  245. }
  246. }
  247. .listimg {
  248. width: 48rpx;
  249. height: 48rpx;
  250. margin-right: 10rpx;
  251. }
  252. .iconimg {
  253. width: 36rpx;
  254. height: 36rpx;
  255. }
  256. .rowsfl {
  257. font-size: 28rpx;
  258. .times {
  259. margin-bottom: 24rpx;
  260. color: #828282;
  261. span {
  262. color: #333333;
  263. }
  264. }
  265. }
  266. .rowsfr {
  267. background: linear-gradient(90.89deg, #38F957 49.57%, #1DEEE1 99.24%);
  268. width: 80%;
  269. height: 64rpx;
  270. text-align: center;
  271. line-height: 64rpx;
  272. color: #040616;
  273. font-size: 28rpx;
  274. border-radius: 8rpx;
  275. margin-left: 10%;
  276. margin-top: 12rpx;
  277. }
  278. }
  279. }
  280. </style>