You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
150 lines
3.2 KiB
150 lines
3.2 KiB
2 years ago
|
<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;">
|
||
|
<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"></image>
|
||
|
<view>{{item.accountName}}</view>
|
||
|
<view>账户总余额:{{handlerNumber(item.balance)}}</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,
|
||
|
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 => {
|
||
|
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: 200rpx;
|
||
|
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:nth-of-type(2) {
|
||
|
margin-top: 10rpx;
|
||
|
color: #778899;
|
||
|
font-size: 24rpx;
|
||
|
}
|
||
|
</style>
|