sharerevenue.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <template>
  2. <view class="sharerevenue">
  3. <view class="top-jg"></view>
  4. <view class="nav-wrapper">邀请算力收益 3%</view>
  5. <view class="all-num">
  6. <view class="">
  7. <view class="title">总收益</view>
  8. <view class="num">{{ allIncome }}FIL</view>
  9. </view>
  10. <view class="">
  11. <view class="title">累计释放</view>
  12. <view class="num">{{ ljIncome }}FIL</view>
  13. </view>
  14. <view class="">
  15. <view class="title">待释放</view>
  16. <view class="num">{{ wait }}FIL</view>
  17. </view>
  18. </view>
  19. <view class="tip">
  20. <view class="line"></view>
  21. <view class="title">每日收益记录</view>
  22. <view class="line"></view>
  23. </view>
  24. <scroll-view :style="{ height: height }" class="days" scroll-y>
  25. <empty v-if="navList[currentIndex].loaded === true && navList[currentIndex].list.length === 0"></empty>
  26. <view class="day-item" v-for="(item,index) in navList[currentIndex].list" :key="index">
  27. <view class="item-time">2021-05-02</view>
  28. <view class="item-wrap">
  29. <view class="item">
  30. <view class="item-title">
  31. 今日可用
  32. <text>25%</text>
  33. </view>
  34. <view class="item-value">0.09FIL</view>
  35. </view>
  36. <view class="item">
  37. <view class="item-title">
  38. 今日冻结
  39. <text>25%</text>
  40. </view>
  41. <view class="item-value">0.09FIL</view>
  42. </view>
  43. <view class="item">
  44. <view class="item-title">
  45. 今日释放
  46. <text>1/150</text>
  47. </view>
  48. <view class="item-value">0.09FIL</view>
  49. </view>
  50. </view>
  51. <uni-load-more :status="tabItem.loadingType"></uni-load-more>
  52. </view>
  53. </scroll-view>
  54. </view>
  55. </template>
  56. <script>
  57. import empty from '@/components/empty';
  58. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  59. export default {
  60. components: {
  61. empty,
  62. uniLoadMore
  63. },
  64. data() {
  65. return {
  66. navList: [
  67. {
  68. title: 'Fil',
  69. list: [],
  70. page: 1,
  71. limit: 10,
  72. loadingType: 'more'
  73. },
  74. // {
  75. // title: 'Chia',
  76. // list: [],
  77. // page: 1,
  78. // limit: 10,
  79. // loadingType: 'more'
  80. // },
  81. // {
  82. // title: 'Bzz',
  83. // list: [],
  84. // page: 1,
  85. // limit: 10,
  86. // loadingType: 'more'
  87. // }
  88. ],
  89. currentIndex: 0,
  90. height: 0,
  91. allIncome: 0, //总收益
  92. ljIncome: 0, //累计收益
  93. wait: 0 //待释放
  94. };
  95. },
  96. onReady(res) {
  97. var _this = this;
  98. uni.getSystemInfo({
  99. success: resu => {
  100. const query = uni.createSelectorQuery();
  101. query.select('.days').boundingClientRect();
  102. query.exec(function(res) {
  103. console.log(res, 'ddddddddddddd');
  104. _this.height = resu.windowHeight - res[0].top + 'px';
  105. console.log('打印页面的剩余高度', _this.height);
  106. });
  107. },
  108. fail: res => {}
  109. });
  110. },
  111. onLoad() {
  112. this.loadData();
  113. },
  114. methods: {
  115. //切换币种
  116. navClick(index) {
  117. this.currentIndex = index;
  118. this.loadData('tabChange');
  119. },
  120. loadData(source) {
  121. //这里是将list挂载到nav列表下
  122. let index = this.currentIndex;
  123. let navItem = this.navList[index];
  124. // let state = navItem.state;
  125. if (source === 'tabChange' && navItem.loaded === true) {
  126. //tab切换只有第一次需要加载数据
  127. return;
  128. }
  129. if (navItem.loadingType === 'loading') {
  130. //防止重复加载
  131. return;
  132. }
  133. if (navItem.loadingType === 'noMore') {
  134. //防止重复加载
  135. return;
  136. }
  137. // 修改当前对象状态为加载中
  138. navItem.loadingType = 'loading';
  139. // orderList({
  140. // type: state,
  141. // page: navItem.page,
  142. // limit: navItem.limit
  143. // })
  144. // .then(({ data }) => {
  145. // let arr = data.map(e => {
  146. // return e;
  147. // });
  148. // navItem.list = navItem.list.concat(arr);
  149. // // console.log(navItem.orderList);
  150. // navItem.page++;
  151. // if (navItem.limit == data.length) {
  152. // //判断是否还有数据, 有改为 more, 没有改为noMore
  153. // navItem.loadingType = 'more';
  154. // return;
  155. // } else {
  156. // //判断是否还有数据, 有改为 more, 没有改为noMore
  157. // navItem.loadingType = 'noMore';
  158. // }
  159. // this.$set(navItem, 'loaded', true);
  160. // })
  161. // .catch(e => {
  162. // console.log(e);
  163. // });
  164. let arr = []
  165. navItem.list = navItem.list.concat(arr)
  166. navItem.page++
  167. navItem.loadingType = 'noMore'
  168. this.$set(navItem, 'loaded', true)
  169. console.log(this.navList)
  170. }
  171. }
  172. };
  173. </script>
  174. <style lang="scss" scoped>
  175. page {
  176. width: 100%;
  177. }
  178. .top-jg {
  179. height: 55rpx;
  180. }
  181. .nav-wrapper {
  182. margin: 0rpx auto 61rpx;
  183. width: 627rpx;
  184. height: 60rpx;
  185. line-height: 60rpx;
  186. // border: 2px solid #5771df;
  187. border-radius: 5rpx;
  188. text-align: center;
  189. background-color: #5771df;
  190. font-size: 28rpx;
  191. font-family: PingFang SC;
  192. font-weight: bold;
  193. color: #ffffff;
  194. }
  195. .all-num {
  196. width: 627rpx;
  197. margin: 0 auto;
  198. display: flex;
  199. justify-content: space-between;
  200. font-size: 30rpx;
  201. font-family: PingFang SC;
  202. font-weight: bold;
  203. color: #333333;
  204. view {
  205. display: flex;
  206. flex-direction: column;
  207. justify-content: center;
  208. align-items: center;
  209. .title {
  210. padding-bottom: 20rpx;
  211. }
  212. .num {
  213. font-weight: 500;
  214. }
  215. }
  216. }
  217. .tip {
  218. width: 627rpx;
  219. margin: 80rpx auto 70rpx;
  220. display: flex;
  221. justify-content: space-between;
  222. align-items: center;
  223. .line {
  224. width: 193rpx;
  225. height: 2rpx;
  226. background: #5771df;
  227. }
  228. .title {
  229. font-size: 28rpx;
  230. font-family: PingFang SC;
  231. font-weight: bold;
  232. color: #5771df;
  233. }
  234. }
  235. .days {
  236. // background-color: red;
  237. padding: 0 65rpx;
  238. .day-item {
  239. height: 198rpx;
  240. border-bottom: 1px solid #f3f4f6;
  241. background-color: #fff;
  242. font-size: 24rpx;
  243. font-family: PingFang SC;
  244. font-weight: bold;
  245. color: #333333;
  246. display: flex;
  247. flex-direction: column;
  248. justify-content: space-around;
  249. padding: 20rpx 0;
  250. .item {
  251. display: flex;
  252. justify-content: space-between;
  253. text {
  254. display: inline-block;
  255. margin-left: 10rpx;
  256. }
  257. }
  258. .item-time {
  259. font-size: 32rpx;
  260. font-family: PingFang SC;
  261. font-weight: bold;
  262. color: #333333;
  263. padding-bottom: 20rpx;
  264. }
  265. .item-wrap {
  266. display: flex;
  267. justify-content: space-between;
  268. .item {
  269. display: flex;
  270. flex-direction: column;
  271. justify-content: space-around;
  272. align-items: center;
  273. .item-title {
  274. font-size: 30rpx;
  275. font-family: PingFang SC;
  276. font-weight: bold;
  277. color: #333333;
  278. line-height: 1;
  279. padding-bottom: 23rpx;
  280. }
  281. .item-value {
  282. line-height: 1;
  283. font-size: 29rpx;
  284. font-family: PingFang SC;
  285. font-weight: 500;
  286. color: #fb3a2f;
  287. }
  288. }
  289. }
  290. }
  291. }
  292. </style>