index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. <template>
  2. <view>
  3. <u-navbar :is-back="false">
  4. <view class="navbar">
  5. <view class="navbar-tit">分润记录</view>
  6. <view class="navbar-screen" @click="popupShow = true"><span>筛选</span>
  7. <u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon>
  8. </view>
  9. </view>
  10. </u-navbar>
  11. <u-popup v-model="popupShow" mode="top" height="80%">
  12. <view class="popup-screen">
  13. <view class="screen">
  14. <view class="screen-item">
  15. <view class="screen-head">查询日期</view>
  16. <view class="screen-main2">
  17. <u-calendar v-model="showdate" mode="date" @change="changedate"></u-calendar>
  18. <u-input :value="queryDate?queryDate:'选择时间筛选'" :type="type" :border="border"
  19. @click="showdate = true" />
  20. <!--
  21. <u-action-sheet :list="actionSheetList" v-model="show" @click="actionSheetCallback"></u-action-sheet>
  22. -->
  23. </view>
  24. </view>
  25. <view class="screen-item">
  26. <view class="screen-head">充电桩类型</view>
  27. <view class="screen-main">
  28. <view :class="{
  29. active:selecttype==''
  30. }" @click="selecttype=''" class="screen-entry ">全部</view>
  31. <view :class="{
  32. active:selecttype=='0'
  33. }" @click="selecttype='0'" class="screen-entry type1">自行车充电</view>
  34. <view :class="{
  35. active:selecttype=='2'
  36. }" @click="selecttype='2'" class="screen-entry type3">交流慢充</view>
  37. <view :class="{
  38. active:selecttype=='1'
  39. }" @click="selecttype='1'" class="screen-entry type2">直流快充</view>
  40. </view>
  41. </view>
  42. <view class="screen-item">
  43. <view class="screen-head">站点</view>
  44. <view class="screen-main">
  45. <view class="screen-entry " :class="{
  46. active:selectstationId==''
  47. }" @click="selectstationId=''">全部</view>
  48. <view v-for="(item,i) in stationList" :key="i" :class="{
  49. active:selectstationId==item.id
  50. }" @click="selectstationId=item.id,selectdeviceNo=''" class="screen-entry">{{item.name}}</view>
  51. </view>
  52. </view>
  53. <view class="screen-item">
  54. <view class="screen-head">桩号</view>
  55. <view class="screen-main">
  56. <view class="screen-entry " :class="{
  57. active:selectdeviceNo==''
  58. }" @click="selectdeviceNo=''">全部</view>
  59. <view v-for="(item,i) in stationListSon" :key="i"
  60. v-show="selectstationId?(selectstationId==item.stationId):true" :class="{
  61. active:selectdeviceNo==item.deviceNo
  62. }" @click="selectdeviceNo=item.deviceNo" class="screen-entry">{{item.name}}</view>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="screen-foot">
  67. <view class="screen-btn-l" @click="resetBtn">重置</view>
  68. <view class="screen-btn-r" @click="okbtn">确定</view>
  69. </view>
  70. </view>
  71. </u-popup>
  72. <u-tabs :list="tabList" :is-scroll="false" :current="current" @change="change" inactive-color="#acb2af"
  73. active-color="#101010"></u-tabs>
  74. <!-- 充电订单 -->
  75. <view class="detailed" v-if="current==0">
  76. <view style="text-align: center;margin-top: 100px" v-if="!list.length">
  77. <img src="@/assets/img/blankpage.png">
  78. <view>查询为空</view>
  79. </view>
  80. <view class="detailed-list" v-for="(item ,index) in list"
  81. @click="gotoUrl('pagesFinance/share/details?id='+item.id)" :key="index">
  82. <view class="detailed-time" v-if="item.show">
  83. <p>{{item.showtime}}</p>
  84. <p>共收{{showMap.get(item.showtime).num}}笔,{{showMap.get(item.showtime).amount}}元</p>
  85. </view>
  86. <view class="detailed-item">
  87. <view class="detailed-item-name" style="
  88. width: 70%;
  89. ">
  90. <h2 class="showName">{{item.stationName}}/{{item.deviceName}}</h2>
  91. <p>{{item.flowNo?item.flowNo:'无充电单号'}}</p>
  92. </view>
  93. <view class="detailed-item-name" style="
  94. min-width: 60px;
  95. width: 30%;
  96. ">
  97. <h2 style=" text-align: end;">{{item.shareProfitAmount}}元</h2>
  98. <p style=" text-align: end;">{{item.createTime?item.createTime.slice(10):''}}</p>
  99. </view>
  100. </view>
  101. <view class="product_tip" v-if="item.status=='1'">
  102. <view class="product_tip_bg"></view>
  103. <p>已提现</p>
  104. </view>
  105. </view>
  106. <u-divider v-if="list.length&&list.length == recordsTotal" color="#B6BDC3" style="margin-top:20px;"
  107. bg-color="#f4f0f0">已经到底了</u-divider>
  108. </view>
  109. <!-- 包月卡 -->
  110. <view class="" v-if="current==1">
  111. <view class="detailed-list">
  112. <view class="detailed-time">
  113. <p>2022-07-19</p>
  114. <p>今日分润 178.00</p>
  115. </view>
  116. <view class="detailed-item">
  117. <view class="detailed-item-name" style="
  118. width: 70%;
  119. ">
  120. <h2 class="showName">荆鹏软件园充电站</h2>
  121. <p>包月卡卡号或用户ID</p>
  122. </view>
  123. <view class="detailed-item-name" style="
  124. min-width: 60px;
  125. width: 30%;
  126. ">
  127. <h2 style=" text-align: end;">100.00</h2>
  128. <p style=" text-align: end;">15:21:11</p>
  129. </view>
  130. </view>
  131. <view class="detailed-item">
  132. <view class="detailed-item-name" style="
  133. width: 70%;
  134. ">
  135. <h2 class="showName">荆鹏软件园充电站</h2>
  136. <p>包月卡卡号或用户ID</p>
  137. </view>
  138. <view class="detailed-item-name" style="
  139. min-width: 60px;
  140. width: 30%;
  141. ">
  142. <h2 style=" text-align: end;">22.00</h2>
  143. <p style=" text-align: end;">15:21:11</p>
  144. </view>
  145. </view>
  146. <view class="detailed-time">
  147. <p>2022-07-18</p>
  148. <p>今日分润 178.00</p>
  149. </view>
  150. <view class="detailed-item">
  151. <view class="detailed-item-name" style="
  152. width: 70%;
  153. ">
  154. <h2 class="showName">荆鹏软件园充电站</h2>
  155. <p>包月卡卡号或用户ID</p>
  156. </view>
  157. <view class="detailed-item-name" style="
  158. min-width: 60px;
  159. width: 30%;
  160. ">
  161. <h2 style=" text-align: end;">11.00</h2>
  162. <p style=" text-align: end;">15:21:11</p>
  163. </view>
  164. </view>
  165. <view class="product_tip">
  166. <view class="product_tip_bg"></view>
  167. <p>已提现</p>
  168. </view>
  169. </view>
  170. </view>
  171. <Tabbar ref="tabbarMain" :current="2"></Tabbar>
  172. </view>
  173. </template>
  174. <script>
  175. import Tabbar from '@/components/TabbarFinance.vue'
  176. import * as API from '@/apis/finance.js'
  177. import {
  178. currentTimeStamp,
  179. parseUnixTime
  180. } from '@/utils'
  181. export default {
  182. data() {
  183. return {
  184. showdate: false,
  185. startTime: "",
  186. queryDate: "",
  187. endTime: "",
  188. selecttype: "",
  189. selectstationId: "",
  190. selectdeviceNo: "",
  191. title: "",
  192. year: "",
  193. startyear: "",
  194. endyear: "",
  195. current: 0,
  196. tabList: [{
  197. name: '充电订单'
  198. }, {
  199. name: '包月卡'
  200. }],
  201. params: {
  202. year: true,
  203. month: false,
  204. day: false,
  205. hour: false,
  206. minute: false,
  207. second: false,
  208. // timestamp: true,
  209. },
  210. form: {
  211. },
  212. pageIndex: 1,
  213. recordsTotal: 0,
  214. list: [],
  215. popupShow: false,
  216. tabbarList: [{
  217. iconPath: "bar-chart-box-fill",
  218. selectedIconPath: "bar-chart-box-fill",
  219. text: '统计',
  220. count: 0,
  221. isDot: true,
  222. customIcon: true,
  223. },
  224. {
  225. iconPath: "article-fill",
  226. selectedIconPath: "article-fill",
  227. text: '明细',
  228. midButton: true,
  229. customIcon: true,
  230. },
  231. {
  232. iconPath: "account-pin-box-fill",
  233. selectedIconPath: "account-pin-box-fill",
  234. text: '我的',
  235. count: 0,
  236. isDot: false,
  237. customIcon: true,
  238. },
  239. ],
  240. showMap: null,
  241. current: 0,
  242. value: '',
  243. type: 'select',
  244. show: false,
  245. border: true,
  246. stationList: [],
  247. stationListSon: [],
  248. actionSheetList: [{
  249. text: '男'
  250. },
  251. {
  252. text: '女'
  253. },
  254. {
  255. text: '保密'
  256. }
  257. ],
  258. }
  259. },
  260. components: {
  261. Tabbar
  262. },
  263. onShow() {
  264. if (this.$refs.tabbarMain) {
  265. this.$refs.tabbarMain.setcount(2);
  266. }
  267. },
  268. onReachBottom() {
  269. if (this.list.length < this.recordsTotal) {
  270. this.myLoadmore();
  271. }
  272. },
  273. onLoad() {
  274. // this.queryDate=parseUnixTime(new Date(),"{y}-{m}-{d}")
  275. this.startyear = new Date().getFullYear()
  276. console.log(this.startyear)
  277. this.endyear = this.startyear - 3
  278. console.log(this.endyear)
  279. },
  280. onReady() {
  281. this.getList()
  282. this.getStation()
  283. },
  284. methods: {
  285. change(index) {
  286. this.current = index;
  287. },
  288. showDateMoth(date) {
  289. var back = date;
  290. if (date) {
  291. var k = date.slice(5, 6)
  292. console.log(k)
  293. if (k == '0') {
  294. back = date.slice(6, 7)
  295. } else {
  296. back = date.slice(5, 7)
  297. }
  298. }
  299. return back;
  300. },
  301. changedate(e) {
  302. console.log(e)
  303. this.queryDate = e.result
  304. },
  305. resetBtn() {
  306. // this.queryDate=parseUnixTime(new Date(),"{y}-{m}-{d}")
  307. this.year = ""
  308. this.startTime = ""
  309. this.endTime = ""
  310. this.selecttype = ""
  311. this.selectstationId = ""
  312. this.selectdeviceNo = ""
  313. this.pageIndex = 1;
  314. this.form = {
  315. queryDate: "",
  316. pageIndex: this.pageIndex,
  317. type: this.selecttype,
  318. stationId: this.selectstationId,
  319. deviceNo: this.selectdeviceNo,
  320. };
  321. this.popupShow = false;
  322. this.list = [];
  323. this.getList()
  324. },
  325. okbtn() {
  326. this.popupShow = false;
  327. this.pageIndex = 1;
  328. this.form = {
  329. queryDate: this.queryDate,
  330. pageIndex: this.pageIndex,
  331. type: this.selecttype,
  332. stationId: this.selectstationId,
  333. deviceNo: this.selectdeviceNo,
  334. };
  335. this.list = [];
  336. this.getList()
  337. },
  338. getList() {
  339. uni.showLoading({
  340. title: "加载中",
  341. mask: true,
  342. })
  343. this.form.pageIndex = this.pageIndex
  344. this.form.pageSize = 20
  345. API.recordData(this.form).then((res) => {
  346. this.list = [
  347. ...this.list,
  348. ...res.data.data
  349. ];
  350. var showMap = new Map()
  351. this.list.forEach(item => {
  352. var ktime = item.createTime.split(" ")[0]
  353. if (showMap.has(ktime)) {
  354. item.show = false;
  355. } else {
  356. var Amount = item.todaySPAmount
  357. var num = item.todaySPNum
  358. showMap.set(ktime, {
  359. amount: Amount,
  360. num: num
  361. })
  362. item.show = true;
  363. item.showtime = ktime;
  364. }
  365. })
  366. this.showMap = showMap;
  367. this.recordsTotal = res.data.recordsTotal
  368. uni.hideLoading()
  369. }).catch(error => {
  370. uni.showToast({
  371. title: error
  372. })
  373. })
  374. },
  375. getStation(bl) {
  376. API.stationList().then((res) => {
  377. this.stationList = res.data.stationList
  378. this.stationListSon = res.data.deviceList
  379. }).catch(error => {
  380. uni.showToast({
  381. title: error
  382. })
  383. })
  384. },
  385. myLoadmore() {
  386. this.pageIndex += 1;
  387. this.getList()
  388. },
  389. // 点击actionSheet回调
  390. actionSheetCallback(index) {
  391. this.value = this.actionSheetList[index].text;
  392. }
  393. }
  394. }
  395. </script>
  396. <style>
  397. page {
  398. background-color: #F7F7F7;
  399. }
  400. </style>
  401. <style lang="scss" scoped>
  402. .product_tip {
  403. position: relative;
  404. top: -75px;
  405. right: 0;
  406. text-align: right;
  407. p {
  408. font-size: 24rpx;
  409. color: #ffffff;
  410. transform: rotate(45deg);
  411. position: absolute;
  412. top: 10rpx;
  413. right: 0rpx;
  414. }
  415. .product_tip_bg {
  416. width: 0;
  417. height: 0;
  418. border-bottom: 52rpx solid #53b56d;
  419. border-right: 52rpx solid transparent;
  420. border-left: 52rpx solid transparent;
  421. transform: rotate(45deg);
  422. position: absolute;
  423. top: -7rpx;
  424. right: -29rpx;
  425. }
  426. }
  427. .popup-screen {
  428. padding: 20px;
  429. position: relative;
  430. .screen {
  431. padding-bottom: 30px;
  432. }
  433. .screen-item {
  434. margin-bottom: 20px;
  435. .screen-head {
  436. margin-bottom: 8px;
  437. font-size: 16px;
  438. }
  439. .screen-main {
  440. // display: -webkit-box;
  441. display: flex;
  442. flex-wrap: wrap;
  443. }
  444. .screen-entry {
  445. width: 29%;
  446. padding: 6px 0;
  447. display: flex;
  448. align-items: center;
  449. justify-content: center;
  450. background-color: #F2F5FA;
  451. text-align: center;
  452. margin-bottom: 10px;
  453. border-radius: 3px;
  454. margin-right: 6px;
  455. }
  456. .screen-entry.active {
  457. background-color: #185AC6;
  458. color: #fff;
  459. }
  460. }
  461. .screen-foot {
  462. position: fixed;
  463. left: 0;
  464. right: 0;
  465. bottom: 0;
  466. display: flex;
  467. height: 50px;
  468. border-top: 1px solid #ededed;
  469. .screen-btn-l {
  470. background-color: #fff;
  471. flex: 0.2;
  472. text-align: center;
  473. line-height: 50px;
  474. }
  475. .screen-btn-r {
  476. flex: 0.8;
  477. text-align: center;
  478. line-height: 50px;
  479. background-color: #185AC6;
  480. color: #fff;
  481. }
  482. }
  483. }
  484. .navbar {
  485. display: flex;
  486. justify-content: space-between;
  487. flex: 1;
  488. padding: 0 15px;
  489. }
  490. .navbar-tit {
  491. font-size: 20px;
  492. }
  493. .navbar-screen {
  494. display: flex;
  495. align-items: center;
  496. span {
  497. margin-right: 2px;
  498. color: #999;
  499. }
  500. }
  501. .detailed-time {
  502. display: flex;
  503. justify-content: space-between;
  504. align-items: center;
  505. padding: 10px 20px;
  506. font-size: 16px;
  507. p {
  508. color: #666;
  509. }
  510. }
  511. .detailed-item {
  512. background-color: #fff;
  513. display: flex;
  514. justify-content: space-between;
  515. padding: 10px 20px;
  516. border-bottom: 1px solid #ededed;
  517. .detailed-item-name {
  518. h4 {
  519. font-weight: normal;
  520. }
  521. p {
  522. font-size: 15px;
  523. margin-top: 4px;
  524. color: #A2A9B5;
  525. }
  526. }
  527. .detailed-item-num {
  528. display: flex;
  529. align-items: center;
  530. h2 {
  531. margin-right: 4px;
  532. }
  533. }
  534. }
  535. .showName {
  536. font-weight: unset;
  537. overflow: hidden;
  538. text-overflow: ellipsis;
  539. white-space: nowrap;
  540. font-size: 16px;
  541. }
  542. /deep/.uni-scroll-view-content {
  543. width: 50% !important;
  544. margin: auto;
  545. }
  546. /deep/.u-tab-bar {
  547. width: 20% !important;
  548. background-color: #0076FF !important;
  549. left: -4.5%;
  550. }
  551. </style>