Browse Source

注册页面修复

桂欢 1 year ago
parent
commit
e1a3b7e625

+ 10 - 0
SLAiELTS/SLAiELTS/ViewControllers/LoginVC/SLRegistViewController.m

@@ -20,6 +20,7 @@
 @property (weak, nonatomic) IBOutlet UITextField *codeTextField;
 
 @property (weak, nonatomic) IBOutlet UITextField *pwTextField;
+@property (weak, nonatomic) IBOutlet UIButton *protocolBtn;
 
 @end
 
@@ -34,6 +35,7 @@
     UIButton *btn = [self.phoneTextField valueForKey:@"_clearButton"];
     [btn setImage:ImageName(@"icon_clear_circle") forState:UIControlStateNormal];
     self.view.backgroundColor = [UIColor whiteColor];
+    self.protocolBtn.selected = YES;
 }
 
 - (IBAction)backBtnClick:(id)sender {
@@ -85,6 +87,10 @@
         [ZFToast ShowWithMessage:@"密码长度为6到16位"];
         return;
     }
+    if (!self.protocolBtn.selected) {
+        [ZFToast ShowWithMessage:@"请勾选协议"];
+        return;
+    }
     NSDictionary *parameter = @{@"phone" : phoneStr, @"password" : pwStr, @"code" : codeStr};
     [[SLHttpCenter SharedInstance] postWithUrl:@"/api/Token/isPhoneCode" parameter:parameter success:^(id responseObject) {
         NSDictionary *dataDict = [responseObject objectForKey:@"data"];
@@ -100,6 +106,10 @@
         
     }];
 }
+- (IBAction)protocolBtnClick:(id)sender {
+    UIButton *btn = (UIButton *)sender;
+    btn.selected = !btn.selected;
+}
 
 /*
 #pragma mark - Navigation

+ 4 - 5
SLAiELTS/SLAiELTS/ViewControllers/LoginVC/SLRegistViewController.xib

@@ -14,6 +14,7 @@
                 <outlet property="codeBtn" destination="joL-K1-4Ad" id="62j-oW-fhi"/>
                 <outlet property="codeTextField" destination="p8e-CM-QHR" id="0Jr-93-ucS"/>
                 <outlet property="phoneTextField" destination="ikY-tv-tJd" id="vLG-zT-Gbp"/>
+                <outlet property="protocolBtn" destination="uax-k7-pSM" id="dYM-Ar-n9T"/>
                 <outlet property="pwTextField" destination="jrR-aU-X5s" id="nmo-8Q-Q1A"/>
                 <outlet property="view" destination="FjC-8z-a07" id="UYs-Qv-xKz"/>
             </connections>
@@ -176,6 +177,9 @@
                                 <color key="titleColor" red="0.086274509799999996" green="0.46666666670000001" blue="1" alpha="1" colorSpace="calibratedRGB"/>
                             </state>
                             <state key="selected" image="check_circle_filled"/>
+                            <connections>
+                                <action selector="protocolBtnClick:" destination="-1" eventType="touchUpInside" id="Dhv-cY-AKW"/>
+                            </connections>
                         </button>
                         <label opaque="NO" userInteractionEnabled="NO" alpha="0.40000000596046448" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="我已同意" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="en9-yj-lXE">
                             <rect key="frame" x="24.000000000000004" y="6.6666666666666288" width="57.333333333333343" height="17"/>
@@ -259,11 +263,6 @@
             <point key="canvasLocation" x="47.692307692307693" y="20.616113744075829"/>
         </view>
     </objects>
-    <designables>
-        <designable name="joL-K1-4Ad">
-            <size key="intrinsicContentSize" width="82" height="32"/>
-        </designable>
-    </designables>
     <resources>
         <image name="check_circle" width="24" height="24.333333969116211"/>
         <image name="check_circle_filled" width="24" height="24.333333969116211"/>

+ 19 - 19
SLAiELTS/SLAiELTS/ViewControllers/MessageVC/Views/IMMessageView/YMIMBaseMessageCell.m

@@ -103,25 +103,25 @@
     CGFloat topMikeBg = (topHeight ? 6 : 0) + topTimeHeight;
     if (msgModel.isReceive) {
         NSArray *msgArr = [msgModel.sendText componentsSeparatedByString:@" "];
-        __block CGFloat m = 0;
-        [msgArr enumerateObjectsUsingBlock:^(NSString *  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
-            NSInteger l = obj.length;
-            CGFloat x = 0;
-            if (l > 12) {
-                x = 20.0;
-            }else if (l > 9 && l < 12) {
-                x = 18.0;
-            }else if (l > 5 && l < 10) {
-                x = 14.0;
-            }else if (l > 3 && l < 6) {
-                x = 12.0;
-            }else {
-                x = 9.0;
-            }
-            m += MIN(obj.length / x, 0.6);
-              
-        }];
-        NSInteger timeLong = ceil(m);
+//        __block CGFloat m = 0;
+//        [msgArr enumerateObjectsUsingBlock:^(NSString *  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
+//            NSInteger l = obj.length;
+//            CGFloat x = 0;
+//            if (l > 12) {
+//                x = 20.0;
+//            }else if (l > 9 && l < 12) {
+//                x = 18.0;
+//            }else if (l > 5 && l < 10) {
+//                x = 14.0;
+//            }else if (l > 3 && l < 6) {
+//                x = 12.0;
+//            }else {
+//                x = 9.0;
+//            }
+//            m += MIN(obj.length / x, 0.6);
+//
+//        }];
+        NSInteger timeLong = ceil(msgArr.count / 2.5);
         {//你有多少数据量
             self.messageLabel.text = msgModel.showTrans ? msgModel.sendTextTrans : msgModel.sendText;
             if (!msgModel.showMike) {