Преглед изворни кода

detail sertifikat dan hide notifikasi

Hendi пре 2 година
родитељ
комит
0ebf9acbb3

BIN
Sirani.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate


+ 2 - 2
Sirani/ApiServices/SiraniApiServices.swift

@@ -146,10 +146,10 @@ class SiraniApiServices {
         
         let headers: HTTPHeaders = ["Accept" : "Application/json; charset=utf-8"]
         let body: Parameters = [
-            "kode" : code
+            "lic_id" : code
         ]
         
-        return AF.request(METHOD_GET_RESULT_QR_CODE, method: .post, parameters: body, encoding: URLEncoding.default, headers: headers)
+        return AF.request(METHOD_GET_RESULT_QR_CODE_NEW, method: .post, parameters: body, encoding: URLEncoding.default, headers: headers)
     }
     
     

+ 3 - 0
Sirani/ApiServices/UriConstants.swift

@@ -122,6 +122,9 @@ let METHOD_GET_SLIDE_IMAGE_NEW = "\(HOST_API_NEW)\(API)\(VERSION)Flashslide"
 let METHOD_GET_FAQ_CATEGORY_NEW = "\(HOST_API_NEW)\(API)\(VERSION)faq/category"
 let METHOD_GET_FAQ_CONTENT_NEW = "\(HOST_API_NEW)\(API)\(VERSION)faq/content"
 
+// QR CODE
+let METHOD_GET_RESULT_QR_CODE_NEW = "\(HOST_API_NEW)\(API)\(VERSION)Qrcode"
+
 // INFORMASI SERTIFIKAT
 let URI_PERSYARATAN_KEWAJIBAN = "https://sertifikasi.postel.go.id/sertifikasi/informasi-sertifikasi/persyaratan-dan-kewajiban?plain=true"
 let URI_PROSEDUR_SERTIFIKASI = "https://sertifikasi.postel.go.id/sertifikasi/informasi-sertifikasi/prosedur-sertifikasi?plain=true"

+ 7 - 7
Sirani/Base.lproj/Main.storyboard

@@ -16,7 +16,7 @@
                     <tabBar key="tabBar" contentMode="scaleAspectFit" insetsLayoutMarginsFromSafeArea="NO" translucent="NO" id="Q8C-vV-Ukc">
                         <rect key="frame" x="0.0" y="0.0" width="414" height="49"/>
                         <autoresizingMask key="autoresizingMask"/>
-                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        <color key="backgroundColor" red="0.1023859456" green="0.26498627660000001" blue="0.53728127479999999" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
                         <color key="barTintColor" red="0.1056468859" green="0.26498940589999997" blue="0.5374458432" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
                         <color key="selectedImageTintColor" red="0.97933279419999997" green="0.97807776489999998" blue="1" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
                         <userDefinedRuntimeAttributes>
@@ -133,7 +133,7 @@
                         <inset key="imageInsets" minX="0.0" minY="2" maxX="0.0" maxY="2"/>
                     </tabBarItem>
                     <connections>
-                        <segue destination="wLH-bE-PwM" kind="show" identifier="QrScannerSegueId" id="lWp-qC-755"/>
+                        <segue destination="wLH-bE-PwM" kind="presentation" identifier="QrScannerSegueId" modalPresentationStyle="fullScreen" id="lWp-qC-755"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="vDO-4T-xDz" userLabel="First Responder" sceneMemberID="firstResponder"/>
@@ -1001,7 +1001,7 @@
                                         <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                         <nil key="highlightedColor"/>
                                     </label>
-                                    <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="M6k-pX-njt" userLabel="NotifContainer">
+                                    <view alpha="0.0" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="M6k-pX-njt" userLabel="NotifContainer">
                                         <rect key="frame" x="331" y="37" width="36" height="28"/>
                                         <subviews>
                                             <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic-notif" translatesAutoresizingMaskIntoConstraints="NO" id="yR5-4P-Uwn">
@@ -2100,7 +2100,7 @@
                         <subviews>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Ditjen SDPPI Kominfo @ 2023" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ewi-4X-Bit" userLabel="NotificationListFooter">
                                 <rect key="frame" x="0.0" y="617" width="375" height="30"/>
-                                <color key="backgroundColor" red="0.1056468859" green="0.26498940589999997" blue="0.5374458432" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
+                                <color key="backgroundColor" red="0.1023859456" green="0.26498627660000001" blue="0.53728127479999999" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="30" id="vjL-P8-aOw"/>
                                 </constraints>
