Browse Source

购物车根据字段判断是否隐藏

Steven 11 months ago
parent
commit
ccb0b6e41a

+ 1 - 1
KulexiuForStudent/KulexiuForStudent.xcodeproj/xcshareddata/xcschemes/KulexiuForStudent.xcscheme

@@ -51,7 +51,7 @@
       </Testables>
    </TestAction>
    <LaunchAction
-      buildConfiguration = "DEV"
+      buildConfiguration = "TEST"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
       launchStyle = "0"

+ 4 - 3
KulexiuForStudent/KulexiuForStudent/Module/Mine/Works/View/MineWorksDraftsCell.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_12" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -40,7 +40,7 @@
                                 </userDefinedRuntimeAttributes>
                             </imageView>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="山茶花读不懂白玫瑰" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="r93-WW-AsM">
-                                <rect key="frame" x="85" y="23" width="147" height="22"/>
+                                <rect key="frame" x="85" y="23" width="254" height="22"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="22" id="ySa-KY-C1W"/>
                                 </constraints>
@@ -140,6 +140,7 @@
                         <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         <constraints>
                             <constraint firstItem="Gqj-ha-fWI" firstAttribute="leading" secondItem="sbM-p5-CSI" secondAttribute="leading" id="4AR-Vh-8JS"/>
+                            <constraint firstAttribute="trailing" secondItem="r93-WW-AsM" secondAttribute="trailing" constant="12" id="D1J-RL-A86"/>
                             <constraint firstItem="WOO-8s-BT6" firstAttribute="top" secondItem="r93-WW-AsM" secondAttribute="bottom" constant="8" id="EUI-Xl-W83"/>
                             <constraint firstItem="rxQ-sS-z9K" firstAttribute="leading" secondItem="Gqj-ha-fWI" secondAttribute="trailing" constant="12" id="FzA-y3-tKP"/>
                             <constraint firstAttribute="trailing" secondItem="09X-I4-Gx4" secondAttribute="trailing" constant="12" id="G5Q-X3-MPL"/>

+ 9 - 9
KulexiuForStudent/KulexiuForStudent/Module/TXLive/Model/KSEnterLiveroomManager.m

@@ -55,15 +55,15 @@ static BOOL isRequestRoomMsg  = NO;
     NSDictionary *configDic = [NSJSONSerialization JSONObjectWithData:jsonData
                                                               options:NSJSONReadingMutableContainers
                                                                 error:&err];
-//    BOOL enableRecord = NO;
-//    if (configDic) {
-//        liveVC.enableChat = ![configDic ks_boolValueForKey:@"whether_chat"];
-//        liveVC.enableSeat = ![configDic ks_boolValueForKey:@"whether_mic"];
-//        liveVC.enableLike = ![configDic ks_boolValueForKey:@"whether_like"];
-//        liveVC.hideCartButton = [configDic ks_integerValueForKey:@"whether_view_shop_cart"] == 1 ? YES : NO;
-//        // 是否录制
-//        enableRecord = [configDic ks_boolValueForKey:@"whether_video"];
-//    }
+    // 是否隐藏shopCart
+    if (configDic) {
+        if ([[configDic allKeys] containsObject:@"whether_view_shop_cart"]) {
+            liveVC.hideCartButton = [configDic ks_integerValueForKey:@"whether_view_shop_cart"] == 1 ? YES : NO;
+        }
+        else {
+            liveVC.hideCartButton = NO;
+        }
+    }
     
     
     liveVC.UserSig = [source ks_stringValueForKey:@"userSig"];