Files
wx_oms/financialCenter/enterprise/account/index.vue
xiaozhiyong d4d20013f0 更新
2023-11-07 16:14:20 +08:00

167 lines
3.7 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view style="height: 100vh;display: flex;flex-direction: column;">
<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.companyName" 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/enterprise/account/detail',item)">
<image class="logo" src="@/static/company.png"></image>
<view>{{item.companyName}}</view>
<view>企业总余额{{handlerNumber(item.totalBalance)}}</view>
</view>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
import serve from '@/api/financialCenter/business.js'
export default {
data() {
return {
styles: {},
paramter: {
currentPage: 1,
pageSize: 10,
sorted:{
createTime:'desc'
},
params: {
companyName: ''
}
},
tableList: []
}
},
onLoad() {
this.styles = uni.getMenuButtonBoundingClientRect()
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) {
console.log(123)
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: 60rpx;
padding: 0 50rpx;
}
.container {
padding: 30rpx 55rpx;
}
.container .item {
position: relative;
margin-bottom: 25rpx;
padding-top: 60rpx;
height: 200rpx;
width: 100%;
background: #fff;
/* border: 1px solid #333; */
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) {
/* margin-top: 57rpx; */
color: #333;
font-size: 30rpx;
font-weight: 550;
}
.container .item view:nth-of-type(2) {
margin-top: 10rpx;
color: #778899;
font-size: 24rpx;
}
</style>