Parcourir la source

feat: 增加客服 意见反馈入口

zhujieshan il y a 3 semaines
Parent
commit
621fcc7d14

+ 4 - 4
QuickSearchLocation.xcodeproj/project.pbxproj

@@ -1387,7 +1387,7 @@
 				CODE_SIGN_ENTITLEMENTS = QuickSearchLocation/QuickSearchLocationDebug.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 42;
+				CURRENT_PROJECT_VERSION = 45;
 				DEVELOPMENT_TEAM = Q364C8K9BL;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -1412,7 +1412,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 1.2.8;
+				MARKETING_VERSION = 1.3.0;
 				PRODUCT_BUNDLE_IDENTIFIER = com.manbu.shouji;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1433,7 +1433,7 @@
 				CODE_SIGN_ENTITLEMENTS = QuickSearchLocation/QuickSearchLocationRelease.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 42;
+				CURRENT_PROJECT_VERSION = 45;
 				DEVELOPMENT_TEAM = Q364C8K9BL;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -1458,7 +1458,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 1.2.8;
+				MARKETING_VERSION = 1.3.0;
 				PRODUCT_BUNDLE_IDENTIFIER = com.manbu.shouji;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";

+ 2 - 2
QuickSearchLocation/Classes/Common/Tool/QSLGuideusersToCommentManager.swift

@@ -65,10 +65,10 @@ class QSLGuideusersToCommentManager: NSObject {
                 DispatchQueue.main.async {
                     QSLInAppReviewmanager.requestReview()
                 }
-            }else{
-                closeBtnClosure()
             }
+            closeBtnClosure()
         } fail: { code, msg in
+            closeBtnClosure()
         }
     }
     

+ 19 - 0
QuickSearchLocation/Classes/Common/Tool/QSLJumpManager.swift

@@ -204,5 +204,24 @@ extension QSLJumpManager {
         vc.type = type
         self.rootViewController()?.pushVC(vc: vc)
     }
+    
+    // 跳转到意见反馈页面
+    func pushToFeedback() {
+        let vc = QSLFeedbackVC()
+        self.rootViewController()?.pushVC(vc: vc)
+    }
+    
+    // 跳转到客服页面
+    func pushToCustomer() {
+        if(!QSLBaseManager.shared.isLogin()){
+            return
+        }
+        
+        let phone = QSLBaseManager.shared.userModel.phone
+        let vc = QSLWebViewController()
+        vc.webUrl = "https://qiyu-kefu.atmob.com?ssid=\(phone)&device_id=\(phone)&app_platform=2&app_version=\(QSLApi.appVersionName)&package_name=\(QSLApi.packageName)&app_name=\(QSLApi.appName)&phone=\(phone)"
+        vc.isShowTop = true
+        self.rootViewController()?.present(vc, animated: true)
+    }
 }
 

+ 154 - 17
QuickSearchLocation/Classes/Main/ViewController.swift

@@ -6,28 +6,125 @@
 //
 
 import UIKit
