|
@@ -15,6 +15,7 @@ struct LoginView: View {
|
15
|
15
|
var bag = DisposeBag()
|
16
|
16
|
@State private var inputAccountMessage:String = ""
|
17
|
17
|
@State private var isPresent:Bool = false
|
|
18
|
+ @State private var checked:Bool = true
|
18
|
19
|
@State private var inputPasswordMessage:String = ""
|
19
|
20
|
|
20
|
21
|
var body: some View {
|
|
@@ -90,8 +91,17 @@ struct LoginView: View {
|
90
|
91
|
|
91
|
92
|
VStack(alignment: .trailing, spacing: 400) {
|
92
|
93
|
|
93
|
|
- VStack(alignment: .center, spacing: 15) {
|
94
|
|
-
|
|
94
|
+ VStack(alignment: .trailing, spacing: 15) {
|
|
95
|
+ HStack {
|
|
96
|
+ CheckBoxView(checked: $checked)
|
|
97
|
+ Text("我已阅读并同意")
|
|
98
|
+ .foregroundColor(.black)
|
|
99
|
+ .font(.system(size: 15))
|
|
100
|
+ Text("《星火云鸽用户协议》")
|
|
101
|
+ .foregroundColor(.blue)
|
|
102
|
+ .font(.system(size: 15))
|
|
103
|
+ Spacer()
|
|
104
|
+ }
|
95
|
105
|
Button(action: {
|
96
|
106
|
if(inputAccountMessage.isEmpty){
|
97
|
107
|
SUIToast.show(messageItem: .init(
|
|
@@ -165,5 +175,17 @@ struct ContentView_Previews: PreviewProvider {
|
165
|
175
|
}
|
166
|
176
|
}
|
167
|
177
|
|
|
178
|
+struct CheckBoxView: View {
|
|
179
|
+ @Binding var checked: Bool
|
|
180
|
+
|
|
181
|
+ var body: some View {
|
|
182
|
+ Image(systemName: checked ? "checkmark.square.fill" : "square")
|
|
183
|
+ .foregroundColor(checked ? Color(UIColor.systemBlue) : Color.secondary)
|
|
184
|
+ .onTapGesture {
|
|
185
|
+ self.checked.toggle()
|
|
186
|
+ }
|
|
187
|
+ }
|
|
188
|
+}
|
|
189
|
+
|
168
|
190
|
|
169
|
191
|
|