| | |
| | | |
| | | // 支付方式相关属性 |
| | | private var paymentMethod: String = "现金" |
| | | private var paymentId: Long = 0 |
| | | private var paymentId: String = "" |
| | | private var paymentMethodList: List<PaymentMethod> = listOf() |
| | | |
| | | companion object { |
| | |
| | | ApiManager.getInstance().requestGetLoading( |
| | | this, |
| | | "terminal/paymentmethod/get", |
| | | PaymentMethodResponse::class.java, |
| | | Array<PaymentMethod>::class.java, |
| | | null, |
| | | object : SubscriberListener<BaseResponse<PaymentMethodResponse>>() { |
| | | override fun onNext(response: BaseResponse<PaymentMethodResponse>) { |
| | | object : SubscriberListener<BaseResponse<Array<PaymentMethod>>>() { |
| | | override fun onNext(response: BaseResponse<Array<PaymentMethod>>) { |
| | | if (response.success) { |
| | | // 获取支付方式列表 |
| | | val paymentMethods = response.content?.obj ?: listOf() |
| | | // 获取支付方式列表,现在content直接是PaymentMethod数组 |
| | | val paymentMethods = response.content?.toList() ?: listOf() |
| | | if (paymentMethods.isNotEmpty()) { |
| | | paymentMethodList = paymentMethods |
| | | // 更新支付方式显示 |
| | |
| | | money = String.format("%.0f", rechargeAmount), |
| | | amount = String.format("%.0f", bonusAmount), |
| | | gift = String.format("%.0f", bonusAmount), |
| | | paymentId = paymentId.toString(), |
| | | paymentId = paymentId, |
| | | price = String.format("%.2f", currentWaterPrice), // 使用统一获取的水价 |
| | | remarks = "充值", |
| | | operator = BaseApplication.userId // 默认操作员ID,可以根据实际情况调整 |