|
|
|
<template>
|
|
|
|
<view style="height: 100vh;display: flex;flex-direction: column; background: #F0F2FF;">
|
|
|
|
<view class="header">
|
|
|
|
<view :style="{height:styles.top+'px'}"></view>
|
|
|
|
<uni-nav-bar @clickLeft='jump(-1)' :border="false" color='white' backgroundColor="rgba(0,0,0,0)"
|
|
|
|
left-icon="back" title="油站账户管理" />
|
|
|
|
<view class="seach">
|
|
|
|
<uni-easyinput @confirm='seachFn' style="border-radius:12rpx ;" prefixIcon="search"
|
|
|
|
placeholder-style="color:#bbb;font-weight: 100;" confirmType="搜索"
|
|
|
|
v-model="paramter.params.accountName" placeholder="请输入油站账户名称">
|
|
|
|
</uni-easyinput>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view style="flex:1;overflow: hidden;">
|
|
|
|
<view v-if="!tableList.length"
|
|
|
|
style="width: 100vw; height: 100%; display: flex;align-items: center;justify-content: center;">
|
|
|
|
<image src="@/static/qx.png" style="width: 500rpx; height: 355rpx;"></image>
|
|
|
|
</view>
|
|
|
|
<scroll-view style="height: 100%;" scroll-y="true" @scrolltolower='scrolltolower'>
|
|
|
|
<view class="container">
|
|
|
|
<view class="item" v-for="item,index in tableList" :key="index"
|
|
|
|
@tap="jump(1,'/financialCenter/serviceStation/detail',item)">
|
|
|
|
<image class="logo" src="@/static/serviceStation.png"></image>
|
|
|
|
<view>{{item.accountName}}</view>
|
|
|
|
<view>账户总余额:{{handlerNumber(item.balance)}}</view>
|
|
|
|
<view>近3日平均销量:{{handlerNumber(item.nlyThreedaysAvgAmount)}}</view>
|
|
|
|
<view>统计时间:{{item.nlyThreedaysAvgTime?item.nlyThreedaysAvgTime:'--'}}</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</scroll-view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import serve from '@/api/financialCenter/serviceStation.js'
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
styles: {},
|
|
|
|
paramter: {
|
|
|
|
currentPage: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
sorted:{
|
|
|
|
createTime:'desc'
|
|
|
|
},
|
|
|
|
params: {
|
|
|
|
accountName: ''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
tableList: []
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onLoad() {
|
|
|
|
this.styles = uni.getMenuButtonBoundingClientRect()
|
|
|
|
this.getByPage()
|
|
|
|
},
|
|
|
|
// onShow() {
|
|
|
|
// this.getByPage()
|
|
|
|
// },
|
|
|
|
methods: {
|
|
|
|
seachFn() {
|
|
|
|
this.tableList = []
|
|
|
|
this.paramter.currentPage = 1
|
|
|
|
this.getByPage()
|
|
|
|
console.log('seachFn')
|
|
|
|
},
|
|
|
|
getByPage() {
|
|
|
|
serve.getByPage(this.paramter).then(res => {
|
|
|
|
if (!res.data.list.length) {
|
|
|
|
uni.showToast({
|
|
|
|
title: '没有数据了哦~',
|
|
|
|
icon: 'none'
|
|
|
|
})
|
|
|
|
return
|
|
|
|
}
|
|
|
|
this.tableList = this.tableList.concat(res.data.list);
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 触底加载
|
|
|
|
scrolltolower() {
|
|
|
|
this.paramter.currentPage += 1
|
|
|
|
this.getByPage()
|
|
|
|
},
|
|
|
|
handlerNumber(number) {
|
|
|
|
if (number == 0) return number
|
|
|
|
if (!number) {
|
|
|
|
return '--'
|
|
|
|
}
|
|
|
|
return +number.toFixed(2)
|
|
|
|
},
|
|
|
|
jump(e, path, item) {
|
|
|
|
switch (e) {
|
|
|
|
case -1:
|
|
|
|
uni.navigateBack()
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `${path}?item=${encodeURI(JSON.stringify(item))}`
|
|
|
|
})
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.uni-easyinput__content {
|
|
|
|
background-color: #fff;
|
|
|
|
}
|
|
|
|
|
|
|
|
.header {
|
|
|
|
position: relative;
|
|
|
|
width: 100%;
|
|
|
|
min-height: 403rpx;
|
|
|
|
background: url('https://xoi-support.oss-cn-hangzhou.aliyuncs.com/星油admin小程序/sjbj.png') center/100% no-repeat;
|
|
|
|
}
|
|
|
|
|
|
|
|
.header .seach {
|
|
|
|
margin-top: 30rpx;
|
|
|
|
padding: 0 50rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.container {
|
|
|
|
padding: 30rpx 55rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.container .item {
|
|
|
|
position: relative;
|
|
|
|
margin-bottom: 25rpx;
|
|
|
|
padding-top: 60rpx;
|
|
|
|
height: 300rpx;
|
|
|
|
width: 100%;
|
|
|
|
background: #fff;
|
|
|
|
border-radius: 10rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.container .item .logo {
|
|
|
|
position: absolute;
|
|
|
|
left: 20rpx;
|
|
|
|
top: 50%;
|
|
|
|
transform: translateY(-50%);
|
|
|
|
width: 100rpx;
|
|
|
|
height: 100rpx;
|
|
|
|
border-radius: 50%;
|
|
|
|
/* border: 1px solid #333; */
|
|
|
|
}
|
|
|
|
|
|
|
|
.container .item view {
|
|
|
|
padding-left: 150rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.container .item view:nth-of-type(1) {
|
|
|
|
color: #333;
|
|
|
|
font-size: 30rpx;
|
|
|
|
font-weight: 550;
|
|
|
|
}
|
|
|
|
|
|
|
|
.container .item view {
|
|
|
|
margin-top: 10rpx;
|
|
|
|
color: #778899;
|
|
|
|
font-size: 24rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|