Przeglądaj źródła

提交内容
1、代码提交;

Handy_Cao 4 lat temu
rodzic
commit
2d0cf2e42c

+ 5 - 5
MTP_iOS/MTP2_iOS/BusinessCore/Bank/BankManager.swift

@@ -540,26 +540,26 @@ class BankManager: BaseManager {
     ///   - type: 扩展业务类型 - 1:签约 2:入金 3:出金
     ///   - callback: 回调块
     func queryBankExtendInfo(cusBankId: String, type: Int, callback: @escaping (_ isCompleted: Bool, _ error: ErrorInfo?,_ extendInfo:[MoExtendInfo]?) -> Void) {
-        // 状态检验
+        /// 状态检验
         if let error = checkStatus() {
             callback(false, error, nil)
             return
         }
-        // 构建查询参数
+        /// 构建查询参数
         let param = ("cusbankid", cusBankId)
         let param1 = ("extendbiztype",type.description)
         
-        // 调用通用查询方法
+        /// 调用通用查询方法
         QueryCommonHelper.queryCommon(statement: Statement.QUERYBANKEXTENDINFO, targetClass: MoExtendInfo.self, params: [param,param1]) {
             isCompleted, error, results, protobufInfos in
             if !isCompleted {
-                // 查询失败
+                /// 查询失败
                 callback(false, error, nil)
                 return
             }
             
             guard let results = results else {
-                // 通用查询返回数据为null
+                /// 通用查询返回数据为null
                 callback(false, ErrorInfo(retCode: -60000, retMsg: nil), nil)
                 return
             }

+ 6 - 4
MTP_iOS/MTP2_iOS/BusinessCore/Goods/Models/GoodsModels.swift

@@ -191,11 +191,13 @@ class MoGoodsInfo: MoBaseMoGoods {
     /// 海南报业获取最新价
     /// - Returns: Double
     func getLast() -> Double {
-        guard let quoteInfo = self.moQuoteInfo else { return 0.0 }
-        if quoteInfo.bid != 0.0 {
-            return quoteInfo.bid
-        } else if quoteInfo.last != 0.0 {
+        guard let quoteInfo = self.moQuoteInfo,
+              quoteInfo.timeStamp != nil else { return 0.0 }
+        
+        if quoteInfo.last != 0.0 {
             return quoteInfo.last
+        } else if quoteInfo.bid != 0.0 {
+            return quoteInfo.bid
         } else if quoteInfo.preSettle != 0.0 {
             return quoteInfo.preSettle
         } else {

+ 2 - 0
MTP_iOS/MTP2_iOS/BusinessCore/Order/Models/OrderModels.swift

@@ -522,6 +522,8 @@ class MoMyPayOrders: MoHsbyMyBuyOrderDetails {
     var tradeid = ""
     /// 成交价格
     var tradeprice = 0.0
+    /// 原金额 = tradeamount + tradecharge + offamount
+    var originalamount = 0.0
 }
 
 /// 我的闲置中收款信息查询

+ 1 - 1
MTP_iOS/MTP2_iOS/Resource/Storyboard/Message/Message.storyboard

@@ -105,7 +105,7 @@
                                         </userDefinedRuntimeAttributes>
                                     </label>
                                 </subviews>
-                                <color key="backgroundColor" red="0.96470588235294119" green="0.96470588235294119" blue="0.97254901960784312" alpha="1" colorSpace="calibratedRGB"/>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                 <constraints>
                                     <constraint firstItem="WVD-eZ-FuR" firstAttribute="top" secondItem="NCy-9Z-Kim" secondAttribute="bottom" id="1Le-rF-MC2"/>
                                     <constraint firstAttribute="bottom" secondItem="WVD-eZ-FuR" secondAttribute="bottom" id="7pF-zT-gWu"/>

+ 1 - 1
MTP_iOS/MTP2_iOS/Resource/Storyboard/Order/Order.storyboard

@@ -39,7 +39,7 @@
                         <subviews>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="TUp-9U-Hf6" customClass="JXSegmentedView" customModule="JXSegmentedView">
                                 <rect key="frame" x="0.0" y="88" width="414" height="44"/>
-                                <color key="backgroundColor" red="0.96470588235294119" green="0.96470588235294119" blue="0.97254901960784312" alpha="1" colorSpace="calibratedRGB"/>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="44" id="AxJ-tO-O6C"/>
                                 </constraints>

+ 6 - 2
MTP_iOS/MTP2_iOS/UserInterface/Coupon/CouponViewController.swift

@@ -224,8 +224,12 @@ class CouponCell: BaseTableViewCell<MoMyCouponHold> {
             
             switch obj.holdstatus {
             case .invalid, .used, .expired: /// 未生效 已使用 已过期
-                /// 背景
-                couponImage.image = obj.holdstatus == .invalid ? UIImage(named: obj.couponcategroy == 1 ? "my_coupon_bg" : "my_coupon_bg_red") : UIImage(named: "my_coupon_bg_gray")
+                /// 选中
+                if let _ = self.superController() as? ChooseCouponViewController {
+                    couponImage.image = UIImage(named: "my_coupon_bg_gray")
+                } else {
+                    couponImage.image = obj.holdstatus == .invalid ? UIImage(named: obj.couponcategroy == 1 ? "my_coupon_bg" : "my_coupon_bg_red") : UIImage(named: "my_coupon_bg_gray")
+                }
                 /// 使用时间
                 usedDate.text = (obj.holdstatus == .expired || obj.holdstatus == .invalid) ? "\(DateUtils.getTDateString(obj.startdate))-\(DateUtils.getTDateString(obj.enddate))" : obj.holdstatus.description
                 /// 不能使用原因

+ 6 - 2
MTP_iOS/MTP2_iOS/UserInterface/Home/HomeViewController.swift

@@ -332,6 +332,7 @@ class HomeViewController: BaseViewController {
             self.goods = hotGoods.sorted(by: { (obj1, obj2) -> Bool in
                 return obj1.hotindex>obj2.hotindex
             })
+            
             /// 轮播图相关
             if self.configs.count != 0 {
                 let paths = self.configs.map({ (model) -> String in
@@ -484,10 +485,13 @@ class GoodsCell: UICollectionViewCell {
             goodsName.text = obj.goodsname
             /// 价格
             if obj.trademode == .TRADEMODE_LISTING_SELECT {
+                /// 竞价商品
                 price.attributedText = (obj.currencysign.withFont(.font_12)+" \((obj.getLast() == 0.0 ? obj.last : obj.getLast()).toDownString(reserve: obj.decimalplace))".withFont(.font_16)).withTextColor(.red)
-            } else if obj.trademode == .TRADEMODE_TRADEMODE_HSBY_SHOP { /// 商城商品
+            } else if obj.trademode == .TRADEMODE_TRADEMODE_HSBY_SHOP {
+                /// 商城商品
                 price.attributedText = (("\(obj.currencysign)".withFont(.font_12))+("\(obj.goodsprice)".withFont(.font_16))).withTextColor(.red)
-            } else { /// 新品抢购
+            } else {
+                /// 新品抢购
                 price.attributedText = (("抢购价:\(obj.currencysign)".withFont(.font_12))+(obj.refprice.description.withFont(.font_16))).withTextColor(.red)
             }
             /// 地址异常

+ 6 - 0
MTP_iOS/MTP2_iOS/UserInterface/Login/LoginViewController.swift

@@ -399,6 +399,12 @@ class LoginViewController: BaseTableViewController<LsLoginUserModel>, UITextFiel
             }
         }
         
+        /// 清空密码输入框
+        if textField == usernameTextField,
+           passwordTextField.text != "" {
+            passwordTextField.text = ""
+        }
+        
         if !userTableView.isHidden {
             isExpand = false
             userTableView.isHidden = true

+ 2 - 0
MTP_iOS/MTP2_iOS/UserInterface/Mine/Settings/Feedback/FeedbackViewController.swift

@@ -133,6 +133,8 @@ class FeedbackViewController: BaseViewController {
                     self.textView.text = ""
                     /// 重新去请求留言板数据
                     self.requestMessageBoards()
+                    /// 重置字符统计
+                    self.count = 300
                     /// 数据获取失败
                 } else {
                     WHToast.showError(withMessage: "添加留言板失败,原因:\(error?.retMsg ?? "未知错误")", duration: 1.5, finishHandler: {})

+ 1 - 1
MTP_iOS/MTP2_iOS/UserInterface/Order/OrderViewController.swift

@@ -418,7 +418,7 @@ class OrderCell: BaseTableViewCell<MoHsbyMyBuyOrderDetails> {
                 /// 成交价格
                 price.text = "\(obj.currencysign) \(payOrder.tradeprice)"
                 /// 金额
-                amount.text = "总价:\(payOrder.tradeamount.toString(reserve: 2)),  优惠:\(payOrder.offamount.toString(reserve: 2)), 实付款:\(payOrder.payamount.toString(reserve: 2))"
+                amount.text = "总价:\(payOrder.originalamount.toString(reserve: 2)),  优惠:\(payOrder.offamount.toString(reserve: 2)), 实付款:\(payOrder.payamount.toString(reserve: 2))"
                 /// 数量
                 qty.text = "×\(payOrder.tradeqty)"
                 /// 只有求购中的商品才可以撤销单据

+ 8 - 1
MTP_iOS/MTP2_iOS/UserInterface/Trade/MyUnusedViewController.swift

@@ -124,7 +124,6 @@ class MyUnusedViewController: BaseViewController {
             self.subscriptQuote()
             /// 挂牌点选
             if obj.trademode == .TRADEMODE_LISTING_SELECT {
-                
                 /// 侦听行情推送广播
                 MTP2BusinessCore.shared.broadcastManager?.addBroadcastListener(owner: self, action: .ReceiveTradeQuote, block: { [unowned self] (notify) in
                     DispatchQueue.main.async {
@@ -149,6 +148,8 @@ class MyUnusedViewController: BaseViewController {
             valid.isUserInteractionEnabled = obj.trademode != .TRADEMODE_LISTING_SELECT
             /// 小数位
             orderPrice.decimalPlace = obj.decimalplace
+            /// 查询数据
+            self.requestQueryHsbyGoodsOrderDetails(self.orderPrice.currentDoubleNumbers.toString(reserve: 2))
         }
     }
     /// 委托单数据
@@ -615,6 +616,12 @@ class MyUnusedViewController: BaseViewController {
             return false
         }
         
+        /// 发布数量不能大于可发布数量
+        if orderQty.currentIntNumbers>orderQty.maxIntNum {
+            WHToast.showError(withMessage: "发布数量应小于等于\(orderQty.maxIntNum)!", duration: 1.5, finishHandler: {})
+            return false
+        }
+        
         return true
     }
     

+ 5 - 6
MTP_iOS/MTP2_iOS/UserInterface/Trade/PaymentOrderViewController.swift

@@ -132,8 +132,7 @@ class PaymentOrderViewController: BaseViewController {
     fileprivate func showGoodsInfo(_ goods: MoGoodsInfo?) {
         /// 数据异常
         guard let obj = goods,
-              let accountManager = MTP2BusinessCore.shared.accountManager,
-              let taAccountInfo = accountManager.getCurrentTAAccountInfo() else { return }
+              let accountManager = MTP2BusinessCore.shared.accountManager else { return }
         
         /// 商品名称
         goodsName.text = obj.goodsname
@@ -149,10 +148,10 @@ 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)
         
-        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now()+0.5) {
-            /// 查询资金信息
-            accountManager.loginQueryReq(queryItem: "1,2") { (isComplete, error) in
-                DispatchQueue.main.async {
+        /// 查询资金信息
+        accountManager.loginQueryReq(queryItem: "1,2") { (isComplete, error) in
+            DispatchQueue.main.async {
+                if let taAccountInfo = accountManager.getCurrentTAAccountInfo() {
                     /// 期末余额
                     let blance = taAccountInfo.currentBalance-(taAccountInfo.freezeMargin+taAccountInfo.otherFreezeMargin+taAccountInfo.freezeCharge)
                     /// 最大可用数量

+ 8 - 5
MTP_iOS/MTP2_iOS/UserInterface/Trade/TradeViewController.swift

@@ -119,12 +119,15 @@ class TradeViewController: BaseViewController {
             /// 更新商品行情信息
             goodsQuoteInfo.forEach {
                 if $0.goodsHqCode == goods.goodscode,
-                   let goodsInfo = goodsManager.goodsInfos.first(where: {$0.goodsid == (takeInfo as? MoGoodsInfo)?.goodsid}) {
+                   let goodsInfo = goodsManager.goodsInfos.first(where: {$0.goodsid == goods.goodsid}) {
                     DispatchQueue.main.async {
                         /// 更新价格
-                        self.price.text = "\(goods.currencysign) \(goodsInfo.getLast() == 0.0 ? goods.last : goodsInfo.getLast())"
-                        /// 当前价格
-                        self.priceField.currentDoubleNumbers = goodsManager.goodsInfos.first(where: {$0.goodsid == (takeInfo as? MoGoodsInfo)?.goodsid})?.getLast() ?? 0.0
+                        self.price.text = "\(goods.currencysign) \(goodsInfo.getLast() == 0.0 ? "\(goods.last)" : goodsInfo.getLast().toString(reserve: goodsInfo.decimalplace))"
+                        if goods.moQuoteInfo?.timeStamp != nil {
+                            /// 当前价格
+                            self.priceField.currentDoubleNumbers = goodsInfo.getLast() == 0.0 ? goods.last : goodsInfo.getLast()
+                        }
+                        
                     }
                 }
             }
@@ -163,7 +166,7 @@ class TradeViewController: BaseViewController {
         priceField.minDoubleNum = obj.limitdown
         priceField.maxDoubleNum = obj.limitup
         priceField.decimalPlace = obj.decimalplace
-        priceField.currentDoubleNumbers = obj.last
+        priceField.currentDoubleNumbers = obj.getLast() == 0.0 ? obj.last : obj.getLast()
         /// 查询对手买家挂牌信息
         self.requestQueryHsbyGoodsOrderDetails(obj.last.toString(reserve: 2))