- Completed Apply Coupon Functionality

- Made a selection for the coupon selected, also added no coupon found when coupon is not there
- Added Masila view in more section
- Added Play trailer from Manila in more section
- Gave other connectivity
This commit is contained in:
2024-07-24 19:59:08 +05:30
parent 22796ec0b1
commit bb68fa1e3c
18 changed files with 260 additions and 77 deletions

View File

@@ -138,23 +138,23 @@
<rect key="frame" x="0.0" y="74" width="393" height="744"/> <rect key="frame" x="0.0" y="74" width="393" height="744"/>
<subviews> <subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="4FL-Qu-GXb"> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="4FL-Qu-GXb">
<rect key="frame" x="0.0" y="0.0" width="393" height="455.66666666666669"/> <rect key="frame" x="0.0" y="0.0" width="393" height="364.33333333333331"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Order Summary" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fbh-Ve-yLY" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Order Summary" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fbh-Ve-yLY" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="5" y="4.9999999999999982" width="383" height="23.333333333333329"/> <rect key="frame" x="5" y="5" width="383" height="24"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="20"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="20"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="qGY-nv-azT"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="qGY-nv-azT">
<rect key="frame" x="5" y="38.333333333333329" width="383" height="99.999999999999986"/> <rect key="frame" x="5" y="39" width="383" height="100"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="100" id="cQ3-vj-QS5"/> <constraint firstAttribute="height" constant="100" id="cQ3-vj-QS5"/>
</constraints> </constraints>
</tableView> </tableView>
<stackView opaque="NO" contentMode="scaleToFill" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="ZuF-hT-QwS"> <stackView opaque="NO" contentMode="scaleToFill" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="ZuF-hT-QwS">
<rect key="frame" x="5" y="148.33333333333334" width="383" height="50"/> <rect key="frame" x="5" y="149" width="383" height="50"/>
<subviews> <subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Enter coupon code" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="0cZ-tT-3PH" customClass="TextFieldShadow" customModule="WOKA" customModuleProvider="target"> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Enter coupon code" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="0cZ-tT-3PH" customClass="TextFieldShadow" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="5" y="0.0" width="273" height="50"/> <rect key="frame" x="5" y="0.0" width="273" height="50"/>
@@ -175,7 +175,7 @@
</userDefinedRuntimeAttribute> </userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
</textField> </textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hLf-a9-uIi" customClass="LocalisedElementsButton" customModule="WOKA" customModuleProvider="target"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hLf-a9-uIi">
<rect key="frame" x="288" y="0.0" width="90" height="50"/> <rect key="frame" x="288" y="0.0" width="90" height="50"/>
<color key="backgroundColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
@@ -209,14 +209,14 @@
<edgeInsets key="layoutMargins" top="0.0" left="5" bottom="0.0" right="5"/> <edgeInsets key="layoutMargins" top="0.0" left="5" bottom="0.0" right="5"/>
</stackView> </stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0M5-Sk-NNP"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0M5-Sk-NNP">
<rect key="frame" x="5" y="208.33333333333331" width="383" height="0.66666666666665719"/> <rect key="frame" x="5" y="209" width="383" height="0.66666666666665719"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="0.69999999999999996" id="euT-bu-DWE"/> <constraint firstAttribute="height" constant="0.69999999999999996" id="euT-bu-DWE"/>
</constraints> </constraints>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Hjo-i3-vzd"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Hjo-i3-vzd">
<rect key="frame" x="5" y="219" width="383" height="34.333333333333343"/> <rect key="frame" x="5" y="219.66666666666669" width="383" height="34.333333333333343"/>
<color key="tintColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="tintColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="All Offers &amp; Coupons" image="chevron.forward.circle.fill" catalog="system"/> <state key="normal" title="All Offers &amp; Coupons" image="chevron.forward.circle.fill" catalog="system"/>
@@ -225,34 +225,40 @@
<action selector="offerCouponBtnTapped:" destination="lm3-5q-Mwn" eventType="touchUpInside" id="6ec-0S-Ymm"/> <action selector="offerCouponBtnTapped:" destination="lm3-5q-Mwn" eventType="touchUpInside" id="6ec-0S-Ymm"/>
</connections> </connections>
</button> </button>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" No Coupon Found!" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yYe-w7-xHF" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="5" y="259" width="383" height="0.0"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="16"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<tableView hidden="YES" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="kB1-D9-Jpc"> <tableView hidden="YES" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="kB1-D9-Jpc">
<rect key="frame" x="5" y="258.33333333333331" width="383" height="0.0"/> <rect key="frame" x="5" y="259" width="383" height="0.0"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" id="Uhk-ez-kna"/> <constraint firstAttribute="height" id="Uhk-ez-kna"/>
</constraints> </constraints>
</tableView> </tableView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PfV-Yj-8cg"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PfV-Yj-8cg">
<rect key="frame" x="5" y="263.33333333333331" width="383" height="0.66666666666668561"/> <rect key="frame" x="5" y="264" width="383" height="0.66666666666668561"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="0.69999999999999996" id="4xH-CV-oza"/> <constraint firstAttribute="height" constant="0.69999999999999996" id="4xH-CV-oza"/>
</constraints> </constraints>
</view> </view>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="IIC-eN-1kV"> <stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="IIC-eN-1kV">
<rect key="frame" x="5" y="274" width="383" height="82.666666666666686"/> <rect key="frame" x="5" y="269.66666666666669" width="383" height="40.666666666666686"/>
<subviews> <subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="0fF-q8-366"> <stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="0fF-q8-366">
<rect key="frame" x="0.0" y="0.0" width="383" height="21"/> <rect key="frame" x="0.0" y="0.0" width="383" height="0.0"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Subtotal: " textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="X02-Xy-T6S" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Subtotal: " textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="X02-Xy-T6S" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="78" height="21"/> <rect key="frame" x="0.0" y="0.0" width="82" height="0.0"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rs. 0" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VJO-dL-zw7" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rs. 0" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VJO-dL-zw7" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="341.33333333333331" y="0.0" width="41.666666666666686" height="21"/> <rect key="frame" x="342" y="0.0" width="41" height="0.0"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
@@ -260,16 +266,16 @@
</subviews> </subviews>
</stackView> </stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="ozO-f8-8kT"> <stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="ozO-f8-8kT">
<rect key="frame" x="0.0" y="41" width="383" height="21"/> <rect key="frame" x="0.0" y="20" width="383" height="0.0"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Discount: " textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SjJ-9G-tNV" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Discount: " textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SjJ-9G-tNV" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="81.666666666666671" height="21"/> <rect key="frame" x="0.0" y="0.0" width="84" height="0.0"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rs. 0" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Aru-WM-a5c" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rs. 0" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Aru-WM-a5c" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="341.33333333333331" y="0.0" width="41.666666666666686" height="21"/> <rect key="frame" x="342" y="0.0" width="41" height="0.0"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
@@ -277,7 +283,7 @@
</subviews> </subviews>
</stackView> </stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="VUT-AU-unP"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="VUT-AU-unP">
<rect key="frame" x="0.0" y="82" width="383" height="0.6666666666666714"/> <rect key="frame" x="0.0" y="40" width="383" height="0.6666666666666643"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="0.69999999999999996" id="JTK-Tg-kDT"/> <constraint firstAttribute="height" constant="0.69999999999999996" id="JTK-Tg-kDT"/>
@@ -286,19 +292,19 @@
</subviews> </subviews>
</stackView> </stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="13" translatesAutoresizingMaskIntoConstraints="NO" id="qF1-U6-f3P"> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="13" translatesAutoresizingMaskIntoConstraints="NO" id="qF1-U6-f3P">
<rect key="frame" x="5" y="366.66666666666669" width="383" height="84"/> <rect key="frame" x="5" y="274.66666666666669" width="383" height="84.666666666666686"/>
<subviews> <subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="YSF-eO-Ree"> <stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="YSF-eO-Ree">
<rect key="frame" x="0.0" y="0.0" width="383" height="21"/> <rect key="frame" x="0.0" y="0.0" width="383" height="21.666666666666668"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Total Amount: " textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mDO-yI-336" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Total Amount: " textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mDO-yI-336" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="116.33333333333333" height="21"/> <rect key="frame" x="0.0" y="0.0" width="122" height="21.666666666666668"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rs. 0" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lH2-35-Ttu" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rs. 0" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lH2-35-Ttu" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="341.33333333333331" y="0.0" width="41.666666666666686" height="21"/> <rect key="frame" x="342" y="0.0" width="41" height="21.666666666666668"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
@@ -306,7 +312,7 @@
</subviews> </subviews>
</stackView> </stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rp4-qX-3OH" customClass="LocalisedElementsButton" customModule="WOKA" customModuleProvider="target"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rp4-qX-3OH" customClass="LocalisedElementsButton" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="34" width="383" height="50"/> <rect key="frame" x="0.0" y="34.666666666666629" width="383" height="50"/>
<color key="backgroundColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="50" id="UFU-ci-N8q"> <constraint firstAttribute="height" constant="50" id="UFU-ci-N8q">
@@ -360,6 +366,7 @@
</constraints> </constraints>
</view> </view>
<connections> <connections>
<outlet property="applyBtn" destination="hLf-a9-uIi" id="t4u-WL-duh"/>
<outlet property="cartTableHeight" destination="cQ3-vj-QS5" id="etf-0A-WQV"/> <outlet property="cartTableHeight" destination="cQ3-vj-QS5" id="etf-0A-WQV"/>
<outlet property="cartTableView" destination="qGY-nv-azT" id="T2q-Sf-2aO"/> <outlet property="cartTableView" destination="qGY-nv-azT" id="T2q-Sf-2aO"/>
<outlet property="confirmBtn" destination="rp4-qX-3OH" id="xJQ-Rf-Bxz"/> <outlet property="confirmBtn" destination="rp4-qX-3OH" id="xJQ-Rf-Bxz"/>
@@ -368,6 +375,7 @@
<outlet property="couponTableHeght" destination="Uhk-ez-kna" id="coX-6q-rQf"/> <outlet property="couponTableHeght" destination="Uhk-ez-kna" id="coX-6q-rQf"/>
<outlet property="couponTableView" destination="kB1-D9-Jpc" id="Wqz-Rk-gfW"/> <outlet property="couponTableView" destination="kB1-D9-Jpc" id="Wqz-Rk-gfW"/>
<outlet property="discountPrice" destination="Aru-WM-a5c" id="3Uo-mk-J79"/> <outlet property="discountPrice" destination="Aru-WM-a5c" id="3Uo-mk-J79"/>
<outlet property="noCouponFound" destination="yYe-w7-xHF" id="efQ-n1-YSe"/>
<outlet property="scrollView" destination="Y68-eb-iI3" id="skF-g0-NEj"/> <outlet property="scrollView" destination="Y68-eb-iI3" id="skF-g0-NEj"/>
<outlet property="subtotalPrice" destination="VJO-dL-zw7" id="HIb-E5-in0"/> <outlet property="subtotalPrice" destination="VJO-dL-zw7" id="HIb-E5-in0"/>
<outlet property="totalCartPrice" destination="lH2-35-Ttu" id="QiM-3w-f0q"/> <outlet property="totalCartPrice" destination="lH2-35-Ttu" id="QiM-3w-f0q"/>
@@ -377,10 +385,28 @@
</objects> </objects>
<point key="canvasLocation" x="907.63358778625945" y="-35.211267605633807"/> <point key="canvasLocation" x="907.63358778625945" y="-35.211267605633807"/>
</scene> </scene>
<!--View Controller-->
<scene sceneID="pB5-5z-2Mm">
<objects>
<viewController id="e74-xp-vgC" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Qtr-Tw-ga2">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="GRP-hQ-hXk"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5u-g1-Lhg" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1637" y="-35"/>
</scene>
</scenes> </scenes>
<designables> <designables>
<designable name="0cZ-tT-3PH"> <designable name="0cZ-tT-3PH">
<size key="intrinsicContentSize" width="186.66666666666666" height="20.333333333333332"/> <size key="intrinsicContentSize" width="134.33333333333334" height="21"/>
</designable>
<designable name="hLf-a9-uIi">
<size key="intrinsicContentSize" width="49" height="34"/>
</designable> </designable>
</designables> </designables>
<resources> <resources>
@@ -389,6 +415,9 @@
<namedColor name="TextDarkBlue"> <namedColor name="TextDarkBlue">
<color red="0.10599999874830246" green="0.050999999046325684" blue="0.60399997234344482" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.10599999874830246" green="0.050999999046325684" blue="0.60399997234344482" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemGreenColor"> <systemColor name="systemGreenColor">
<color red="0.20392156862745098" green="0.7803921568627451" blue="0.34901960784313724" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.20392156862745098" green="0.7803921568627451" blue="0.34901960784313724" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor> </systemColor>

