sharerevenue.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. <template>
  2. <view class="sharerevenue">
  3. <view class="top-jg"></view>
  4. <view class="nav-wrapper">
  5. <view class="nav-item" v-for="(item, index) in navList" :key="index" :class="{ active: currentIndex === index }" @click="navClick(index)">{{ item.title }}</view>
  6. </view>
  7. <!-- <view class="top-jg"></view> -->
  8. <!-- <view class="nav-wrapper">邀请算力收益</view> -->
  9. <!-- <view class="all-num">
  10. <view class="">
  11. <view class="title">总收益</view>
  12. <view class="num">{{ allIncome }}{{ navList[currentIndex].unit }}</view>
  13. </view>
  14. <view class="">
  15. <view class="title">累计释放</view>
  16. <view class="num">{{ ljIncome }}{{ navList[currentIndex].unit }}</view>
  17. </view>
  18. <view class="">
  19. <view class="title">待释放</view>
  20. <view class="num">{{ wait }}{{ navList[currentIndex].unit }}</view>
  21. </view>
  22. </view> -->
  23. <view class="tip">
  24. <view class="line"></view>
  25. <view class="title">每日收益记录</view>
  26. <view class="line"></view>
  27. </view>
  28. <scroll-view :style="{ height: height }" class="days" scroll-y>
  29. <empty v-if="navList[currentIndex].loaded === true && navList[currentIndex].list.length === 0"></empty>
  30. <view class="day-item" v-for="(item, index) in navList[currentIndex].list" :key="index">
  31. <view class="item-time">{{item.add_time}}</view>
  32. <view class="">
  33. 今日推荐奖励:{{item.number}}{{item.category}}
  34. </view>
  35. <!-- <view class="item-wrap">
  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>25%</text>
  47. </view>
  48. <view class="item-value">0.09FIL</view>
  49. </view>
  50. <view class="item">
  51. <view class="item-title">
  52. 今日释放
  53. <text>1/150</text>
  54. </view>
  55. <view class="item-value">0.09FIL</view>
  56. </view>
  57. </view> -->
  58. <!-- <uni-load-more :status="tabItem.loadingType"></uni-load-more> -->
  59. </view>
  60. </scroll-view>
  61. </view>
  62. </template>
  63. <script>
  64. import empty from '@/components/empty';
  65. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  66. import { mining, miningIndex, myMiningGet ,getMyShare} from '@/api/calculation.js';
  67. import { moneyLog, recharge } from '@/api/finance.js';
  68. export default {
  69. components: {
  70. empty,
  71. uniLoadMore
  72. },
  73. data() {
  74. return {
  75. navList: [
  76. {
  77. title: 'Fil',
  78. unit: 'FIL',
  79. slUnit: 'T',
  80. list: [],
  81. page: 1,
  82. limit: 10,
  83. loadingType: 'more'
  84. },
  85. {
  86. title: 'Chia',
  87. unit: 'XCH',
  88. slUnit: 'T',
  89. list: [],
  90. page: 1,
  91. limit: 10,
  92. loadingType: 'more'
  93. },
  94. {
  95. title: 'Bzz',
  96. unit: 'BZZ',
  97. slUnit: '节点',
  98. list: [],
  99. page: 1,
  100. limit: 10,
  101. loadingType: 'more'
  102. }
  103. ],
  104. currentIndex: 0,
  105. height: 0,
  106. allIncome: 0, //总收益
  107. ljIncome: 0, //累计收益
  108. wait: 0 //待释放
  109. };
  110. },
  111. onReady(res) {
  112. var _this = this;
  113. uni.getSystemInfo({
  114. success: resu => {
  115. const query = uni.createSelectorQuery();
  116. query.select('.days').boundingClientRect();
  117. query.exec(function(res) {
  118. console.log(res, 'ddddddddddddd');
  119. _this.height = resu.windowHeight - res[0].top + 'px';
  120. console.log('打印页面的剩余高度', _this.height);
  121. });
  122. },
  123. fail: res => {}
  124. });
  125. },
  126. onLoad() {
  127. this.loadData();
  128. // this.getIndexDate()
  129. },
  130. methods: {
  131. //切换币种
  132. navClick(index) {
  133. this.currentIndex = index;
  134. this.loadData('tabChange');
  135. },
  136. loadData(source) {
  137. console.log('loadnoe');
  138. //这里是将list挂载到nav列表下
  139. let index = this.currentIndex;
  140. let navItem = this.navList[index];
  141. // let state = navItem.state;
  142. if (source === 'tabChange' && navItem.loaded === true) {
  143. //tab切换只有第一次需要加载数据
  144. return;
  145. }
  146. if (navItem.loadingType === 'loading') {
  147. //防止重复加载
  148. return;
  149. }
  150. if (navItem.loadingType === 'noMore') {
  151. //防止重复加载
  152. return;
  153. }
  154. // 修改当前对象状态为加载中
  155. navItem.loadingType = 'loading';
  156. moneyLog(
  157. {
  158. page: navItem.page,
  159. limit: navItem.limit,
  160. type: 'group_create_brokerage'
  161. },
  162. navItem.unit
  163. ).then(({ data }) => {
  164. // obj.typeList = data.type_list;
  165. // obj.list = data.list;
  166. // console.log(obj.list);
  167. console.log(data,'5555555555555555')
  168. let arr = data.list.map(e => {
  169. return e;
  170. });
  171. console.log(arr)
  172. navItem.list = navItem.list.concat(arr);
  173. navItem.page++;
  174. if (navItem.limit == data.list.data.length) {
  175. //判断是否还有数据, 有改为 more, 没有改为noMore
  176. navItem.loadingType = 'more';
  177. console.log('more');
  178. return;
  179. } else {
  180. //判断是否还有数据, 有改为 more, 没有改为noMore
  181. navItem.loadingType = 'noMore';
  182. console.log('noMore');
  183. }
  184. this.$set(navItem, 'loaded', true);
  185. }).catch(e => {
  186. console.log(e);
  187. });
  188. // myMiningGet({
  189. // type: navItem.unit,
  190. // page: navItem.page,
  191. // limit: navItem.limit
  192. // })
  193. // .then(({ data }) => {
  194. // console.log(data, '888888888888888888888');
  195. // this.all_lock = data.all_lock;
  196. // this.all_get = data.all_get;
  197. // let arr = data.list.data.map(e => {
  198. // return e;
  199. // });
  200. // navItem.list = navItem.list.concat(arr);
  201. // console.log(arr);
  202. // navItem.page++;
  203. // if (navItem.limit == data.list.data.length) {
  204. // //判断是否还有数据, 有改为 more, 没有改为noMore
  205. // navItem.loadingType = 'more';
  206. // console.log('more');
  207. // return;
  208. // } else {
  209. // //判断是否还有数据, 有改为 more, 没有改为noMore
  210. // navItem.loadingType = 'noMore';
  211. // console.log('noMore');
  212. // }
  213. // this.$set(navItem, 'loaded', true);
  214. // })
  215. // .catch(e => {
  216. // console.log(e);
  217. // });
  218. },
  219. // getIndexDate() {
  220. // moneyLog(
  221. // {
  222. // page: 1,
  223. // limit: 100,
  224. // type: 'group_create_brokerage'
  225. // },
  226. // unit
  227. // ).then(({ data }) => {
  228. // // obj.typeList = data.type_list;
  229. // // obj.list = data.list;
  230. // // console.log(obj.list);
  231. // console.log(data,'5555555555555555')
  232. // });
  233. // }
  234. }
  235. };
  236. </script>
  237. <style lang="scss" scoped>
  238. page {
  239. width: 100%;
  240. }
  241. .top-jg {
  242. height: 55rpx;
  243. }
  244. .all-num {
  245. width: 627rpx;
  246. margin: 0 auto;
  247. display: flex;
  248. justify-content: space-between;
  249. font-size: 30rpx;
  250. font-family: PingFang SC;
  251. font-weight: bold;
  252. color: #333333;
  253. view {
  254. display: flex;
  255. flex-direction: column;
  256. justify-content: center;
  257. align-items: center;
  258. .title {
  259. padding-bottom: 20rpx;
  260. }
  261. .num {
  262. font-weight: 500;
  263. }
  264. }
  265. }
  266. .tip {
  267. width: 627rpx;
  268. margin: 80rpx auto 70rpx;
  269. display: flex;
  270. justify-content: space-between;
  271. align-items: center;
  272. .line {
  273. width: 193rpx;
  274. height: 2rpx;
  275. background: #5771df;
  276. }
  277. .title {
  278. font-size: 28rpx;
  279. font-family: PingFang SC;
  280. font-weight: bold;
  281. color: #5771df;
  282. }
  283. }
  284. .days {
  285. // background-color: red;
  286. padding: 0 65rpx;
  287. .day-item {
  288. height: 198rpx;
  289. border-bottom: 1px solid #f3f4f6;
  290. background-color: #fff;
  291. font-size: 24rpx;
  292. font-family: PingFang SC;
  293. font-weight: bold;
  294. color: #333333;
  295. display: flex;
  296. flex-direction: column;
  297. justify-content: space-around;
  298. padding: 20rpx 0;
  299. .item {
  300. display: flex;
  301. justify-content: space-between;
  302. text {
  303. display: inline-block;
  304. margin-left: 10rpx;
  305. }
  306. }
  307. .item-time {
  308. font-size: 32rpx;
  309. font-family: PingFang SC;
  310. font-weight: bold;
  311. color: #333333;
  312. padding-bottom: 20rpx;
  313. }
  314. .item-wrap {
  315. display: flex;
  316. justify-content: space-between;
  317. .item {
  318. display: flex;
  319. flex-direction: column;
  320. justify-content: space-around;
  321. align-items: center;
  322. .item-title {
  323. font-size: 30rpx;
  324. font-family: PingFang SC;
  325. font-weight: bold;
  326. color: #333333;
  327. line-height: 1;
  328. padding-bottom: 23rpx;
  329. }
  330. .item-value {
  331. line-height: 1;
  332. font-size: 29rpx;
  333. font-family: PingFang SC;
  334. font-weight: 500;
  335. color: #fb3a2f;
  336. }
  337. }
  338. }
  339. }
  340. }
  341. .nav-wrapper {
  342. margin: 0rpx auto 10rpx;
  343. width: 627rpx;
  344. height: 60rpx;
  345. border: 2px solid #5771df;
  346. border-radius: 5rpx;
  347. display: flex;
  348. .nav-item {
  349. width: 209rpx;
  350. text-align: center;
  351. line-height: 60rpx;
  352. font-size: 28rpx;
  353. font-family: PingFang SC;
  354. font-weight: bold;
  355. color: #5771df;
  356. }
  357. .active {
  358. background: #5771df;
  359. color: #fff;
  360. }
  361. }
  362. </style>