zhujieshan 4 hete
szülő
commit
704b437649
34 módosított fájl, 696 hozzáadás és 206 törlés
  1. BIN
      .DS_Store
  2. 6 2
      QuickSearchLocation.xcodeproj/project.pbxproj
  3. 1 1
      QuickSearchLocation/Classes/Common/Model/QSLConfModel.swift
  4. 4 0
      QuickSearchLocation/Classes/Common/Model/QSLMemberModel.swift
  5. 11 0
      QuickSearchLocation/Classes/Common/Model/QSLWakeupModel.swift
  6. 22 0
      QuickSearchLocation/Classes/Common/Tool/QSLGravityManager.swift
  7. 69 1
      QuickSearchLocation/Classes/Common/Tool/QSLJumpManager.swift
  8. 40 1
      QuickSearchLocation/Classes/EventHandle/QSEventHandle.swift
  9. 5 5
      QuickSearchLocation/Classes/Main/AppDelegate.swift
  10. 0 20
      QuickSearchLocation/Classes/Main/CustomTabBarController.swift
  11. 3 3
      QuickSearchLocation/Classes/Main/QSLBaseManager.swift
  12. 1 0
      QuickSearchLocation/Classes/Main/SceneDelegate.swift
  13. 3 0
      QuickSearchLocation/Classes/Main/ViewController.swift
  14. 15 0
      QuickSearchLocation/Classes/Network/QSLNetwork.swift
  15. 36 16
      QuickSearchLocation/Classes/Pages/QSLAdd/Controller/QSLAddController.swift
  16. 5 22
      QuickSearchLocation/Classes/Pages/QSLContact/Controller/QSLContactController.swift
  17. 13 27
      QuickSearchLocation/Classes/Pages/QSLFriend/Controller/QSLFriendController.swift
  18. 21 9
      QuickSearchLocation/Classes/Pages/QSLFriend/Controller/QSLSearchFriendVC.swift
  19. 13 0
      QuickSearchLocation/Classes/Pages/QSLGuide/QSLGuideController.swift
  20. 39 64
      QuickSearchLocation/Classes/Pages/QSLHome/Controller/QSLHomeController.swift
  21. 9 3
      QuickSearchLocation/Classes/Pages/QSLHome/View/QSLHomeFriendView.swift
  22. 182 0
      QuickSearchLocation/Classes/Pages/QSLHome/View/QSLTrialTipsAlertView.swift
  23. 14 8
      QuickSearchLocation/Classes/Pages/QSLMine/Controller/QSLMineController.swift
  24. 18 2
      QuickSearchLocation/Classes/Pages/QSLMine/View/QSLMineInfoView.swift
  25. 12 0
      QuickSearchLocation/Classes/Pages/QSLVip/Controller/QSLActivityVipVC.swift
  26. 12 0
      QuickSearchLocation/Classes/Pages/QSLVip/Controller/QSLVipController.swift
  27. 90 11
      QuickSearchLocation/Classes/Pages/QSLVip/Controller/QSLVipTrialVC.swift
  28. 5 0
      QuickSearchLocation/Classes/Pages/QSLVip/QSLVipManager.swift
  29. 7 1
      QuickSearchLocation/Macro/QSLApi.swift
  30. 2 10
      QuickSearchLocation/Macro/QSLConfig.swift
  31. 16 0
      QuickSearchLocation/Macro/QSLGravityConst.swift
  32. 22 0
      QuickSearchLocation/Resources/Assets.xcassets/Vip/vip_trial_tips.imageset/Contents.json
  33. BIN
      QuickSearchLocation/Resources/Assets.xcassets/Vip/vip_trial_tips.imageset/Group 43678 (1) (1).png
  34. BIN
      QuickSearchLocation/Resources/Assets.xcassets/Vip/vip_trial_tips.imageset/Group 43678 (2).png

BIN
.DS_Store


+ 6 - 2
QuickSearchLocation.xcodeproj/project.pbxproj

@@ -146,6 +146,7 @@
 		FEE6AE812EB30921008AC6CE /* QSLLoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEE6AE802EB30921008AC6CE /* QSLLoadingView.swift */; };
 		FEE6AE832EB30F94008AC6CE /* QSLConfModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEE6AE822EB30F94008AC6CE /* QSLConfModel.swift */; };
 		FEE6AE852EB363DD008AC6CE /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FEE6AE842EB363DC008AC6CE /* UserNotifications.framework */; };
+		FEE6AE882EB4A54A008AC6CE /* QSLTrialTipsAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEE6AE872EB4A54A008AC6CE /* QSLTrialTipsAlertView.swift */; };
 		FEEB37CA2E28CC8F00BFFD7D /* QSAppleAdHandle.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEEB37C92E28CC8F00BFFD7D /* QSAppleAdHandle.swift */; };
 		FEEB37CD2E28CD7A00BFFD7D /* QSWikiHandle.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEEB37CC2E28CD7A00BFFD7D /* QSWikiHandle.swift */; };
 		FEF9D30E2E824870001F4660 /* QSLAddFriendSuccessAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEF9D30D2E824870001F4660 /* QSLAddFriendSuccessAlertView.swift */; };
@@ -300,6 +301,7 @@
 		FEE6AE822EB30F94008AC6CE /* QSLConfModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QSLConfModel.swift; sourceTree = "<group>"; };
 		FEE6AE842EB363DC008AC6CE /* UserNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; };
 		FEE6AE862EB36694008AC6CE /* QuickSearchLocationDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = QuickSearchLocationDebug.entitlements; sourceTree = "<group>"; };
+		FEE6AE872EB4A54A008AC6CE /* QSLTrialTipsAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QSLTrialTipsAlertView.swift; sourceTree = "<group>"; };
 		FEEB37C92E28CC8F00BFFD7D /* QSAppleAdHandle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QSAppleAdHandle.swift; sourceTree = "<group>"; };
 		FEEB37CC2E28CD7A00BFFD7D /* QSWikiHandle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QSWikiHandle.swift; sourceTree = "<group>"; };
 		FEF9D30D2E824870001F4660 /* QSLAddFriendSuccessAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QSLAddFriendSuccessAlertView.swift; sourceTree = "<group>"; };
@@ -346,6 +348,7 @@
 				FE8360B62D02F7A600978E03 /* QSLHomeAnnotatinView.swift */,
 				FE8360B82D02F9B500978E03 /* QSLHomeCallOutView.swift */,
 				FEF9D30F2E82521D001F4660 /* QSLHomeAddFriendAlertView.swift */,
+				FEE6AE872EB4A54A008AC6CE /* QSLTrialTipsAlertView.swift */,
 			);
 			path = View;
 			sourceTree = "<group>";
@@ -1137,6 +1140,7 @@
 				FE5B42422CF4612E000AACCB /* QSLSizeFit.swift in Sources */,
 				FE8360A92D018B6F00978E03 /* QSLRequestCell.swift in Sources */,
 				FE638AD42D1ABB9800858121 /* QSLJumpManager.swift in Sources */,
+				FEE6AE882EB4A54A008AC6CE /* QSLTrialTipsAlertView.swift in Sources */,
 				FE8360A72D017C4300978E03 /* QSLRequestController.swift in Sources */,
 				FE8360812CF723FA00978E03 /* QSLVipController.swift in Sources */,
 				04F33BD92BC6896F003E2111 /* UITabBarController+Extension.swift in Sources */,
@@ -1383,7 +1387,7 @@
 				CODE_SIGN_ENTITLEMENTS = QuickSearchLocation/QuickSearchLocationDebug.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 32;
+				CURRENT_PROJECT_VERSION = 36;
 				DEVELOPMENT_TEAM = Q364C8K9BL;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -1429,7 +1433,7 @@
 				CODE_SIGN_ENTITLEMENTS = QuickSearchLocation/QuickSearchLocationRelease.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 32;
