1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- //
- // UseServiceAndPrivacyModal.swift
- // fiveConstant
- //
- // Created by 李建 on 2023/1/16.
- //
- import SwiftUI
- struct UseServiceAndPrivacyModal: View {
- @Binding var show:Bool
- var onOk: () ->()
- var body: some View {
- ZStack {
- MaskView(bgColor: .gray)
- VStack {
- Text("用户协议和隐私政策")
- .font(.title3)
- ScrollView {
- Text("欢迎使用永续绿建五恒 APP,我们非常重视您的隐私保护和个人信息保护,使用本软件的过程中我们会严格按照法律规定收集存储和使用您的个人信息,未经您的同意我们不会向第三方提供您的任何信息,您可以阅读《用户协议》 和《隐私协议》 全文了解详细信息。如您同意,请点击“同意”开始接受我们的服务。")
- }
- .frame(height: 200)
- Button {
- self.onOk()
- } label: {
- Text("同意")
- .foregroundColor(.white)
- .padding(9)
- .frame(maxWidth: .infinity)
- .background(
- Color("MainColor")
- .cornerRadius(8)
- )
- .border(Color("MainColor"), width: 0)
- }
- Button {
- show.toggle()
- } label: {
- Text("不同意退出")
- .foregroundColor(Color.gray)
- }
- .padding()
- }
- .padding(.bottom, 40)
- .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: 400)
- .cornerRadius(8)
- .padding(.horizontal, 48)
- .background(Color.white)
- }
- }
- }
- struct MaskView: View {
- var bgColor: Color
- var body: some View {
- VStack {
- Spacer()
- }
- .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity)
- .background(bgColor)
- .edgesIgnoringSafeArea(.all)
- .opacity(0.5)
- }
- }
- struct UseServiceAndPrivacyModal_Previews: PreviewProvider {
- @State static var show:Bool = true
- static var previews: some View {
- UseServiceAndPrivacyModal(show: $show) {
-
- }
- }
- }
|