Commit 9f523b7dc3921f95849b29dfe68bbce8b2f09681

Authored by “张旭”
1 parent d7576d32

检测没安装微信 , 不显示微信登录按钮

metaCode.xcodeproj/project.pbxproj
@@ -2632,7 +2632,7 @@ @@ -2632,7 +2632,7 @@
2632 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements; 2632 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements;
2633 CODE_SIGN_IDENTITY = "Apple Development"; 2633 CODE_SIGN_IDENTITY = "Apple Development";
2634 CODE_SIGN_STYLE = Automatic; 2634 CODE_SIGN_STYLE = Automatic;
2635 - CURRENT_PROJECT_VERSION = 1.1.2.24.08.24.15; 2635 + CURRENT_PROJECT_VERSION = 1.1.2.24.08.26.11;
2636 DEBUG_INFORMATION_FORMAT = dwarf; 2636 DEBUG_INFORMATION_FORMAT = dwarf;
2637 DEVELOPMENT_TEAM = 94X49GG3ZW; 2637 DEVELOPMENT_TEAM = 94X49GG3ZW;
2638 ENABLE_BITCODE = NO; 2638 ENABLE_BITCODE = NO;
@@ -2888,7 +2888,7 @@ @@ -2888,7 +2888,7 @@
2888 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements; 2888 CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements;
2889 CODE_SIGN_IDENTITY = "Apple Development"; 2889 CODE_SIGN_IDENTITY = "Apple Development";
2890 CODE_SIGN_STYLE = Automatic; 2890 CODE_SIGN_STYLE = Automatic;
2891 - CURRENT_PROJECT_VERSION = 1.1.2.24.08.24.15; 2891 + CURRENT_PROJECT_VERSION = 1.1.2.24.08.26.11;
2892 DEVELOPMENT_TEAM = 94X49GG3ZW; 2892 DEVELOPMENT_TEAM = 94X49GG3ZW;
2893 ENABLE_BITCODE = NO; 2893 ENABLE_BITCODE = NO;
2894 ENABLE_MODULE_VERIFIER = NO; 2894 ENABLE_MODULE_VERIFIER = NO;
metaCode/Classes/Main/LoginPage/Controller/CNLiveLoginViewController.swift
@@ -11,6 +11,7 @@ import SnapKit @@ -11,6 +11,7 @@ import SnapKit
11 import APButton 11 import APButton
12 import CNLiveShareToolKit 12 import CNLiveShareToolKit
13 import AuthenticationServices 13 import AuthenticationServices
  14 +import CNLivePayCostModule
14 15
15 class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate { 16 class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate {
16 17
@@ -375,7 +376,10 @@ class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate { @@ -375,7 +376,10 @@ class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate {
375 make.right.equalTo(-40) 376 make.right.equalTo(-40)
376 make.height.equalTo(40) 377 make.height.equalTo(40)
377 } 378 }
378 - view.addSubview(wxButton) 379 + if WXApi.isWXAppInstalled(){
  380 + view.addSubview(wxButton)
  381 + }else{
  382 + }
379 383
380 if #available(iOS 13.0, *) { 384 if #available(iOS 13.0, *) {
381 let appleButton = ASAuthorizationAppleIDButton(type: ASAuthorizationAppleIDButton.ButtonType.default, style: ASAuthorizationAppleIDButton.Style.white) 385 let appleButton = ASAuthorizationAppleIDButton(type: ASAuthorizationAppleIDButton.ButtonType.default, style: ASAuthorizationAppleIDButton.Style.white)
@@ -391,26 +395,31 @@ class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate { @@ -391,26 +395,31 @@ class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate {
391 make.top.equalTo(loginButton.snp.bottom).offset(15) 395 make.top.equalTo(loginButton.snp.bottom).offset(15)
392 make.height.equalTo(loginButton.snp.height) 396 make.height.equalTo(loginButton.snp.height)
393 } 397 }
394 -  
395 - wxButton.snp.makeConstraints { make in  
396 - make.right.equalTo(loginButton.snp.right)  
397 - make.left.equalTo(loginButton.snp.centerX).offset(5)  
398 - make.top.equalTo(loginButton.snp.bottom).offset(15)  
399 - make.height.equalTo(loginButton.snp.height) 398 + if WXApi.isWXAppInstalled(){
  399 + wxButton.snp.makeConstraints { make in
  400 + make.right.equalTo(loginButton.snp.right)
  401 + make.left.equalTo(loginButton.snp.centerX).offset(5)
  402 + make.top.equalTo(loginButton.snp.bottom).offset(15)
  403 + make.height.equalTo(loginButton.snp.height)
  404 + }
400 } 405 }
401 } else { 406 } else {
402 // Fallback on earlier versions 407 // Fallback on earlier versions
403 - wxButton.snp.makeConstraints { make in  
404 - make.centerX.equalTo(view)  
405 - make.top.equalTo(loginButton.snp.bottom).offset(15)  
406 - make.left.equalTo(40)  
407 - make.right.equalTo(-40)  
408 - make.height.equalTo(40) 408 + if WXApi.isWXAppInstalled(){
  409 + wxButton.snp.makeConstraints { make in
  410 + make.centerX.equalTo(view)
  411 + make.top.equalTo(loginButton.snp.bottom).offset(15)
  412 + make.left.equalTo(40)
  413 + make.right.equalTo(-40)
  414 + make.height.equalTo(40)
  415 + }
409 } 416 }
410 } 417 }
411 418
412 loginButton.setGradient(colors: [UIColor(red: 103/255.0, green: 197/255.0, blue: 255/255.0, alpha: 0.3),UIColor(red: 96/255.0, green: 154/255.0, blue: 255/255.0, alpha: 0.3)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5)) 419 loginButton.setGradient(colors: [UIColor(red: 103/255.0, green: 197/255.0, blue: 255/255.0, alpha: 0.3),UIColor(red: 96/255.0, green: 154/255.0, blue: 255/255.0, alpha: 0.3)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5))
413 - wxButton.setGradient(colors: [UIColor(red: 35/255.0, green: 203/255.0, blue: 105/255.0, alpha: 1),UIColor(red: 13/255.0, green: 179/255.0, blue: 85/255.0, alpha: 1)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5)) 420 + if WXApi.isWXAppInstalled(){
  421 + wxButton.setGradient(colors: [UIColor(red: 35/255.0, green: 203/255.0, blue: 105/255.0, alpha: 1),UIColor(red: 13/255.0, green: 179/255.0, blue: 85/255.0, alpha: 1)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5))
  422 + }
