feat: 校园旧版,东区缴费初始化

This commit is contained in:
2025-05-19 20:47:23 +08:00
parent 4ff043228b
commit 67aae16733
105 changed files with 20039 additions and 0 deletions
+313
View File
@@ -0,0 +1,313 @@
<template>
<div class="container">
<van-pull-refresh v-model="refreshLoading" @refresh="onRefresh">
<van-skeleton :row="10" :loading="loadingPage">
<div class="bill" v-for="(bill, index) in billList" :key="index" v-if="billList.length > 0"
style="padding-bottom: .5rem">
<div class="time">
<van-row>
<van-col span="2"></van-col>
<van-col span="20" style="font-size:12px;font-weight:500;">{{ bill.lastEnableDate }}</van-col>
</van-row>
</div>
<div @click="toBillDetail(bill)">
<van-row>
<van-col span="1"></van-col>
<van-col span="22">
<div class="content-box">
<div class="title">{{bill.billTitle}}</div>
<van-divider dashed :style="{width: '95%', margin: '0 auto'}"/>
<div class="content">
<div v-for="(item, itemIndex) in bill.itemList" :key="itemIndex"
class="item">
<van-row>
<van-col span="12">
<van-image
width="18"
height="18"
:src="require('@/assets/img/pay.png')"
v-if="item.subItemList.length === 0 && item.itemPayStatus === 1"
/>
<van-image
width="18"
height="18"
:src="require('@/assets/img/notPay.png')"
v-else-if="item.subItemList.length === 0 && item.itemPayStatus === 0"
/>
<van-image
width="18"
height="18"
:src="require('@/assets/img/notPay.png')"
style="opacity: 0"
v-else
/>
{{item.itemName}}
<span v-show="item.mustPay === 1" style="color: red">*</span>
</van-col>
<van-col span="12">{{ checkPrice(item) }}</van-col>
</van-row>
<van-row v-for="(subItem, subItemIndex) in item.subItemList" :key="'subItem' + subItemIndex"
class="sub-item"
v-if="item.subItemList && item.subItemList.length > 0">
<van-col span="12">
<van-image
width="18"
height="18"
:src="require('@/assets/img/pay.png')"
v-if="subItem.subItemPayStatus === 1"
/>
<van-image
width="18"
height="18"
:src="require('@/assets/img/notPay.png')"
v-else
/>
{{ subItem.subItemName }}
</van-col>
<van-col span="12">{{ '¥' + subItem.subItemPrice }}</van-col>
</van-row>
</div>
<van-row class="pay-money">
<van-col span="12">
<van-image
width="18"
height="18"
:src="require('@/assets/img/notPay.png')"
style="opacity: 0"
/>
已付金额
</van-col>
<van-col span="12">{{ '¥' + bill.payMoney }}</van-col>
</van-row>
</div>
<van-divider dashed :style="{width: '95%', margin: '0 auto'}"/>
<van-row class="bottom-box">
<van-col span="20" class="end-date">{{'截止时间:' + bill.billEndDate}}</van-col>
<van-col span="4" class="detail">详情</van-col>
</van-row>
</div>
</van-col>
</van-row>
</div>
</div>
<van-empty description="暂无账单信息" v-if="billList.length === 0"/>
</van-skeleton>
</van-pull-refresh>
</div>
</template>
<script>
import api from "../api/api"
import {Dialog, Toast} from "vant"
export default {
name: "bill",
data() {
return {
currentStudent: null,
billList: [],
refreshLoading: false,
loadingPage: true
}
},
methods: {
// 下拉刷新
onRefresh() {
this.refreshLoading = false
// 初始化数据
this.loadingPage = true
this.billList = []
this.listH5Bill()
},
// 查询账单列表数据
selectBillList(currentStudent) {
this.currentStudent = currentStudent
this.listH5Bill()
},
listH5Bill() {
api.listH5Bill({
studentId: this.currentStudent.id,
deptId: this.currentStudent.schoolId,
}).then(res => {
this.billList = res.data.data
this.loadingPage = false
}).catch(err => {
console.error(err)
Toast('查询账单失败')
this.loadingPage = false
})
},
// 验证金额
checkPrice(item) {
let result
// 不定金额
if (item.indefiniteStatus === 1) {
result = "自定义金额"
} else {
// 单选
if (item.itemOption === 0) {
result = '¥' + item.itemPrice
} else {
result = ''
}
}
return result
},
// 跳转账单详情
toBillDetail(bill) {
// 查看是否存在待支付的订单
api.checkExistOrder({
studentId: this.currentStudent.id,
billId: bill.billId,
}).then(res => {
let orderNo = res.data.data
console.log("订单号: {}", orderNo)
if (orderNo !== null && orderNo !== "" && orderNo !== undefined) {
Dialog.confirm({
message: '当前还有未支付的订单, 是否跳转支付?',
}).then(() => {
// 确认跳转
this.$router.push({
path: '/orderDetail',
query: {
orderCode: orderNo
}
})
}).catch(() => {
// on cancel
})
} else {
this.$router.push({
path: '/billDetail',
query: {
billId: bill.billId,
studentId: this.currentStudent.id,
studentName: this.currentStudent.stuName,
deptId: this.currentStudent.schoolId
}
})
}
}).catch(err => {
console.error(err)
Toast('查询账单详情失败')
})
}
}
}
</script>
<style lang="scss">
.container {
padding-top: .1rem;
padding-bottom: .3rem;
background: #f8f8f8;
.bill {
.time {
text-align: center;
color: #a2a6b0;
padding: .1rem;
font-weight: bolder;
font-size: .28rem;
}
.content-box {
padding-top: .2rem;
padding-bottom: .2rem;
// box-shadow: 2px 2px 6px 2px #d2d2d2;
background-color: #FFF;
border-radius: .1rem;
margin-top: .2rem;
.title {
padding: .1rem .3rem .2rem .3rem;
font-weight: bolder;
color: #374d4e;
font-size: 0.28rem;
letter-spacing: 0.02rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.content {
text-align: center;
margin-top: .1rem;
margin-bottom: .1rem;
font-size: .25rem;
.pay-money {
color: #81838f;
text-align: right;
}
.item, .pay-money {
.van-col {
padding: .2rem;
.van-image {
top: .07rem;
}
}
.van-col:nth-child(1) {
text-align: left;
padding-left: .25rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.van-col:nth-child(2) {
text-align: right;
padding-right: .3rem;
}
.sub-item {
.van-col:nth-child(1) {
padding-left: .65rem;
}
}
}
}
.bottom-box {
padding: .1rem 0 .1rem .3rem;
margin-top: .2rem;
font-weight: 400;
font-size: .24rem;
.end-date {
color: #374d4e;
}
.detail {
text-align: right;
padding-right: .3rem;
color: #f6a138;
}
}
}
}
.bill:nth-child(n + 2) {
margin-top: 0.5rem;
}
.van-divider::before {
border-width: 2px 0 0
}
}
</style>