View File

@@ -50,6 +50,18 @@ class CartListVC: UIViewController {
// MARK: - Tap Handler // MARK: - Tap Handler
@IBAction func checkoutBtnTapped(_ sender: LocalisedElementsButton) { @IBAction func checkoutBtnTapped(_ sender: LocalisedElementsButton) {
if AuthFunc.shareInstance.getUserType() == 1{ // Kids cannot purchase goods
// Utilities.alertWithBtn(title: "", msgBody: "Children cannot purchase this product. Please contact your Guardian.", okBtnStr: "OK", vc: self)
let sb = UIStoryboard(name: K.StoryBoard.customAlerts, bundle: nil)
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.CustomAlerts.alertCustomVC) as! AlertCustomVC
vcPush.contentLabel = "Children cannot purchase this product. Please contact your Guardian."
vcPush.mainTitleText = "Purchase"
vcPush.yesBtnText = "OK"
vcPush.modalPresentationStyle = .overCurrentContext
vcPush.modalTransitionStyle = .crossDissolve
self.present(vcPush, animated: true)
return
}
let sb = UIStoryboard(name: K.StoryBoard.cart, bundle: nil) let sb = UIStoryboard(name: K.StoryBoard.cart, bundle: nil)
let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Cart.cartPaymentOptionsVC) as! CartPaymentOptionsVC let vcPush = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Cart.cartPaymentOptionsVC) as! CartPaymentOptionsVC
vcPush.vm.cartListData = vm.cartListData vcPush.vm.cartListData = vm.cartListData