414 // wxButton.setGradient(colors: [UIColor(red: 35/255.0, green: 203/255.0, blue: 105/255.0, alpha: 0.3),UIColor(red: 13/255.0, green: 179/255.0, blue: 85/255.0, alpha: 0.3)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5)) 423 // wxButton.setGradient(colors: [UIColor(red: 35/255.0, green: 203/255.0, blue: 105/255.0, alpha: 0.3),UIColor(red: 13/255.0, green: 179/255.0, blue: 85/255.0, alpha: 0.3)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5))
415 } 424 }
416 425
@@ -520,7 +529,9 @@ extension CNLiveLoginViewController { @@ -520,7 +529,9 @@ extension CNLiveLoginViewController {
520 is_agree = sender.isSelected 529 is_agree = sender.isSelected
521 if is_agree { 530 if is_agree {
522 loginButton.setGradient(colors: [UIColor(red: 103/255.0, green: 197/255.0, blue: 255/255.0, alpha: 1),UIColor(red: 96/255.0, green: 154/255.0, blue: 255/255.0, alpha: 1)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5)) 531 loginButton.setGradient(colors: [UIColor(red: 103/255.0, green: 197/255.0, blue: 255/255.0, alpha: 1),UIColor(red: 96/255.0, green: 154/255.0, blue: 255/255.0, alpha: 1)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5))
523 - wxButton.setGradient(colors: [UIColor(red: 35/255.0, green: 203/255.0, blue: 105/255.0, alpha: 1),UIColor(red: 13/255.0, green: 179/255.0, blue: 85/255.0, alpha: 1)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5)) 532 + if WXApi.isWXAppInstalled(){
  533 + wxButton.setGradient(colors: [UIColor(red: 35/255.0, green: 203/255.0, blue: 105/255.0, alpha: 1),UIColor(red: 13/255.0, green: 179/255.0, blue: 85/255.0, alpha: 1)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5))
  534 + }
524 } else { 535 } else {
525 loginButton.setGradient(colors: [UIColor(red: 103/255.0, green: 197/255.0, blue: 255/255.0, alpha: 0.3),UIColor(red: 96/255.0, green: 154/255.0, blue: 255/255.0, alpha: 0.3)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5)) 536 loginButton.setGradient(colors: [UIColor(red: 103/255.0, green: 197/255.0, blue: 255/255.0, alpha: 0.3),UIColor(red: 96/255.0, green: 154/255.0, blue: 255/255.0, alpha: 0.3)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5))
526 // wxButton.setGradient(colors: [UIColor(red: 35/255.0, green: 203/255.0, blue: 105/255.0, alpha: 0.3),UIColor(red: 13/255.0, green: 179/255.0, blue: 85/255.0, alpha: 0.3)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5)) 537 // wxButton.setGradient(colors: [UIColor(red: 35/255.0, green: 203/255.0, blue: 105/255.0, alpha: 0.3),UIColor(red: 13/255.0, green: 179/255.0, blue: 85/255.0, alpha: 0.3)], startPoint: CGPoint(x: 0, y: 0.5), endPoint: CGPoint(x: 1, y: 0.5))