Proyectos de Subversion Iphone Microlearning - Inconcert

Rev

Rev 11 | Rev 18 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 11 Rev 17
Línea 25... Línea 25...
25
    @State private var keyboardHeight : CGFloat = 0
25
    @State private var keyboardHeight : CGFloat = 0
Línea 26... Línea 26...
26
    
26
    
Línea 27... Línea 27...
27
    private var appData = AppData.sharedInstance
27
    private var appData = AppData.sharedInstance
28
 
28
 
29
    
29
    
30
    @State private var email: String = "" {
30
    @State private var email: String = "efrain.yanez@leaderslinked.com" {
31
        didSet {
31
        didSet {
32
            if email.count > 250 {
32
            if email.count > 250 {
Línea 39... Línea 39...
39
    @State private var isProcessing : Bool = false
39
    @State private var isProcessing : Bool = false
Línea 40... Línea 40...
40
    
40
    
41
    @State private var isValidEmail : Bool = true
41
    @State private var isValidEmail : Bool = true
Línea 42... Línea 42...
42
    @State private var isEditingEmail : Bool = false
42
    @State private var isEditingEmail : Bool = false
43
    
43
    
44
    @State private var password: String = ""  {
44
    @State private var password: String = "Cesa2020$"  {
45
        didSet {
45
        didSet {
46
            if password.count > 25 {
46
            if password.count > 25 {
47
                password = String(password.prefix(25))
47
                password = String(password.prefix(25))
Línea 210... Línea 210...
210
        //print(" aes  = \(appData.deviceAes) " )
210
        //print(" aes  = \(appData.deviceAes) " )
211
        //print(" email  = \(self.email) " )
211
        //print(" email  = \(self.email) " )
212
        //print(" password  = \(self.password) " )
212
        //print(" password  = \(self.password) " )
Línea 213... Línea 213...
213
        
213
        
214
 
214
 
Línea 215... Línea 215...
215
        let syncDao = SyncDao.sharedInstance
215
        let syncDao = SyncDao()
Línea 216... Línea 216...
216
        if appData.deviceAes.isEmpty  {
216
        if appData.deviceAes.isEmpty  {
217
            
217
            
218
            let syncRecord = syncDao.selectOneByType(type: Constants.SYNC_ADAPTER_TYPE_DEVICE)
218
            let syncRecord = syncDao.selectOneByType(type: Constants.SYNC_ADAPTER_TYPE_DEVICE)
219
                    
219
                    
220
            if syncRecord.id > 0 {
220
            if syncRecord.id > 0 {
221
                let syncAdapter = SyncAdapter()
221
                let syncAdapter = SyncAdapter()
Línea 222... Línea 222...
222
                syncAdapter.sync {
222
                syncAdapter.sync(isForeground: true){
Línea 254... Línea 254...
254
 
254
 
255
        //print(" email encrypted = \(emailEncrypted) " )
255
        //print(" email encrypted = \(emailEncrypted) " )
Línea 256... Línea 256...
256
        //print(" password encrypted = \(passwordEncrypted) " )
256
        //print(" password encrypted = \(passwordEncrypted) " )
257
 
257
 
-
 
258
        let parameters = [
258
        let parameters = [
259
            Constants.POST_SIGNIN_FIELD_APPLICATION_ID: "\(Config.APPLICATION_ID)",
259
            Constants.POST_SIGNIN_FIELD_APPLICATION_ID: "\(Constants.GLOBAL_APPLICATION_ID)",
260
            Constants.POST_SIGNIN_FIELD_VARIANT_ID: "\(Config.VARIANT_ID)",
260
            Constants.POST_SYNC_FIELD_DEVICE_UUID: device_uuid,
261
            Constants.POST_SYNC_FIELD_DEVICE_UUID: device_uuid,
261
            Constants.POST_SIGNIN_FIELD_EMAIL: emailEncrypted,
262
            Constants.POST_SIGNIN_FIELD_EMAIL: emailEncrypted,
262
            Constants.POST_SIGNIN_FIELD_PASSWORD: passwordEncrypted,
263
            Constants.POST_SIGNIN_FIELD_PASSWORD: passwordEncrypted,
Línea 306... Línea 307...
306
                            var userLog = UserLogModel()
307
                            var userLog = UserLogModel()
307
                            userLog.userUuid = appData.userUuid
308
                            userLog.userUuid = appData.userUuid
308
                            userLog.activity = Constants.USER_LOG_ACTIVITY_SIGNIN
309
                            userLog.activity = Constants.USER_LOG_ACTIVITY_SIGNIN
309
                            userLog.addedOn = dateOn
310
                            userLog.addedOn = dateOn
Línea 310... Línea 311...
310
                            
311
                            
311
                            let userLogDao = UserLogDao.sharedInstance
312
                            let userLogDao = UserLogDao()
Línea 312... Línea 313...
312
                            userLogDao.insert(record: userLog)
313
                            userLogDao.insert(record: userLog)
Línea 313... Línea 314...
313
                            
314
                            
Línea 486... Línea 487...
486
    
487
    
487
    var body : some View {
488
    var body : some View {
488
        //Inicio Label Email
489
        //Inicio Label Email
489
        HStack {
490
        HStack {
490
            Text(Config.LANG_SIGNIN_TITLE_EMAIL_FIELD)
491
            Text(Config.LANG_SIGNIN_TITLE_EMAIL_FIELD)
491
            .font(Font.custom(Config  .FONT_NAME_REGULAR, size: 11))
492
            .font(Font.custom(Config  .FONT_NAME_REGULAR, size: Config.FONT_SIZE_TEXTFIELD_LABEL))
492
            .foregroundColor(Color("color_textview_foreground"))
493
            .foregroundColor(Color("color_textview_foreground"))
493
            Spacer()
494
            Spacer()
494
        }
495
        }
495
        .padding(.leading, 16)
496
        .padding(.leading, 16)
Línea 530... Línea 531...
530
                        self.isEditingEmail = false
531
                        self.isEditingEmail = false
531
                        self.isValidEmail = Validator.checkEmail(email: self.email)
532
                        self.isValidEmail = Validator.checkEmail(email: self.email)
532
                    }
533
                    }
533
                )
534
                )
Línea 534... Línea 535...
534
            
535
            
535
                .font(Font.custom(Config.FONT_NAME_REGULAR, size: 12))
536
                .font(Font.custom(Config.FONT_NAME_REGULAR, size: Config.FONT_SIZE_TEXTFIELD))
536
                .textFieldStyle(PlainTextFieldStyle())
537
                .textFieldStyle(PlainTextFieldStyle())
537
                .frame(height: 32)
538
                .frame(height: 32)
538
                .keyboardType(.emailAddress)
539
                .keyboardType(.emailAddress)
539
                .autocapitalization(.none)
540
                .autocapitalization(.none)
Línea 559... Línea 560...
559
            HStack {
560
            HStack {
560
                Spacer()
561
                Spacer()
Línea 561... Línea 562...
561
             
562
             
562
                Text(Config.LANG_SIGNIN_ERROR_EMAIL_FIELD)
563
                Text(Config.LANG_SIGNIN_ERROR_EMAIL_FIELD)
563
                .foregroundColor(.red)
564
                .foregroundColor(.red)
Línea 564... Línea 565...
564
                    .font(Font.custom(Config.FONT_NAME_REGULAR, size: 11))
565
                .font(Font.custom(Config.FONT_NAME_REGULAR, size: Config.FONT_SIZE_TEXTFIELD_ERROR))
565
             
566
             
566
            }
567
            }
567
            .padding(.top, 5)
568
            .padding(.top, 5)
Línea 583... Línea 584...
583
 
584
 
584
    var body : some View {
585
    var body : some View {
585
        //Inicio Label Password
586
        //Inicio Label Password
586
        HStack {
587
        HStack {
587
            Text(Config.LANG_SIGNIN_TITLE_PASSWORD_FIELD)
588
            Text(Config.LANG_SIGNIN_TITLE_PASSWORD_FIELD)
588
            .font(Font.custom(Config  .FONT_NAME_REGULAR, size: 11))
589
                .font(Font.custom(Config  .FONT_NAME_REGULAR, size: Config.FONT_SIZE_TEXTFIELD_LABEL))
589
            .foregroundColor(Color("color_textview_foreground"))
590
            .foregroundColor(Color("color_textview_foreground"))
590
            Spacer()
591
            Spacer()
591
        }
592
        }
592
        .padding(.leading, 16)
593
        .padding(.leading, 16)
Línea 619... Línea 620...
619
                        }, onCommit: {
620
                        }, onCommit: {
620
                            self.isEditingPassword = false
621
                            self.isEditingPassword = false
621
                            self.isValidPassword = Validator.checkPassword(password:  self.password)
622
                            self.isValidPassword = Validator.checkPassword(password:  self.password)
622
                        }
623
                        }
623
                    )
624
                    )
624
                    .font(Font.custom(Config.FONT_NAME_REGULAR, size: 12))
625
                    .font(Font.custom(Config.FONT_NAME_REGULAR, size: Config.FONT_SIZE_TEXTFIELD))
625
                    .textFieldStyle(PlainTextFieldStyle())
626
                    .textFieldStyle(PlainTextFieldStyle())
626
                    .frame(height: 32)
627
                    .frame(height: 32)
627
                        .keyboardType(.default)
628
                        .keyboardType(.default)
628
                    .autocapitalization(.none)
629
                    .autocapitalization(.none)
629
                    /*
630
                    /*
Línea 648... Línea 649...
648
                        self.isValidPassword = Validator.checkPassword(password: self.password)
649
                        self.isValidPassword = Validator.checkPassword(password: self.password)
649
                    })
650
                    })
650
                    .onTapGesture {
651
                    .onTapGesture {
651
                        self.isEditingPassword = true
652
                        self.isEditingPassword = true
652
                    }
653
                    }
653
                    .font(Font.custom(Config.FONT_NAME_REGULAR, size: 11))
654
                    .font(Font.custom(Config.FONT_NAME_REGULAR, size: Config.FONT_SIZE_TEXTFIELD))
654
                    .textFieldStyle(PlainTextFieldStyle())
655
                    .textFieldStyle(PlainTextFieldStyle())
655
                    .frame(height: 32)
656
                    .frame(height: 32)
656
                        .keyboardType(.default)
657
                        .keyboardType(.default)
657
                    .autocapitalization(.none)
658
                    .autocapitalization(.none)
658
                    /*
659
                    /*
Línea 691... Línea 692...
691
            HStack {
692
            HStack {
692
                Spacer()
693
                Spacer()
Línea 693... Línea 694...
693
             
694
             
694
                Text(Config.LANG_SIGNIN_ERROR_PASSWORD_FIELD)
695
                Text(Config.LANG_SIGNIN_ERROR_PASSWORD_FIELD)
695
                .foregroundColor(.red)
696
                .foregroundColor(.red)
Línea 696... Línea 697...
696
                    .font(Font.custom(Config.FONT_NAME_REGULAR, size: 11))
697
                .font(Font.custom(Config.FONT_NAME_REGULAR, size: Config.FONT_SIZE_TEXTFIELD_ERROR))
697
             
698
             
698
            }
699
            }
699
            .padding(.top, 5)
700
            .padding(.top, 5)