View File

@@ -17,10 +17,12 @@ class CartPaymentOptionsVC: UIViewController {
@IBOutlet weak var couponCodeTF: TextFieldShadow! @IBOutlet weak var couponCodeTF: TextFieldShadow!
@IBOutlet weak var totalCartPrice: LocalisedElementsLabel! @IBOutlet weak var totalCartPrice: LocalisedElementsLabel!
@IBOutlet weak var scrollView: UIScrollView! @IBOutlet weak var scrollView: UIScrollView!
@IBOutlet weak var applyBtn: UIButton!
@IBOutlet weak var couponAplliedStack: UIStackView! @IBOutlet weak var couponAplliedStack: UIStackView!
@IBOutlet weak var subtotalPrice: LocalisedElementsLabel! @IBOutlet weak var subtotalPrice: LocalisedElementsLabel!
@IBOutlet weak var discountPrice: LocalisedElementsLabel! @IBOutlet weak var discountPrice: LocalisedElementsLabel!
@IBOutlet weak var noCouponFound: LocalisedElementsLabel!
var vm = CartPaymentOptionsVM() var vm = CartPaymentOptionsVM()
@@ -32,10 +34,6 @@ class CartPaymentOptionsVC: UIViewController {
navigationController?.navigationBar.shadowImage = UIImage() navigationController?.navigationBar.shadowImage = UIImage()
} }
override func viewDidLayoutSubviews() {
vm.updateCart()
}
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: animated) navigationController?.setNavigationBarHidden(false, animated: animated)
@@ -73,7 +71,7 @@ class CartPaymentOptionsVC: UIViewController {
@IBAction func confirmBtnTapped(_ sender: LocalisedElementsButton) { @IBAction func confirmBtnTapped(_ sender: LocalisedElementsButton) {
} }
@IBAction func applyBtnTapped(_ sender: LocalisedElementsButton) { @IBAction func applyBtnTapped(_ sender: UIButton) {
if self.couponCodeTF.text == "" { if self.couponCodeTF.text == "" {
Utilities.alertWithBtn(title: "", msgBody: "Please enter coupon code", okBtnStr: "OK", vc: self) Utilities.alertWithBtn(title: "", msgBody: "Please enter coupon code", okBtnStr: "OK", vc: self)
return return
@@ -101,7 +99,7 @@ extension CartPaymentOptionsVC : TableViewSRC{
}else{ }else{
let cell = tableView.dequeueReusableCell(withIdentifier: K.CellIdentifier.Cart.couponCell) as! CouponCell let cell = tableView.dequeueReusableCell(withIdentifier: K.CellIdentifier.Cart.couponCell) as! CouponCell
let data = vm.couponData[indexPath.row] let data = vm.couponData[indexPath.row]
cell.setData(data: data) cell.setData(data: data, isSelected: vm.couponCodeSelected == data.couponCode ? true : false)
return cell return cell
} }
} }
@@ -117,7 +115,9 @@ extension CartPaymentOptionsVC : TableViewSRC{
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if tableView == couponTableView{ if tableView == couponTableView{
let couponCode = vm.couponData[indexPath.row].couponCode let couponCode = vm.couponData[indexPath.row].couponCode
vm.couponCodeSelected = vm.couponData[indexPath.row].couponCode ?? ""
self.couponCodeTF.text = couponCode self.couponCodeTF.text = couponCode
tableView.reloadData()
} }
} }
} }

