Files
water-management-system/frontend/src/api/wx-hall.ts
T

86 lines
2.1 KiB
TypeScript
Raw Normal View History

import request from './request'
const BASE = '/wx-hall'
// ========== 水费查询缴费 ==========
export function getBillList(params: {
customerNo: string
billPeriod?: string
status?: string
pageNum?: number
pageSize?: number
}) {
return request.get(`${BASE}/bill/list`, { params })
}
export function getBillDetail(billId: number) {
return request.get(`${BASE}/bill/${billId}`)
}
export function payBill(data: { billId: number; amount: number }) {
return request.post(`${BASE}/bill/pay`, data)
}
export function getPaymentRecords(params: { customerNo: string; limit?: number }) {
return request.get(`${BASE}/bill/payment-records`, { params })
}
// ========== 报装申请 ==========
export function submitInstallApply(data: {
name: string
phone: string
area: string
address: string
customerType?: string
caliber?: string
}) {
return request.post(`${BASE}/install/apply`, data)
}
export function getInstallProgress(applyNo: string) {
return request.get(`${BASE}/install/progress`, { params: { applyNo } })
}
export function getInstallList(params: { phone: string; limit?: number }) {
return request.get(`${BASE}/install/list`, { params })
}
// ========== 停水公告 ==========
export function getNoticeList(params: {
page?: number
size?: number
type?: string
keyword?: string
}) {
return request.get(`${BASE}/notice/list`, { params })
}
export function getNoticeDetail(id: number) {
return request.get(`${BASE}/notice/${id}`)
}
export function getActiveNotices(areaCode?: string) {
return request.get(`${BASE}/notice/active`, { params: { areaCode } })
}
// ========== 用户绑定 ==========
export function bindPhone(data: { openId: string; phone: string }) {
return request.post(`${BASE}/user/bindPhone`, data)
}
export function bindCustomer(data: { openId: string; customerNo: string }) {
return request.post(`${BASE}/user/bindCustomer`, data)
}
export function unbind(data: { openId: string; bindingId: string }) {
return request.post(`${BASE}/user/unbind`, data)
}
export function getBindings(openId: string) {
return request.get(`${BASE}/user/bindings`, { params: { openId } })
}