增加online检测
This commit is contained in:
parent
051051b5d8
commit
832447d9cc
Binary file not shown.
@ -675,10 +675,10 @@
|
|||||||
filePath = "SwiftProject/Project/View/FeedbackView/FeedbackView.swift"
|
filePath = "SwiftProject/Project/View/FeedbackView/FeedbackView.swift"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "154"
|
startingLineNumber = "169"
|
||||||
endingLineNumber = "154"
|
endingLineNumber = "169"
|
||||||
landmarkName = "show(praiseCallback:negativeCallback:)"
|
landmarkName = "show(praiseCallback:negativeCallback:)"
|
||||||
landmarkType = "7">
|
landmarkType = "9">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
</BreakpointProxy>
|
</BreakpointProxy>
|
||||||
<BreakpointProxy
|
<BreakpointProxy
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
import SVProgressHUD
|
||||||
class FeedBackVC: BaseController, UITextViewDelegate, UITextFieldDelegate {
|
class FeedBackVC: BaseController, UITextViewDelegate, UITextFieldDelegate {
|
||||||
//问题意见标题Label
|
//问题意见标题Label
|
||||||
private lazy var problemTitleLabel:UILabel = setLabel(NSLocalizedString("v1.5_problem/suggestion title", comment: ""), color: .init(r: 255, g: 255, b: 255, a: 0.8), font: .systemFont(ofSize: 16, weight: .medium))
|
private lazy var problemTitleLabel:UILabel = setLabel(NSLocalizedString("v1.5_problem/suggestion title", comment: ""), color: .init(r: 255, g: 255, b: 255, a: 0.8), font: .systemFont(ofSize: 16, weight: .medium))
|
||||||
@ -39,7 +39,7 @@ class FeedBackVC: BaseController, UITextViewDelegate, UITextFieldDelegate {
|
|||||||
return textField
|
return textField
|
||||||
}()
|
}()
|
||||||
//二号计数Label
|
//二号计数Label
|
||||||
private lazy var twoNumbersLabel:UILabel = setLabel("0/30", color: .init(r: 255, g: 255, b: 255, a: 0.5), font: .systemFont(ofSize: 14, weight: .medium))
|
private lazy var twoNumbersLabel:UILabel = setLabel("0/50", color: .init(r: 255, g: 255, b: 255, a: 0.5), font: .systemFont(ofSize: 14, weight: .medium))
|
||||||
//提交按钮
|
//提交按钮
|
||||||
private lazy var submitButton:UIButton = {
|
private lazy var submitButton:UIButton = {
|
||||||
let btn = UIButton()
|
let btn = UIButton()
|
||||||
@ -53,7 +53,7 @@ class FeedBackVC: BaseController, UITextViewDelegate, UITextFieldDelegate {
|
|||||||
btn.backgroundColor = .init(r: 42, g: 42, b: 42, a: 1)
|
btn.backgroundColor = .init(r: 42, g: 42, b: 42, a: 1)
|
||||||
btn.layer.masksToBounds = true
|
btn.layer.masksToBounds = true
|
||||||
btn.layer.cornerRadius = 12
|
btn.layer.cornerRadius = 12
|
||||||
|
btn.isEnabled = false
|
||||||
return btn
|
return btn
|
||||||
}()
|
}()
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
@ -171,11 +171,11 @@ class FeedBackVC: BaseController, UITextViewDelegate, UITextFieldDelegate {
|
|||||||
//MARK: - textField And textView
|
//MARK: - textField And textView
|
||||||
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
|
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
|
||||||
let text = (textField.text! as NSString).replacingCharacters(in: range, with: string)
|
let text = (textField.text! as NSString).replacingCharacters(in: range, with: string)
|
||||||
guard text.count <= 30 else {
|
guard text.count <= 50 else {
|
||||||
twoNumbersLabel.text = "30/30"
|
twoNumbersLabel.text = "50/50"
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
twoNumbersLabel.text = "\(text.count)/30"
|
twoNumbersLabel.text = "\(text.count)/50"
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
func textViewShouldBeginEditing(_ textView: UITextView) -> Bool {
|
func textViewShouldBeginEditing(_ textView: UITextView) -> Bool {
|
||||||
@ -208,7 +208,7 @@ class FeedBackVC: BaseController, UITextViewDelegate, UITextFieldDelegate {
|
|||||||
submitButton.backgroundColor = .init(r: 83, g: 38, b: 214, a: 1)
|
submitButton.backgroundColor = .init(r: 83, g: 38, b: 214, a: 1)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if str.count >= 5 {
|
if str.count >= 1 {
|
||||||
submitButton.isEnabled = true
|
submitButton.isEnabled = true
|
||||||
submitButton.backgroundColor = .init(r: 83, g: 38, b: 214, a: 1)
|
submitButton.backgroundColor = .init(r: 83, g: 38, b: 214, a: 1)
|
||||||
}else {
|
}else {
|
||||||
@ -224,13 +224,15 @@ class FeedBackVC: BaseController, UITextViewDelegate, UITextFieldDelegate {
|
|||||||
}
|
}
|
||||||
//提交
|
//提交
|
||||||
@objc private func submitClick(_ sender:UIButton) {
|
@objc private func submitClick(_ sender:UIButton) {
|
||||||
|
|
||||||
|
SVProgressHUD.show(withStatus: NSLocalizedString("v1.5_提交中...", comment: ""))
|
||||||
//获取
|
//获取
|
||||||
let probleText = problemTextView.text ?? ""
|
let probleText = problemTextView.text ?? ""
|
||||||
let contact = contactTextField.text ?? ""
|
let contact = contactTextField.text ?? ""
|
||||||
|
|
||||||
//上传用户反馈的内容
|
//上传用户反馈的内容
|
||||||
ZNetUtil.postUrl(urlStr: ZNetUtil.kUserFeedbackUrl, params: ["catalog":"feedback","remark":probleText,"contact":contact]) { [weak self] result, error in
|
ZNetUtil.postUrl(urlStr: ZNetUtil.kUserFeedbackUrl, params: ["catalog":"feedback","remark":probleText,"contact":contact]) { [weak self] result, error in
|
||||||
|
SVProgressHUD.dismiss()
|
||||||
self?.navigationController?.popViewController(animated: true)
|
self?.navigationController?.popViewController(animated: true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,8 +23,8 @@ class MenuVC: BaseController,UITableViewDelegate,UITableViewDataSource {
|
|||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
self.configureUI()
|
self.configureUI()
|
||||||
let remoteConfig = FirebaseRemoteConfig.RemoteConfig.remoteConfig()
|
// let remoteConfig = FirebaseRemoteConfig.RemoteConfig.remoteConfig()
|
||||||
print("..\(remoteConfig).")
|
// print("..\(remoteConfig).")
|
||||||
// self.configureData()
|
// self.configureData()
|
||||||
// {
|
// {
|
||||||
// "default":[{"icon":"xxxxxx","title":"wecht","url":""},
|
// "default":[{"icon":"xxxxxx","title":"wecht","url":""},
|
||||||
@ -158,7 +158,7 @@ class MenuVC: BaseController,UITableViewDelegate,UITableViewDataSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var localConfig = contactConfig[NSLocalizedString("menu_lang", comment: "")] as? [[String:Any]]
|
var localConfig = contactConfig[NSLocalizedString("v1.5_menu_lang", comment: "")] as? [[String:Any]]
|
||||||
if localConfig == nil {
|
if localConfig == nil {
|
||||||
localConfig = contactConfig["default"] as? [[String:Any]]
|
localConfig = contactConfig["default"] as? [[String:Any]]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,8 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import StoreKit
|
import StoreKit
|
||||||
|
import Firebase
|
||||||
|
import FirebaseRemoteConfig
|
||||||
class FeedbackView: UIView {
|
class FeedbackView: UIView {
|
||||||
var scenterBgView:UIView?
|
var scenterBgView:UIView?
|
||||||
var alphaBgView:UIView?
|
var alphaBgView:UIView?
|
||||||
@ -119,6 +121,19 @@ class FeedbackView: UIView {
|
|||||||
|
|
||||||
@objc func praiseAction(sender:UIButton) {
|
@objc func praiseAction(sender:UIButton) {
|
||||||
hiddenSelf()
|
hiddenSelf()
|
||||||
|
let config = FirebaseRemoteConfig.RemoteConfig.remoteConfig()
|
||||||
|
let menuParams = config.configValue(forKey: "menuParams")
|
||||||
|
guard let dicInfo = menuParams.jsonValue as? [String:Any] else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
guard let isOnline = dicInfo["isOnline"] as? Bool else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if isOnline == false {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
guard let praiseCallback else {
|
guard let praiseCallback else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -132,4 +132,5 @@
|
|||||||
"v1.5_contact information placeholder" = "Please @xxxx.com";
|
"v1.5_contact information placeholder" = "Please @xxxx.com";
|
||||||
"v1.5_contact information title" = "Contact information";
|
"v1.5_contact information title" = "Contact information";
|
||||||
"v1.5_submit" = "Submit";
|
"v1.5_submit" = "Submit";
|
||||||
"menu_lang" = "en";
|
"v1.5_menu_lang" = "en";
|
||||||
|
"v1.5_提交中..." = "submiting...";
|
||||||
|
|||||||
@ -128,4 +128,5 @@
|
|||||||
"v1.5_contact information title" = "联系信息";
|
"v1.5_contact information title" = "联系信息";
|
||||||
"v1.5_contact information placeholder" = "请输入 @xxxx.com";
|
"v1.5_contact information placeholder" = "请输入 @xxxx.com";
|
||||||
"v1.5_submit" = "提交";
|
"v1.5_submit" = "提交";
|
||||||
"menu_lang" = "zh";
|
"v1.5_menu_lang" = "en";
|
||||||
|
"v1.5_提交中..." = "提交中...";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user