reportPage.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. <template>
  2. <view class="content">
  3. <view class="headerSection">
  4. <view class="sectionA">
  5. <view class="left">
  6. <view class="name">今日可提现</view>
  7. <view class="value" :style="`color: ${color2};`">¥{{headerInfo.canCashOut || 0.00}}</view>
  8. <!-- <num-run :value="700"></num-run> -->
  9. </view>
  10. <view class="right">
  11. <view class="txRecord" :style="`color: ${color2};`" @click="txRecordList">提现记录></view>
  12. <view class="txRequest" :style="`background-color: ${color1};`">提现申请</view>
  13. </view>
  14. </view>
  15. <view class="sectionB">
  16. <view class="item1" v-for="(item, idx) in shouyiList" :key="idx">
  17. <view class="name">{{item.title}}</view>
  18. <view class="value">¥{{item.value}}</view>
  19. <view class="des" v-if="idx == 1">
  20. (服续费¥{{item.subValue}})
  21. </view>
  22. <view class="rightLine" v-if="idx < 2"></view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="screenSection">
  27. <view class="sectionA">
  28. <view class="title">我的收益明细</view>
  29. <view class="dataScreen">
  30. <block v-if="listParmas.startDate">
  31. <text @click="dataScreenAction">{{listParmas.startDate + '-' + listParmas.endDate}}</text>
  32. <text @click="clearDate" :style="`margin-left: 10px; color: ${color2};`">清空</text>
  33. </block>
  34. <block v-else>
  35. <text @click="dataScreenAction">时间选择</text>
  36. <image src="../../static/icons/icon_dropDown@2x.png" mode="aspectFit"></image>
  37. </block>
  38. </view>
  39. </view>
  40. <view class="sectionB">
  41. <view class="item" v-for="(item, idx) in tabList" :key="idx" :style="`background-color: ${item.isSelect ? color1: '#fff'}; color: ${item.isSelect ? '#fff': '#B1B1B1'};`"
  42. @click="selectTab(item)">
  43. {{item.typeName}}
  44. </view>
  45. </view>
  46. </view>
  47. <view class="listSection">
  48. <view class="top-Section">
  49. <view class="point"></view>
  50. <view class="name">任务详情</view>
  51. <view class="totalPrice" :style="`color: ${color2};`">总收益:{{totalIncome}}元</view>
  52. </view>
  53. <view class="item" v-for="(item, idx) in dataList" :key="idx">
  54. <view class="sectionA">
  55. <view class="point" :style="`background-color: ${color1};`"></view>
  56. <view class="name" :style="`color: ${color1};`">{{item.name}}</view>
  57. </view>
  58. <view class="sectionB">
  59. <image class="icon" src="https://dm.static.elab-plus.com/yezhu/h5/icon_dingwei.png" mode="aspectFit" style="color: #0066CC;"></image>
  60. <view class="date">{{item.happenTime || '-'}}</view>
  61. </view>
  62. <view class="sectionC">
  63. <view class="point"></view>
  64. <view class="name">收益明细</view>
  65. </view>
  66. <view class="sectionD">
  67. <view class="name">{{item.incomeType || '-'}}</view>
  68. <view class="value" :style="`color: ${color2};`">+{{item.income}}元</view>
  69. </view>
  70. <view class="bottomLine" v-if="idx < dataList.length - 1"></view>
  71. </view>
  72. <view class="com_noMore_text" v-if="noMore && dataList.length > 0">没有更多了</view>
  73. <view class="empty" v-if="dataList.length == 0">
  74. <image class="emptyImg" src="https://dm.static.elab-plus.com/yezhu/h5/icon_empty.png" mode=""></image>
  75. <view class="text">暂无数据</view>
  76. </view>
  77. </view>
  78. <view class="homeBtn"
  79. :style="`position: fixed; z-index: 1000; right: 0; bottom: 15%; width: 96rpx; height: 110rpx; display: flex; flex-direction: column; align-items: center;border-radius: 20rpx 0rpx 0px 20rpx;box-shadow: 0rpx 10rpx 20rpx 0px rgba(119,55,12,0.20); background-color: ${color2};`"
  80. @click="backAction">
  81. <image class="icon" style="margin-top: 8rpx;width: 30rpx; height: 28rpx;" src="https://dm.static.elab-plus.com/yezhu/h5/icon_homeBtn.png" mode="aspectFit"></image>
  82. <view class="text" style="margin-top: 6rpx;font-size: 12rpx;font-family: PingFang SC, PingFang SC-Semibold;font-weight: 400;text-align: center;color: #ffffff;">返回</view>
  83. <view class="text" style="margin-top: -2rpx;;font-size: 12rpx;font-family: PingFang SC, PingFang SC-Semibold;font-weight: 400;text-align: center;color: #ffffff;">任务大厅</view>
  84. </view>
  85. <dm-calendar-picker-view ref='calendarPickerView' @confirmSelDate='confirmSelDate'></dm-calendar-picker-view>
  86. <dmWithDrawalRecord ref='withDrawalRecord'></dmWithDrawalRecord>
  87. </view>
  88. </template>
  89. <script>
  90. import numRun from '../../components/numRun/numRun.vue'
  91. import dmCalendarPickerView from '../../components/subComponents/dmCalendarPickerView.vue'
  92. import moment from '../../static/moment.min.js'
  93. import dmWithDrawalRecord from '../../components/subComponents/dmWithDrawalRecord.vue'
  94. let app = getApp();
  95. export default {
  96. data() {
  97. return {
  98. headerInfo: {
  99. alreadyCashOut: 0.00,
  100. canCashOut: 0.00,
  101. serviceFee: 0.00,
  102. todayIncome: 0.00,
  103. totalIncome: 0.00
  104. },
  105. shouyiList: [{
  106. title: '今日收益',
  107. value: 0,
  108. des: ''
  109. },
  110. {
  111. title: '总收益',
  112. value: 0,
  113. subValue: 20,
  114. des: ''
  115. },
  116. {
  117. title: '累计已提现',
  118. value: 0,
  119. des: ''
  120. }
  121. ],
  122. color1: '',
  123. color2: '',
  124. tabList: [],
  125. listParmas: {
  126. endDate: "",
  127. pageNo: 1,
  128. pageSize: 20,
  129. startDate: "",
  130. type: 0
  131. },
  132. dataList: [],
  133. noMore: true,
  134. totalIncome: 0.00
  135. }
  136. },
  137. mounted() {
  138. this.color1 = app.globalData.color1;
  139. this.color2 = app.globalData.color2;
  140. this.getReportHeader()
  141. this.getReportMenu()
  142. },
  143. methods: {
  144. // 表头数据
  145. async getReportHeader() {
  146. const res = await this.$myRequest({
  147. url: '/report/header',
  148. method: 'GET'
  149. });
  150. if (res && res.data.success) {
  151. console.log('表头res:', res)
  152. this.headerInfo = res.data.single || {
  153. alreadyCashOut: 0.00,
  154. canCashOut: 0.00,
  155. serviceFee: 0.00,
  156. todayIncome: 0.00,
  157. totalIncome: 0.00
  158. }
  159. this.shouyiList[0].value = this.headerInfo.todayIncome || 0.00
  160. this.shouyiList[1].value = this.headerInfo.totalIncome || 0.00
  161. this.shouyiList[2].value = this.headerInfo.alreadyCashOut || 0.00
  162. this.shouyiList[1].subValue = this.headerInfo.serviceFee || 0.00
  163. }
  164. },
  165. async getReportMenu() {
  166. const res = await this.$myRequest({
  167. url: '/report/nav',
  168. method: 'GET'
  169. });
  170. if (res && res.data.success) {
  171. console.log('菜单res:', res)
  172. var tempList = res.data.list || []
  173. tempList.forEach((item, idx) => {
  174. item['isSelect'] = idx == 0 ? true : false
  175. })
  176. this.tabList = tempList
  177. if (this.tabList.length > 0) {
  178. this.selectTab(this.tabList[0])
  179. }
  180. }
  181. },
  182. selectTab(e) {
  183. this.tabList.forEach((item, idx) => {
  184. item.isSelect = false
  185. if (e.type == item.type) {
  186. item.isSelect = true
  187. }
  188. })
  189. this.listParmas.type = e.type
  190. this.pullDownRefresh(true)
  191. },
  192. async getReportList() {
  193. var self = this
  194. const res = await this.$myRequest({
  195. url: '/report/list',
  196. data: self.listParmas
  197. });
  198. if (res && res.data.success) {
  199. if (this.listParmas.pageNo == 1) {
  200. this.dataList = res.data.single.pageInfoModel.resultSet || []
  201. } else {
  202. this.dataList = this.dataList.concat(res.data.single.pageInfoModel.resultSet || []);
  203. }
  204. this.totalIncome = res.data.single.totalIncome || '0.00'
  205. this.noMore = res.data.single.pageInfoModel.resultSet.length < this.listParmas.pageSize
  206. uni.stopPullDownRefresh();
  207. }
  208. else {
  209. this.noMore = true
  210. this.totalIncome = '0.00'
  211. uni.stopPullDownRefresh();
  212. }
  213. },
  214. dataScreenAction() {
  215. this.$refs.calendarPickerView.show()
  216. },
  217. confirmSelDate(e) {
  218. const startDate = e.startDate;
  219. const endDate = e.endDate;
  220. if (moment(startDate).isBefore(endDate)) {
  221. this.listParmas.startDate = startDate;
  222. this.listParmas.endDate = endDate;
  223. } else {
  224. this.listParmas.startDate = endDate;
  225. this.listParmas.endDate = startDate;
  226. }
  227. this.pullDownRefresh()
  228. },
  229. clearDate() {
  230. this.listParmas.startDate = '';
  231. this.listParmas.endDate = '';
  232. this.pullDownRefresh()
  233. },
  234. pullDownRefresh(isPullDown = true) {
  235. if (isPullDown) {
  236. this.listParmas.pageNo = 1;
  237. this.getReportList()
  238. } else {
  239. if (this.noMore) {
  240. return;
  241. }
  242. this.listParmas.pageNo++;
  243. this.getReportList()
  244. }
  245. },
  246. backAction() {
  247. uni.navigateBack({
  248. delta: 1
  249. })
  250. },
  251. txRecordList(){
  252. this.$refs.withDrawalRecord.show();
  253. }
  254. },
  255. onPullDownRefresh() {
  256. this.pullDownRefresh(true)
  257. setTimeout(function() {
  258. uni.stopPullDownRefresh();
  259. }, 1000);
  260. },
  261. onReachBottom() {
  262. this.pullDownRefresh(false)
  263. },
  264. watch: {
  265. },
  266. components: {
  267. numRun,
  268. dmCalendarPickerView,
  269. dmWithDrawalRecord,
  270. }
  271. }
  272. </script>
  273. <style lang="scss" scoped>
  274. page {
  275. width: 100vw;
  276. // height: 100vh;
  277. }
  278. .content {
  279. width: 100%;
  280. // height: 100%;
  281. // max-height: 100%;
  282. // overflow-y: scroll;
  283. background-color: #F5F5F7;
  284. padding: 20rpx 20rpx 100rpx 20rpx;
  285. box-sizing: border-box;
  286. .headerSection {
  287. width: 100%;
  288. height: 352rpx;
  289. background-color: #fff;
  290. border-radius: 16rpx;
  291. padding: 32rpx 30rpx 16rpx 48rpx;
  292. box-sizing: border-box;
  293. .sectionA {
  294. display: flex;
  295. align-items: center;
  296. justify-content: space-between;
  297. .left {
  298. .name {
  299. font-size: 32rpx;
  300. font-family: Verdana, Verdana-Regular;
  301. font-weight: 400;
  302. text-align: left;
  303. color: #2c2c2c;
  304. line-height: 40px;
  305. }
  306. .value {
  307. margin-left: -12rpx;
  308. font-size: 64rpx;
  309. font-family: DIN Alternate, DIN Alternate-Bold;
  310. font-weight: 700;
  311. text-align: left;
  312. }
  313. }
  314. .right {
  315. .txRecord {
  316. font-size: 24rpx;
  317. font-family: Verdana, Verdana-Regular;
  318. font-weight: 400;
  319. text-align: right;
  320. }
  321. .txRequest {
  322. margin-top: 32rpx;
  323. width: 178rpx;
  324. height: 60rpx;
  325. border-radius: 12rpx;
  326. font-size: 28rpx;
  327. font-family: Verdana, Verdana-Bold;
  328. font-weight: 700;
  329. text-align: center;
  330. color: #ffffff;
  331. line-height: 60rpx;
  332. }
  333. }
  334. }
  335. .sectionB {
  336. margin-top: 40rpx;
  337. display: flex;
  338. justify-content: space-between;
  339. align-items: flex-start;
  340. .item1 {
  341. width: calc((100% - 90rpx) / 3);
  342. position: relative;
  343. height: 110rpx;
  344. .name {
  345. font-size: 24rpx;
  346. font-family: Verdana, Verdana-Regular;
  347. font-weight: 400;
  348. text-align: left;
  349. color: #999999;
  350. }
  351. .value {
  352. font-size: 32rpx;
  353. font-family: DIN Alternate, DIN Alternate-Bold;
  354. font-weight: 700;
  355. text-align: left;
  356. color: #262626;
  357. }
  358. .des {
  359. font-size: 20rpx;
  360. font-family: Verdana, Verdana-Regular;
  361. font-weight: 400;
  362. text-align: left;
  363. color: #cecece;
  364. white-space: nowrap;
  365. margin-left: -15rpx;
  366. }
  367. .rightLine {
  368. position: absolute;
  369. right: 0;
  370. width: 2rpx;
  371. height: 60rpx;
  372. border-right: 2rpx dashed #7f7f7f;
  373. top: calc((100% - 60rpx) / 2);
  374. opacity: 0.2;
  375. }
  376. }
  377. }
  378. }
  379. .screenSection {
  380. margin-top: 60rpx;
  381. width: 100%;
  382. padding: 20rpx;
  383. box-sizing: border-box;
  384. .sectionA {
  385. display: flex;
  386. justify-content: space-between;
  387. align-items: center;
  388. .title {
  389. font-size: 28rpx;
  390. font-family: Verdana, Verdana-Bold;
  391. font-weight: 700;
  392. text-align: left;
  393. color: #262626;
  394. }
  395. .dataScreen {
  396. display: flex;
  397. align-items: center;
  398. font-size: 24rpx;
  399. font-family: Verdana, Verdana-Regular;
  400. font-weight: 400;
  401. text-align: right;
  402. color: #262626;
  403. image {
  404. margin-left: 10rpx;
  405. width: 30rpx;
  406. height: 30rpx;
  407. }
  408. }
  409. }
  410. .sectionB {
  411. margin-top: 24rpx;
  412. display: flex;
  413. align-items: center;
  414. justify-content: space-between;
  415. flex-wrap: nowrap;
  416. overflow-x: scroll;
  417. .item {
  418. width: 160rpx;
  419. min-width: 160rpx;
  420. height: 70rpx;
  421. border-radius: 8rpx;
  422. font-size: 24rpx;
  423. font-family: Verdana, Verdana-Bold;
  424. font-weight: 700;
  425. text-align: center;
  426. line-height: 70rpx;
  427. margin-right: 10rpx;
  428. }
  429. }
  430. .sectionB::-webkit-scrollbar {
  431. display: none;
  432. /* Chrome Safari */
  433. }
  434. }
  435. .listSection {
  436. padding: 30rpx;
  437. box-sizing: border-box;
  438. position: relative;
  439. background-color: #fff;
  440. border-radius: 20rpx;
  441. .top-Section {
  442. height: 80rpx;
  443. display: flex;
  444. justify-content: space-between;
  445. align-items: center;
  446. border-bottom: 2px dashed rgba($color: #7F7F7F, $alpha: 0.1);
  447. .point {
  448. width: 16rpx;
  449. height: 16rpx;
  450. background: #3ecde6;
  451. border-radius: 50%;
  452. }
  453. .name {
  454. margin-left: 26rpx;
  455. font-size: 28rpx;
  456. font-family: Verdana, Verdana-Regular;
  457. font-weight: 400;
  458. text-align: left;
  459. color: #262626;
  460. flex-grow: 1;
  461. }
  462. .totalPrice {
  463. font-size: 28rpx;
  464. font-family: Verdana, Verdana-Regular;
  465. font-weight: 400;
  466. text-align: right;
  467. }
  468. }
  469. .item {
  470. position: relative;
  471. padding: 40rpx 0;
  472. box-sizing: border-box;
  473. .sectionA {
  474. display: flex;
  475. align-items: center;
  476. .point {
  477. width: 14rpx;
  478. height: 14rpx;
  479. border-radius: 50%;
  480. }
  481. .name {
  482. margin-left: 28rpx;
  483. font-size: 32rpx;
  484. font-family: Verdana, Verdana-Bold;
  485. font-weight: 700;
  486. text-align: left;
  487. }
  488. }
  489. .sectionB {
  490. display: flex;
  491. align-items: center;
  492. margin-top: 12rpx;
  493. .icon {
  494. margin-left: -5rpx;
  495. width: 22rpx;
  496. height: 27rpx;
  497. margin-right: 24rpx;
  498. }
  499. .date {
  500. font-size: 30rpx;
  501. font-family: Verdana, Verdana-Regular;
  502. font-weight: 400;
  503. text-align: left;
  504. color: #262626;
  505. }
  506. }
  507. .sectionC {
  508. display: flex;
  509. align-items: center;
  510. margin-top: 34rpx;
  511. .point {
  512. width: 14rpx;
  513. height: 14rpx;
  514. background: #e0e0e0;
  515. border-radius: 50%;
  516. margin-right: 28rpx;
  517. }
  518. .name {
  519. font-size: 22rpx;
  520. font-family: Verdana, Verdana-Regular;
  521. font-weight: 400;
  522. text-align: left;
  523. color: #b1b1b1;
  524. }
  525. }
  526. .sectionD {
  527. display: flex;
  528. align-items: center;
  529. margin-top: 6rpx;
  530. justify-content: space-between;
  531. .name {
  532. margin-left: 35rpx;
  533. font-size: 30rpx;
  534. font-family: Verdana, Verdana-Regular;
  535. font-weight: 400;
  536. text-align: left;
  537. color: #262626;
  538. }
  539. .value {
  540. font-size: 30rpx;
  541. font-family: Verdana, Verdana-Regular;
  542. font-weight: 400;
  543. text-align: right;
  544. color: #fd8f3c;
  545. }
  546. }
  547. .bottomLine {
  548. bottom: 0;
  549. width: 100%;
  550. left: 0;
  551. position: absolute;
  552. border-bottom: 2rpx dashed rgba($color: #7F7F7F, $alpha: 0.1);
  553. }
  554. }
  555. .empty {
  556. display: flex;
  557. flex-direction: column;
  558. align-items: center;
  559. .emptyImg {
  560. width: 283rpx;
  561. height: 227rpx;
  562. }
  563. .text {
  564. margin-top: -20rpx;
  565. font-size: 28rpx;
  566. font-family: PingFang SC, PingFang SC-Medium;
  567. font-weight: 500;
  568. text-align: center;
  569. color: #b1b3ba;
  570. }
  571. }
  572. }
  573. }
  574. </style>