@@ -2839,7 +2839,7 @@
                         <outlet property="progressLoading" destination="bBt-re-q5B" id="tCb-0q-YZV"/>
                         <segue destination="woP-pQ-9vy" kind="unwind" identifier="unwindToHome" unwindAction="unwindToHomeWithSegue:" id="jS5-YC-Rsp"/>
                         <segue destination="9eh-5g-W3M" kind="show" identifier="daftarSertifikatSearchSegueId" id="y0g-cv-RmB"/>
-                        <segue destination="wLH-bE-PwM" kind="show" identifier="sertifikatDetailSegueId" id="BLS-DN-77B"/>
+                        <segue destination="wLH-bE-PwM" kind="presentation" identifier="sertifikatDetailSegueId" modalPresentationStyle="fullScreen" id="BLS-DN-77B"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="6p5-TE-wbs" userLabel="First Responder" sceneMemberID="firstResponder"/>
@@ -6349,7 +6349,7 @@
                         <outlet property="layoutNoData" destination="fJd-wW-GkA" id="CrG-iT-RwR"/>
                         <outlet property="progressLoading" destination="eNY-uD-MJd" id="cu4-e1-eE5"/>
                         <segue destination="V6A-1e-Hw1" kind="presentation" identifier="searchSertifikatNewSegueId" modalPresentationStyle="fullScreen" id="Ygg-sY-0vd"/>
-                        <segue destination="wLH-bE-PwM" kind="show" identifier="sertifikatNewDetailSegueId" id="xge-6s-p6K"/>
+                        <segue destination="wLH-bE-PwM" kind="presentation" identifier="sertifikatNewDetailSegueId" modalPresentationStyle="fullScreen" id="xge-6s-p6K"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="8Yi-Ta-jpJ" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
@@ -25608,7 +25608,7 @@
     <inferredMetricsTieBreakers>
         <segue reference="pgo-8x-SnY"/>
         <segue reference="6xD-yH-Auw"/>
-        <segue reference="VWb-QP-6FN"/>
+        <segue reference="lWp-qC-755"/>
     </inferredMetricsTieBreakers>
     <resources>
         <image name="calendar.badge.clock" catalog="system" width="128" height="109"/>

+ 12 - 3
Sirani/View/ScanQR/Scanner/QRScannerVC.swift

@@ -80,7 +80,7 @@ class QRScannerVC: UIViewController {
         AppUtility.lockOrientation(.portrait)
         
         if let kode = self.kode {
-            onQrDataAvailable(decodedString: "https://sertifikasi.postel.go.id/valid?section=e5b641c4ca613f3c9bbef51591869276S3r \(kode) S3ra5ee163d60011bd373cb43db6d3b6f74")
+            onQrDataAvailable(decodedString: "\(kode)")
             dataCaptured = true
         }
         
@@ -304,6 +304,10 @@ extension QRScannerVC: AVCaptureMetadataOutputObjectsDelegate {
     func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) {
         
         if !dataCaptured {
+            print("TEST SCAN")
+            print(metadataObjects.count)
+            print(metadataObjects)
+            
             // Check if the metadataObjects array is not nil and it contains at least one object.
             if metadataObjects.count == 0 {
                 onQrDataEmpty()
@@ -320,8 +324,13 @@ extension QRScannerVC: AVCaptureMetadataOutputObjectsDelegate {
                 qrCodeFrameView?.frame = barCodeObject!.bounds
                 
                 if metadataObj.stringValue != nil {
-                    onQrDataAvailable(decodedString: metadataObj.stringValue!)
-                    dataCaptured = true
+                    if let url = URL(string: metadataObj.stringValue ?? "") {                        
+                        let lic_id = url.lastPathComponent
+                        
+                        onQrDataAvailable(decodedString: lic_id)
+                        dataCaptured = true
+                    }
+                    
                 }
             }
         }

+ 1 - 1
Sirani/View/Sertifikat/SertifikatPublic/SertifikatPublicVC.swift

@@ -154,7 +154,7 @@ extension SertifikatPublicVC: SertifikatViewDelegate {
 extension SertifikatPublicVC: UITableViewDelegate, UITableViewDataSource, UIScrollViewDelegate, SertifikatNewCellDelegate {
 
     func openSertifikatDetail(data: CertificateData?) {
-        self.kode = data?.apl_id
+        self.kode = data?.lic_id
         performSegue(withIdentifier: "sertifikatPublicDetailSegueId", sender: self)
     }