杨锴
2025-04-16 09a372bc45fde16fd42257ab6f78b8deeecf720b
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
63
64
65
//
//  LogoutAccountVC.swift
//  XQMuse
//
//  Created by 无故事王国 on 2024/8/21.
//
 
import UIKit
import JQTools
import WebKit
 
class LogoutAccountVC: BaseVC {
 
    @IBOutlet weak var btn_logout: UIButton!
    @IBOutlet weak var label_content: UILabel!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "注销账号"
 
        if !isSimulator{
            Services.getTurn(progress: false).subscribe(onNext: {[weak self]data in
                guard let weakSelf = self else { return }
                if let m = data.data,m == true{
                    weakSelf.label_content.attributedText =  AttributedStringbuilder.build().add(string: "请认真阅读并理解,注销账号将产生以下后果:\n", withFont: .systemFont(ofSize: 16, weight: .medium), withColor: .black.withAlphaComponent(0.6),lineSpace: 10)
                        .add(string: "1、账号信息、第三方授权、认证身份将被清空和取消;\n2、所有使用、收藏、关注列表和购买记录将被清空;\n3、账户中所有的余额将被清空;\n4、账户对应的会员身份与权益将被取消;\n5、您在平台发布的内容将做匿名处理。\n\n", withFont: .systemFont(ofSize: 14, weight: .medium), withColor: .black.withAlphaComponent(0.6), lineSpace: 7)
                        .add(string: "一经确认,以上内容将无法恢复,请谨慎考虑后决定。\n\n", withFont: .systemFont(ofSize: 14, weight: .medium), withColor: .black.withAlphaComponent(0.6),lineSpace: 7)
                        .add(string: "根据相关法律法规,注销泉疗愈账号并不代表注销前的账号行为和相关责任得到豁免或减轻。", withFont: .systemFont(ofSize: 14, weight: .medium), withColor: .black.withAlphaComponent(0.6),lineSpace: 7).mutableAttributedString
                }
            }).disposed(by: disposeBag)
        }
 
 
        label_content.attributedText =  AttributedStringbuilder.build().add(string: "请认真阅读并理解,注销账号将产生以下后果:\n", withFont: .systemFont(ofSize: 16, weight: .medium), withColor: .black.withAlphaComponent(0.6),lineSpace: 10)
            .add(string: "1、账号信息、第三方授权、认证身份将被清空和取消;\n2、所有使用、收藏、关注列表将被清空;\n3、账户对应的会员身份与权益将被取消;\n4、您在平台发布的内容将做匿名处理。\n\n", withFont: .systemFont(ofSize: 14, weight: .medium), withColor: .black.withAlphaComponent(0.6), lineSpace: 7)
            .add(string: "一经确认,以上内容将无法恢复,请谨慎考虑后决定。\n\n", withFont: .systemFont(ofSize: 14, weight: .medium), withColor: .black.withAlphaComponent(0.6),lineSpace: 7)
            .add(string: "根据相关法律法规,注销泉疗愈账号并不代表注销前的账号行为和相关责任得到豁免或减轻。", withFont: .systemFont(ofSize: 14, weight: .medium), withColor: .black.withAlphaComponent(0.6),lineSpace: 7).mutableAttributedString
 
 
    }
    @IBAction func completeAction(_ sender: UIButton) {
        Services.deleteUser().subscribe(onNext: {data in
            CommonAlertView.show(title: "提示", content: "注销成功", cancelStr: nil, completeStr: "确定", isSingle: true) { state in
                if state{
                    UserDefaultSettingViewModel.clearSetting()
                    sceneDelegate?.needLogin()
                    self.navigationController?.popToRootViewController(animated: false)
                    DispatchQueue.main.asyncAfter(delay: 0.5) {
                        self.navigationController?.tabBarController?.selectedIndex = 0
                    }
                }
            }
        }).disposed(by: disposeBag)
    }
 
    @IBAction func quitAction(_ sender: UIButton) {
        self.navigationController?.popViewController()
    }
 
 
    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        btn_logout.jq_gradientNibColor(colorArr: [UIColor(hexStr: "#8EA47A").cgColor,UIColor(hexStr: "#AFCA98").cgColor], cornerRadius: 20)
    }
}