提交 da87009a authored 作者: 宋雄's avatar 宋雄

更换图标

......@@ -710,4 +710,21 @@ export const ownerIntegralRecordsApi = (params = {}, config = {})=> {
.then(res=> { resolve(res) })
.catch(err=> { reject(err) })
})
}
// 历史缴费统计
export const communityPaymentStatisticsApi = (params = {}, config = {})=> {
return new Promise((resolve, reject)=> {
http.get('/property-community/wechat/communityPayment/statistics',
{
data: {
...params,
residentPhone: uni.getStorageSync('user_phone'),
platformCode: uni.getStorageSync('platform_code')
},
...config
})
.then(res=> { resolve(res) })
.catch(err=> { reject(err) })
})
}
\ No newline at end of file
......@@ -28,8 +28,8 @@
</view>
<view class="quick-entry" v-if="userType !== '2'">
<view class="item" @click="quickEntry(8)">
<image src="../../static/images/quick08.png" class="icon"></image>
<text>社区服务</text>
<image src="../../static/images/quick09.png" class="icon"></image>
<text>扫一扫</text>
</view>
<view class="item" @click="quickEntry(6)">
<view class="item-img">
......
......@@ -76,7 +76,7 @@
</view>
<view class="item" @click="quickEntry(9)">
<view class="left">
<image src="../../static/images/user06.png" class="icon"></image>
<image src="../../static/images/user10.png" class="icon"></image>
<div class="title">我的积分</div>
</view>
<image src="../../static/images/icon_more.png" class="arrow"></image>
......
......@@ -90,9 +90,16 @@
},
toRecord(type) {
if(type == 1){
uni.navigateTo({
url: '/pages/payCostStatistical/index',
});
let obj = freeType.find(item=>item.code === chargeTypeCode)
if(obj) {
uni.navigateTo({
url: '/pages/payCostStatistical/index?code=' + chargeTypeCode + '&name=' + obj.name
});
} else {
uni.navigateTo({
url: '/pages/payCostStatistical/index?code=' + chargeTypeCode
});
}
}else if(type == 2){
uni.navigateTo({
url: '/pages/payCostRecord/index?code=' + chargeTypeCode
......
......@@ -4,28 +4,30 @@
<view class="property">
<view class="user">
<view class="name">{{userName}} {{userPhone}}</view>
<view class="add">{{platformName}}</view>
<view class="house-box">
<view class="add">{{platformName}}</view>
<picker @change="onHouseChange" range-key="label" :range="houseList">
<view class="uni-input">{{houseList[houseIndex].label}}</view>
</picker>
</view>
</view>
<view class="screening">
<!-- <view class="title"> -->
<!-- <view class="picker on"> -->
<picker @change="bindPickerChange" :value="year" :range="yearList">
<view class="uni-input">{{yearList[index]}}<image src="../../static/images/icon_up.png" class="icon"></image></view>
</picker>
<!-- </view> -->
<!-- </view> -->
<picker @change="onYearChange" :range="yearList">
<view class="uni-input">{{yearList[index]}}<image src="../../static/images/icon_up.png" class="icon"></image></view>
</picker>
<view class="content">
<view class="text">
<view class="name">合计金额(元)</view>120
<view class="name">合计金额(元)</view>{{costTotalAmount}}
</view>
<view class="text">
<view class="name">缴费单位</view>汉江之星物业公司
<view class="name">缴费单位</view>{{propertyName}}
</view>
</view>
<view class="bottom">2023年度物业费累计:220元</view>
<view class="bottom" v-if="index === 0">近三年{{costName}}累计:{{costTotalAmount}}</view>
<view class="bottom" v-else>{{yearList[index]}}{{costName}}累计:{{costYearAmount}}</view>
</view>
<view class="statistical">
<qiun-data-charts type="line" :chartData="chartData" :opts="opts" background="none" />
<qiun-data-charts type="line" :chartData="chartData" :opts="opts" background="#fff" />
</view>
</view>
</view>
......@@ -33,6 +35,11 @@
</template>
<script>
import {
getHouseListApi,
communityPaymentStatisticsApi
} from '@/config/api.js'
import {Moment} from '@/utils/moment.js'
let chargeTypeCode = ''
export default {
data() {
......@@ -40,22 +47,24 @@
userName: '',
userPhone: '',
platformName: '',
year: '',
costName: '',
costTotalAmount: 0,
costYearAmount: 0,
houseList: [],
houseIndex: 0,
propertyName: '',
index: 0,
yearList: ['全部', '2023年', '2022年', '2021年'],
month: '',
yearList: [],
chartData: {
categories: ["2023年", "2022年", "2021年"],
categories: ['2021年', '2022年', '2023年'],
series: [{
"name": "费用统计",
"data": [2000, 2050, 1000]
"data": [13, 34, 1200]
}]
},
opts: {
color: ["#6A59F2", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
"#ea7ccc"
],
padding: [15, 10, 0, 15],
color: ["#6A59F2", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", "#ea7ccc"],
padding: [15, 10, 0, 10],
enableScroll: false,
legend: {},
xAxis: {
......@@ -72,23 +81,82 @@
activeType: "hollow"
}
},
update: true
}
}
},
methods: {
bindPickerChange: function(e) {
this.index = e.detail.value
async getHouseList() {
let {result} = await getHouseListApi({
pageNo: 1,
pageSize: 20,
auditStatus: "auditPass"
})
if(result.total > 0) {
this.propertyName = result.records[0].propertyName
this.houseList = result.records.map(item=> {
return {
label: item.buildingName + item.unitName + item.roomName,
value: item.roomId
}
})
this.getStatistical()
}
},
async getStatistical() {
let roomId = this.houseList[this.houseIndex].value
let year = this.index === 0 ? '0' : this.yearList[this.index].replace('年', '')
let {result} = await communityPaymentStatisticsApi({
roomId,
chargeTypeCode,
year
})
let yearList = []
let yearData = []
result.forEach(item=> {
if(this.index === 0) {
yearList.push(`${item.YEAR}`)
} else {
yearList.push(`${item.MONTH}`)
}
yearData.push(item.totalAmount)
})
this.costYearAmount = yearData.reduce((pra, cur)=> {
return pra + cur
}, 0)
if(this.index === 0) {
this.costTotalAmount = this.costYearAmount
}
this.chartData.categories = yearList
this.chartData.series = [
{
name: `${this.costName}统计`,
data: yearData
}
]
},
bindPickerChange1: function(e) {
this.index1 = e.detail.value
onHouseChange(e) {
this.houseIndex = Number(e.detail.value)
this.index = 0
this.getStatistical()
},
async onYearChange(e) {
this.index = Number(e.detail.value)
this.getStatistical()
}
},
onLoad(option) {
this.userName = uni.getStorageSync('user_name')
this.userPhone = uni.getStorageSync('user_phone')
this.platformName = uni.getStorageSync('platform_name')
this.costName = option.name || '费用'
chargeTypeCode = option.code
// this.getList()
let nowYear = new Moment().format('YYYY')
let lastYear = (Number(nowYear) - 1).toString() + '年'
let beforeear = (Number(nowYear) - 2).toString() + '年'
this.yearList = ['全部', beforeear, lastYear, nowYear + '年']
this.getHouseList()
}
}
</script>
......@@ -118,11 +186,49 @@
margin-bottom: 20rpx;
}
.add {
font-size: 28rpx;
color: #D5DCFF;
.house-box {
display: flex;
align-items: center;
.add {
font-size: 28rpx;
color: #D5DCFF;
}
.uni-input {
color: #D5DCFF;
margin-left: 30rpx;
position: relative;
&::after {
position: absolute;
content: " ";
width: 0;
height: 0;
top: 50%;
right: -15px;
border-top: 6px solid #D5DCFF;
border-right: 6px solid transparent;
border-left: 6px solid transparent;
transform-origin: center;
transform: translateY(-50%);
}
}
}
}
.uni-input {
font-size: 28rpx;
color: #373737;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.icon {
width: 20rpx;
height: 12rpx;
margin-left: 15rpx;
}
.screening {
margin: 30rpx 0;
......@@ -149,19 +255,9 @@
// }
// }
}
.uni-input {
font-size: 28rpx;
color: #373737;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.icon {
width: 20rpx;
height: 12rpx;
margin-left: 15rpx;
}
.content {
......
<?xml version="1.0" encoding="UTF-8"?>
<svg width="22px" height="23px" viewBox="0 0 22 23" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 53.2 (72643) - https://sketchapp.com -->
<title>删 除 copy</title>
<desc>Created with Sketch.</desc>
<g id="首页终稿" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="首页-20190505" transform="translate(-625.000000, -419.000000)" fill="#FFFFFF" fill-rule="nonzero">
<g id="删-除-copy-2" transform="translate(625.000000, 419.000000)">
<g id="删-除-copy">
<path d="M21.1606154,23 C20.9446288,23 20.7286423,22.9131672 20.5641602,22.7412384 L0.246472607,1.50368161 C-0.0824816763,1.15935458 -0.0821097514,0.601478941 0.247303324,0.257631482 C0.5767164,-0.0862159767 1.1104286,-0.0858272132 1.43938288,0.25849981 L21.7570705,21.4960566 C21.9953079,21.7491138 22.0655827,22.1266056 21.9355111,22.4545772 C21.8054395,22.7825488 21.5002642,22.9973513 21.1606154,23" id="路径"></path>
<path d="M0.845347273,22.9999983 C0.503601988,23.0006998 0.195208881,22.7857784 0.0643378123,22.4557071 C-0.0665332566,22.1256358 0.00597209736,21.7456222 0.247958542,21.4933179 L20.5974482,0.217111512 C20.9328491,-0.0876069052 21.4364531,-0.0695360382 21.7510835,0.258507503 C22.0657138,0.586551045 22.0844003,1.11303688 21.7938897,1.46455938 L1.442736,22.7407657 C1.28445273,22.9067221 1.06950822,22.9999957 0.845347273,22.9999983" id="路径"></path>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论