提交 5f128aa4 authored 作者: 宋雄's avatar 宋雄

完善支付和对账

上级 2df02534
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
const serverConfig = { const serverConfig = {
baseURL: "https://life.cloud.hjxbc.cn", baseURL: "https://life.cloud.hjxbc.cn",
imageURL: "https://life.cloud.hjxbc.cn/sys/common/static/", imageURL: "https://life.cloud.hjxbc.cn/sys/common/static/",
// baseURL: "http://192.168.0.101:9999", // baseURL: "http://192.168.0.106:9999",
// baseURL: "http://192.168.0.119:9999", // baseURL: "http://192.168.0.119:9999",
// baseURL: "http://220.203.25.212:9999", /* 根域名 */ // baseURL: "http://220.203.25.212:9999", /* 根域名 */
// baseURL: "http://114.67.111.37:8001" /* 根域名 */ // baseURL: "http://114.67.111.37:8001" /* 根域名 */
......
...@@ -134,12 +134,14 @@ ...@@ -134,12 +134,14 @@
}, { }, {
"path": "pages/payCostProperty/index", "path": "pages/payCostProperty/index",
"style": { "style": {
"navigationBarTitleText": "缴费" "navigationBarTitleText": "缴费",
"enablePullDownRefresh": true
} }
}, { }, {
"path": "pages/payCostRecord/index", "path": "pages/payCostRecord/index",
"style": { "style": {
"navigationBarTitleText": "缴费记录" "navigationBarTitleText": "缴费记录",
"enablePullDownRefresh": true
} }
}, { }, {
"path": "pages/payCostDetails/index", "path": "pages/payCostDetails/index",
...@@ -187,7 +189,8 @@ ...@@ -187,7 +189,8 @@
},{ },{
"path": "pages/myPaycost/index", "path": "pages/myPaycost/index",
"style": { "style": {
"navigationBarTitleText": "我的缴费记录" "navigationBarTitleText": "我的缴费记录",
"enablePullDownRefresh": true
} }
}, { }, {
"path": "pages/myPaycostDetails/index", "path": "pages/myPaycostDetails/index",
......
<template> <template>
<view class="container"> <view class="container">
<view class="page" v-if="payList.length"> <view class="page">
<view class="paycost"> <view class="paycost">
<view class="screening"> <view>
<uni-datetime-picker v-model="range" type="daterange" /> <uni-datetime-picker v-model="range" type="daterange" start-placeholder="缴费开始日期" end-placeholder="缴费结束日期" @change="onDateChange" />
</view> </view>
<view class="list"> <view class="list" v-if="payList.length">
<view class="item" @click="toDetail()"> <view class="item" @click="toDetail(item.id)" v-for="item in payList" :key="item.id">
<view class="title"> <view class="title">
<view class="name">电费</view> <view class="name">{{item.chargeTypeName}}</view>
<view class="cost">¥100.00</view> <view class="cost">¥{{item.totalAmount}}</view>
</view> </view>
<view class="content"> <view class="content">
<view class="text"> <view class="text">
<view class="name">缴费人</view> <view class="name">缴费人</view>
<view class="detail">张一</view> <view class="detail">{{item.residentName}}</view>
</view> </view>
<view class="text"> <view class="text">
<view class="name">缴费人号码</view> <view class="name">缴费人号码</view>
<view class="detail">15214525682</view> <view class="detail">{{item.residentPhone}}</view>
</view> </view>
<view class="text"> <view class="text">
<view class="name">缴费时间</view> <view class="name">缴费时间</view>
<view class="detail">2023年3月1日 12:12</view> <view class="detail">{{item.paymentTime}}</view>
</view> </view>
<view class="text"> <view class="text">
<view class="name">缴费地址</view> <view class="name">缴费地址</view>
<view class="detail">十堰市张湾区汉江之星小区1栋1302</view> <view class="detail">{{item.buildingName}}{{item.unitName}}{{item.roomName}}</view>
</view> </view>
</view> </view>
</view> </view>
<!-- <view class="item" @click="toDetail()">
<view class="title">
<view class="name">水费</view>
<view class="cost">¥100.00</view>
</view>
<view class="content">
<view class="text">
<view class="name">缴费人</view>
<view class="detail">张一</view>
</view>
<view class="text">
<view class="name">缴费人号码</view>
<view class="detail">15214525682</view>
</view>
<view class="text">
<view class="name">缴费时间</view>
<view class="detail">2023年3月1日 12:12</view>
</view>
<view class="text">
<view class="name">缴费地址</view>
<view class="detail">十堰市张湾区汉江之星小区1栋1302</view>
</view>
</view>
</view>
<view class="item" @click="toDetail()">
<view class="title">
<view class="name">物业费</view>
<view class="cost">¥100.00</view>
</view>
<view class="content">
<view class="text">
<view class="name">缴费人</view>
<view class="detail">张一</view>
</view>
<view class="text">
<view class="name">缴费人号码</view>
<view class="detail">15214525682</view>
</view>
<view class="text">
<view class="name">缴费时间</view>
<view class="detail">2023年3月1日 12:12</view>
</view>
<view class="text">
<view class="name">缴费地址</view>
<view class="detail">十堰市张湾区汉江之星小区1栋1302</view>
</view>
</view>
</view> -->
</view> </view>
</view> </view>
</view> </view>
...@@ -96,23 +47,55 @@ ...@@ -96,23 +47,55 @@
components: {noData}, components: {noData},
data() { data() {
return { return {
isFinish: false,
pageNo: 1,
range: ['', ''], range: ['', ''],
payList: [] payList: []
} }
}, },
methods: { methods: {
async getList() { async getList(flag) {
let {result} = await communityPaymentApi({paymentStatus: 'paid'}) let {result} = await communityPaymentApi({
this.payList = result.records paymentStatus: 'paid',
payStartTime: this.range[0] || '',
payEndTime: this.range[1] || '',
pageNo: this.pageNo,
pageSize: 10
})
if(this.pageNo === 1) {
this.payList = [].concat(result.records)
} else {
this.payList = this.payList.concat(result.records)
}
if(flag) { uni.stopPullDownRefresh(); }
if(this.payList.length >= result.total) {
this.isFinish = true
} else {
this.pageNo += 1
}
},
onDateChange(value) {
this.pageNo = 1
this.range = value
this.getList()
}, },
toDetail() { toDetail(id) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/myPaycostDetails/index', url: '/pages/myPaycostDetails/index?id=' + id
}); });
} }
}, },
onLoad() { onLoad() {
this.getList() this.getList()
},
onPullDownRefresh() {
this.pageNo = 1
this.isFinish = false
this.getList(true)
},
onReachBottom() {
if(this.isFinish) return
this.getList()
} }
} }
</script> </script>
...@@ -123,16 +106,13 @@ ...@@ -123,16 +106,13 @@
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.page { .page {
padding: 30rpx 30rpx 90rpx; padding: 30rpx;
background-color: #F8F6F9; background-color: #F8F6F9;
} }
.paycost { .paycost {
.screening {
margin-bottom: 30rpx;
}
.list { .list {
margin-top: 30rpx;
.item { .item {
background-color: #ffffff; background-color: #ffffff;
border-radius: 16rpx; border-radius: 16rpx;
......
...@@ -5,51 +5,63 @@ ...@@ -5,51 +5,63 @@
<view class="details"> <view class="details">
<view class="title"> <view class="title">
<view class="name"> <view class="name">
<view class="cost">100</view> <view class="cost">{{payDetail.totalAmount}}</view>
</view> </view>
<view class="text">汉江之星物业公司</view> <view class="text">{{payDetail.propertyName}}</view>
</view> </view>
<view class="content"> <view class="content">
<view class="text"> <view class="text">
<view class="name">费用类型</view> <view class="name">费用类型</view>
<view class="detail">电费</view> <view class="detail">{{payDetail.chargeTypeName}}</view>
</view> </view>
<view class="text"> <view class="text">
<view class="name">订单编号</view> <view class="name">订单编号</view>
<view class="detail">1278373332321</view> <view class="detail">{{payDetail.id}}</view>
</view> </view>
<view class="text"> <view class="text">
<view class="name">创建时间</view> <view class="name">创建时间</view>
<view class="detail">2021/09/09 13:20 </view> <view class="detail">{{payDetail.createTime}}</view>
</view> </view>
<view class="text"> <view class="text">
<view class="name">缴费周期</view> <view class="name">缴费周期</view>
<view class="detail">1月</view> <view class="detail">{{payDetail.chargeCycle | transChargeCycle}}</view>
</view> </view>
<view class="text"> <view class="text">
<view class="name">支付时间</view> <view class="name">支付时间</view>
<view class="detail"> 2021/11/09 13:20</view> <view class="detail">{{payDetail.paymentTime}}</view>
</view>
<view class="text">
<view class="name">上期度数(度)</view>
<view class="detail">5</view>
</view>
<view class="text">
<view class="name">本期度数(度)</view>
<view class="detail">5</view>
</view>
<view class="text">
<view class="name">用量(度)</view>
<view class="detail">10</view>
</view> </view>
<template v-if="payDetail.designFormulas === 2">
<view class="text">
<view class="name">建筑面积</view>
<view class="detail">{{payDetail.floorSpace}}</view>
</view>
<view class="text">
<view class="name">单价</view>
<view class="detail">{{payDetail.unitPrice}}</view>
</view>
</template>
<template v-if="payDetail.designFormulas === 3">
<view class="text">
<view class="name">上期度数(度)</view>
<view class="detail">{{payDetail.lastDegrees}}</view>
</view>
<view class="text">
<view class="name">本期度数(度)</view>
<view class="detail">{{payDetail.currentDegrees}}</view>
</view>
<view class="text">
<view class="name">用量(度)</view>
<view class="detail">{{payDetail.useAmount}}</view>
</view>
</template>
<view class="text"> <view class="text">
<view class="name">支付方式</view> <view class="name">支付方式</view>
<view class="detail">微信支付</view> <view class="detail">微信支付</view>
</view> </view>
</view> </view>
</view> </view>
<view class="form-bounced" @click="receipt()">开收据</view> <!-- <view class="form-bounced" @click="receipt()">开收据</view>
<view class="form-bounced" @click="receipt()">申请退款</view> <view class="form-bounced" @click="receipt()">申请退款</view> -->
</view> </view>
</view> </view>
<uni-popup ref="popup" type="dialog"> <uni-popup ref="popup" type="dialog">
...@@ -60,13 +72,30 @@ ...@@ -60,13 +72,30 @@
</template> </template>
<script> <script>
import {
communityPaymentDetailApi
} from '@/config/api.js'
import {CHARGING_CYCLE} from '@/utils/dictionary'
export default { export default {
data() { data() {
return { return {
payDetail: {}
}
},
filters: {
transChargeCycle(value) {
let current = CHARGING_CYCLE.find(item=>item.value === value)
return current ? current.label : ''
} }
}, },
methods: { methods: {
async getDetail(id) {
let res = await communityPaymentDetailApi({id})
this.payDetail = res.result
if(res.result.designFormulas === 3) {
this.payDetail['useAmount'] = (res.result.currentDegrees - Number(res.result.lastDegrees)).toFixed(2)
}
},
receipt() { receipt() {
this.$refs.popup.open() this.$refs.popup.open()
}, },
...@@ -77,11 +106,8 @@ ...@@ -77,11 +106,8 @@
this.$refs.popup.close() this.$refs.popup.close()
} }
}, },
onLoad() { onLoad(option) {
this.getDetail(option.id)
},
onShow() {
} }
} }
</script> </script>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<view class="name"> <view class="name">
<view class="cost">{{payDetail.totalAmount}}</view> <view class="cost">{{payDetail.totalAmount}}</view>
</view> </view>
<view class="tag" :class="{'pay': item.paymentStatus === 'unPaid'}">{{item.paymentStatus === 'paid' ? '已付款' : '未付款'}}</view> <view class="tag" :class="{'pay': payDetail.paymentStatus === 'unPaid'}">{{payDetail.paymentStatus === 'paid' ? '已付款' : '未付款'}}</view>
</view> </view>
<view class="content"> <view class="content">
<view class="text"> <view class="text">
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</view> </view>
</view> </view>
<view class="form-submit" @click="onSubmit">支付</view> <view v-if="payDetail.paymentStatus === 'unPaid'" class="form-submit" @click="onSubmit">支付</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -15,9 +15,10 @@ ...@@ -15,9 +15,10 @@
<view class="list"> <view class="list">
<view class="item" v-for="item in payList" :key="item.id" @click="toDetail(item.id)"> <view class="item" v-for="item in payList" :key="item.id" @click="toDetail(item.id)">
<view class="title"> <view class="title">
<view class="name">{{item.chargeTypeName}}<view class="cost">¥{{item.totalAmount}}</view> <view class="name">
{{item.chargeTypeName}}<view class="cost">¥{{item.totalAmount}}</view>
</view> </view>
<view class="tag">去缴费</view> <view class="tag">{{item.paymentStatus === 'paid' ? '已缴费' : '去缴费'}}</view>
</view> </view>
<view class="content"> <view class="content">
<view class="text"> <view class="text">
...@@ -54,10 +55,13 @@ ...@@ -54,10 +55,13 @@
{code: 'SFLX00004', name: '燃气费'}, {code: 'SFLX00004', name: '燃气费'},
{code: 'SFLX00005', name: '暖气费'} {code: 'SFLX00005', name: '暖气费'}
] ]
let chargeTypeCode = ''
export default { export default {
components: {noData}, components: {noData},
data() { data() {
return { return {
isFinish: false,
pageNo: 1,
userName: '', userName: '',
userPhone: '', userPhone: '',
platformName: '', platformName: '',
...@@ -65,9 +69,24 @@ ...@@ -65,9 +69,24 @@
} }
}, },
methods: { methods: {
async getList(chargeTypeCode) { async getList(flag) {
let {result} = await communityPaymentApi({chargeTypeCode}) let {result} = await communityPaymentApi({
this.payList = result.records paymentStatus: 'unPaid',
chargeTypeCode,
pageNo: this.pageNo,
pageSize: 10
})
if(this.pageNo === 1) {
this.payList = [].concat(result.records)
} else {
this.payList = this.payList.concat(result.records)
}
if(flag) { uni.stopPullDownRefresh(); }
if(this.payList.length >= result.total) {
this.isFinish = true
} else {
this.pageNo += 1
}
}, },
toRecord(type) { toRecord(type) {
if(type == 1){ if(type == 1){
...@@ -76,7 +95,7 @@ ...@@ -76,7 +95,7 @@
}); });
}else if(type == 2){ }else if(type == 2){
uni.navigateTo({ uni.navigateTo({
url: '/pages/payCostRecord/index', url: '/pages/payCostRecord/index?code=' + chargeTypeCode
}); });
} }
}, },
...@@ -90,13 +109,23 @@ ...@@ -90,13 +109,23 @@
this.userName = uni.getStorageSync('user_name') this.userName = uni.getStorageSync('user_name')
this.userPhone = uni.getStorageSync('user_phone') this.userPhone = uni.getStorageSync('user_phone')
this.platformName = uni.getStorageSync('platform_name') this.platformName = uni.getStorageSync('platform_name')
this.getList(option.code) chargeTypeCode = option.code
this.getList()
let obj = freeType.find(item=>item.code === option.code) let obj = freeType.find(item=>item.code === option.code)
if(obj) { if(obj) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: obj.name title: obj.name
}) })
} }
},
onPullDownRefresh() {
this.pageNo = 1
this.isFinish = false
this.getList(true)
},
onReachBottom() {
if(this.isFinish) return
this.getList()
} }
} }
</script> </script>
......
<template> <template>
<view class="container"> <view class="container">
<view class="page"> <view class="page" v-if="payList.length">
<view class="property"> <view class="property">
<view class="list"> <view class="list">
<view class="item" @click="toDetail()"> <view class="item" @click="toDetail(item.id)" v-for="item in payList" :key="item.id">
<view class="title"> <view class="title">
<view class="name">物业费:<view class="cost">¥100.00</view> <view class="name">{{item.chargeTypeName}}<view class="cost">¥{{item.totalAmount}}</view>
</view> </view>
<view class="tag">已付款</view> <view class="tag">已付款</view>
</view> </view>
<view class="content"> <view class="content">
<view class="text"> <view class="text">
<view class="name">缴费人</view> <view class="name">缴费人</view>
<view class="detail">张一</view> <view class="detail">{{item.residentName}}</view>
</view> </view>
<view class="text"> <view class="text">
<view class="name">缴费人号码</view> <view class="name">缴费人号码</view>
<view class="detail">15214525682</view> <view class="detail">{{item.residentPhone}}</view>
</view> </view>
<view class="text"> <view class="text">
<view class="name">缴费时间</view> <view class="name">缴费时间</view>
<view class="detail">2023年3月1日 12:12</view> <view class="detail">{{item.paymentTime}}</view>
</view> </view>
<view class="text"> <view class="text">
<view class="name">缴费地址</view> <view class="name">缴费地址</view>
<view class="detail">十堰市张湾区汉江之星小区1栋1302</view> <view class="detail">{{item.buildingName}}{{item.unitName}}{{item.roomName}}</view>
</view>
</view>
</view>
<view class="item" @click="toDetail()">
<view class="title">
<view class="name">物业费:<view class="cost">¥100.00</view>
</view>
<view class="tag">已付款</view>
</view>
<view class="content">
<view class="text">
<view class="name">缴费人</view>
<view class="detail">张一</view>
</view>
<view class="text">
<view class="name">缴费人号码</view>
<view class="detail">15214525682</view>
</view>
<view class="text">
<view class="name">缴费时间</view>
<view class="detail">2023年3月1日 12:12</view>
</view>
<view class="text">
<view class="name">缴费地址</view>
<view class="detail">十堰市张湾区汉江之星小区1栋1302</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- <no-data :show="payList.length === 0" text="暂无缴费记录"></no-data> --> <no-data :show="payList.length === 0" text="暂无缴费记录"></no-data>
</view> </view>
</template> </template>
...@@ -66,25 +40,53 @@ ...@@ -66,25 +40,53 @@
communityPaymentApi communityPaymentApi
} from '@/config/api.js' } from '@/config/api.js'
import noData from '@/components/no-data/no-data' import noData from '@/components/no-data/no-data'
let chargeTypeCode = ''
export default { export default {
components: {noData}, components: {noData},
data() { data() {
return { return {
isFinish: false,
pageNo: 1,
payList: [] payList: []
} }
}, },
methods: { methods: {
async getList() { async getList(flag) {
let {result} = await communityPaymentApi({paymentStatus: 'paid'}) let {result} = await communityPaymentApi({
this.payList = result.records paymentStatus: 'paid',
chargeTypeCode,
pageNo: this.pageNo,
pageSize: 10
})
if(this.pageNo === 1) {
this.payList = [].concat(result.records)
} else {
this.payList = this.payList.concat(result.records)
}
if(flag) { uni.stopPullDownRefresh(); }
if(this.payList.length >= result.total) {
this.isFinish = true
} else {
this.pageNo += 1
}
}, },
toDetail() { toDetail(id) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/payCostDetails/index', url: '/pages/myPaycostDetails/index?id=' + id
}); });
} }
}, },
onLoad() { onLoad(option) {
chargeTypeCode = option.code
this.getList()
},
onPullDownRefresh() {
this.pageNo = 1
this.isFinish = false
this.getList(true)
},
onReachBottom() {
if(this.isFinish) return
this.getList() this.getList()
} }
} }
......
...@@ -3,23 +3,17 @@ ...@@ -3,23 +3,17 @@
<view class="page"> <view class="page">
<view class="property"> <view class="property">
<view class="user"> <view class="user">
<view class="name">张一 15214525682</view> <view class="name">{{userName}} {{userPhone}}</view>
<view class="add">十堰市张湾区汉江之星小区1栋1302</view> <view class="add">{{platformName}}</view>
</view> </view>
<view class="screening"> <view class="screening">
<view class="title"> <!-- <view class="title"> -->
<view class="picker on"> <!-- <view class="picker on"> -->
<picker @change="bindPickerChange" :value="year" :range="yearList"> <picker @change="bindPickerChange" :value="year" :range="yearList">
<view class="uni-input">{{yearList[index]}}<image src="../../static/images/icon_up.png" class="icon"></image></view> <view class="uni-input">{{yearList[index]}}<image src="../../static/images/icon_up.png" class="icon"></image></view>
</picker> </picker>
</view> <!-- </view> -->
<view class="picker"> <!-- </view> -->
<picker @change="bindPickerChange1" :value="month" :range="monthList">
<view class="uni-input">{{monthList[index1]}}<image src="../../static/images/icon_up.png" class="icon"></image></view>
</picker>
</view>
</view>
<view class="content"> <view class="content">
<view class="text"> <view class="text">
<view class="name">合计金额(元)</view>120 <view class="name">合计金额(元)</view>120
...@@ -39,15 +33,17 @@ ...@@ -39,15 +33,17 @@
</template> </template>
<script> <script>
let chargeTypeCode = ''
export default { export default {
data() { data() {
return { return {
userName: '',
userPhone: '',
platformName: '',
year: '', year: '',
index: 0, index: 0,
yearList: ['2023年', '2022年', '2021年'], yearList: ['全部', '2023年', '2022年', '2021年'],
month: '', month: '',
index1: 0,
monthList: ['全部月份', '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
chartData: { chartData: {
categories: ["2023年", "2022年", "2021年"], categories: ["2023年", "2022年", "2021年"],
series: [{ series: [{
...@@ -87,11 +83,12 @@ ...@@ -87,11 +83,12 @@
this.index1 = e.detail.value this.index1 = e.detail.value
}, },
}, },
onLoad() { onLoad(option) {
this.userName = uni.getStorageSync('user_name')
}, this.userPhone = uni.getStorageSync('user_phone')
onShow() { this.platformName = uni.getStorageSync('platform_name')
chargeTypeCode = option.code
// this.getList()
} }
} }
</script> </script>
...@@ -136,27 +133,35 @@ ...@@ -136,27 +133,35 @@
.title { .title {
display: flex; display: flex;
.picker { // .picker {
display: flex; // display: flex;
align-items: center; // align-items: center;
.uni-input { // .uni-input {
font-size: 28rpx; // font-size: 28rpx;
color: #373737; // color: #373737;
} // }
.icon { // .icon {
width: 20rpx; // width: 20rpx;
height: 12rpx; // height: 12rpx;
margin-left: 15rpx; // margin-left: 15rpx;
} // }
} // }
}
.uni-input {
font-size: 28rpx;
color: #373737;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.on { .icon {
padding-right: 40rpx; width: 20rpx;
margin-right: 40rpx; height: 12rpx;
border-right: 1px solid #F0F0F2; margin-left: 15rpx;
}
} }
.content { .content {
......
...@@ -5,4 +5,20 @@ export const relationShipList = [ ...@@ -5,4 +5,20 @@ export const relationShipList = [
{label: '亲人', value: 'relative'}, {label: '亲人', value: 'relative'},
{label: '朋友', value: 'friend'}, {label: '朋友', value: 'friend'},
{label: '其他', value: 'other'} {label: '其他', value: 'other'}
]
// 付费周期
export const CHARGING_CYCLE = [
{label: '每月', value: '1'},
{label: '每季度', value: '2'},
{label: '每年', value: '3'},
{label: '一次性付清', value: '4'},
{label: '预付', value: '5'}
]
// 计算公式
export const DESIGN_FORMULAS = [
{label: '固定金额', value: 1},
{label: '建筑面积 × 单价', value: 2},
{label: '(本期度数 - 上期度数) × 单价', value: 3}
] ]
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论