|
|
@@ -149,19 +149,21 @@ class PaymentOrderViewController: BaseViewController {
|
|
|
guard let url = StringUtils.getImageUrl(obj.picurls) else { return }
|
|
|
goodsImage.sd_setImage(with: url, placeholderImage: UIImage(named: "placeholder_image"), options: .queryDiskDataSync, context: nil)
|
|
|
|
|
|
- /// 查询资金信息
|
|
|
- accountManager.loginQueryReq(queryItem: "1,2") { (isComplete, error) in
|
|
|
- DispatchQueue.main.async {
|
|
|
- /// 期末余额
|
|
|
- let blance = taAccountInfo.currentBalance-(taAccountInfo.freezeMargin+taAccountInfo.otherFreezeMargin+taAccountInfo.freezeCharge)
|
|
|
- /// 最大可用数量
|
|
|
- self.qtyField.maxIntNum = obj.buymaxqty == 0 ? (obj.orderqty-obj.tradeqty) : min((obj.orderqty-obj.tradeqty), obj.buymaxqty)
|
|
|
- /// 最大可用数量
|
|
|
- self.maxQty.text = "最大可购买数量:\(self.qtyField.maxIntNum)"
|
|
|
- /// 余额
|
|
|
- self.blance.text = "可用余额:\(blance.toString(reserve: 2))"
|
|
|
- /// 请求优惠券
|
|
|
- self.requestQueryMyCoupons(Double(self.qtyField.currentIntNumbers)*obj.orderprice*obj.agreeUnit)
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: DispatchTime.now()+0.5) {
|
|
|
+ /// 查询资金信息
|
|
|
+ accountManager.loginQueryReq(queryItem: "1,2") { (isComplete, error) in
|
|
|
+ DispatchQueue.main.async {
|
|
|
+ /// 期末余额
|
|
|
+ let blance = taAccountInfo.currentBalance-(taAccountInfo.freezeMargin+taAccountInfo.otherFreezeMargin+taAccountInfo.freezeCharge)
|
|
|
+ /// 最大可用数量
|
|
|
+ self.qtyField.maxIntNum = obj.buymaxqty == 0 ? (obj.orderqty-obj.tradeqty) : min((obj.orderqty-obj.tradeqty), obj.buymaxqty)
|
|
|
+ /// 最大可用数量
|
|
|
+ self.maxQty.text = "最大可购买数量:\(self.qtyField.maxIntNum)"
|
|
|
+ /// 余额
|
|
|
+ self.blance.text = "可用余额:\(blance.toString(reserve: 2))"
|
|
|
+ /// 请求优惠券
|
|
|
+ self.requestQueryMyCoupons(Double(self.qtyField.currentIntNumbers)*obj.orderprice*obj.agreeUnit)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -319,7 +321,7 @@ class PaymentOrderViewController: BaseViewController {
|
|
|
self._anim?.stopAnimating()
|
|
|
/// 查询成功
|
|
|
if isComplete {
|
|
|
- if objs?.count != 0 { self.couponHold = objs?.first }
|
|
|
+ if objs?.count != 0 { self.couponHold = objs?.first } else { self.couponHold = nil }
|
|
|
self.rowNum = 0
|
|
|
} else {
|
|
|
/// showError
|