View File

@@ -74,23 +74,20 @@
<color key="textColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1tR-6T-n7r"> <stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="1tR-6T-n7r">
<rect key="frame" x="0.0" y="80" width="225" height="36"/> <rect key="frame" x="0.0" y="80" width="225" height="36"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Rs.350" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Qsz-SF-4LE" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Rs.350" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Qsz-SF-4LE" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="195" height="36"/> <rect key="frame" x="0.0" y="0.0" width="47.666666666666664" height="36"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="15"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="15"/>
<color key="textColor" name="ImageDarkBlue"/> <color key="textColor" name="ImageDarkBlue"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="74b-BA-x46"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="74b-BA-x46">
<rect key="frame" x="195" y="0.0" width="30" height="36"/> <rect key="frame" x="199" y="0.0" width="26" height="36"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="aeb-P4-qGx"/>
</constraints>
<color key="tintColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="tintColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="TrashCan"/> <state key="normal" title=" " image="TrashCan"/>
<connections> <connections>
<action selector="deleteBtnTapped:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="aGI-m2-zLv"/> <action selector="deleteBtnTapped:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="aGI-m2-zLv"/>
</connections> </connections>

View File

@@ -10,6 +10,7 @@ import UIKit
class CouponCell: UITableViewCell { class CouponCell: UITableViewCell {
@IBOutlet weak var couponText: LocalisedElementsLabel! @IBOutlet weak var couponText: LocalisedElementsLabel!
@IBOutlet weak var couponStack: UIStackView!
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
@@ -22,8 +23,13 @@ class CouponCell: UITableViewCell {
} }
func setData(data : CouponListDM.ResultData){ func setData(data : CouponListDM.ResultData , isSelected : Bool){
// let double = data.discountValue?.toDouble() // let double = data.discountValue?.toDouble()
if isSelected{
couponStack.backgroundColor = #colorLiteral(red: 0.7176470588, green: 0.937254902, blue: 0.9960784314, alpha: 1)
}else{
couponStack.backgroundColor = .white
}
if data.discountType == 1{ // Percentage if data.discountType == 1{ // Percentage
self.couponText.text = (data.discountValue ?? "0.0") + "% Off with Coupon Code: " + (data.couponCode ?? "NA") self.couponText.text = (data.discountValue ?? "0.0") + "% Off with Coupon Code: " + (data.couponCode ?? "NA")

View File

@@ -33,10 +33,8 @@
<constraint firstAttribute="width" constant="20" id="JJr-zG-zms"/> <constraint firstAttribute="width" constant="20" id="JJr-zG-zms"/>
</constraints> </constraints>
</view> </view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MWy-QG-0WV" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MWy-QG-0WV" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="30" y="0.0" width="318" height="46"/> <rect key="frame" x="30" y="0.0" width="318" height="46"/>
<string key="text">Mixed title
Mixed title</string>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="15"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="15"/>
<color key="textColor" name="ImageDarkBlue"/> <color key="textColor" name="ImageDarkBlue"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
@@ -60,7 +58,8 @@ Mixed title</string>
</tableViewCellContentView> </tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/> <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections> <connections>
<outlet property="couponText" destination="MWy-QG-0WV" id="pCG-vU-No4"/> <outlet property="couponStack" destination="6Af-SH-oXG" id="PUK-zm-kBg"/>
<outlet property="couponText" destination="MWy-QG-0WV" id="Bw8-tv-5OT"/>
</connections> </connections>
<point key="canvasLocation" x="166.41221374045801" y="-7.042253521126761"/> <point key="canvasLocation" x="166.41221374045801" y="-7.042253521126761"/>
</tableViewCell> </tableViewCell>

View File

@@ -15,6 +15,7 @@ class CartPaymentOptionsVM{
var couponData = [CouponListDM.ResultData]() var couponData = [CouponListDM.ResultData]()
var isExpanded = false var isExpanded = false
var cartTotalPrice = 0.0 var cartTotalPrice = 0.0
var couponCodeSelected = ""
func initView(){ func initView(){
vc.couponCodeTF.roundCorner() vc.couponCodeTF.roundCorner()
@@ -23,6 +24,8 @@ class CartPaymentOptionsVM{
setupCell() setupCell()
updateCart() updateCart()
getCouponAndOffers() getCouponAndOffers()
self.vc.totalCartPrice.text = K.ConstantString.rupeeSign + " " + cartTotalPrice.toString()
} }
func setupCell(){ func setupCell(){
@@ -44,12 +47,11 @@ class CartPaymentOptionsVM{
} }
func updateCart(){ func updateCart(){
self.vc.cartTableView.reloadData() guard let self = self.vc else{return}
self.vc.cartTableHeight.constant = self.vc.cartTableView.contentSize.height + 100 self.cartTableView.reloadData()
self.vc.cartTableView.layoutIfNeeded() self.cartTableHeight.constant = self.cartTableView.contentSize.height + 1000
self.vc.cartTableHeight.constant = self.vc.cartTableView.contentSize.height self.cartTableView.layoutIfNeeded()
self.cartTableHeight.constant = self.cartTableView.contentSize.height
self.vc.totalCartPrice.text = K.ConstantString.rupeeSign + " " + self.cartTotalPrice.toString()
} }
// MARK: - Get SuperCategory // MARK: - Get SuperCategory
@@ -70,12 +72,13 @@ class CartPaymentOptionsVM{
Error Error
*/ */
Utilities.dismissProgressHUD() Utilities.dismissProgressHUD()
self.vc.noCouponFound.isHidden = false
case 1: case 1:
Utilities.dismissProgressHUD() Utilities.dismissProgressHUD()
guard let data = data.data?.result else{return} guard let data = data.data?.result else{return}
self.couponData = data self.couponData = data
self.vc.noCouponFound.isHidden = true
self.vc.couponTableView.reloadData() self.vc.couponTableView.reloadData()
self.vc.couponTableHeght.constant = self.vc.couponTableView.contentSize.height + 100 self.vc.couponTableHeght.constant = self.vc.couponTableView.contentSize.height + 100
self.vc.couponTableView.layoutIfNeeded() self.vc.couponTableView.layoutIfNeeded()
@@ -100,10 +103,10 @@ class CartPaymentOptionsVM{
} }
func applyCoupon(code : String){ func applyCoupon(code : String){
Utilities.startProgressHUD()
let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()] let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()]
let params : Parameters = ["coupon_code" : "", let params : Parameters = ["coupon_code" : code,
"total_amount" : self.cartTotalPrice] "total_amount" : self.cartTotalPrice]
self.vc.couponAplliedStack.isHidden = true
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Cart.applied_coupon_discount, method: .post,parameters: params,headers: headers) { [weak self](result : Result<BaseResponseModel<CouponApplyDM>, NetworkManager.APIError>) in NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Cart.applied_coupon_discount, method: .post,parameters: params,headers: headers) { [weak self](result : Result<BaseResponseModel<CouponApplyDM>, NetworkManager.APIError>) in
switch result{ switch result{
@@ -118,7 +121,6 @@ class CartPaymentOptionsVM{
Error Error
*/ */
Utilities.dismissProgressHUD() Utilities.dismissProgressHUD()
case 1: case 1:
Utilities.dismissProgressHUD() Utilities.dismissProgressHUD()
guard let data = data.data else{return} guard let data = data.data else{return}
@@ -136,7 +138,7 @@ class CartPaymentOptionsVM{
return return
} }
Utilities.dismissProgressHUD() Utilities.dismissProgressHUD()
Utilities.alertWithBtnCompletion(title: "Error", msgBody: error.localizedDescription, okBtnStr: "Retry?", vc: self.vc) { isDone in Utilities.alertWithBtnCancelCompletion(title: "Error", msgBody: error.localizedDescription, okBtnStr: "Retry?", vc: self.vc) { isDone in
if isDone{ if isDone{
self.applyCoupon(code: self.vc.couponCodeTF.text ?? "") self.applyCoupon(code: self.vc.couponCodeTF.text ?? "")
} }
@@ -144,4 +146,49 @@ class CartPaymentOptionsVM{
} }
} }
} }
func createOrder(){
Utilities.startProgressHUD()
let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken()]
let params : Parameters = ["product_ids" : [],
"addressID" : "String"]
struct URLResp : Codable {
var url : String?
}
NetworkManager.shareInstance.apiRequest(url: APIEndPoints.Cart.create_new_order, method: .post,headers: headers) { [weak self](result : Result<BaseResponseModel<URLResp>, NetworkManager.APIError>) in
switch result{
case .success(let data):
guard let self else{
Utilities.dismissProgressHUD()
return
}
switch data.success{
case 0:
/*
Error
*/
Utilities.dismissProgressHUD()
case 1:
Utilities.dismissProgressHUD()
guard let data = data.data else{return}
print(data.url)
default:
Utilities.dismissProgressHUD()
break
}
case .failure(let error):
guard let self else{
Utilities.dismissProgressHUD()
return
}
Utilities.dismissProgressHUD()
Utilities.alertWithBtnCancelCompletion(title: "Error", msgBody: error.localizedDescription, okBtnStr: "Retry?", vc: self.vc) { isDone in
if isDone{
self.createOrder()
}
}
}
}
}
} }

View File

@@ -54,7 +54,7 @@ open class LLSpinner {
spinnerView = UIActivityIndicatorView(style: style) spinnerView = UIActivityIndicatorView(style: style)
spinnerView!.center = CGPoint(x: backgroundView!.center.x, spinnerView!.center = CGPoint(x: backgroundView!.center.x,
y: backgroundView!.center.y - 10) // Move spinner up y: backgroundView!.center.y - 10) // Move spinner up
spinnerView!.color = UIColor.appColor(.TextDarkBlue) spinnerView!.color = UIColor.appColor(.TextDarkBlue)!
window.addSubview(spinnerView!) window.addSubview(spinnerView!)
spinnerView!.startAnimating() spinnerView!.startAnimating()

View File

@@ -78,6 +78,33 @@ class Utilities{
vc.present(alert, animated: true, completion: nil) vc.present(alert, animated: true, completion: nil)
} }
static func alertWithBtnCancelCompletion(title: String, msgBody: String, okBtnStr: String?, vc: UIViewController, onCompletion: @escaping (Bool) -> Void) {
let alert = UIAlertController(title: title, message: nil, preferredStyle: .alert)
// OK Action
let okAction = UIAlertAction(title: okBtnStr ?? "OK", style: .default, handler: {_ in
onCompletion(true)
})
okAction.setValue(UIColor.appColor(.TextDarkBlue), forKey: "titleTextColor")
alert.addAction(okAction)
// Cancel Action
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: {_ in
onCompletion(false)
})
cancelAction.setValue(UIColor.red, forKey: "titleTextColor")
alert.addAction(cancelAction)
// Custom Message
let messageAttributes = [NSAttributedString.Key.font: FontCustom.shareInstance.customFont(fontName: .Exo2_Medium, size: 15), NSAttributedString.Key.foregroundColor: UIColor.black]
let messageString = NSAttributedString(string: msgBody, attributes: messageAttributes)
alert.setValue(messageString, forKey: "attributedMessage")
// Presenting Alert
vc.present(alert, animated: true, completion: nil)
}
static func reportBug(message: String, line: Int = #line, file: String = #file) { static func reportBug(message: String, line: Int = #line, file: String = #file) {
print("Line: \(line): File \(file): \(message)") print("Line: \(line): File \(file): \(message)")
//TODO: Send report to ferofly //TODO: Send report to ferofly

View File

@@ -25,6 +25,11 @@ struct APIEndPoints {
static let appUrl = "https://apps.apple.com/in/app/woka/id6465305185" static let appUrl = "https://apps.apple.com/in/app/woka/id6465305185"
} }
struct StaticURLs{
// var masilaUrl = "https://content.jwplatform.com/videos/Iygt11AD-Ysj2G4DQ.mp4"
static let masilaUrl = "https://cdn.jwplayer.com/manifests/Iygt11AD.m3u8"
}
struct Auth { struct Auth {
static let check_exist_email = makeURL(path: "check_exist_email") static let check_exist_email = makeURL(path: "check_exist_email")
@@ -115,6 +120,7 @@ struct APIEndPoints {
static let remove_cart = makeURL(path: "remove_cart") static let remove_cart = makeURL(path: "remove_cart")
static let coupon_listing = makeURL(path: "coupon_listing") static let coupon_listing = makeURL(path: "coupon_listing")
static let applied_coupon_discount = makeURL(path: "applied_coupon_discount") static let applied_coupon_discount = makeURL(path: "applied_coupon_discount")
static let create_new_order = makeURL(path: "create_new_order")
} }
// Other endpoint categories... // Other endpoint categories...

View File

@@ -233,10 +233,6 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
</subviews> </subviews>
<constraints>
<constraint firstAttribute="height" constant="95" id="LJb-1R-ZRv"/>
<constraint firstAttribute="width" constant="95" id="oeO-z9-81t"/>
</constraints>
</stackView> </stackView>
</subviews> </subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -445,6 +441,8 @@
<constraint firstItem="ppi-HI-rj1" firstAttribute="trailing" secondItem="vdl-cu-G32" secondAttribute="trailing" id="DQI-oo-bqb"/> <constraint firstItem="ppi-HI-rj1" firstAttribute="trailing" secondItem="vdl-cu-G32" secondAttribute="trailing" id="DQI-oo-bqb"/>
<constraint firstItem="ppi-HI-rj1" firstAttribute="leading" secondItem="vdl-cu-G32" secondAttribute="leading" id="DnV-cr-qUh"/> <constraint firstItem="ppi-HI-rj1" firstAttribute="leading" secondItem="vdl-cu-G32" secondAttribute="leading" id="DnV-cr-qUh"/>
<constraint firstItem="yuF-d6-Tag" firstAttribute="trailing" secondItem="xgH-t8-LiX" secondAttribute="trailing" constant="-5" id="DrT-s8-9xs"/> <constraint firstItem="yuF-d6-Tag" firstAttribute="trailing" secondItem="xgH-t8-LiX" secondAttribute="trailing" constant="-5" id="DrT-s8-9xs"/>
<constraint firstItem="qS4-gX-qTX" firstAttribute="width" secondItem="UEh-jl-IQp" secondAttribute="height" multiplier="95:852" id="G3B-ar-U0R"/>
<constraint firstItem="qS4-gX-qTX" firstAttribute="height" secondItem="UEh-jl-IQp" secondAttribute="height" multiplier="0.111502" id="JKD-lf-ovJ"/>
<constraint firstAttribute="bottom" secondItem="xgH-t8-LiX" secondAttribute="bottom" id="KLp-zL-JIG"/> <constraint firstAttribute="bottom" secondItem="xgH-t8-LiX" secondAttribute="bottom" id="KLp-zL-JIG"/>
<constraint firstItem="sf9-me-n7i" firstAttribute="top" secondItem="vdl-cu-G32" secondAttribute="top" constant="5" id="MnT-8w-p9T"/> <constraint firstItem="sf9-me-n7i" firstAttribute="top" secondItem="vdl-cu-G32" secondAttribute="top" constant="5" id="MnT-8w-p9T"/>
<constraint firstItem="U1W-OZ-7vR" firstAttribute="centerX" secondItem="vdl-cu-G32" secondAttribute="centerX" id="NqK-Cw-qNu"/> <constraint firstItem="U1W-OZ-7vR" firstAttribute="centerX" secondItem="vdl-cu-G32" secondAttribute="centerX" id="NqK-Cw-qNu"/>
@@ -547,19 +545,72 @@
</constraints> </constraints>
</view> </view>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="U0W-18-4oe"> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="U0W-18-4oe">
<rect key="frame" x="0.0" y="45" width="393" height="204"/> <rect key="frame" x="0.0" y="45" width="393" height="224"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Coming Soon on WOKA" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="D2p-c5-usH" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Coming Soon on WOKA" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="D2p-c5-usH" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="10" y="10" width="373" height="4"/> <rect key="frame" x="10" y="10" width="373" height="24"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="20"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="20"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UKc-92-GPa"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UKc-92-GPa">
<rect key="frame" x="10" y="24" width="373" height="180"/> <rect key="frame" x="10" y="44" width="373" height="180"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="MasilaComingSoon" translatesAutoresizingMaskIntoConstraints="NO" id="Kj9-jH-Y88">
<rect key="frame" x="7" y="7" width="359" height="140"/>
<constraints>
<constraint firstAttribute="height" constant="140" id="4Ed-zt-52J"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="5"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="11Q-tE-Z7c" customClass="LocalisedElementsButton" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="126.66666666666666" y="57" width="120" height="40"/>
<color key="backgroundColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="120" id="TY4-vs-ytg"/>
<constraint firstAttribute="height" constant="40" id="kyk-fQ-qPF">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="20"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</constraint>
</constraints>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="14"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="PLAY TRAILER"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="20"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="playTrailerBtnTapped:" destination="Faj-VN-SMZ" eventType="touchUpInside" id="dJK-SJ-dR8"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="MASILA" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="biB-gs-Rgq">
<rect key="frame" x="7" y="152" width="359" height="21.666666666666657"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" name="TextDarkBlue"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints> <constraints>
<constraint firstItem="11Q-tE-Z7c" firstAttribute="centerX" secondItem="Kj9-jH-Y88" secondAttribute="centerX" id="3LC-EL-li2"/>
<constraint firstItem="11Q-tE-Z7c" firstAttribute="centerY" secondItem="Kj9-jH-Y88" secondAttribute="centerY" id="4Vf-VK-mD5"/>
<constraint firstItem="Kj9-jH-Y88" firstAttribute="leading" secondItem="UKc-92-GPa" secondAttribute="leading" constant="7" id="FV9-UJ-ErQ"/>
<constraint firstItem="Kj9-jH-Y88" firstAttribute="top" secondItem="UKc-92-GPa" secondAttribute="top" constant="7" id="KV3-vj-5KC"/>
<constraint firstItem="biB-gs-Rgq" firstAttribute="top" secondItem="Kj9-jH-Y88" secondAttribute="bottom" constant="5" id="OPP-rh-ZEk"/>
<constraint firstAttribute="trailing" secondItem="Kj9-jH-Y88" secondAttribute="trailing" constant="7" id="a6A-Hm-5qE"/>
<constraint firstAttribute="height" constant="180" id="gwN-aD-t1t"/> <constraint firstAttribute="height" constant="180" id="gwN-aD-t1t"/>
<constraint firstAttribute="trailing" secondItem="biB-gs-Rgq" secondAttribute="trailing" constant="7" id="tv9-3n-THM"/>
<constraint firstItem="biB-gs-Rgq" firstAttribute="leading" secondItem="UKc-92-GPa" secondAttribute="leading" constant="7" id="vJp-jM-XK6"/>
</constraints> </constraints>
<userDefinedRuntimeAttributes> <userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
@@ -571,7 +622,7 @@
<edgeInsets key="layoutMargins" top="10" left="10" bottom="0.0" right="10"/> <edgeInsets key="layoutMargins" top="10" left="10" bottom="0.0" right="10"/>
</stackView> </stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="Qcq-yj-AzB"> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="Qcq-yj-AzB">
<rect key="frame" x="0.0" y="249" width="393" height="209"/> <rect key="frame" x="0.0" y="269" width="393" height="209"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="BLOGS" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lW0-W4-2hl" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="BLOGS" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lW0-W4-2hl" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="10" y="10" width="373" height="24"/> <rect key="frame" x="10" y="10" width="373" height="24"/>
@@ -597,7 +648,7 @@
<edgeInsets key="layoutMargins" top="10" left="10" bottom="0.0" right="10"/> <edgeInsets key="layoutMargins" top="10" left="10" bottom="0.0" right="10"/>
</stackView> </stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="pJu-fq-XmG"> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="pJu-fq-XmG">
<rect key="frame" x="0.0" y="458" width="393" height="286"/> <rect key="frame" x="0.0" y="478" width="393" height="266"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="WOKA Songs" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FSJ-QT-rAW" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="WOKA Songs" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FSJ-QT-rAW" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="10" y="10" width="373" height="24"/> <rect key="frame" x="10" y="10" width="373" height="24"/>
@@ -606,7 +657,7 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="31Z-fz-1ec"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="31Z-fz-1ec">
<rect key="frame" x="10" y="44" width="373" height="242"/> <rect key="frame" x="10" y="44" width="373" height="222"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tableView> </tableView>
</subviews> </subviews>
@@ -636,7 +687,7 @@
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="kvq-vw-eSu" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="kvq-vw-eSu" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="2195" y="-872"/> <point key="canvasLocation" x="2194.6564885496182" y="-872.53521126760563"/>
</scene> </scene>
<!--User NotificationVC--> <!--User NotificationVC-->
<scene sceneID="VA9-b8-0MB"> <scene sceneID="VA9-b8-0MB">
@@ -1092,6 +1143,7 @@
<image name="LiveTV" width="172" height="122.66666412353516"/> <image name="LiveTV" width="172" height="122.66666412353516"/>
<image name="LiveTVBaloon" width="135" height="135"/> <image name="LiveTVBaloon" width="135" height="135"/>
<image name="LiveTVBorder" width="79.333335876464844" height="67"/> <image name="LiveTVBorder" width="79.333335876464844" height="67"/>
<image name="MasilaComingSoon" width="200" height="100"/>
<image name="Moon" width="144.66667175292969" height="144.66667175292969"/> <image name="Moon" width="144.66667175292969" height="144.66667175292969"/>
<image name="MoreBG" width="428" height="926"/> <image name="MoreBG" width="428" height="926"/>
<image name="Notification" width="44" height="44"/> <image name="Notification" width="44" height="44"/>
@@ -1108,10 +1160,10 @@
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor> </systemColor>
<systemColor name="systemBrownColor"> <systemColor name="systemBrownColor">
<color red="0.63529411759999999" green="0.51764705879999995" blue="0.36862745099999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.63529411764705879" green="0.51764705882352946" blue="0.36862745098039218" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor> </systemColor>
<systemColor name="systemGreenColor"> <systemColor name="systemGreenColor">
<color red="0.20392156859999999" green="0.78039215689999997" blue="0.34901960780000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.20392156862745098" green="0.7803921568627451" blue="0.34901960784313724" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor> </systemColor>
</resources> </resources>
</document> </document>

View File

@@ -33,6 +33,10 @@ class MoreVC: UIViewController {
vm.player?.pause() vm.player?.pause()
} }
@IBAction func playTrailerBtnTapped(_ sender: LocalisedElementsButton) {
let item = JwPlayerItemCreate(url: APIEndPoints.StaticURLs.masilaUrl, poster: nil, titles: "Masila")
JWPlayerManager.shared.presentPlayer(from: self, playerItems: [item], contentType: .trailer)
}
} }
// MARK: - TableView DataSource , Delegates // MARK: - TableView DataSource , Delegates

View File

@@ -109,7 +109,7 @@ class PlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate {
override func jwplayer(_ player: any JWPlayer, didFinishLoadingWithTime loadTime: TimeInterval) { override func jwplayer(_ player: any JWPlayer, didFinishLoadingWithTime loadTime: TimeInterval) {
super.jwplayer(player, didFinishLoadingWithTime: loadTime) super.jwplayer(player, didFinishLoadingWithTime: loadTime)
print("LoadTime", loadTime) print("LoadTime", loadTime)
if let videoIndex{ if let videoIndex , contentType == .webSeries{
player.nextUpPlaylistIndex = videoIndex player.nextUpPlaylistIndex = videoIndex
player.next() player.next()
self.videoIndex = nil self.videoIndex = nil
@@ -129,7 +129,8 @@ class PlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate {
// player.next() // player.next()
} }
case .trailer: case .trailer:
player.play() break
// player.play()
case .continueWatching,.audioBooks, .games: case .continueWatching,.audioBooks, .games:
player.seek(to: 0) player.seek(to: 0)
player.play() player.play()

View File

@@ -12,7 +12,8 @@ class RadioVC: UIViewController, WKNavigationDelegate {
@IBOutlet var webView: WKWebView! @IBOutlet var webView: WKWebView!
var url = "https://wokaland.com/admin/api/woka_fm" var url = "https://wokaland.com/admin/api/woka_fm"
// var url = "https://s4.voscast.com:9161/stream" // var url = "https://s4.voscast.com:9161/stream" provide on 18th july
// var url = "https://planetcast.radiowalla.in/radio.mp3" //url from 24th july
@IBOutlet weak var backView: UIView! @IBOutlet weak var backView: UIView!
@@ -63,7 +64,6 @@ class RadioVC: UIViewController, WKNavigationDelegate {
self.unloadWebView() self.unloadWebView()
} }
} }
func unloadWebView() { func unloadWebView() {
// Cancel any ongoing navigation // Cancel any ongoing navigation

View File

@@ -125,10 +125,7 @@ class MoreVM{
Utilities.dismissProgressHUD() Utilities.dismissProgressHUD()
guard let data = data.data?.blogs else{return} guard let data = data.data?.blogs else{return}
blogData = data blogData = data
blogData.append(contentsOf: data)
vc.blogsCollectionView.reloadData() vc.blogsCollectionView.reloadData()
//Fetched Blogs
break
default: default:
break break
} }

View File

@@ -73,7 +73,7 @@ class WebSeriesVC: UIViewController {
// MARK: - Tap Handler // MARK: - Tap Handler
@IBAction func playTrailer(_ sender: LocalisedElementsButton) { @IBAction func playTrailer(_ sender: LocalisedElementsButton) {
let item = JwPlayerItemCreate(url: vm.masilaUrl, poster: nil, titles: "Masila") let item = JwPlayerItemCreate(url: APIEndPoints.StaticURLs.masilaUrl, poster: nil, titles: "Masila")
JWPlayerManager.shared.presentPlayer(from: self, playerItems: [item], contentType: .trailer) JWPlayerManager.shared.presentPlayer(from: self, playerItems: [item], contentType: .trailer)
} }

View File

@@ -115,6 +115,11 @@ class JWPlayerManager {
.playlist(items: items) .playlist(items: items)
.autostart(true) .autostart(true)
.build() .build()
case .trailer:
finalConfig = try JWPlayerConfigurationBuilder()
.playlist(items: items)
.autostart(true)
.build()
default: default:
// Create a JWPlayerConfiguration with the playlist // Create a JWPlayerConfiguration with the playlist
finalConfig = try JWPlayerConfigurationBuilder() finalConfig = try JWPlayerConfigurationBuilder()

View File

@@ -20,7 +20,8 @@ class WebSeriesVM{
var dataSource = [String]() var dataSource = [String]()
//Static url for masila //Static url for masila
var masilaUrl = "https://content.jwplatform.com/videos/Iygt11AD-Ysj2G4DQ.mp4" //// var masilaUrl = "https://content.jwplatform.com/videos/Iygt11AD-Ysj2G4DQ.mp4"
// var masilaUrl = "https://cdn.jwplayer.com/manifests/Iygt11AD.m3u8"
var pageNo = 0 var pageNo = 0
var stopFetch = false var stopFetch = false