iOS-study
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. //
  2. // ContentView.swift
  3. // iOSFirst
  4. //
  5. // Created by 孙宇峰 on 2023/1/31.
  6. //
  7. import SwiftUI
  8. struct ContentView: View {
  9. var body: some View {
  10. VStack(alignment:.leading,spacing: 0) {
  11. HStack{
  12. Spacer()
  13. Image(systemName: "globe")
  14. .imageScale(.large)
  15. .foregroundColor(.accentColor)
  16. Text("设置").font(.system(size: 14))
  17. }
  18. Text("欢迎来到")
  19. .foregroundColor(.gray)
  20. .font(.system(size: 30))
  21. .multilineTextAlignment(.center)
  22. .bold()
  23. .padding(.top,20)
  24. HStack{
  25. Text("logo")
  26. .foregroundColor(.gray)
  27. .font(.system(size: 30))
  28. .multilineTextAlignment(.center)
  29. .bold()
  30. Image("txtlogo")
  31. .imageScale(.large)
  32. .foregroundColor(.accentColor)
  33. .frame(width: 240,height: 35)
  34. }
  35. .padding(.top,20)
  36. .padding(.bottom,100)
  37. VStack(alignment: .leading, spacing: 400) {
  38. HStack(alignment: .center, spacing: 15) {
  39. Image(systemName: "globe")
  40. .imageScale(.large)
  41. .foregroundColor(.accentColor)
  42. TextField("请输入手机号",text:.constant(""))
  43. .font(.system(size: 16))
  44. .frame(maxWidth: .infinity,alignment: .center)
  45. }
  46. }
  47. .frame(height: 80)
  48. Divider()
  49. VStack(alignment: .leading, spacing: 400) {
  50. HStack(alignment: .center, spacing: 15) {
  51. Image(systemName: "globe")
  52. .imageScale(.large)
  53. .foregroundColor(.accentColor)
  54. TextField("请输入密码",text:.constant(""))
  55. .font(.system(size: 16))
  56. .frame(maxWidth: .infinity,alignment: .center)
  57. }
  58. }.frame(height: 80)
  59. Divider().padding(.bottom,40)
  60. VStack(alignment: .trailing, spacing: 400) {
  61. VStack(alignment: .center, spacing: 15) {
  62. Button(action: {
  63. let msg="点击了登录按钮"
  64. print(msg)
  65. SUIToast.show(messageItem: .init(
  66. message: msg,
  67. bgColor: .gray,
  68. messageColor: .white
  69. ))
  70. }) {
  71. Text("登录")
  72. .font(.system(size: 17))
  73. .bold()
  74. .frame(minWidth: 0, maxWidth: .infinity)
  75. .padding()
  76. .foregroundColor(.white)
  77. .background(.blue)
  78. .cornerRadius(30)
  79. }
  80. }
  81. }
  82. HStack{
  83. Text("验证码登录").font(.system(size:15)).onTapGesture {
  84. let msg="点击了验证码登录"
  85. print(msg)
  86. SUIToast.show(messageItem: .init(
  87. message: msg,
  88. bgColor: .gray,
  89. messageColor: .white
  90. ))
  91. }
  92. Spacer ()
  93. Text("忘记密码?").font(.system(size:15)).onTapGesture {
  94. let msg="点击了密码"
  95. print(msg)
  96. SUIToast.show(messageItem: .init(
  97. message: msg,
  98. bgColor: .gray,
  99. messageColor: .white
  100. ))
  101. }.padding(.vertical,20).font(.system(size: 15))
  102. }
  103. Spacer()
  104. }.padding()
  105. .frame(width: .infinity,height: .infinity)
  106. }
  107. }
  108. struct ContentView_Previews: PreviewProvider {
  109. static var previews: some View {
  110. ContentView()
  111. }
  112. }