宽窄优行-由【嘉易行】项目成品而来
younger_times
2023-07-05 0d8f5fc8a516bfd07e425909e4a4432600572ee7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
//  MineShareVC.swift
//  OKProject
//
//  Created by alvin_y on 2020/6/17.
//  Copyright © 2020 yangwang. All rights reserved.
//
 
import UIKit
 
/// 分享
class MineShareVC: YYViewController {
 
    /// 分享按钮
    private let button_share: YYButton = {
       let button = YYButton()
        button.setTitle("分享给好友", for: .normal)
        button.titleLabel?.font = UIFont.systemFont(ofSize: 14)
        button.setTitleColor(UIColor.color(light: UIColor.color(hexString: "#FFFFFF"), dark: UIColor.color(hexString: "#FFFFFF")), for: .normal)
        button.backgroundColor = ThemeColor
        button.layer.cornerRadius = 4
        return button
    }()
    
    override func viewDidLoad() {
        super.viewDidLoad()
 
        // Do any additional setup after loading the view.
    }
    
 
    //MARK: - UI
    override func setupViews() {
        super.setupViews()
        navigationItem.title = "分享"
        view.backgroundColor = UIColor.color(light: UIColor.color(hexString: "#F3F4F5"), dark: UIColor.color(hexString: "#F3F4F5"))
        view.addSubview(button_share)
    }
    
    //MARK: - Layouts
    override func defineLayouts() {
        super.defineLayouts()
        button_share.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.width.equalTo(screenW - 28)
            make.height.equalTo(40)
            make.bottom.equalToSuperview().offset(-(14 + UIDevice.ld_safeEdges.bottom))
        }
    }
 
    
    //MARK: - Rx
    override func bindRx() {
        super.bindRx()
        
        button_share.rx.tap.subscribe(onNext: {[unowned self] (_) in
            ShareView.share(controller: self, title: nil, content: "新版“宽窄优行”隆重上线,下载注册即送打车券。", url: "\(share_url)/share/shareIndex.html?uid=\(app.userInfo.id)&type=1",hiddenMessage: true).show {
                
            }
        }).disposed(by: disposeBag)
    }
}