+				CURRENT_PROJECT_VERSION = 36;
 				DEVELOPMENT_TEAM = Q364C8K9BL;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				FRAMEWORK_SEARCH_PATHS = (

+ 1 - 1
QuickSearchLocation/Classes/Common/Model/QSLConfModel.swift

@@ -14,7 +14,7 @@ struct QSLConfModel: Modelable {
     
     var phoneLocationEnable: Bool = false
     
-    var authPopEnable: Bool = false
+    var addFriendTipEnable: Bool = false
 
     var loginPayEnable: Bool = true
     

+ 4 - 0
QuickSearchLocation/Classes/Common/Model/QSLMemberModel.swift

@@ -18,8 +18,12 @@ struct QSLMemberModel: Modelable {
     
     var endTimestamp: Int = 0
     
+    var serverTimestamp: Int = 0
+    
     var expired: Bool = true
     
+    var trialed: Bool = true
+    
     var permanent: Bool = false
     
     var deviceId: String = ""

+ 11 - 0
QuickSearchLocation/Classes/Common/Model/QSLWakeupModel.swift

@@ -22,3 +22,14 @@ struct QSLWakeupModel: Modelable {
     
 }
 
+
+struct QSLWakeupBannerModel: Modelable {
+    mutating func mapping(_ json: SwiftyJSON.JSON) {
+        
+    }
+    
+
+    var banners: [String] = []
+    
+}
+

+ 22 - 0
QuickSearchLocation/Classes/Common/Tool/QSLGravityManager.swift

@@ -47,6 +47,8 @@ class QSLGravityManager {
                 QSLGuideusersToCommentManager.commentShare.clickCompanyChannel = clickCom
             }
             
+            self.requestConfig()
+            
             // 检查订单
             QSLBaseManager.shared.initPayCheck()
             
@@ -61,10 +63,30 @@ class QSLGravityManager {
             
             // 检查订单
             QSLBaseManager.shared.initPayCheck()
+            self.requestConfig()
         })
         
         //开始统计时长
         QSLStatisticsUserTimeManager.shared.startTracking()
     }
     
+    func requestConfig(){
+        var isAttr = false
+        if((UserDefaults.standard.value(forKey: "QSAttribution")) != nil){
+            if let attr = UserDefaults.standard.value(forKey: "QSAttribution") as? Bool {
+                isAttr = attr
+            }
+        }
+        QSLNetwork().request(.confGlobal(dict: ["attribution":isAttr,"clickCompany":QSLGuideusersToCommentManager.commentShare.clickCompanyChannel])) { response in
+            var model = response.mapObject(QSLConfModel.self, modelKey: "data")
+            model.loginPayEnable = false
+            QSLCacheManager.cacheConfModel(model)
+        } fail: { code, msg in
+            if(QSLCacheManager.getModel() == nil){
+                let model = QSLConfModel.init()
+                QSLCacheManager.cacheConfModel(model)
+            }
+        }
+    }
+    
 }

+ 69 - 1
QuickSearchLocation/Classes/Common/Tool/QSLJumpManager.swift

