TradeViewController.swift 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. //
  2. // TradeViewController.swift
  3. // MTP2_iOS
  4. //
  5. // Created by Handy_Cao on 2020/10/29.
  6. // Copyright © 2020 Muchinfo. All rights reserved.
  7. //
  8. import UIKit
  9. import SDWebImage
  10. import NVActivityIndicatorView
  11. import WHToast
  12. /// 购买视图容器控制类
  13. class TradeViewController: BaseViewController {
  14. // MARK: - 属性列表
  15. /// 公司名称
  16. @IBOutlet weak var company: UILabel!
  17. /// 标题
  18. @IBOutlet weak var goodsName: UILabel!
  19. /// 商品图片
  20. @IBOutlet weak var goodsImage: UIImageView!
  21. /// 单号
  22. @IBOutlet weak var orderNo: UILabel!
  23. /// 资金提示信息
  24. @IBOutlet weak var amountTips: UILabel!
  25. /// 提示信息
  26. @IBOutlet weak var tips: UILabel!
  27. /// 金额范围
  28. @IBOutlet weak var priceRange: UILabel!
  29. /// 价格
  30. @IBOutlet weak var price: UILabel!
  31. /// 购买价格
  32. @IBOutlet weak var priceField: IBNumberEditText! {
  33. didSet {
  34. priceField.valueType = 2
  35. priceField.delegate = self
  36. }
  37. }
  38. /// 购买数量
  39. @IBOutlet weak var qtyField: IBNumberEditText! {
  40. didSet {
  41. qtyField.valueType = 1
  42. qtyField.delegate = self
  43. }
  44. }
  45. /// 卖家列表
  46. @IBOutlet weak var tableView: UITableView!
  47. /// 高度
  48. @IBOutlet weak var tableViewHeightConstraint: NSLayoutConstraint!
  49. /// 提交
  50. @IBOutlet weak var submit: UIButton!
  51. /// 提交
  52. @IBOutlet weak var refresh: UIButton!
  53. /// CellIdentifier
  54. let CellIdentifier = "Trade_Cell"
  55. /// 商品数据
  56. override var takeInfo: Any? {
  57. didSet {
  58. guard let obj = takeInfo as? MoGoodsInfo else { return }
  59. DispatchQueue.main.asyncAfter(deadline: DispatchTime.now()+0.5) {
  60. /// 显示商品详情数据信息
  61. self.showGoodsDetailInfo(obj)
  62. /// 行情订阅
  63. self.subscriptQuote()
  64. }
  65. }
  66. }
  67. /// 卖家挂牌委托单数据
  68. var orderDetails: [MoHsbyGoodsOrderDetail] = [] {
  69. didSet {
  70. /// 刷新列表数据
  71. self.tableView.reloadData()
  72. /// 重新设置高度约束
  73. self.tableViewHeightConstraint.constant = CGFloat(orderDetails.count)*50.0
  74. /// 是否隐藏提示
  75. self.tips.isHidden = orderDetails.count != 0
  76. /// setTitle
  77. self.submit.setTitle(orderDetails.count == 0 ? "发布求购" : "提交订单", for: .normal)
  78. /// orderTips
  79. orderTips.isHidden = orderDetails.count == 0
  80. }
  81. }
  82. /// 提示信息
  83. @IBOutlet weak var orderTips: UILabel!
  84. /// 委托数量
  85. var orderQty: Int = 0 {
  86. didSet {
  87. qtyField.currentIntNumbers = orderQty
  88. /// 计算购买金额
  89. self.calculate()
  90. }
  91. }
  92. // MARK: - 生命周期相关
  93. override func viewDidLoad() {
  94. super.viewDidLoad()
  95. // Do any additional setup after loading the view.
  96. /// UI界面初始化
  97. buildView()
  98. }
  99. override func viewWillAppear(_ animated: Bool) {
  100. super.viewWillAppear(animated)
  101. /// 隐藏导航栏
  102. self.navigationController?.setNavigationBarHidden(false, animated: true)
  103. /// 侦听行情推送广播
  104. MTP2BusinessCore.shared.broadcastManager?.addBroadcastListener(owner: self, action: .ReceiveTradeQuote) { [unowned self] in
  105. /// 异常情况
  106. guard let goodsQuoteInfo = $0.object as? [(goodsHqCode: String, exchHqCode: String)],
  107. goodsQuoteInfo.count != 0,
  108. let goodsManager = MTP2BusinessCore.shared.goodsManager,
  109. let goods = self.takeInfo as? MoGoodsInfo else { return }
  110. /// 更新商品行情信息
  111. goodsQuoteInfo.forEach {
  112. if $0.goodsHqCode == goods.goodscode,
  113. let goodsInfo = goodsManager.goodsInfos.first(where: {$0.goodsid == goods.goodsid}) {
  114. DispatchQueue.main.async {
  115. /// 更新价格
  116. self.price.text = "\(goods.currencysign) \(goodsInfo.getLast() == 0.0 ? "\(goods.last)" : goodsInfo.getLast().toString(reserve: goodsInfo.decimalplace))"
  117. if goods.moQuoteInfo?.timeStamp != nil {
  118. /// 当前价格
  119. self.priceField.currentDoubleNumbers = goodsInfo.getLast() == 0.0 ? goods.last : goodsInfo.getLast()
  120. }
  121. }
  122. }
  123. }
  124. }
  125. }
  126. deinit {
  127. /// 移出行情广播
  128. MTP2BusinessCore.shared.broadcastManager?.removeBroadcastListener(owner: self, forName: .ReceiveTradeQuote)
  129. }
  130. // MARK: - 数据初始化
  131. /// UI界面初始化
  132. fileprivate func buildView() {
  133. /// addLoadingView
  134. self.addLoadingView()
  135. }
  136. /// 显示商品详情数据信息
  137. /// - Parameter obj: obj
  138. fileprivate func showGoodsDetailInfo(_ obj: MoGoodsInfo) {
  139. /// 异常
  140. guard let accountManager = MTP2BusinessCore.shared.accountManager else { return }
  141. /// 商品名称
  142. self.goodsName.text = obj.goodsname
  143. /// 商品编号
  144. self.orderNo.text = obj.goodscode
  145. /// 商品价格
  146. self.price.text = "\(obj.currencysign) \(obj.getLast() == 0.0 ? obj.last : obj.getLast())"
  147. /// 价格范围
  148. priceRange.text = "\(obj.limitdown)<= 价格范围 <= \(obj.limitup)"
  149. /// 供应商名称
  150. company.text = obj.vendorname
  151. /// 输入框价格
  152. priceField.incrementDoubleNum = obj.stepvalue
  153. priceField.minDoubleNum = obj.limitdown
  154. priceField.maxDoubleNum = obj.limitup
  155. priceField.decimalPlace = obj.decimalplace
  156. priceField.currentDoubleNumbers = obj.getLast() == 0.0 ? obj.last : obj.getLast()
  157. /// 查询对手买家挂牌信息
  158. self.requestQueryHsbyGoodsOrderDetails(obj.last.toString(reserve: 2))
  159. /// 输入步进值
  160. qtyField.incrementIntNum = obj.lotsize
  161. qtyField.minIntNum = obj.lotsize
  162. qtyField.currentIntNumbers = obj.lotsize
  163. qtyField.maxIntNum = obj.buymaxqty == 0 ? Int.max : obj.buymaxqty
  164. /// 查询资金信息
  165. accountManager.loginQueryReq(queryItem: "1,2") { (isComplete, error) in
  166. DispatchQueue.main.async {
  167. /// 计算购买金额
  168. self.calculate()
  169. }
  170. }
  171. /// 商品图片
  172. guard let url = StringUtils.getImageUrl(obj.picurls) else { return }
  173. goodsImage.sd_setImage(with: url, placeholderImage: UIImage(named: "placeholder_image"), options: .queryDiskDataSync, context: nil)
  174. }
  175. // MARK: - 交互相关
  176. /// UITextField输入值发生改变响应事件
  177. /// - Parameter sender: sender
  178. @IBAction func onValueChanged(_ sender: UITextField) {}
  179. /// onButtonPressed
  180. /// - Parameter sender: sender
  181. @IBAction fileprivate func onButtonPressed(_ sender: UIControl) {
  182. switch sender {
  183. case submit:
  184. let isListing = !tableView.visibleCells.contains { (cell) -> Bool in
  185. return (cell as? TradeCell)?.isCheck ?? false
  186. }
  187. /// 有对手委托单得时候必须选一个
  188. if isListing, orderDetails.count != 0 {
  189. WHToast.showError(withMessage: "请选择卖家", duration: 1.5, finishHandler: {})
  190. return
  191. }
  192. if isListing {
  193. /// 买挂牌
  194. doListingTrade()
  195. } else {
  196. /// 买摘牌
  197. doDeListingTrade()
  198. }
  199. case refresh: /// 刷新按钮
  200. /// 更新单据
  201. self.requestQueryHsbyGoodsOrderDetails(priceField.currentDoubleNumbers.toString(reserve: 2))
  202. default:
  203. break
  204. }
  205. }
  206. // MARK: - 接口请求
  207. /// 买挂牌提交请求方法
  208. fileprivate func doListingTrade() {
  209. /// 异常
  210. guard let tradeManager = MTP2BusinessCore.shared.tradeManager,
  211. let obj = takeInfo as? MoGoodsInfo,
  212. check() else { return }
  213. /// 构建交易参数
  214. let tradeParam = MoTradeParam()
  215. /// 买卖方向
  216. tradeParam.buyOrSell = .ORDERDIRECTION_BUY
  217. /// 数量
  218. tradeParam.orderQty = Double(qtyField.currentIntNumbers)
  219. /// 挂牌价格
  220. tradeParam.orderPrice = priceField.currentDoubleNumbers
  221. /// 挂牌点选类型
  222. tradeParam.delistingType = .DELISTINGTYPE_SELECTED
  223. /// 点选成交
  224. tradeParam.listingSelectType = .LISTINGSELECTTYPE_LISTING
  225. /// 有效类型
  226. tradeParam.validType = .VALIDTYPE_DR
  227. /// 下单类型
  228. tradeParam.buildType = .BUILDTYPE_OPEN
  229. /// 时间有效类型
  230. tradeParam.timevalidType = .VALIDTYPE_DR
  231. /// 市场编号
  232. tradeParam.marketID = obj.marketid
  233. /// 商品ID
  234. tradeParam.goodsID = obj.goodsid
  235. /// 开启Loading
  236. NVActivityIndicatorPresenter.sharedInstance.startAnimating(ActivityData(message: "购买中......", type: .ballClipRotate, color: UIColor.loding(), backgroundColor: .clear), NVActivityIndicatorView.DEFAULT_FADE_IN_ANIMATION)
  237. tradeManager.tradeCommision(tradeParam: tradeParam) { [weak self] (isSuccess, error, orderNo) in
  238. DispatchQueue.main.async {
  239. /// dismisss loding.....
  240. NVActivityIndicatorPresenter.sharedInstance.stopAnimating(NVActivityIndicatorView.DEFAULT_FADE_OUT_ANIMATION)
  241. if isSuccess {
  242. /// 返回上次视图
  243. WHToast.showSuccess(withMessage: "请求成功", duration: 1.5) {
  244. self?.navigationController?.popViewController(animated: true)
  245. }
  246. } else {
  247. WHToast.showError(withMessage: "请求失败,\(ErrorUtils.getDesc(errorCode: error?.retCode ?? -99999) ?? "未知错误")", duration: 1.5, finishHandler: {})
  248. }
  249. }
  250. }
  251. }
  252. /// 买摘牌提交请求方法
  253. fileprivate func doDeListingTrade() {
  254. /// 异常
  255. guard let tradeManager = MTP2BusinessCore.shared.tradeManager,
  256. let obj = takeInfo as? MoGoodsInfo,
  257. check() else { return }
  258. let group = DispatchGroup()
  259. /// 开启Loading
  260. NVActivityIndicatorPresenter.sharedInstance.startAnimating(ActivityData(message: "购买中......", type: .ballClipRotate, color: UIColor.loding(), backgroundColor: .clear), NVActivityIndicatorView.DEFAULT_FADE_IN_ANIMATION)
  261. /// 构建交易参数
  262. let tradeParam = MoTradeParam()
  263. /// 买卖方向
  264. tradeParam.buyOrSell = .ORDERDIRECTION_BUY
  265. /// 挂牌点选类型
  266. tradeParam.delistingType = .DELISTINGTYPE_SELECTED
  267. /// 点选成交
  268. tradeParam.listingSelectType = .LISTINGSELECTTYPE_DELISTING
  269. /// 有效类型
  270. tradeParam.validType = .VALIDTYPE_DR
  271. /// 下单类型
  272. tradeParam.buildType = .BUILDTYPE_OPEN
  273. /// 时间有效类型
  274. tradeParam.timevalidType = .VALIDTYPE_DR
  275. /// 市场编号
  276. tradeParam.marketID = obj.marketid
  277. /// 商品ID
  278. tradeParam.goodsID = obj.goodsid
  279. for cell in tableView.visibleCells {
  280. if let cell = cell as? TradeCell, cell.isCheck {
  281. /// 挂牌价格
  282. tradeParam.orderPrice = cell.model?.orderprice ?? 0.0
  283. /// 关联单号
  284. tradeParam.relatedID = UInt64(cell.model?.orderid ?? "0") ?? 0
  285. /// 数量
  286. tradeParam.orderQty = Double(cell.qtyField.currentIntNumbers)
  287. group.enter()
  288. tradeManager.tradeCommision(tradeParam: tradeParam) { (isSuccess, error, orderNo) in
  289. group.leave()
  290. }
  291. }
  292. }
  293. group.notify(queue: DispatchQueue.main) {
  294. /// dismisss loding.....
  295. NVActivityIndicatorPresenter.sharedInstance.stopAnimating(NVActivityIndicatorView.DEFAULT_FADE_OUT_ANIMATION)
  296. WHToast.showSuccess(withMessage: "委托已提交,请前往我的单据页面查看!", duration: 1.5, finishHandler: {
  297. self.navigationController?.popViewController(animated: true)
  298. })
  299. }
  300. }
  301. /// 查询商品对应委托单的数据信息
  302. /// - Parameter price: 价格
  303. fileprivate func requestQueryHsbyGoodsOrderDetails(_ price: String?) {
  304. /// 异常
  305. guard let orderManager = MTP2BusinessCore.shared.orderManager,
  306. let obj = takeInfo as? MoGoodsInfo else { return }
  307. /// startAnimating
  308. self._anim?.startAnimating()
  309. /// 发送请求
  310. orderManager.requestQueryHsbyGoodsOrderDetails(obj.goodsid, price) { (isComplete, error, orderDetails) in
  311. DispatchQueue.main.async {
  312. /// stopAnimating
  313. self._anim?.stopAnimating()
  314. if isComplete {
  315. /// 更新数据
  316. self.orderDetails = orderDetails ?? []
  317. } else {
  318. self.orderDetails = []
  319. WHToast.showError(withMessage: "数据更新失败,原因:\(error?.retMsg ?? "未知错误")", duration: 1.5, finishHandler: {})
  320. }
  321. }
  322. }
  323. }
  324. /// 合规性校验
  325. /// - Returns: Bool
  326. fileprivate func check() -> Bool {
  327. /// 请输入委托价格
  328. guard priceField.currentDoubleNumbers != 0.0 else {
  329. WHToast.showError(withMessage: "请输入委托价格", duration: 1.5, finishHandler: {})
  330. return false
  331. }
  332. /// 委托价格不在范围内
  333. let detail = takeInfo as? MoGoodsInfo
  334. if priceField.currentDoubleNumbers < (detail?.limitdown ?? 0.0) || (priceField.currentDoubleNumbers > detail?.limitup ?? 0.0) {
  335. WHToast.showError(withMessage: "\(detail?.limitdown ?? 0.0)<=委托价格<=\(detail?.limitup ?? 0.0)", duration: 1.5, finishHandler: {})
  336. return false
  337. }
  338. /// 请输入交易数量
  339. if qtyField.currentIntNumbers == 0 {
  340. WHToast.showError(withMessage: "请输入交易数量", duration: 1.5, finishHandler: {})
  341. return false
  342. }
  343. /// 委托数量不能大于
  344. if qtyField.currentIntNumbers > qtyField.maxIntNum {
  345. WHToast.showError(withMessage: "交易数量应小于等于\(qtyField.maxIntNum)", duration: 1.5, finishHandler: {})
  346. return false
  347. }
  348. return true
  349. }
  350. // MARK: - 订阅行情相关
  351. var uuid: String = UUID().uuidString
  352. /// 行情订阅
  353. private func subscriptQuote() {
  354. var goodsCodes = Set<String>()
  355. if let goods = self.takeInfo as? MoGoodsInfo {
  356. goodsCodes.insert(goods.goodscode)
  357. }
  358. guard let quoteSubscriptManager = MTP2BusinessCore.shared.quoteSubscriptManager else { return }
  359. quoteSubscriptManager.updateQuoteSubcriptGoods(uuid: uuid, goodsCode: goodsCodes)
  360. }
  361. // MARK: - 计算相关
  362. /// 计算相关
  363. fileprivate func calculate() {
  364. /// 异常
  365. guard let obj = takeInfo as? MoGoodsInfo,
  366. let accountManager = MTP2BusinessCore.shared.accountManager,
  367. let taAccountInfo = accountManager.getCurrentTAAccountInfo() else {
  368. return
  369. }
  370. let amount = (priceField.currentDoubleNumbers*Double(qtyField.currentIntNumbers)*obj.agreeUnit).toDownString(reserve: obj.decimalplace)
  371. /// 期末余额
  372. let blance = taAccountInfo.currentBalance-(taAccountInfo.freezeMargin+taAccountInfo.otherFreezeMargin+taAccountInfo.freezeCharge)
  373. amountTips.text = "购买金额:\(amount) 可用金额:\(blance.toDownString(reserve: 2))"
  374. }
  375. }
  376. extension TradeViewController: UITableViewDelegate, UITableViewDataSource {
  377. func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
  378. return orderDetails.count
  379. }
  380. func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
  381. let cell = tableView.dequeueReusableCell(withIdentifier: CellIdentifier, for: indexPath) as! TradeCell
  382. cell.model = orderDetails[indexPath.row]
  383. cell.isCheck = false
  384. cell.block = { (_ model: MoHsbyGoodsOrderDetail?, _ isCheck: Bool, _ qty: Int) in
  385. var qty: Int = 0
  386. self.tableView.visibleCells.forEach { (cell) in
  387. if (cell as! TradeCell).isCheck {
  388. qty += (cell as! TradeCell).qtyField.currentIntNumbers
  389. }
  390. }
  391. self.orderQty = qty
  392. /// 输入框是否可用
  393. self.qtyField.isUserInteractionEnabled = !self.tableView.visibleCells.contains(where: { (cell) -> Bool in
  394. return ((cell as? TradeCell)?.isCheck ?? false)
  395. })
  396. }
  397. /// 最小交易数量
  398. if let obj = takeInfo as? MoGoodsInfo {
  399. cell.qtyField.incrementIntNum = obj.lotsize
  400. cell.qtyField.minIntNum = obj.lotsize
  401. }
  402. return cell
  403. }
  404. func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
  405. return 50.0
  406. }
  407. }
  408. extension TradeViewController: IBNumberEditTextDelegate {
  409. func numberInputViewDidEndEditing(_ numberInputView: IBNumberEditText) {
  410. if numberInputView == priceField {
  411. let orderPrice = numberInputView.currentDoubleNumbers
  412. /// 更新单据
  413. self.requestQueryHsbyGoodsOrderDetails(orderPrice.toString(reserve: 2))
  414. } else {
  415. calculate()
  416. }
  417. }
  418. func numberInputView(_ numberInputView: IBNumberEditText, _ buttonType: NumberInputViewButtonType) {
  419. if numberInputView == priceField {
  420. let orderPrice = numberInputView.currentDoubleNumbers
  421. /// 更新单据
  422. self.requestQueryHsbyGoodsOrderDetails(orderPrice.toString(reserve: 2))
  423. }
  424. calculate()
  425. }
  426. func IBNumberEditText(textField: UITextField) {}
  427. }
  428. class TradeCell: BaseTableViewCell<MoHsbyGoodsOrderDetail> {
  429. // MARK: - 属性列表
  430. /// bgView
  431. @IBOutlet weak var bgView: UIView!
  432. /// checkBox
  433. @IBOutlet weak var checkBox: UIButton!
  434. /// accountName
  435. @IBOutlet weak var accountName: UILabel!
  436. /// price
  437. @IBOutlet weak var price: UILabel!
  438. /// qty
  439. @IBOutlet weak var qty: UILabel!
  440. /// checkBox
  441. @IBOutlet weak var qtyField: IBNumberEditText! {
  442. didSet {
  443. qtyField.valueType = 1
  444. qtyField.delegate = self
  445. }
  446. }
  447. /// 数据模型
  448. override var model: MoHsbyGoodsOrderDetail? {
  449. didSet {
  450. /// 异常
  451. guard let obj = model else { return }
  452. /// 数量范围
  453. qtyField.maxIntNum = obj.enableqty
  454. if let vc = self.superController() as? MyUnusedViewController { /// 我的闲置
  455. qtyField.minIntNum = vc.myGoods?.lotsize ?? 1
  456. qtyField.incrementIntNum = vc.myGoods?.lotsize ?? 1
  457. qtyField.currentIntNumbers = obj.enableqty
  458. } else {
  459. let lotSize = ((self.superController() as? TradeViewController)?.takeInfo as? MoGoodsInfo)?.lotsize ?? 1
  460. qtyField.minIntNum = lotSize
  461. qtyField.incrementIntNum = lotSize
  462. qtyField.currentIntNumbers = lotSize
  463. }
  464. /// 客户名称
  465. accountName.text = obj.customername
  466. /// 委托价格
  467. price.text = "\(obj.currencysign)\(obj.orderprice)"
  468. /// 委托数量
  469. qty.text = "\(obj.enableqty)\(obj.goodunit)"
  470. }
  471. }
  472. /// 是否勾选
  473. var isCheck: Bool = false {
  474. didSet {
  475. /// 异常
  476. guard let obj = model else { return }
  477. /// setImage
  478. checkBox.setImage(UIImage(named: isCheck ? "check_selected" : "check_normal"), for: .normal)
  479. /// 执行回调
  480. if let callBack = block { callBack(obj, isCheck, qtyField.currentIntNumbers) }
  481. /// 设置交互色
  482. bgView.backgroundColor = UIColorFromHex(rgbValue: isCheck ? 0xecf3fd : 0xf7f7f7)
  483. /// 是否可用
  484. qtyField.isUserInteractionEnabled = isCheck
  485. }
  486. }
  487. /// 回调块
  488. var block: ((_ model: MoHsbyGoodsOrderDetail?, _ isCheck: Bool, _ qty: Int) -> Void)?
  489. /// onButtonPressed
  490. /// - Parameter sender: sender
  491. @IBAction func onButtonPressed(_ sender: UIButton) {
  492. switch sender {
  493. case checkBox:
  494. isCheck = !isCheck
  495. default:
  496. return
  497. }
  498. }
  499. }
  500. extension TradeCell: IBNumberEditTextDelegate {
  501. /// 不做任何处理
  502. func IBNumberEditText(textField: UITextField) {}
  503. func numberInputView(_ numberInputView: IBNumberEditText, _ buttonType: NumberInputViewButtonType) {
  504. isCheck = true
  505. }
  506. func numberInputViewDidEndEditing(_ numberInputView: IBNumberEditText) {
  507. isCheck = true
  508. }
  509. }