reportPage.vue 16 KB

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