feat: add WeChat sharing and invite flow
This commit is contained in:
@ -157,7 +157,9 @@ private final class AccountSwitchCell: UITableViewCell {
|
||||
|
||||
private let card = UIView()
|
||||
private let avatarView = UIImageView()
|
||||
private let titleStackView = UIStackView()
|
||||
private let titleLabel = UILabel()
|
||||
private let currentTagLabel = UILabel()
|
||||
private let subtitleLabel = UILabel()
|
||||
private let phoneLabel = UILabel()
|
||||
private let tagLabel = UILabel()
|
||||
@ -176,7 +178,23 @@ private final class AccountSwitchCell: UITableViewCell {
|
||||
avatarView.clipsToBounds = true
|
||||
avatarView.contentMode = .scaleAspectFill
|
||||
|
||||
titleStackView.axis = .horizontal
|
||||
titleStackView.alignment = .center
|
||||
titleStackView.spacing = 6
|
||||
|
||||
titleLabel.font = .systemFont(ofSize: 16, weight: .semibold)
|
||||
titleLabel.numberOfLines = 1
|
||||
titleLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
|
||||
currentTagLabel.font = .systemFont(ofSize: 11, weight: .regular)
|
||||
currentTagLabel.text = "当前"
|
||||
currentTagLabel.textColor = AppColor.primary
|
||||
currentTagLabel.textAlignment = .center
|
||||
currentTagLabel.backgroundColor = UIColor(hex: 0xEFF6FF)
|
||||
currentTagLabel.layer.cornerRadius = 4
|
||||
currentTagLabel.clipsToBounds = true
|
||||
currentTagLabel.isHidden = true
|
||||
currentTagLabel.setContentHuggingPriority(.required, for: .horizontal)
|
||||
currentTagLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
|
||||
subtitleLabel.font = .systemFont(ofSize: 13)
|
||||
subtitleLabel.textColor = AppColor.text666
|
||||
phoneLabel.font = .systemFont(ofSize: 12)
|
||||
@ -187,7 +205,10 @@ private final class AccountSwitchCell: UITableViewCell {
|
||||
tagLabel.clipsToBounds = true
|
||||
|
||||
card.addSubview(avatarView)
|
||||
card.addSubview(titleLabel)
|
||||
titleStackView.addArrangedSubview(titleLabel)
|
||||
titleStackView.addArrangedSubview(currentTagLabel)
|
||||
|
||||
card.addSubview(titleStackView)
|
||||
card.addSubview(subtitleLabel)
|
||||
card.addSubview(phoneLabel)
|
||||
card.addSubview(tagLabel)
|
||||
@ -200,14 +221,18 @@ private final class AccountSwitchCell: UITableViewCell {
|
||||
make.leading.centerY.equalToSuperview().inset(14)
|
||||
make.width.height.equalTo(50)
|
||||
}
|
||||
titleLabel.snp.makeConstraints { make in
|
||||
titleStackView.snp.makeConstraints { make in
|
||||
make.leading.equalTo(avatarView.snp.trailing).offset(13)
|
||||
make.top.equalTo(avatarView).offset(2)
|
||||
make.trailing.lessThanOrEqualTo(tagLabel.snp.leading).offset(-8)
|
||||
}
|
||||
currentTagLabel.snp.makeConstraints { make in
|
||||
make.height.equalTo(19)
|
||||
make.width.greaterThanOrEqualTo(34)
|
||||
}
|
||||
subtitleLabel.snp.makeConstraints { make in
|
||||
make.leading.equalTo(titleLabel)
|
||||
make.top.equalTo(titleLabel.snp.bottom).offset(4)
|
||||
make.leading.equalTo(titleStackView)
|
||||
make.top.equalTo(titleStackView.snp.bottom).offset(4)
|
||||
}
|
||||
phoneLabel.snp.makeConstraints { make in
|
||||
make.leading.equalTo(titleLabel)
|
||||
@ -230,9 +255,7 @@ private final class AccountSwitchCell: UITableViewCell {
|
||||
|
||||
func configure(account: AccountSwitchAccount, selected: Bool, isCurrent: Bool) {
|
||||
titleLabel.text = account.title
|
||||
if isCurrent {
|
||||
titleLabel.text = (account.title) + " (当前)"
|
||||
}
|
||||
currentTagLabel.isHidden = !isCurrent
|
||||
subtitleLabel.text = account.subtitle
|
||||
phoneLabel.text = account.phone
|
||||
tagLabel.text = account.isStoreUser ? "门店" : "景区"
|
||||
|
||||
Reference in New Issue
Block a user