reportPage.vue 16 KB

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