first_page.dart 11.7 KB
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/app.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/v_empty_view.dart';

class FirstPage extends StatefulWidget {
  FirstPage({Key key}) : super(key: key);

  @override
  _FirstPageState createState() => _FirstPageState();
}

class _FirstPageState extends State<FirstPage> {
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    Utils.changeStatusColor(color: MyColours.color_199095);
  }

  @override
  Widget build(BuildContext context) {
    ScreenUtil.init(context, width: 750, height: 1334);
    return Scaffold(
      body: Container(
          color: MyColours.color_199095,
          height: double.infinity,
          padding: EdgeInsets.symmetric(
              horizontal: ScreenUtil().setWidth(40),
              vertical: ScreenUtil().setWidth(80)),
          child: Center(
              child: Container(
            height: ScreenUtil().setWidth(690),
            decoration: BoxDecoration(
              color: MyColours.color_ffffff,
              borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)),
            ),
            child: Column(
              children: [
                VEmptyView(40),
                Text(
                  '温馨提示',
                  style: TextStyle(
                      color: MyColours.color_333333,
                      fontWeight: FontWeight.bold,
                      fontSize: ScreenUtil().setSp(34)),
                ),
                VEmptyView(40),
                MyDivider(double.infinity, ScreenUtil().setWidth(1)),
                Expanded(
                    child: SingleChildScrollView(
                  child: Column(children: [
                    VEmptyView(50),
                    Padding(
                      padding: EdgeInsets.symmetric(
                          horizontal: ScreenUtil().setWidth(30)),
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Text(
                            '亲爱的用户,感谢您信任并使用一键订!',
                            style: TextStyle(
                              color: MyColours.color_333333,
                              fontSize: ScreenUtil().setSp(28),
                            ),
                            strutStyle: StrutStyle(
                                forceStrutHeight: true,
                                height: 1,
                                leading: 0.3),
                          ),
                          VEmptyView(16),
                          Wrap(
                            children: [
                              Text(
                                '我们制定了',
                                style: TextStyle(
                                  color: MyColours.color_333333,
                                  fontSize: ScreenUtil().setSp(28),
                                ),
                                strutStyle: StrutStyle(
                                    forceStrutHeight: true,
                                    height: 1,
                                    leading: 0.3),
                              ),
                              InkWell(
                                onTap: () {
                                  NavigatorUtil.goWebPage(
                                      context, '《隐私政策》', "zc",
                                      need: true);
                                },
                                child: Text(
                                  '《隐私政策》',
                                  style: TextStyle(
                                    color: MyColours.color_2bb5b7,
                                    fontSize: ScreenUtil().setSp(28),
                                  ),
                                  strutStyle: StrutStyle(
                                      forceStrutHeight: true,
                                      height: 1,
                                      leading: 0.3),
                                ),
                              ),
                              Text(
                                '和',
                                style: TextStyle(
                                  color: MyColours.color_333333,
                                  fontSize: ScreenUtil().setSp(28),
                                ),
                                strutStyle: StrutStyle(
                                    forceStrutHeight: true,
                                    height: 1,
                                    leading: 0.3),
                              ),
                              InkWell(
                                onTap: () {
                                  NavigatorUtil.goWebPage(
                                      context, '软件服务协议', "xy",
                                      need: true);
                                },
                                child: Text(
                                  '《软件服务协议》',
                                  style: TextStyle(
                                    color: MyColours.color_2bb5b7,
                                    fontSize: ScreenUtil().setSp(28),
                                  ),
                                  strutStyle: StrutStyle(
                                      forceStrutHeight: true,
                                      height: 1,
                                      leading: 0.3),
                                ),
                              ),
                              Text(
                                '请您点击同意之前仔细阅读并充分理解相关条款,其中的重点条款已为您标注,方便您了解自己的权利。',
                                style: TextStyle(
                                  color: MyColours.color_333333,
                                  fontSize: ScreenUtil().setSp(28),
                                ),
                                strutStyle: StrutStyle(
                                    forceStrutHeight: true,
                                    height: 1,
                                    leading: 0.3),
                              ),
                            ],
                          ),
                          VEmptyView(16),
                          Text(
                            '''为了向您提供更好的服务,我们需要获取以下权限和信息,系统将以弹窗提示征求您的授权。
                            \n1.地理位置:经授权,为了让您的客户快速地找到您的店铺,我们会收集您店铺的名称、所在位置相关信息(您授权的GPS位置信息,我们仅收集您当时所处的地理位置,但不会将您各时段的位置信息进行结合以判断您的行踪轨迹)来判断您所处的地点。
                            \n2.通讯录:经授权,为了方便您快速录入客户的姓名、联系电话,在您同意开启通讯录权限后您在录入预订订单时不需再手动输入您通讯录中联系人的信息,用于订单快速生成。
                            \n3.相册:经授权,当您设置您的通知信息时,“一键订”需要调用基于图片/视频上传的扩展功能:我们会使用您所上传的图片,作为您的形象照片和微信二维码展示,方便客户添加您的微信。
                            \n4.相机:经授权,当您传送订单水单给客户时,“一键订”需要调用基于摄像头(相机)的扩展功能:您可以使用这项扩展功能完成拍照上传水单传送给客户。
                            \n5.设备信息:经授权,我们会收集您的设备信息以保障系统运行和您的账号、交易安全。''',
                            style: TextStyle(
                              color: MyColours.color_333333,
                              fontWeight: FontWeight.bold,
                              fontSize: ScreenUtil().setSp(28),
                            ),
                            strutStyle: StrutStyle(
                                forceStrutHeight: true,
                                height: 1,
                                leading: 0.3),
                          ),
                          VEmptyView(16),
                          Text(
                            '我们将通过《隐私政策》向您说明:\n我们在您使用我们的产品与/或服务时如何收集、使用、保存、共享和转让这些信息,以及我们为您提供的访问、更新、控制和保护这些信息的方式。',
                            style: TextStyle(
                              color: MyColours.color_333333,
                              fontWeight: FontWeight.bold,
                              fontSize: ScreenUtil().setSp(28),
                            ),
                            strutStyle: StrutStyle(
                                forceStrutHeight: true,
                                height: 1,
                                leading: 0.3),
                          ),
                        ],
                      ),
                    )
                  ]),
                )),
                VEmptyView(40),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                  children: [
                    RoundButton(
                        width: ScreenUtil().setWidth(100 * 2),
                        height: ScreenUtil().setWidth(70),
                        radius: ScreenUtil().setWidth(10),
                        text: '拒绝',
                        fontSize: 28,
                        isBold: false,
                        textColor: MyColours.color_199095,
                        gradientStart: MyColours.color_efefef,
                        gradientEnd: MyColours.color_efefef,
                        onPressed: () {
                          //修改之前有内容,则弹框
                          DialogUtil.cupertinoAlertDialog(context,
                              title: "",
                              content: "您需要同意《一键订隐私政策》,才能继续使用我们的服务哦。",
                              lTitle: "暂不",
                              rTitle: "去同意", lCallback: () {
                            print("取消");
                            //退出应用
                            exit(0);
                          }, rCallback: () {
                            print("确定");
                          });
                        }),
                    RoundButton(
                        width: ScreenUtil().setWidth(100 * 2),
                        height: ScreenUtil().setWidth(70),
                        radius: ScreenUtil().setWidth(10),
                        text: '同意',
                        fontSize: 28,
                        isBold: false,
                        textColor: MyColours.color_ffffff,
                        gradientStart: MyColours.color_199095,
                        gradientEnd: MyColours.color_199095,
                        onPressed: () {
                          App.sp.setBool("isFirst", false);
                          //进入应用
                          NavigatorUtil.goLoginPage(context);
                        }),
                  ],
                ),
                VEmptyView(40),
              ],
            ),
          ))),
    );
  }
}