123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741 |
- <template>
- <view>
- <ujp-navbar :is-back="false">
- <view class="navbar">
- <view class="navbar-tit">分润记录</view>
- <view class="navbar-screen" v-show="current==0" @click="popupShow = true"><span>筛选</span>
- <u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon>
- </view>
- </view>
- </ujp-navbar>
- <u-popup v-model="popupShow" mode="top" height="80%">
- <view class="popup-screen">
- <view class="screen">
- <view class="screen-item">
- <view class="screen-head">查询日期</view>
- <view class="screen-main2">
- <u-calendar v-model="showdate" mode="date" @change="changedate"></u-calendar>
- <u-input :value="queryDate?queryDate:'选择时间筛选'" :type="type" :border="border"
- @click="showdate = true" />
- <!--
- <u-action-sheet :list="actionSheetList" v-model="show" @click="actionSheetCallback"></u-action-sheet>
- -->
- </view>
- </view>
- <view class="screen-item" v-if="false">
- <view class="screen-head">充电桩类型</view>
- <view class="screen-main">
- <view :class="{
- active:selecttype==''
- }" @click="selecttype=''" class="screen-entry ">全部</view>
- <view :class="{
- active:selecttype=='0'
- }" @click="selecttype='0'" class="screen-entry type1">自行车充电</view>
- <view :class="{
- active:selecttype=='2'
- }" @click="selecttype='2'" class="screen-entry type3">交流慢充</view>
- <view :class="{
- active:selecttype=='1'
- }" @click="selecttype='1'" class="screen-entry type2">直流快充</view>
- </view>
- </view>
- <view class="screen-item">
- <view class="screen-head">站点</view>
- <view class="screen-main">
- <view class="screen-entry " :class="{
- active:selectstationId==''
- }" @click="selectstationId=''">全部</view>
-
-
- <template v-for="(item,i) in stationList" >
-
- <view class="screen-head"
- style="width: 100%;"
- v-if="getStationNo(i)" :key="i" >
-
- {{item.stationNo.substring(0,1)}}类</view>
- <view
- :key="i"
- :class="{
- active:selectstationId==item.id
- }"
- @click="selectstationId=item.id,selectdeviceNo=''"
- class="screen-entry" >{{item.name}}</view>
- </template>
- </view>
- </view>
- <view class="screen-item" v-show="selectstationId">
- <view class="screen-head">桩号</view>
- <view class="screen-main">
- <view class="screen-entry " :class="{
- active:selectdeviceNo==''
- }" @click="selectdeviceNo=''">全部</view>
- <view v-for="(item,i) in stationListSon" :key="i"
- v-show="selectstationId?(selectstationId==item.stationId):true" :class="{
- active:selectdeviceNo==item.deviceNo
- }" @click="selectdeviceNo=item.deviceNo" class="screen-entry">{{item.name}}</view>
- </view>
- </view>
- </view>
- <view class="screen-foot">
- <view class="screen-btn-l" @click="resetBtn">重置</view>
- <view class="screen-btn-r" @click="okbtn">确定</view>
- </view>
- </view>
- </u-popup>
- <u-tabs :list="tabList" bar-width="100" :is-scroll="false" :current="current" @change="change" inactive-color="#acb2af"
- active-color="#101010"></u-tabs>
- <!-- 充电订单 -->
- <view class="detailed" v-show="current==0">
- <view style="text-align: center;margin-top: 100px" v-if="!list.length">
- <img src="@/assets/img/blankpage.png">
- <view>查询为空</view>
- </view>
- <view class="detailed-list" v-for="(item ,index) in list"
- @click="gotoUrl('pagesFinance/share/details?id='+item.id)" :key="index">
- <view class="detailed-time" v-if="item.show">
- <p>{{item.showtime}}</p>
- <p>共收{{showMap.get(item.showtime).num}}笔,{{showNumJP(showMap.get(item.showtime).amount)}}元</p>
- </view>
- <view class="detailed-item">
- <view class="detailed-item-name" style="
- width: 70%;
- ">
- <h2 class="showName">{{item.stationName}}/{{item.deviceName}}</h2>
-
- <p
- v-if="item.chargingRecord"
- :style="{
- color:colorList[item.chargingRecord.platform%3]
- }">{{item.chargingRecord.platformText}}</p>
- </view>
- <view class="detailed-item-name" style="
- min-width: 60px;
- width: 30%;
- ">
- <h2 style=" text-align: end;">{{showNumJP(item.shareProfitAmount)}}元</h2>
- <p style=" text-align: end;">{{item.createTime?item.createTime.slice(10):''}}</p>
- </view>
-
- <view class="sign" v-if="item.status=='1'">
- <img src="../../assets/img/tixian.png" alt="">
- </view>
- </view>
-
- </view>
- <u-divider v-if="list.length&&list.length == recordsTotal" color="#B6BDC3" style="margin-top:20px;"
- bg-color="#f7f7f7">已经到底了</u-divider>
- </view>
-
- <!-- 包月卡 -->
- <view class="detailed"
- style=" padding-bottom: 20px;" v-show="current==1">
- <view style="text-align: center;margin-top: 100px" v-if="!list2.length">
- <img src="@/assets/img/blankpage.png">
- <view>查询为空</view>
- </view>
-
- <view class="detailed-list" v-for="(item ,index) in list2"
- @click="gotoUrl('pagesFinance/share/monthlyCardDetails?id='+item.id)"
-
- :key="index"
- >
- <view class="detailed-time" v-if="item.show" >
- <p>{{item.showtime}}</p>
- <!-- {{showMap2.get(item.showtime).num}}笔, -->
- <p v-if="false&&showMap2">共收{{showMap2.get(item.showtime).amount.toFixed(2)}}元</p>
-
- </view>
- <view class="detailed-item">
- <view class="detailed-item-name" style="
- width: 70%;
- ">
- <h2 class="showName" v-if="item.stationName">{{item.stationName}}/{{item.deviceName}}</h2>
- <h2 class="showName" v-else>平台收益</h2>
- <p>{{item.regUserCardNo}}</p>
- </view>
- <view class="detailed-item-name" style="
- min-width: 60px;
- width: 30%;
- ">
- <h2 style=" text-align: end;">{{item.shareProfitAmount.toFixed(2)}}元</h2>
- <p style=" text-align: end;">{{item.stationName?item.stationProportion:item.disProportion}}%</p>
- </view>
- <view class="sign" v-if="item.status==2">
- <img src="../../assets/img/tixian.png" alt="">
- </view>
- </view>
-
-
- </view>
- <u-divider v-if="list2.length&&list2.length == recordsTotal2" color="#B6BDC3" style="margin-top:20px;" bg-color="#f7f7f7">已经到底了</u-divider>
-
- </view>
- <Tabbar ref="tabbarMain" :current="2"></Tabbar>
- </view>
- </template>
- <script>
- import Tabbar from '@/components/TabbarFinance.vue'
- import * as API from '@/apis/finance.js'
- import {
- currentTimeStamp,
- parseUnixTime
- } from '@/utils'
- export default {
- data() {
- return {
- showdate: false,
- startTime: "",
- queryDate: "",
- endTime: "",
- selecttype: "",
- selectstationId: "",
- selectdeviceNo: "",
- title: "",
- year: "",
- startyear: "",
- endyear: "",
- current: 0,
- tabList: [{
- name: '分润记录'
- }, {
- name: '折扣卡分润'
- }],
- params: {
- year: true,
- month: false,
- day: false,
- hour: false,
- minute: false,
- second: false,
- // timestamp: true,
- },
- colorList:["#00B962","#1677FF","#eb372a",'#d5dc21','#00e0d4','#e536e0'],
- form: {
- },
- pageIndex: 1,
- recordsTotal: 0,
- list: [],
- pageIndex2: 1,
- recordsTotal2: 0,
- list2: [],
- showMap2:null,
- popupShow: false,
- tabbarList: [{
- iconPath: "bar-chart-box-fill",
- selectedIconPath: "bar-chart-box-fill",
- text: '统计',
- count: 0,
- isDot: true,
- customIcon: true,
- },
- {
- iconPath: "article-fill",
- selectedIconPath: "article-fill",
- text: '明细',
- midButton: true,
- customIcon: true,
- },
- {
- iconPath: "account-pin-box-fill",
- selectedIconPath: "account-pin-box-fill",
- text: '我的',
- count: 0,
- isDot: false,
- customIcon: true,
- },
- ],
- showMap: null,
- //current: 0,
- value: '',
- type: 'select',
- show: false,
- border: true,
- stationList: [],
- stationListSon: [],
- actionSheetList: [{
- text: '男'
- },
- {
- text: '女'
- },
- {
- text: '保密'
- }
- ],
- }
- },
- components: {
- Tabbar
- },
- onShow() {
- if (this.$refs.tabbarMain) {
- this.$refs.tabbarMain.setcount(2);
- }
- },
- onReachBottom() {
- this.myLoadmore();
- },
- onLoad() {
- // this.queryDate=parseUnixTime(new Date(),"{y}-{m}-{d}")
- this.startyear = new Date().getFullYear()
- //console.log(this.startyear)
- this.endyear = this.startyear - 3
- //console.log(this.endyear)
- },
- onReady() {
- this.getList()
- this.getList2()
- this.getStation()
- },
- methods: {
- getStationNo(i){
- var no=this.stationList[i].stationNo
- if(no){
- if(i==0){
- return true
- }else{
- var no2=this.stationList[i-1].stationNo
- console.log(no2,no)
- if(no2){
- return no2.substring(0,1)!=no.substring(0,1)
- }else{
- return false
- }
-
- }
- }else{
- return false
- }
-
- },
- change(index) {
- this.current = index;
- },
- showDateMoth(date) {
- var back = date;
- if (date) {
- var k = date.slice(5, 6)
- // console.log(k)
- if (k == '0') {
- back = date.slice(6, 7)
- } else {
- back = date.slice(5, 7)
- }
- }
- return back;
- },
- changedate(e) {
- console.log(e)
- this.queryDate = e.result
- },
- resetBtn() {
- // this.queryDate=parseUnixTime(new Date(),"{y}-{m}-{d}")
- this.year = ""
- this.startTime = ""
- this.endTime = ""
- this.selecttype = ""
- this.selectstationId = ""
- this.selectdeviceNo = ""
- this.pageIndex = 1;
- this.form = {
- queryDate: "",
- pageIndex: this.pageIndex,
- type: this.selecttype,
- stationId: this.selectstationId,
- deviceNo: this.selectdeviceNo,
- };
- this.popupShow = false;
- this.list = [];
- this.getList()
- },
- okbtn() {
- this.popupShow = false;
- this.pageIndex = 1;
- this.form = {
- queryDate: this.queryDate,
- pageIndex: this.pageIndex,
- type: this.selecttype,
- stationId: this.selectstationId,
- deviceNo: this.selectdeviceNo,
- };
- this.list = [];
- this.getList()
- },
- getList() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- this.form.pageIndex = this.pageIndex
- this.form.pageSize = 20
- API.recordData(this.form).then((res) => {
- this.list = [
- ...this.list,
- ...res.data.data
- ];
- var showMap = new Map()
- this.list.forEach(item => {
- var ktime = item.createTime.split(" ")[0]
- if (showMap.has(ktime)) {
- item.show = false;
- } else {
- var Amount = item.todaySPAmount
- var num = item.todaySPNum
- showMap.set(ktime, {
- amount: Amount,
- num: num
- })
- item.show = true;
- item.showtime = ktime;
- }
- })
- this.showMap = showMap;
- this.recordsTotal = res.data.recordsTotal
- uni.hideLoading()
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- getList2() {
-
- // uni.showLoading({
- // title: "加载中",
- // mask: true,
- // })
-
-
- API.cardProfitData({
- pageIndex:this.pageIndex2,
- pageSize:20
- }).then((res) => {
- var showMap=new Map()
- this.showMap2=showMap;
- this.list2 = [
- ...this.list2,
- ...res.data.data
- ];
-
- this.list2.forEach(item=>{
- if(item.createTime){
- var ktime=item.createTime.split(" ")[0]
- if(showMap.has(ktime)){
- item.show=false;
-
-
- }else{
- var Amount=item.todayAmount
- var num=0;//item.totalNum
- showMap.set(ktime,{
- amount:Amount,
- num:num
- })
-
- item.show=true;
- item.showtime=ktime;
- }
- }
-
- })
-
- this.showMap2=showMap;
- this.recordsTotal2 = res.data.recordsTotal
- //uni.hideLoading()
-
- }).catch(error => {
- uni.showToast({
-
- title: error
- })
- })
- },
- getStation(bl) {
- API.stationList().then((res) => {
- var list= res.data.stationList
-
- var list2=list.sort(function(item1,item2){
-
-
- return (item1.stationNo>item2.stationNo)?1:-1
- })
- for(var i in list2){
- //console.log(list2[i].stationNo)
- }
-
- this.stationList =list2
-
- this.stationListSon=res.data.deviceList
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- myLoadmore() {
- if(this.current==0){
- if (this.list.length < this.recordsTotal) {
- this.pageIndex += 1;
- this.getList()
- }
-
- }else{
- if (this.list2.length < this.recordsTotal2) {
- this.pageIndex2 += 1;
- this.getList2()
- }
- }
- },
- // 点击actionSheet回调
- actionSheetCallback(index) {
- this.value = this.actionSheetList[index].text;
- }
- }
- }
- </script>
- <style>
- page {
- background-color: #F7F7F7;
- }
- </style>
- <style lang="scss" scoped>
-
- .popup-screen {
- padding: 20px;
- position: relative;
- .screen {
- padding-bottom: 30px;
- }
- .screen-item {
- margin-bottom: 20px;
-
- .screen-head {
- margin-bottom: 8px;
- font-size: 16px;
- }
- .screen-main {
- // display: -webkit-box;
- display: flex;
- flex-wrap: wrap;
- }
- .screen-entry {
- width: 29%;
- padding: 6px 0;
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: #F2F5FA;
- text-align: center;
- margin-bottom: 10px;
- border-radius: 3px;
- margin-right: 6px;
- }
- .screen-entry.active {
- background-color: #185AC6;
- color: #fff;
- }
- }
- .screen-foot {
- position: fixed;
- left: 0;
- right: 0;
- bottom: 0;
- display: flex;
- height: 50px;
- border-top: 1px solid #ededed;
- .screen-btn-l {
- background-color: #fff;
- flex: 0.2;
- text-align: center;
- line-height: 50px;
- }
- .screen-btn-r {
- flex: 0.8;
- text-align: center;
- line-height: 50px;
- background-color: #185AC6;
- color: #fff;
- }
- }
- }
- .navbar {
- display: flex;
- justify-content: space-between;
- flex: 1;
- padding: 0 15px;
- }
- .navbar-tit {
- font-size: 20px;
- }
- .navbar-screen {
- display: flex;
- align-items: center;
- span {
- margin-right: 2px;
- color: #999;
- }
- }
- .product_tip{
- position: absolute;
- top: 0;
- right: 0;
- width: 26px;
- height: 26px;
- text-align: right;
- p{
- font-size: 12px;
- color: #ffffff;
- transform: rotate(45deg);
- position: relative;
- top: 0rpx;
- right: 0rpx;
- }
- .product_tip_bg{
- width: 0;
- height: 0;
- border-bottom: 44rpx solid #FD662A;
- border-right: 44rpx solid transparent;
- border-left: 44rpx solid transparent;
- transform: rotate(45deg);
- position: absolute;
- top: -7rpx;
- right: -29rpx;
- }
- }
- .detailed-time {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 10px 20px;
- font-size: 16px;
- p {
- color: #666;
- }
- }
- .detailed-item {
- background-color: #fff;
- display: flex;
- justify-content: space-between;
- padding: 10px 20px;
- border-bottom: 1px solid #ededed;
- position: relative;
- .sign{
- width: 32px;
- height: 32px;
- position: absolute;
- top: 0;
- right: 0;
- img{
- width: 100%;
- }
- }
- .detailed-item-name {
- h4 {
- font-weight: normal;
- }
- p {
- font-size: 15px;
- margin-top: 4px;
- color: #A2A9B5;
- }
- }
- .detailed-item-num {
- display: flex;
- align-items: center;
- h2 {
- margin-right: 4px;
- }
- }
- }
- .showName {
- font-weight: unset;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size: 16px;
- }
- .u-tabs{
- /deep/.uni-scroll-view-content {
- width: 56.2% !important;
- margin: auto;
- }
- }
- /deep/.u-tab-bar {
-
- background-color: #0076FF !important;
-
- }
- </style>
|