index.vue 11 KB

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