reportPage.vue 16 KB

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