IntegralWebViewController.swift 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // IntegralWebViewController.swift
  3. // xingchuangke
  4. //
  5. // Created by Virgil on 2019/5/5.
  6. // Copyright © 2019 Virgil. All rights reserved.
  7. //
  8. import UIKit
  9. class IntegralWebViewController: BaseViewController {
  10. var wkWebView: WKWebView!
  11. override func viewDidLoad() {
  12. super.viewDidLoad()
  13. self.title = "积分专区"
  14. initNavLeftBackButton()
  15. let config = WKWebViewConfiguration.init()
  16. wkWebView = WKWebView.init(frame: self.view.bounds, configuration: config)
  17. self.view.addSubview(wkWebView)
  18. let urlStr = "\(RequestURL.integralMain)#/?user_level=2&org_id=\(RequestURL.orgId)&user_no=\(CommonValue.getUserId())"
  19. wkWebView.load(URLRequest(url: URL(string: urlStr)!))
  20. initNavRightButtonForImage(imgName: "share_common")
  21. }
  22. override func btnRightMenuClick() {
  23. CommonUMengShare.showSharedMenu(viewController: self, title: "立即注册,积分兑钱", desc: "15+家热门银行、超高兑换价、快速结算", icon: UIImage(named: "icon")!, url: "\(RequestURL.userRecCode)?recCode=\(CommonValue.getUserRecCode())")
  24. }
  25. override func handleBack() {
  26. if wkWebView.canGoBack {
  27. wkWebView.goBack()
  28. } else {
  29. super.handleBack()
  30. }
  31. }
  32. override func viewWillAppear(_ animated: Bool) {
  33. super.viewWillAppear(animated)
  34. self.tabBarController?.title = self.title
  35. }
  36. override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
  37. super.init(nibName: "IntegralWebViewController", bundle: nil)
  38. }
  39. required init?(coder aDecoder: NSCoder) {
  40. fatalError("init(coder:) has not been implemented")
  41. }
  42. }