@@ -53,7 +53,18 @@ extension QSLJumpManager {
     }
     
     func unlockBtnAction(){
-
+        if(!QSLBaseManager.shared.isLogin()){
+            if(QSLBaseManager.shared.isVip()){
+                QSLJumpManager.shared.pushToLogin(type: .member)
+                return
+            }
+            
+            if(QSLConfig.loginPayEnable){
+                QSLJumpManager.shared.pushToLogin(type: .member)
+                return
+            }
+        }
+        
         if let selectGood = QSLCountdownManager.shared.selectGood{
             
             let memberModel = QSLBaseManager.shared.userModel.memberModel
@@ -67,6 +78,7 @@ extension QSLJumpManager {
             QSLVipManager.shared.startPay(goods: selectGood) { status, outTradeNo in
                 QSLVipManager.shared.isPaying = false
                 if status == .success {
+                    QSLLoading.hide()
                     QSLLoading.success(text: "支付成功")
                     
                     //弹出是否好评的弹窗
@@ -99,6 +111,62 @@ extension QSLJumpManager {
         }
     }
     
+    func unlockTrialBtnAction(){
+        if(!QSLBaseManager.shared.isLogin()){
+            if(QSLBaseManager.shared.isVip()){
+                QSLJumpManager.shared.pushToLogin(type: .member)
+                return
+            }
+            
+            if(QSLConfig.loginPayEnable){
+                QSLJumpManager.shared.pushToLogin(type: .member)
+                return
+            }
+        }
+        
+        if let selectGood = QSLCountdownManager.shared.trialGood{
+            
+            let memberModel = QSLBaseManager.shared.userModel.memberModel
+            
+            if let subscriptionExpired = memberModel.subscriptionExpired, !subscriptionExpired {
+                UIApplication.keyWindow?.toast(text: "你已经订阅了")
+                return
+            }
+            
+            QSLLoading.show()
+            QSLVipManager.shared.startPay(goods: selectGood) { status, outTradeNo in
+                QSLVipManager.shared.isPaying = false
+                if status == .success {
+                    QSLLoading.success(text: "支付成功")
+                    
+                    //弹出是否好评的弹窗
+                    //QSLGuideusersToCommentManager.commentShare.manageWhetherTriggerPopUpWindow(QSLGuideusersToCommentType.member)
+                    
+                    // 引力传递支付事件
+                    gravityInstance?.trackPayEvent(withAmount: Int32(selectGood.amount), withPayType: "CNY", withOrderId: outTradeNo, withPayReason: selectGood.name, withPayMethod: "apple")
+                    
+                    QSEventHandle.eventPush(eventName: QSLGravityConst.activity_purchase_result, eventProps: ["is_member":QSLBaseManager.shared.isVip(),"purchase_result": "success","pay_amount":Int32(selectGood.amount),"page_type":"coupon_popup"])
+                    
+                    DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
+                        NotificationCenter.default.post(name: QSLNotification.QSLRefreshMember, object: nil)
+                        
+                        if(!QSLBaseManager.shared.isLogin()){
+                            QSLJumpManager.shared.pushToLogin(type: .member)
+                        }
+                    }
+                    
+                
+                } else if status == .cancel {
+                    QSEventHandle.eventPush(eventName: QSLGravityConst.activity_purchase_result, eventProps: ["is_member":QSLBaseManager.shared.isVip(),"purchase_result": "cancel","pay_amount":Int32(selectGood.amount),"page_type":"coupon_popup"])
+                    QSLLoading.error(text: "支付取消")
+                } else if status == .fail {
+                    QSEventHandle.eventPush(eventName: QSLGravityConst.activity_purchase_result, eventProps: ["is_member":QSLBaseManager.shared.isVip(),"purchase_result": "fail","pay_amount":Int32(selectGood.amount),"page_type":"coupon_popup"])
+                    QSLLoading.error(text: "支付失败")
+                }
+            }
+        }
+    }
+    
     // 跳转到登录页面
     func pushToLogin(type: QSLLoginJumpType) {
         

+ 40 - 1
QuickSearchLocation/Classes/EventHandle/QSEventHandle.swift

@@ -9,8 +9,26 @@ import UIKit
 import GravityEngineSDK
 
 class QSEventHandle: NSObject {
-    
+    static let isDebug = false
     static func gravityPush(eventName: String, eventProps: [String:Any] = [:]){
+#if targetEnvironment(simulator)
+        return;
+#else
+
+#endif
+        if(isDebug){
+            do {
+                let jsonData = try JSONSerialization.data(withJSONObject: eventProps, options: .prettyPrinted)
+                let jsonString = String(data: jsonData, encoding: .utf8)
+                DispatchQueue.main.async {
+                    UIApplication.keyWindow?.toast(text: "event:\(eventName)\neventProps:\(String(describing: jsonString))")
+                }
+                print(jsonString ?? "转换失败")
+            } catch {
+                print("JSON 转换错误: \(error)")
+            }
+            
+        }
         GravityEngineSDK.sharedInstance()?.track(eventName, properties: eventProps)
     }
 
@@ -31,6 +49,25 @@ class QSEventHandle: NSObject {
     ///   ```
     ///
     static func eventPush(eventType: String = "track", eventName: String, eventProps: [String:Any] = [:]){
+#if targetEnvironment(simulator)
+        return;
+#else
+
+#endif
+        if(isDebug){
+            do {
+                let jsonData = try JSONSerialization.data(withJSONObject: eventProps, options: .prettyPrinted)
+                let jsonString = String(data: jsonData, encoding: .utf8)
+                DispatchQueue.main.async {
+                    UIApplication.keyWindow?.toast(text: "event:\(eventName)\neventProps:\(String(describing: jsonString))")
+                }
+                
+                print(jsonString ?? "转换失败")
+            } catch {
+                print("JSON 转换错误: \(error)")
+            }
+            
+        }
         GravityEngineSDK.sharedInstance()?.track(eventName, properties: eventProps)
         QSLCentralEventManager.shared.uploadEvent(eventType: "track", eventName: eventName, eventProps: eventProps)
     }
@@ -54,4 +91,6 @@ class QSEventHandle: NSObject {
     static func eventArrPush(eventType: String = "track", eventName: String, eventPropsArr: [[String:Any]] = []){
         QSLCentralEventManager.shared.uploadEvent(eventType: "track", eventName: eventName, eventPropsArr: eventPropsArr)
     }
+    
+    
 }

+ 5 - 5
QuickSearchLocation/Classes/Main/AppDelegate.swift

@@ -30,11 +30,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
 
     func configNoti(){
         UNUserNotificationCenter.current().delegate = self
-        // 请求静默推送权限
-        UNUserNotificationCenter.current().requestAuthorization(
-            options: [.provisional]
-        ) { granted, error in
-        }
+        QSLTools.shared.requestNotificationPermission()
+
     }
     
     // MARK: UISceneSession Lifecycle
@@ -62,6 +59,9 @@ extension AppDelegate : UNUserNotificationCenterDelegate{
     func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
         let token = deviceToken.map { String(format: "%02.2hhx", $0) }.joined()
         UserDefaults.standard.set(token, forKey: "deviceToken")
+        
+        UIPasteboard.general.string = token
+        
         print("notification token: \(token)")
 
         QSLNetwork().request(.notiTokenReport(dict: ["deviceToken":token])) { response in

+ 0 - 20
QuickSearchLocation/Classes/Main/CustomTabBarController.swift

@@ -20,14 +20,6 @@ class CustomTabBarController: UITabBarController {
     override func viewDidLoad() {
         super.viewDidLoad()
         
-        if(QSLCacheManager.getModel() == nil){
-            requestConfig()
-            Thread.sleep(forTimeInterval: 1)
-        }else{
-            requestConfig()
-        }
-        
-        
         // 设置 tabbar 样式
         self.setTabBarAppearence()
         // 添加 tab 页
@@ -38,18 +30,6 @@ class CustomTabBarController: UITabBarController {
         managerAppOnlyLaunch()
     }
     
-    func requestConfig(){
-        QSLNetwork().request(.confGlobal(dict: [String: Any]())) { response in
-            var model = response.mapObject(QSLConfModel.self, modelKey: "data")
-            QSLCacheManager.cacheConfModel(model)
-        } fail: { code, msg in
-            if(QSLCacheManager.getModel() == nil){
-                let model = QSLConfModel.init()
-                QSLCacheManager.cacheConfModel(model)
-            }
-        }
-    }
-    
     //管理app启动埋点
     func managerAppOnlyLaunch() {
         

+ 3 - 3
QuickSearchLocation/Classes/Main/QSLBaseManager.swift

@@ -17,7 +17,7 @@ class QSLBaseManager {
     static let shared = QSLBaseManager()
     
     var userModel = QSLUserModel()
-    
+    var isLoadG = false
     private init() {}
     
     public func initConfig() {
@@ -28,7 +28,6 @@ class QSLBaseManager {
         }
         
         initializeSystem()
-        initIDFA()
         initPayCheck()
     }
 }
@@ -199,7 +198,7 @@ extension QSLBaseManager {
     
     func initIDFA() {
         
-        DispatchQueue.global().asyncAfter(deadline: .now() + 0.1){
+        DispatchQueue.global().asyncAfter(deadline: .now() + 0.5){
             if #available(iOS 14.0, *) {
                 // 用户请求授权获得IDFA权限
                 ATTrackingManager.requestTrackingAuthorization { status in
@@ -240,6 +239,7 @@ extension QSLBaseManager {
     
     // 引力引擎初始化
     func initGE() {
+        isLoadG = true
         
         DispatchQueue.main.async {
             if gravityInstance == nil {

+ 1 - 0
QuickSearchLocation/Classes/Main/SceneDelegate.swift

@@ -33,6 +33,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
             scheme = "location://page/QSLFeedbackVC"
         }else if type == "com.manbu.shouji.trial"{
             scheme = "location://page/QSLVipTrialVC"
+            QSEventHandle.eventPush(eventName: QSLGravityConst.unpaid_click_uninstall_popup)
         }else if type == "com.manbu.shouji.member"{
             scheme = "location://page/QSLVipController"
         }else{

+ 3 - 0
QuickSearchLocation/Classes/Main/ViewController.swift

@@ -28,6 +28,9 @@ class ViewController: UIViewController {
                 sceneDelegate.window?.makeKeyAndVisible()
             }
         } else {
+            if(!QSLBaseManager.shared.isLoadG){
+                QSLBaseManager.shared.initIDFA()
+            }
             // 主页
             if let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate {
                 sceneDelegate.window?.rootViewController = CustomTabBarController()

+ 15 - 0
QuickSearchLocation/Classes/Network/QSLNetwork.swift

@@ -64,6 +64,8 @@ enum QSLNetworkAPI {
     case confGlobal(dict: [String : Any])
 
     case notiTokenReport(dict: [String : Any])
+    case memberTrialTrack(dict: [String : Any])
+    case wakeupTrialBanner(dict: [String : Any])
 }
 
 extension QSLNetworkAPI: TargetType {
@@ -123,6 +125,11 @@ extension QSLNetworkAPI: TargetType {
         case .userPhoneAttribution: return QSLApi.user_phone_attr
             
         case .notiTokenReport: return QSLApi.noti_token_push
+        case .memberTrialTrack: return QSLApi.member_trial_track
+            
+            
+        case .wakeupTrialBanner: return QSLApi.wakeup_trial_banner
+            
         }
     }
     
@@ -312,6 +319,14 @@ extension QSLNetworkAPI: TargetType {
             for (key, value) in dict {
                 parameters[key] = value
             }
+        case .memberTrialTrack(dict: let dict):
+            for (key, value) in dict {
+                parameters[key] = value
+            }
+        case .wakeupTrialBanner(dict: let dict):
+            for (key, value) in dict {
+                parameters[key] = value
+            }
         }
 
         debugPrint(parameters)

+ 36 - 16
QuickSearchLocation/Classes/Pages/QSLAdd/Controller/QSLAddController.swift

@@ -131,14 +131,14 @@ class QSLAddController: QSLBaseController {
         return btn
     }()
     
-//    lazy var infoLabel: UILabel = {
-//      
-//        let label = UILabel()
-//        label.text("定位功能需要双方同意方可使用")
-//        label.textColor = .hexStringColor(hexString: "#A7A7A7")
-//        label.font(13)
-//        return label
-//    }()    
+    lazy var infoLabel: UILabel = {
+      
+        let label = UILabel()
+        label.text("定位功能需要双方同意方可使用")
+        label.textColor = .hexStringColor(hexString: "#A7A7A7")
+        label.font(13)
+        return label
+    }()    
     
     override func viewDidLoad() {
         super.viewDidLoad()
@@ -157,6 +157,13 @@ class QSLAddController: QSLBaseController {
                 QSEventHandle.gravityPush(eventName: QSLGravityConst.add_show, eventProps: ["id": 1004])
             }
         }
+        
+        self.infoLabel.isHidden = true
+        
+        if(QSLConfig.addFriendTipEnable){
+            self.infoLabel.isHidden = false
+        }
+
     }
     
     // 点击添加按钮
@@ -177,9 +184,22 @@ class QSLAddController: QSLBaseController {
         
         if !QSLBaseManager.shared.isVip() {
 
-            let vc = QSLSearchFriendVC.init()
-            vc.searchPhone = self.phoneTextField.text ?? ""
-            self.navigationController?.pushViewController(vc, animated: true)
+//            let vc = QSLSearchFriendVC.init()
+//            vc.searchPhone = self.phoneTextField.text ?? ""
+//            self.navigationController?.pushViewController(vc, animated: true)
+            
+            QSLLoading.show()
+            
+            
+            DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
+                QSLLoading.hide()
+                if let currentWindow = UIApplication.keyWindow {
+                    QSLAddFriendSuccessAlertView.alert(view: currentWindow, clickBtnClosure:  { [weak self] in
+                        QSLJumpManager.shared.pushToVip(type: .add)
+                    })
+                }
+            }
+            
             
             return
         }
@@ -370,10 +390,10 @@ extension QSLAddController {
             make.bottom.equalTo(-30.rpx)
         }
         
-//        self.view.addSubview(infoLabel)
-//        infoLabel.snp.makeConstraints { make in
-//            make.centerX.equalToSuperview()
-//            make.bottom.equalTo(-QSLConst.qsl_kTabbarBottom - 26.rpx)
-//        }
+        self.view.addSubview(infoLabel)
+        infoLabel.snp.makeConstraints { make in
+            make.centerX.equalToSuperview()
+            make.bottom.equalTo(-QSLConst.qsl_kTabbarBottom - 26.rpx)
+        }
     }
 }

+ 5 - 22
QuickSearchLocation/Classes/Pages/QSLContact/Controller/QSLContactController.swift

@@ -168,31 +168,14 @@ class QSLContactController: QSLBaseController {
 extension QSLContactController {
     
     @objc func addBtnAction() {
-        
-        if(!QSLConfig.loginPayEnable){
-            if !QSLBaseManager.shared.isVip() {
-                
-                QSLJumpManager.shared.pushToVip(type: .homeRoad)
-                return
-            }
-        }else{
+        if QSLBaseManager.shared.isVip() {
             if !QSLBaseManager.shared.isLogin() {
-                
-                if let view = self.tabBarController?.view {
-                    QSLAlertView.alert(view: view, title: "温馨提示", content: "登录即可体验查看轨迹记录", secondBtnClosure:  {
-                        
-                        QSLJumpManager.shared.pushToLogin(type: .road)
-                    })
-                }
-                
-                return
-            }
-            
-            if !QSLBaseManager.shared.isVip() {
-                
-                QSLJumpManager.shared.pushToVip(type: .homeRoad)
+                QSLJumpManager.shared.pushToLogin(type: .contact)
                 return
             }
+        }else{
+            QSLJumpManager.shared.pushToVip(type: .contact)
+            return
         }
         
         QSLContactAddAlertView.alert(vc: self) { phone in

+ 13 - 27
QuickSearchLocation/Classes/Pages/QSLFriend/Controller/QSLFriendController.swift

@@ -118,12 +118,14 @@ extension QSLFriendController {
     }
     
     @objc func resortBtnAction() {
-        if !QSLBaseManager.shared.isLogin() {
-            QSQuickLogonHandle.share.currentVC = self
-            QSQuickLogonHandle.share.starOneQuickLogin(loginSuccess: {
-                
-            })
-            return;
+        if QSLBaseManager.shared.isVip() {
+            if !QSLBaseManager.shared.isLogin() {
+                QSLJumpManager.shared.pushToLogin(type: .contact)
+                return
+            }
+        }else{
+            QSLJumpManager.shared.pushToVip(type: .contact)
+            return
         }
         
         QSEventHandle.eventPush(eventName: QSLGravityConst.contact_shortcut_send)
@@ -161,30 +163,14 @@ extension QSLFriendController: QSLFriendTableViewCellDelegate {
     
     func roadBtnClickAction(model: QSLUserModel) {
         
-        if(!QSLConfig.loginPayEnable){
-            if !QSLBaseManager.shared.isVip() {
-                
-                QSLJumpManager.shared.pushToVip(type: .homeRoad)
-                return
-            }
-        }else{
+        if QSLBaseManager.shared.isVip() {
             if !QSLBaseManager.shared.isLogin() {
-                
-                if let view = self.tabBarController?.view {
-                    QSLAlertView.alert(view: view, title: "温馨提示", content: "登录即可体验查看轨迹记录", secondBtnClosure:  {
-                        
-                        QSLJumpManager.shared.pushToLogin(type: .road)
-                    })
-                }
-                
-                return
-            }
-            
-            if !QSLBaseManager.shared.isVip() {
-                
-                QSLJumpManager.shared.pushToVip(type: .homeRoad)
+                QSLJumpManager.shared.pushToLogin(type: .road)
                 return
             }
+        }else{
+            QSLJumpManager.shared.pushToVip(type: .homeRoad)
+            return
         }
         
         QSLJumpManager.shared.pushToRoad(type: .friend, model: model)

+ 21 - 9
QuickSearchLocation/Classes/Pages/QSLFriend/Controller/QSLSearchFriendVC.swift

@@ -77,7 +77,7 @@ class QSLSearchFriendVC: QSLBaseController {
         ].randomElement()!
         
         
-        startMapAnimation(longitude: randomCityCoordinate.longitude, latitude: randomCityCoordinate.latitude)
+        startMapAnimation(longitude: randomCityCoordinate.longitude, latitude: randomCityCoordinate.latitude ,isShowLocation: false)
         
         startLoading()
         
@@ -110,32 +110,44 @@ class QSLSearchFriendVC: QSLBaseController {
     }
     
     
-    func startMapAnimation(longitude:Double, latitude:Double){
+    func startMapAnimation(longitude:Double, latitude:Double, isShowLocation:Bool = false){
         isMove = true
         
         roadMapView.setZoomLevel(4, animated: true)
 
         roadMapView.setCenter(CLLocationCoordinate2D(latitude: latitude, longitude: longitude), animated: true)
         
+        var firstZoom : CGFloat = 5
+        if(isShowLocation){
+            firstZoom = 5
+        }
         DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
-            self.roadMapView.setZoomLevel(6, animated: true)
+            self.roadMapView.setZoomLevel(firstZoom, animated: true)
             let randomProgress1 = CGFloat.random(in: 20...35)
             if self.loadingView.progress < randomProgress1 {
                 self.loadingView.progress = randomProgress1
             }
         }
 
-        DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
-            self.roadMapView.setZoomLevel(7, animated: true)
-            let randomProgress2 = CGFloat.random(in: 45...70)
+        var secondZoom : CGFloat = 6
+        if(isShowLocation){
+            secondZoom = 6.5
+        }
+        DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
+            self.roadMapView.setZoomLevel(secondZoom, animated: true)
+            let randomProgress2 = CGFloat.random(in: 45...75)
             if self.loadingView.progress < randomProgress2 {
                 self.loadingView.progress = randomProgress2
             }
         }
 
-        DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
-            self.roadMapView.setZoomLevel(8, animated: true)
-            let randomProgress3 = CGFloat.random(in: 86...100)
+        var thirdZoom : CGFloat = 7
+        if(isShowLocation){
+            thirdZoom = 8
+        }
+        DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) {
+            self.roadMapView.setZoomLevel(thirdZoom, animated: true)
+            let randomProgress3 = CGFloat.random(in: 90...100)
             if self.loadingView.progress < randomProgress3 {
                 self.loadingView.progress = randomProgress3
             }

+ 13 - 0
QuickSearchLocation/Classes/Pages/QSLGuide/QSLGuideController.swift

@@ -7,11 +7,16 @@
 
 import UIKit
 import GKCycleScrollView
+import Alamofire
 
 class QSLGuideController: QSLBaseController {
     
 //    var currentPage
     
+    func checkIDFA(){
+        QSLBaseManager.shared.initIDFA()
+    }
+    
     lazy var cycleScrollView: GKCycleScrollView = {
       
         let cycleScrollView = GKCycleScrollView()
@@ -51,6 +56,14 @@ class QSLGuideController: QSLBaseController {
     override func viewDidLoad() {
         super.viewDidLoad()
         
+        NetworkReachabilityManager.default?.startListening(onUpdatePerforming: { status in
+            if(status != .notReachable){
+                print("checkIDFA")
+                self.checkIDFA()
+                NetworkReachabilityManager.default?.stopListening()
+            }
+        })
+        
         self.view.addSubview(cycleScrollView)
         cycleScrollView.snp.makeConstraints { make in
             make.left.equalTo(40.rpx)

+ 39 - 64
QuickSearchLocation/Classes/Pages/QSLHome/Controller/QSLHomeController.swift

@@ -70,9 +70,8 @@ class QSLHomeController: QSLBaseController {
         }else{
             let vc = QSLActivityVipVC()
             vc.modalPresentationStyle = .fullScreen
-            self.present(vc, animated: false)
+            self.navigationController?.pushViewController(vc, animated: false)
             vc.dismissHandler = {[weak self] isCancel in
-                
                 QSLGuideusersToCommentManager.commentShare.manageWhetherTriggerPopUpWindow(.nonMember){[weak self] in
                     self?.showAddFriendView(hideBtnClosure: {[weak self] in
                         DispatchQueue.main.async {
@@ -85,14 +84,6 @@ class QSLHomeController: QSLBaseController {
         }
         
         
-        //试用过期弹窗
-//        QSLTrialExpireAlertView.alert(view: currentWindow, isOneBtn: true, oneBtnText: "继续支付", oneBtnClosure:  { [weak self] in
-//            QSLCountdownManager.shared.selectGood = yearGood
-//            self?.unlockBtnAction()
-//            QSEventHandle.eventPush(eventName: QSLGravityConst.new_vip_retention_click, eventProps: ["button":"continue_payment"])
-//        },closeBtnClosure: {
-//            QSEventHandle.eventPush(eventName: QSLGravityConst.new_vip_retention_click, eventProps: ["button":"close"])
-//        })
     }
     
     func checkLocAgain(){
@@ -103,9 +94,29 @@ class QSLHomeController: QSLBaseController {
         
         self.onceLocation()
         firstEnterLocationHomepage()
+        
+        if(QSLBaseManager.shared.isLogin()){
+            let memberModel = QSLBaseManager.shared.userModel.memberModel
+            let duration = (memberModel.serverTimestamp - memberModel.endTimestamp)
+            if(duration > 0 && memberModel.trialed) {
+                showTrialDialog()
+            }
+        }
+        
+        
 
     }
     
+    func showTrialDialog(){
+        if let currentWindow = UIApplication.keyWindow {
+            QSLTrialTipsAlertView.alert(view: currentWindow, clickBtnClosure: {[weak self] in
+                QSLJumpManager.shared.pushToVip(type: .shortcut)
+            },hideBtnClosure:  {
+                
+            })
+        }
+    }
+    
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         if(self.isFirstRequestLoc && self.isEnterSearchFriend){
@@ -218,35 +229,10 @@ class QSLHomeController: QSLBaseController {
         QSLJumpManager.shared.pushToAdd(type: .homesmall)
     }
     
-    lazy var homeFriendBtn: UIView = {
-        let _homeResortBtn = UIView(frame: CGRect(x: QSLConst.qsl_kScreenW - 40.rpx, y: QSLConst.qsl_kStatusBarFrameH + 28.rpx, width: 34.rpx, height: 44.rpx))
-        
-        let imgView = UIImageView.init(image: UIImage(named: "home_find_friend"))
-        imgView.frame = CGRectMake(0, 0, 34.rpx, 40.rpx)
-        imgView.isUserInteractionEnabled = true
-        _homeResortBtn.addSubview(imgView)
-        
-        let label = YYLabel.init(frame: CGRectMake(0, 29.rpx, 34.rpx, 15.rpx))
-        // 创建文字属性
-        let attributedString = NSMutableAttributedString(string: QSLConfig.addFriendIconText)
-        attributedString.yy_font = UIFont.boldSystemFont(ofSize: 13)
-        attributedString.yy_color = UIColor.black // 文字颜色为黑色
-        // 创建描边阴影(模拟边框效果)
-        let shadow = YYTextShadow()
-        shadow.color = UIColor.white // 边框颜色
-        shadow.radius = 4 // 边框粗细
-        shadow.offset = CGSize.zero // 偏移量为0,形成描边效果
-
-        // 设置文字描边
-        attributedString.yy_setTextShadow(shadow, range: NSRange(location: 0, length: attributedString.length))
-
-        label.attributedText = attributedString
-        label.textAlignment = .center
-        _homeResortBtn.addSubview(label)
-        
-        let tapG = UITapGestureRecognizer.init(target: self, action: #selector(homeFriendBtnAction))
-        _homeResortBtn.addGestureRecognizer(tapG)
-        
+    lazy var homeFriendBtn: UIButton = {
+        let _homeResortBtn = UIButton(frame: CGRect(x: 0, y: 0, width: 56.rpx, height: 56.rpx))
+        _homeResortBtn.image(UIImage(named: "home_find_friend"))
+        _homeResortBtn.addTarget(self, action: #selector(homeFriendBtnAction), for: .touchUpInside)
         return _homeResortBtn
     }()
     
@@ -652,9 +638,9 @@ extension QSLHomeController: MAMapViewDelegate, AMapLocationManagerDelegate {
               // 统一处理权限变化
               amapLocationManager(manager, didChangeAuthorization: status)
               
-              if(status != .notDetermined){
-                  QSLTools.shared.requestNotificationPermission()
-              }
+//              if(status != .notDetermined){
+//                  QSLTools.shared.requestNotificationPermission()
+//              }
               //print("系统定位权限变化: \(status.rawValue)")
           } else {
               // Fallback on earlier versions
@@ -797,30 +783,14 @@ extension QSLHomeController: QSLHomeEmptyViewDelegate, QSLHomeFriendViewDelegate
     
     // 轨迹
     func routeBtnAction(model: QSLUserModel) {
-        if(!QSLConfig.loginPayEnable){
-            if !QSLBaseManager.shared.isVip() {
-                
-                QSLJumpManager.shared.pushToVip(type: .homeRoad)
-                return
-            }
-        }else{
+        if QSLBaseManager.shared.isVip() {
             if !QSLBaseManager.shared.isLogin() {
-                
-                if let view = self.tabBarController?.view {
-                    QSLAlertView.alert(view: view, title: "温馨提示", content: "登录即可体验查看轨迹记录", secondBtnClosure:  {
-                        
-                        QSLJumpManager.shared.pushToLogin(type: .road)
-                    })
-                }
-                
-                return
-            }
-            
-            if !QSLBaseManager.shared.isVip() {
-                
-                QSLJumpManager.shared.pushToVip(type: .homeRoad)
+                QSLJumpManager.shared.pushToLogin(type: .contact)
                 return
             }
+        }else{
+            QSLJumpManager.shared.pushToVip(type: .contact)
+            return
         }
 
         QSLJumpManager.shared.pushToRoad(type: .home, model: model)
@@ -882,7 +852,12 @@ extension QSLHomeController {
         }
         
         view.addSubview(homeFriendBtn)
-//        
+        homeFriendBtn.snp.makeConstraints { make in
+            make.size.equalTo(CGSize(width: 56.rpx, height: 56.rpx))
+            make.top.equalTo(QSLConst.qsl_kStatusBarFrameH + 28.rpx)
+            make.right.equalTo(-2.rpx)
+        }
+//
 //        view.addSubview(homeLocateBtnView)
 //        homeLocateBtnView.snp.makeConstraints { make in
 //            make.size.equalTo(CGSize(width: 40, height: 40))

+ 9 - 3
QuickSearchLocation/Classes/Pages/QSLHome/View/QSLHomeFriendView.swift

@@ -306,9 +306,15 @@ extension QSLHomeFriendView {
 // MARK: - 点击事件
 extension QSLHomeFriendView {
     @objc func unlockBtnAction(){
-        QSEventHandle.eventPush(eventName: QSLGravityConst.home_coupon_click)
-
-        QSLJumpManager.shared.unlockBtnAction()
+        
+        if(countDownType == 1){
+            QSEventHandle.eventPush(eventName: QSLGravityConst.activity_page_click, eventProps: ["page_type":"coupon_popup"])
+            QSLJumpManager.shared.unlockTrialBtnAction()
+        }else{
+            QSEventHandle.eventPush(eventName: QSLGravityConst.home_coupon_click)
+            QSLJumpManager.shared.unlockBtnAction()
+        }
+        
     }
     
     @objc func homeFriPhoneViewAction() {

+ 182 - 0
QuickSearchLocation/Classes/Pages/QSLHome/View/QSLTrialTipsAlertView.swift

@@ -0,0 +1,182 @@
+//
+//  QSLTrialTipsAlertView.swift
+//  QuickSearchLocation
+//
+//  Created by Destiny on 2025/10/31.
+//
+
+import UIKit
+
+class QSLTrialTipsAlertView: UIView {
+    
+    lazy var contentView: UIView = {
+        
+        let contentViewW = 318.rpx
+        let contentViewH =  436.rpx
+        let contentView = UIView(frame: CGRect(x: 0, y: 0, width: contentViewW, height: contentViewH))
+        return contentView
+    }()
+    
+    lazy var centerImage : UIImageView = {
+        let centerImage = UIImageView()
+        centerImage.contentMode = .scaleAspectFit
+        centerImage.image = UIImage(named: "vip_trial_tips")
+        return centerImage
+    }()
+    
+    lazy var contentLabel: UILabel = {
+        let label = UILabel()
+        label.text("您已好友守护了Ta   次,\n并且有   条重要轨迹即将消失。")
+        label.font(12)
+        label.numberOfLines = 2
+        label.textColor = .hexStringColor(hexString: "#B6795B")
+        return label
+    }()
+    
+    lazy var oneButton: UIButton = {
+        let btn = UIButton()
+        btn.addTarget(self, action: #selector(oneBtnAction), for: .touchUpInside)
+        return btn
+    }()
+    
+    lazy var hideButton: UIButton = {
+        let btn = UIButton()
+        btn.image(UIImage(named: "vip_pay_failure_close"))
+        btn.addTarget(self, action: #selector(removeView), for: .touchUpInside)
+        return btn
+    }()
+    
+    var oneBtnClosure: (() -> ())?
+    var hideBtnClosure: (() -> ())?
+    
+    class func alert(view: UIView,
+                     clickBtnClosure: @escaping () -> () = {},
+                     hideBtnClosure: @escaping () -> () = {}) {
+        
+        let window = QSLTrialTipsAlertView(frame: CGRect(x: 0, y: 0, width: QSLConst.qsl_kScreenW, height: QSLConst.qsl_kScreenH))
+        view.addSubview(window)
+        window.oneBtnClosure = clickBtnClosure
+        window.hideBtnClosure = hideBtnClosure
+        
+        QSEventHandle.eventPush(eventName: QSLGravityConst.trial_exposure_end_popup)
+        UIView.animate(withDuration: 0.4, delay: 0, usingSpringWithDamping: 0.95, initialSpringVelocity: 0.05) {
+            window.backgroundColor = .hexStringColor(hexString: "#000000", alpha: 0.7)
+            window.contentView.isHidden = false
+        }
+    }
+    
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        
+        initView()
+
+        let attr = NSMutableAttributedString()
+        let firstAttr = NSMutableAttributedString(string: "您已好友守护了Ta")
+        firstAttr.yy_font = UIFont.textM(12)
+        firstAttr.yy_color = UIColor.hexStringColor(hexString: "#B6795B")
+        attr.append(firstAttr)
+        
+        let randomAddCount1 = Int.random(in: 1...10)
+        let randomAddCount2 = Int.random(in: 1...5)
+        let firstText = "\(randomAddCount1)"
+        let firstAttr1 = NSMutableAttributedString(string: firstText)
+        firstAttr1.yy_font = UIFont.textM(15)
+        firstAttr1.yy_color = .hexStringColor(hexString: "#69280E")
+        attr.append(firstAttr1)
+
+        let secondAttr = NSMutableAttributedString(string: "次,\n并且有")
+        secondAttr.yy_font = UIFont.textB(12)
+        secondAttr.yy_color = UIColor.hexStringColor(hexString: "#B6795B")
+        attr.append(secondAttr)
+        
+        let secondText = "\(randomAddCount2)"
+        let secondAttr1 = NSMutableAttributedString(string: secondText)
+        secondAttr1.yy_font = UIFont.textM(15)
+        secondAttr1.yy_color = .hexStringColor(hexString: "#69280E")
+        attr.append(secondAttr1)
+        
+        let thirdAttr = NSMutableAttributedString(string: "条重要轨迹即将消失。")
+        thirdAttr.yy_font = UIFont.textM(12)
+        thirdAttr.yy_color = UIColor.hexStringColor(hexString: "#B6795B")
+        attr.append(thirdAttr)
+        
+        contentLabel.attributedText = attr
+    }
+    
+    required init?(coder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    
+    // 单按钮点击事件
+    @objc func oneBtnAction() {
+        if let oneBtnClosure = self.oneBtnClosure {
+            oneBtnClosure()
+        }
+        removeView1()
+        QSEventHandle.eventPush(eventName: QSLGravityConst.trial_click_end_popup)
+    }
+    
+    @objc func removeView1() {
+        
+        UIView.animate(withDuration: 0.4, delay: 0, usingSpringWithDamping: 0.95, initialSpringVelocity: 0.05) { [weak self] in
+            self?.backgroundColor = UIColor.init(white: 0, alpha: 0)
+            self?.contentView.isHidden = true
+            self?.centerImage.isHidden = true
+        } completion: { [weak self] finished in
+            self?.removeFromSuperview()
+        }
+    }
+    
+    // 移除
+    @objc func removeView() {
+        
+        UIView.animate(withDuration: 0.4, delay: 0, usingSpringWithDamping: 0.95, initialSpringVelocity: 0.05) { [weak self] in
+            self?.backgroundColor = UIColor.init(white: 0, alpha: 0)
+            self?.contentView.isHidden = true
+            self?.centerImage.isHidden = true
+        } completion: { [weak self] finished in
+            self?.hideBtnClosure?()
+            self?.removeFromSuperview()
+        }
+    }
+}
+
+extension QSLTrialTipsAlertView {
+    
+    func initView() {
+
+        addSubview(contentView)
+        contentView.snp.makeConstraints { make in
+            make.size.equalTo(CGSize(width: 318.rpx, height: 436.rpx))
+            make.center.equalToSuperview()
+        }
+        
+        contentView.addSubview(centerImage)
+        centerImage.snp.makeConstraints { make in
+            make.top.bottom.left.right.equalTo(0)
+        }
+        
+        contentView.addSubview(contentLabel)
+        contentLabel.snp.makeConstraints { make in
+            make.left.equalTo(15.rpx)
+            make.right.equalTo(-15.rpx)
+            make.top.equalTo(68.rpx)
+            make.height.equalTo(40.rpx)
+        }
+        
+        addSubview(hideButton)
+        hideButton.snp.makeConstraints { make in
+            make.size.equalTo(CGSize(width: 28.rpx, height: 28.rpx))
+            make.right.equalTo(-24.rpx)
+            make.top.equalTo(contentView.snp.top).offset(-30.rpx)
+        }
+        
+        contentView.addSubview(oneButton)
+        oneButton.snp.makeConstraints { make in
+            make.size.equalTo(CGSize(width: 220.rpx, height: 44.rpx))
+            make.centerX.equalToSuperview()
+            make.bottom.equalTo(-20.rpx)
+        }
+    }
+}

+ 14 - 8
QuickSearchLocation/Classes/Pages/QSLMine/Controller/QSLMineController.swift

@@ -160,12 +160,14 @@ extension QSLMineController: QSLMineFuncViewDelegate {
     }
     
     func jumpToContact() {
-        if !QSLBaseManager.shared.isLogin() {
-            QSQuickLogonHandle.share.currentVC = self
-            QSQuickLogonHandle.share.starOneQuickLogin(loginSuccess: {
-                
-            })
-            return;
+        if QSLBaseManager.shared.isVip() {
+            if !QSLBaseManager.shared.isLogin() {
+                QSLJumpManager.shared.pushToLogin(type: .contact)
+                return
+            }
+        }else{
+            QSLJumpManager.shared.pushToVip(type: .contact)
+            return
         }
         
         QSEventHandle.eventPush( eventName: QSLGravityConst.mine_contact)
@@ -230,11 +232,15 @@ extension QSLMineController {
         self.mineFuncView.funcTableView.reloadData()
         
         if QSLBaseManager.shared.isLogin() {
-            
             let name = "用户\(QSLBaseManager.shared.userModel.phone.suffix(4))"
             self.mineInfoView.config(name: name, content: "您好,尊敬的用户")
         } else {
-            self.mineInfoView.config(name: "立即登录", content: "解锁更多精彩内容")
+            if QSLBaseManager.shared.isVip(){
+                self.mineInfoView.config(name: "立即登录", content: "  登录即享受会员权益  ")
+            }else{
+                self.mineInfoView.config(name: "立即登录", content: "解锁更多精彩内容")
+            }
+            
         }
         
         mineVipView.updateUI()

+ 18 - 2
QuickSearchLocation/Classes/Pages/QSLMine/View/QSLMineInfoView.swift

@@ -28,7 +28,7 @@ class QSLMineInfoView: UIView {
     lazy var infoContentLabel: UILabel = {
         
         let label = UILabel()
-        label.font(13)
+        label.font(10)
         label.textColor = QSLColor.textColor_A7
         label.text = "解锁更多精彩内容"
         return label
@@ -47,6 +47,22 @@ class QSLMineInfoView: UIView {
     func config(name: String, content: String) {
         self.infoNameLabel.text = name
         self.infoContentLabel.text = content
+        if(content == "  登录即享受会员权益  "){
+            self.infoContentLabel.textColor = UIColor.hexStringColor(hexString: "#FF743A")
+            self.infoContentLabel.backgroundColor = UIColor.hexStringColor(hexString: "#FFF5DA")
+            self.infoContentLabel.layer.borderColor = UIColor.hexStringColor(hexString: "#FFDBA8").cgColor
+            self.infoContentLabel.layer.borderWidth = 1
+            self.infoContentLabel.layer.cornerRadius = 9.rpx
+            self.infoContentLabel.layer.masksToBounds = true
+        }else{
+            self.infoContentLabel.textColor = QSLColor.textColor_A7
+            self.infoContentLabel.backgroundColor = UIColor.clear
+            self.infoContentLabel.layer.borderColor = UIColor.clear.cgColor
+            self.infoContentLabel.layer.borderWidth = 1
+            self.infoContentLabel.layer.cornerRadius = 9.rpx
+            self.infoContentLabel.layer.masksToBounds = true
+        }
+        
     }
 }
 
@@ -71,7 +87,7 @@ extension QSLMineInfoView {
         }
         
         infoContentLabel.snp.makeConstraints { make in
-            make.height.equalTo(17.rpx)
+            make.height.equalTo(18.rpx)
             make.left.equalTo(infoAvatarImageView.snp.right).offset(12.rpx)
             make.top.equalTo(infoNameLabel.snp.bottom).offset(2.rpx)
         }

+ 12 - 0
QuickSearchLocation/Classes/Pages/QSLVip/Controller/QSLActivityVipVC.swift

@@ -63,6 +63,18 @@ class QSLActivityVipVC: QSLBaseController {
     }
     
     @objc func payBtnAction() {
+        if(!QSLBaseManager.shared.isLogin()){
+            if(QSLBaseManager.shared.isVip()){
+                QSLJumpManager.shared.pushToLogin(type: .member)
+                return
+            }
+            
+            if(QSLConfig.loginPayEnable){
+                QSLJumpManager.shared.pushToLogin(type: .member)
+                return
+            }
+        }
+        
         if let curGood = self.selectGood {
             QSLCountdownManager.shared.selectGood = curGood
         }

+ 12 - 0
QuickSearchLocation/Classes/Pages/QSLVip/Controller/QSLVipController.swift

@@ -578,6 +578,18 @@ extension QSLVipController {
     
     // 支付按钮点击
     @objc func unlockBtnAction() {
+        if(!QSLBaseManager.shared.isLogin()){
+            if(QSLBaseManager.shared.isVip()){
+                QSLJumpManager.shared.pushToLogin(type: .member)
+                return
+            }
+            
+            if(QSLConfig.loginPayEnable){
+                QSLJumpManager.shared.pushToLogin(type: .member)
+                return
+            }
+        }
+        
         if let curGood = self.selectGood {
             QSLCountdownManager.shared.selectGood = curGood
         }

+ 90 - 11
QuickSearchLocation/Classes/Pages/QSLVip/Controller/QSLVipTrialVC.swift

@@ -7,6 +7,7 @@
 
 import UIKit
 import YYText
+import GKCycleScrollView
 
 enum QSLTrialVipJumpType: Int {
     
@@ -19,9 +20,12 @@ class QSLVipTrialVC: QSLBaseController {
 
     var type: QSLTrialVipJumpType?
     var selectGood: QSLGoodModel?
+    var bannerList : [String] = []
     
     override func viewDidLoad() {
         super.viewDidLoad()
+        QSEventHandle.eventPush(eventName: QSLGravityConst.activity_exposure_page, eventProps: ["page_type":"activity_page"])
+        QSEventHandle.eventPush(eventName: QSLGravityConst.activity_exposure_page, eventProps: ["page_type":"coupon_popup"])
         QSLCountdownManager.shared.addDelegate(self)
         setUI()
         requestNetwork()
@@ -43,7 +47,7 @@ class QSLVipTrialVC: QSLBaseController {
         QSLNetwork().request(.wakeupTrialList(dict: ["itemListType": 2])) {[weak self] response in
             // 后续逻辑不变...
             let list = response.mapArray(QSLGoodModel.self, modelKey: "data>list")
- 
+            
             if list.count > 0 {
                 self?.selectGood = list[0]
                 
@@ -68,13 +72,25 @@ class QSLVipTrialVC: QSLBaseController {
                             userInfo: ["showCoupon": true, "couponType":"1"]
                         )
                     }
-
+                    
                 }
-                
-
             }
+            
+            let bannerModel = response.mapObject(QSLWakeupBannerModel.self, modelKey: "data")
+            self?.bannerList = bannerModel.banners
+            if(bannerModel.banners.count > 0){
+                self?.bgCenterView.isHidden = true
+                self?.cycleScrollView.isHidden = false
+                self?.cycleScrollView.reloadData()
+            }else{
+                self?.bgCenterView.isHidden = false
+                self?.cycleScrollView.isHidden = true
+            }
+            
         } fail: { code, error in
             self.view.toast(text: "加载商品列表失败")
+            self.bgCenterView.isHidden = false
+            self.cycleScrollView.isHidden = true
         }
     }
     
@@ -126,6 +142,20 @@ class QSLVipTrialVC: QSLBaseController {
     }
     
     @objc func payBtnAction(){
+        QSEventHandle.eventPush(eventName: QSLGravityConst.activity_page_click, eventProps: ["page_type":"activity_page"])
+        
+        if(!QSLBaseManager.shared.isLogin()){
+            if(QSLBaseManager.shared.isVip()){
+                QSLJumpManager.shared.pushToLogin(type: .member)
+                return
+            }
+            
+            if(QSLConfig.loginPayEnable){
+                QSLJumpManager.shared.pushToLogin(type: .member)
+                return
+            }
+        }
+        
         let memberModel = QSLBaseManager.shared.userModel.memberModel
         
         if let subscriptionExpired = memberModel.subscriptionExpired, !subscriptionExpired {
@@ -144,13 +174,10 @@ class QSLVipTrialVC: QSLBaseController {
                 // 引力传递支付事件
                 gravityInstance?.trackPayEvent(withAmount: Int32(currentGood.amount), withPayType: "CNY", withOrderId: outTradeNo, withPayReason: currentGood.name, withPayMethod: "apple")
                 
-                QSEventHandle.eventPush(eventName: QSLGravityConst.new_vip_result, eventProps: ["is_member":QSLBaseManager.shared.isVip(),"purchase_result": "success","pay_amount":Int32(currentGood.amount)])
-
-                QSEventHandle.gravityPush(eventName: QSLGravityConst.vip_submit_success, eventProps: ["id": 01001])
-                
+                QSEventHandle.eventPush(eventName: QSLGravityConst.activity_purchase_result, eventProps: ["is_member":QSLBaseManager.shared.isVip(),"purchase_result": "success","pay_amount":Int32(currentGood.amount),"page_type":"activity_page"])
                 DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
                     NotificationCenter.default.post(name: QSLNotification.QSLRefreshMember, object: nil)
-                    
+                    self.backBtnAction()
                     if(!QSLBaseManager.shared.isLogin()){
                         QSLJumpManager.shared.pushToLogin(type: .member)
                     }
@@ -158,10 +185,10 @@ class QSLVipTrialVC: QSLBaseController {
                 
             
             } else if status == .cancel {
-                QSEventHandle.eventPush(eventName: QSLGravityConst.new_vip_result, eventProps: ["is_member":QSLBaseManager.shared.isVip(),"purchase_result": "cancel","pay_amount":Int32(currentGood.amount)])
+                QSEventHandle.eventPush(eventName: QSLGravityConst.activity_purchase_result, eventProps: ["is_member":QSLBaseManager.shared.isVip(),"purchase_result": "cancel","pay_amount":Int32(currentGood.amount),"page_type":"activity_page"])
                 QSLLoading.error(text: "支付取消")
             } else if status == .fail {
-                QSEventHandle.eventPush(eventName: QSLGravityConst.new_vip_result, eventProps: ["is_member":QSLBaseManager.shared.isVip(),"purchase_result": "fail","pay_amount":Int32(currentGood.amount)])
+                QSEventHandle.eventPush(eventName: QSLGravityConst.activity_purchase_result, eventProps: ["is_member":QSLBaseManager.shared.isVip(),"purchase_result": "fail","pay_amount":Int32(currentGood.amount),"page_type":"activity_page"])
                 QSLLoading.error(text: "支付失败")
             }
         }
@@ -223,12 +250,21 @@ class QSLVipTrialVC: QSLBaseController {
             make.top.equalTo(bgTopTit2View.snp.bottom).offset(6.rpx)
         }
         
+        bgCenterView.isHidden = true
         bgImageView.addSubview(bgCenterView)
         bgCenterView.snp.makeConstraints { make in
             make.centerX.equalTo(bgImageView.snp.centerX)
             make.bottom.equalTo(0)
         }
         
+        bgImageView.addSubview(cycleScrollView)
+        cycleScrollView.snp.makeConstraints { make in
+            make.centerX.equalTo(bgImageView.snp.centerX)
+            make.width.equalTo(290.rpx)
+            make.height.equalTo(344.rpx)
+            make.bottom.equalTo(30.rpx)
+        }
+        
         self.view.addSubview(vipNaviView)
         vipNaviView.snp.makeConstraints { make in
             make.top.left.right.equalTo(0)
@@ -432,6 +468,7 @@ class QSLVipTrialVC: QSLBaseController {
         item.contentMode = .scaleAspectFill
         item.image = UIImage(named: "vip_trial_bottom_bg")
         item.layer.masksToBounds = true
+        item.isUserInteractionEnabled = true
         return item
     }()
     
@@ -488,6 +525,48 @@ class QSLVipTrialVC: QSLBaseController {
         label.font = UIFont.systemFont(ofSize: 12)
         return label
     }()
+    
+    lazy var cycleScrollView: GKCycleScrollView = {
+      
+        let cycleScrollView = GKCycleScrollView()
+        cycleScrollView.dataSource = self
+        cycleScrollView.delegate = self
+        cycleScrollView.isAutoScroll = true
+        cycleScrollView.isInfiniteLoop = true
+        cycleScrollView.isChangeAlpha = false
+        cycleScrollView.leftRightMargin = 0
+        cycleScrollView.topBottomMargin = 0
+        
+        return cycleScrollView
+    }()
+}
+
+extension QSLVipTrialVC : GKCycleScrollViewDelegate, GKCycleScrollViewDataSource{
+    func cycleScrollView(_ cycleScrollView: GKCycleScrollView!, cellForViewAt index: Int) -> GKCycleScrollViewCell! {
+        if let cell = cycleScrollView.dequeueReusableCell() {
+            cell.imageView.kf.setImage(with: URL(string: self.bannerList[index]))
+            cell.layer.masksToBounds = true
+            cell.contentMode = .scaleAspectFit
+            return cell
+        }
+        
+        let cell = GKCycleScrollViewCell()
+        cell.imageView.kf.setImage(with: URL(string: self.bannerList[index]))
+        cell.layer.masksToBounds = true
+        cell.contentMode = .scaleAspectFit
+        return cell
+
+    }
+    
+    func numberOfCells(in cycleScrollView: GKCycleScrollView!) -> Int {
+        return self.bannerList.count
+    }
+    
+    func sizeForCell(in cycleScrollView: GKCycleScrollView!) -> CGSize {
+        return CGSizeMake(290.rpx, 344.rpx);
+    }
+    
+    
 }
 
 extension QSLVipTrialVC : QSLCountdownManagerDelegate{

+ 5 - 0
QuickSearchLocation/Classes/Pages/QSLVip/QSLVipManager.swift

@@ -487,6 +487,11 @@ extension QSLVipManager: SKPaymentTransactionObserver, SKRequestDelegate {
             payment.applicationUsername = self.orderModel?.appAccountToken
             payment.quantity = 1
             SKPaymentQueue.default().add(payment)
+        }else{
+            if let payCompleteCloure = self.payCompleteCloure {
+                payCompleteCloure(.fail, "")
+                self.payCompleteCloure = nil
+            }
         }
     }
     

+ 7 - 1
QuickSearchLocation/Macro/QSLApi.swift

@@ -13,7 +13,7 @@ enum QSLEnvironment: Int {
 
 struct QSLApi {
     
-    static let environment = QSLEnvironment.local
+    static let environment = QSLEnvironment.prod
     
     // 本地
     static let LocalUrl = "https://ws00.by.takin.cc"
@@ -203,6 +203,9 @@ extension QSLApi {
     
     // 获取轨迹
     static let location_track_query = "/s/v1/location/track/query"
+    
+    static let member_trial_track = "/s/v1/member/trial/track"
+    
 }
 
 extension QSLApi {
@@ -247,4 +250,7 @@ extension QSLApi {
     static let wakeup_press_info = "/s/v1/user/wakeUp/press/info"
     // 试用长按跳转
     static let wakeup_press_check = "/s/v1/user/wakeUp/press/check"
+    
+    // 试用商品列表
+    static let wakeup_trial_banner = "/s/v1/item/trial/banner"
 }

+ 2 - 10
QuickSearchLocation/Macro/QSLConfig.swift

@@ -73,16 +73,8 @@ extension QSLConfig {
         }
     }
     
-    static var addFriendTips: String {
-        if((UserDefaults.standard.value(forKey: "LocAddFriendTips")) != nil){
-            if let status =  UserDefaults.standard.value(forKey: "LocAddFriendTips") as? String{
-                return status
-            }else{
-                return ""
-            }
-        }else{
-            return ""
-        }
+    static var addFriendTipEnable: Bool {
+        return QSLCacheManager.getConfModel()?.addFriendTipEnable ?? true
     }
     
 }

+ 16 - 0
QuickSearchLocation/Macro/QSLGravityConst.swift

@@ -314,3 +314,19 @@ extension QSLGravityConst {
     
    
 }
+
+extension QSLGravityConst {
+    
+    // 试用引导页曝光
+    static let activity_exposure_page = "activity_exposure_page"
+
+    static let activity_page_click = "activity_page_click"
+    // 会员页购买
+    static let activity_purchase_result = "activity_purchase_result"
+    
+    static let unpaid_click_uninstall_popup = "unpaid_click_uninstall_popup"
+    
+    static let trial_exposure_end_popup = "trial_exposure_end_popup"
+    
+    static let trial_click_end_popup = "trial_click_end_popup"
+}

+ 22 - 0
QuickSearchLocation/Resources/Assets.xcassets/Vip/vip_trial_tips.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "Group 43678 (2).png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "Group 43678 (1) (1).png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
QuickSearchLocation/Resources/Assets.xcassets/Vip/vip_trial_tips.imageset/Group 43678 (1) (1).png


BIN
QuickSearchLocation/Resources/Assets.xcassets/Vip/vip_trial_tips.imageset/Group 43678 (2).png