+import Alamofire
 
 class ViewController: UIViewController {
-
+    private var timer: Timer?
+    private var count = 0
+    
     override func viewDidLoad() {
         super.viewDidLoad()
-        self.intoMain()
+        self.checkNetwork()
+        self.setUI()
     }
     
-    func intoMain() {
+    @objc private func updateCountdown() {
+        if(count > 6){
+            self.contentLabel.isHidden = false
+            self.oneButton.isHidden = false
+            invalidateTimer()
+        }
+        count += 1
+        
+    }
+    
+    private func invalidateTimer() {
+        timer?.invalidate()
+        timer = nil
+    }
+    
+    func setUI(){
+        if timer == nil {
+            timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(updateCountdown), userInfo: nil, repeats: true)
+            RunLoop.current.add(timer!, forMode: .common)
+        }
+        
+        self.view.addSubview(bgView)
+        bgView.snp.makeConstraints { make in
+            make.left.right.bottom.equalToSuperview()
+            make.height.equalTo(131)
+        }
+
+        self.view.addSubview(bgLogoView)
+        bgLogoView.snp.makeConstraints { make in
+            make.size.equalTo(CGSize(width: 96, height: 96))
+            make.centerX.equalToSuperview()
+            make.top.equalTo(self.view.safeAreaLayoutGuide.snp.top).offset(130)
+        }
+        
+        self.view.addSubview(bgTitleView)
+        bgTitleView.snp.makeConstraints { make in
+            make.left.equalToSuperview().offset(96)
+            make.right.equalToSuperview().offset(-96)
+            make.bottom.equalTo(self.view.safeAreaLayoutGuide.snp.bottom).offset(-40)
+            make.height.equalTo(bgTitleView.snp.width).multipliedBy(156.0/501.0)
+        }
+        
+        self.view.addSubview(contentLabel)
+        contentLabel.snp.makeConstraints { make in
+            make.size.equalTo(CGSize(width: QSLConst.qsl_kScreenW, height: 18.0.rpx))
+            make.center.equalToSuperview()
+        }
         
+        self.view.addSubview(oneButton)
+        oneButton.snp.makeConstraints { make in
+            make.size.equalTo(CGSize(width: 140.rpx, height: 44.rpx))
+            make.centerX.equalToSuperview()
+            make.top.equalTo(contentLabel.snp.bottom).offset(20.rpx)
+        }
+        
+        self.contentLabel.isHidden = true
+        self.oneButton.isHidden = true
+        
+    }
+    
+    @objc func checkNetworkSetting(){
+        if let url = URL(string: UIApplication.openSettingsURLString), UIApplication.shared.canOpenURL(url) {
+            
+            UIApplication.shared.open(url)
+        }
+    }
+    
+    @objc func checkNetwork(){
+        NetworkReachabilityManager.default?.startListening(onUpdatePerforming: {[weak self] status in
+            if(status != .notReachable){
+                print("checkIDFA")
+                UNUserNotificationCenter.current().requestAuthorization(
+                    options: [.alert, .sound, .badge]
+                ) { granted, error in
+                    DispatchQueue.main.async {
+                        if granted {
+                            DispatchQueue.main.async {
+                                UIApplication.shared.registerForRemoteNotifications()
+                            }
+                        } else if let error = error {
+                            print("Error: \(error.localizedDescription)")
+                        }
+
+                        self?.intoMain()
+                    }
+                }
+                NetworkReachabilityManager.default?.stopListening()
+                self?.invalidateTimer()
+            }
+        })
+    }
+    
+    func intoMain() {
+        self.contentLabel.isHidden = true
+        self.oneButton.isHidden = true
         QSLBaseManager.shared.initConfig()
         
         // 是否通过引导页
-        let isShowGuideKey = UserDefaults.standard.bool(forKey: "isShowGuideKey")
-        if !isShowGuideKey {
-            // 引导页
-            UserDefaults.standard.set(true, forKey: "isShowGuideKey")
-            if let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate {
-                sceneDelegate.window?.rootViewController = QSLGuideController()
-                sceneDelegate.window?.makeKeyAndVisible()
-            }
-        } else {
+//        let isShowGuideKey = UserDefaults.standard.bool(forKey: "isShowGuideKey")
+//        if !isShowGuideKey {
+//            // 引导页
+//            UserDefaults.standard.set(true, forKey: "isShowGuideKey")
+//            if let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate {
+//                sceneDelegate.window?.rootViewController = QSLGuideController()
+//                sceneDelegate.window?.makeKeyAndVisible()
+//            }
+//        } else {
             UNUserNotificationCenter.current().requestAuthorization(
                 options: [.alert, .sound, .badge]
             ) { granted, error in
@@ -42,18 +139,59 @@ class ViewController: UIViewController {
                 }
             }
             
-            if(!QSLBaseManager.shared.isLoadG){
-                QSLBaseManager.shared.initIDFA()
-            }
+            QSLBaseManager.shared.initIDFA()
             // 主页
             if let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate {
                 sceneDelegate.window?.rootViewController = CustomTabBarController()
                 sceneDelegate.window?.makeKeyAndVisible()
             }
-        }
+//        }
         
     }
     
+    lazy var bgView: UIImageView = {
+        let item = UIImageView()
+        item.image = UIImage(named: "launch_bottom_bg")
+        item.contentMode = .scaleToFill
+        return item
+    }()
+    
+    lazy var bgLogoView: UIImageView = {
+        let item = UIImageView()
+        item.image = UIImage(named: "launch_icon")
+        item.contentMode = .scaleToFill
+        return item
+    }()
+    
+    lazy var bgTitleView: UIImageView = {
+        let item = UIImageView()
+        item.image = UIImage(named: "launch_title")
+        item.contentMode = .scaleToFill
+        return item
+    }()
+    
+    lazy var contentLabel: UILabel = {
+        let label = UILabel()
+        label.text("网络错误,请检查网络权限")
+        label.font(16)
+        label.textColor = .black
+        label.textAlignment = .center
+        return label
+    }()
+    
+    lazy var oneButton: UIButton = {
+      
+        let btn = UIButton()
+        btn.addRadius(radius: 22.rpx)
+        btn.title("去设置")
+        btn.textColor(.white)
+        btn.mediumFont(14)
+        btn.gradientBackgroundColor(color1: .hexStringColor(hexString: "#15CBA1"), color2: .hexStringColor(hexString: "#1FE0BA"), width: 250.rpx, height: 44.rpx, direction: .horizontal)
+        btn.addTarget(self, action: #selector(checkNetworkSetting), for: .touchUpInside)
+        return btn
+    }()
+    
+    
     // 用户协议跳转
     func agreementAction() {
         
@@ -74,4 +212,3 @@ class ViewController: UIViewController {
         self.present(vc, animated: true)
     }
 }
-

+ 1 - 1
QuickSearchLocation/Classes/Pages/QSLHome/Controller/QSLHomeController.swift

@@ -763,7 +763,7 @@ extension QSLHomeController: QSLHomeEmptyViewDelegate, QSLHomeFriendViewDelegate
         switch self.homeFriendView.scrollLocation {
         case .ScrollTop:
             self.homeFriendView.snp.updateConstraints { make in
-                make.top.equalTo(QSLConst.qsl_kStatusBarFrameH - 40.rpx)
+                make.top.equalTo(QSLConst.qsl_kStatusBarFrameH)
             }
             break
         case .ScrollCenter:

+ 11 - 0
QuickSearchLocation/Classes/Pages/QSLHome/View/QSLHomeAddFriendAlertView.swift

@@ -8,6 +8,11 @@
 import UIKit
 
 class QSLHomeAddFriendView: UIView {
+    lazy var bgButton: UIButton = {
+        let btn = UIButton()
+        btn.addTarget(self, action: #selector(removeView), for: .touchUpInside)
+        return btn
+    }()
     
     lazy var contentView: UIView = {
         
@@ -129,6 +134,12 @@ extension QSLHomeAddFriendView {
     
     func initView() {
         
+        addSubview(bgButton)
+        bgButton.snp.makeConstraints { make in
+            make.size.equalTo(CGSize(width: QSLConst.qsl_kScreenW, height: QSLConst.qsl_kScreenH))
+            make.center.equalToSuperview()
+        }
+        
         addSubview(contentView)
         contentView.snp.makeConstraints { make in
             make.size.equalTo(CGSize(width: QSLConst.qsl_kScreenW, height: 365.0.rpx))

+ 1 - 0
QuickSearchLocation/Classes/Pages/QSLMine/Controller/QSLFeedbackVC.swift

@@ -34,6 +34,7 @@ class QSLFeedbackVC: QSLBaseController {
         QSLLoading.show()
         DispatchQueue.main.asyncAfter(deadline: .now() + 0.8) {
             QSLLoading.success(text: "提交成功")
+            self.navigationController?.popViewController(animated: true)
         }
     }
     

+ 31 - 24
QuickSearchLocation/Classes/Pages/QSLMine/Controller/QSLMineController.swift

@@ -82,8 +82,7 @@ extension QSLMineController {
             
             QSLBaseManager.shared.saveUserId(id: memberModel.userId)
             
-            self.mineVipView.updateUI()
-//            NotificationCenter.default.post(name: QSLNotification.QSLRefreshMember, object: nil)
+            self.updateUI()
             
         } fail: { code, error in
             
@@ -130,35 +129,44 @@ extension QSLMineController: QSLMineVipViewDelegate {
 extension QSLMineController: QSLMineFuncViewDelegate {
     
     func didSelectRowAt(indexPath: IndexPath) {
-        switch indexPath.row {
-        case 0:
+        switch viewModel.funcLists[indexPath.row]["title"] {
+        case "添加紧急联系人":
             self.jumpToContact()
             break
-        case 1:
+        case "权限设置":
             // 权限跳转
             self.authAction()
             break
-        case 2:
+        case "关于我们":
             // 关于我们
             self.jumpToInfo()
             break
-        case 3:
+        case "注销账号":
             // 注销
             self.logOffAction()
             break
-        case 4:
+        case "退出登录":
             // 退出登录
             self.logoutAction()
             break
-        case 5: break
-        case 6: break
-        case 7:
-            
+        case "用户反馈":
+            self.feedbackAction()
+            break
+        case "联系客服":
+            self.customerAction()
             break
         default: break
         }
     }
     
+    func customerAction() {
+        QSLJumpManager.shared.pushToCustomer()
+    }
+    
+    func feedbackAction() {
+        QSLJumpManager.shared.pushToFeedback()
+    }
+    
     func jumpToContact() {
         if QSLBaseManager.shared.isVip() {
             if !QSLBaseManager.shared.isLogin() {
@@ -172,8 +180,6 @@ extension QSLMineController: QSLMineFuncViewDelegate {
         
         QSEventHandle.eventPush( eventName: QSLGravityConst.mine_contact)
         QSLJumpManager.shared.pushToContact(type: .mine)
-//        let vc = QSLContactController()
-//        self.navigationController?.pushViewController(vc, animated: true)
     }
     
     func jumpToInfo() {
@@ -222,15 +228,7 @@ extension QSLMineController: QSLMineFuncViewDelegate {
 extension QSLMineController {
     
     @objc func updateUI() {
-        
-        self.viewModel.initFuncData()
-        
-        mineFuncView.snp.updateConstraints { make in
-            make.height.equalTo(viewModel.funcViewHeight)
-        }
-        
-        self.mineFuncView.funcTableView.reloadData()
-        
+ 
         if QSLBaseManager.shared.isLogin() {
             let name = "用户\(QSLBaseManager.shared.userModel.phone.suffix(4))"
             self.mineInfoView.config(name: name, content: "您好,尊敬的用户")
@@ -242,8 +240,17 @@ extension QSLMineController {
             }
             
         }
-        
+ 
         mineVipView.updateUI()
+        
+        self.viewModel.initFuncData()
+        
+        mineFuncView.snp.updateConstraints { make in
+            make.height.equalTo(viewModel.funcViewHeight)
+        }
+        
+        self.mineFuncView.funcTableView.reloadData()
+        
     }
     
     func setUpUI() {

+ 27 - 14
QuickSearchLocation/Classes/Pages/QSLMine/ViewModel/QSLMineViewModel.swift

@@ -15,9 +15,8 @@ class QSLMineViewModel: NSObject {
     
     var funcViewHeight = 72.0.rpx
     
-    var funcLists = [["image":"mine_func_about","title":"关于我们"],
-                     ["image":"mine_func_logoff","title":"注销账号"],
-                     ["image":"mine_func_logout","title":"退出登录"]]
+    var funcLists = [["image":"mine_func_advice","title":"用户反馈"],
+                     ["image":"mine_func_about","title":"关于我们"]]
     
     override init() {
         super.init()
@@ -35,23 +34,37 @@ extension QSLMineViewModel {
             funcLists = [
                 ["image":"mine_func_emergency","title":"添加紧急联系人"],
 //                ["image":"mine_func_share","title":"分享好友"],
-//                ["image":"mine_func_advice","title":"用户反馈"],
+                ["image":"mine_func_advice","title":"用户反馈"],
 //                ["image":"mine_func_contact","title":"联系客服"],
                 ["image":"mine_func_auth","title":"权限设置"],
                 ["image":"mine_func_about","title":"关于我们"],
             ]
         } else {
             // 登录
-            funcLists = [
-                ["image":"mine_func_emergency","title":"添加紧急联系人"],
-//                ["image":"mine_func_share","title":"分享好友"],
-//                ["image":"mine_func_advice","title":"用户反馈"],
-//                ["image":"mine_func_contact","title":"联系客服"],
-                ["image":"mine_func_auth","title":"权限设置"],
-                ["image":"mine_func_about","title":"关于我们"],
-                ["image":"mine_func_logoff","title":"注销账号"],
-                ["image":"mine_func_logout","title":"退出登录"]
-            ]
+            if QSLBaseManager.shared.isVip() {
+                funcLists = [
+                    ["image":"mine_func_emergency","title":"添加紧急联系人"],
+    //                ["image":"mine_func_share","title":"分享好友"],
+                    ["image":"mine_func_advice","title":"用户反馈"],
+                    ["image":"mine_func_contact","title":"联系客服"],
+                    ["image":"mine_func_auth","title":"权限设置"],
+                    ["image":"mine_func_about","title":"关于我们"],
+                    ["image":"mine_func_logoff","title":"注销账号"],
+                    ["image":"mine_func_logout","title":"退出登录"]
+                ]
+            }else{
+                funcLists = [
+                    ["image":"mine_func_emergency","title":"添加紧急联系人"],
+    //                ["image":"mine_func_share","title":"分享好友"],
+                    ["image":"mine_func_advice","title":"用户反馈"],
+//                    ["image":"mine_func_contact","title":"联系客服"],
+                    ["image":"mine_func_auth","title":"权限设置"],
+                    ["image":"mine_func_about","title":"关于我们"],
+                    ["image":"mine_func_logoff","title":"注销账号"],
+                    ["image":"mine_func_logout","title":"退出登录"]
+                ]
+            }
+
         }
         
         funcViewHeight = 28.0.rpx + Double(funcLists.count) * UX.funcCellHeight