隐私协议,,注销账号
This commit is contained in:
parent
c5f3157b31
commit
b7e99f819d
|
|
@ -11,8 +11,11 @@ class ConfigBean {
|
|||
String? nightCardTips;
|
||||
String? bsUrl;
|
||||
String? channelId;
|
||||
String? userAgreement;
|
||||
String? privacyAgreement;
|
||||
|
||||
ConfigBean(this.isChecking, this.isAuthRealName, this.signKey, this.nightCardTips, this.bsUrl, this.channelId);
|
||||
ConfigBean(
|
||||
this.isChecking, this.isAuthRealName, this.signKey, this.nightCardTips, this.bsUrl, this.channelId, this.userAgreement, this.privacyAgreement);
|
||||
|
||||
factory ConfigBean.fromJson(Map<String, dynamic> json) => _$ConfigBeanFromJson(json);
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ ConfigBean _$ConfigBeanFromJson(Map<String, dynamic> json) => ConfigBean(
|
|||
json['nightCardTips'] as String?,
|
||||
json['bsUrl'] as String?,
|
||||
json['channelId'] as String?,
|
||||
json['userAgreement'] as String?,
|
||||
json['privacyAgreement'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ConfigBeanToJson(ConfigBean instance) =>
|
||||
|
|
@ -23,4 +25,6 @@ Map<String, dynamic> _$ConfigBeanToJson(ConfigBean instance) =>
|
|||
'nightCardTips': instance.nightCardTips,
|
||||
'bsUrl': instance.bsUrl,
|
||||
'channelId': instance.channelId,
|
||||
'userAgreement': instance.userAgreement,
|
||||
'privacyAgreement': instance.privacyAgreement,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../network/NetworkConfig.dart';
|
||||
import '../tools/me/set/agreement_page.dart';
|
||||
|
||||
class AgreementDialog extends StatefulWidget {
|
||||
|
|
@ -40,19 +41,6 @@ class _AgreementDialogState extends State<AgreementDialog> {
|
|||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
child: Text(
|
||||
'免责声明与风险提示',
|
||||
style: TextStyle(fontSize: 16, color: Colors.white, fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10, left: 22, right: 22),
|
||||
child: Text(
|
||||
'本平台生成的相关内容为人工智能模型概率生成,不确保真实性,您须自行进行核实,特别是针对其中包含的数字、时间以及各类事实性描述等内容。除与您个人信息相关的内容,您在使用妙语星河软件及相关服务时发布上传的内容均由您原创或已获合法授权(且含转授权),知识产权归您或合法第三方所有,同时不侵犯任何人的相关权益。',
|
||||
style: TextStyle(color: Colors.white, fontSize: 10),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 15),
|
||||
child: Text(
|
||||
|
|
@ -63,7 +51,7 @@ class _AgreementDialogState extends State<AgreementDialog> {
|
|||
Container(
|
||||
margin: EdgeInsets.only(top: 10, left: 22, right: 22),
|
||||
child: Text(
|
||||
'感谢您选择妙语星河!感谢您一直以来的支持!',
|
||||
'感谢您选择蒸汽云游!感谢您一直以来的支持!',
|
||||
style: TextStyle(color: Colors.white, fontSize: 10),
|
||||
),
|
||||
),
|
||||
|
|
@ -99,7 +87,7 @@ class _AgreementDialogState extends State<AgreementDialog> {
|
|||
TextSpan(text: '3.您可以对上述信息进行访问、更正、删除以及撤回同意等。 更多内容请您认真阅读并了解《', style: TextStyle(fontSize: 10, color: Colors.white)),
|
||||
TextSpan(
|
||||
text: '用户协议',
|
||||
style: TextStyle(fontSize: 10, color: Color(0xFFFF9000)),
|
||||
style: TextStyle(fontSize: 10, color: Color(0xFF074CE7)),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
Navigator.push(
|
||||
|
|
@ -107,14 +95,14 @@ class _AgreementDialogState extends State<AgreementDialog> {
|
|||
MaterialPageRoute(
|
||||
builder: (context) => AgreementPage(
|
||||
title: "用户协议",
|
||||
url: "https://shhuanmeng.com/yonghuxieyi.html",
|
||||
url: "${NetworkConfig.configBean?.userAgreement}",
|
||||
)),
|
||||
);
|
||||
}),
|
||||
TextSpan(text: '》、《', style: TextStyle(fontSize: 10, color: Colors.white)),
|
||||
TextSpan(
|
||||
text: '隐私政策',
|
||||
style: TextStyle(fontSize: 10, color: Color(0xFFFF9000)),
|
||||
style: TextStyle(fontSize: 10, color: Color(0xFF074CE7)),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
Navigator.push(
|
||||
|
|
@ -122,7 +110,7 @@ class _AgreementDialogState extends State<AgreementDialog> {
|
|||
MaterialPageRoute(
|
||||
builder: (context) => AgreementPage(
|
||||
title: "隐私政策",
|
||||
url: "https://shhuanmeng.com/yinsixieyi.html",
|
||||
url: "${NetworkConfig.configBean?.privacyAgreement}",
|
||||
)),
|
||||
);
|
||||
}),
|
||||
|
|
@ -144,8 +132,11 @@ class _AgreementDialogState extends State<AgreementDialog> {
|
|||
height: 40,
|
||||
margin: EdgeInsets.only(top: 10),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(color: Color(0xFFFF9000), borderRadius: BorderRadius.all(Radius.circular(50))),
|
||||
child: Text('同意并继续'),
|
||||
decoration: BoxDecoration(color: Color(0xFF074CE7), borderRadius: BorderRadius.all(Radius.circular(50))),
|
||||
child: Text(
|
||||
'同意并继续',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
|
|
|
|||
87
lib/dialog/cancel_dialog.dart
Normal file
87
lib/dialog/cancel_dialog.dart
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class CancelDialog extends StatefulWidget {
|
||||
final Function onTap;
|
||||
|
||||
CancelDialog({required this.onTap});
|
||||
|
||||
@override
|
||||
State<CancelDialog> createState() => _CancelDialogState();
|
||||
}
|
||||
|
||||
class _CancelDialogState extends State<CancelDialog> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
type: MaterialType.transparency, //透明类型
|
||||
color: Color(0x1A000000),
|
||||
child: Center(
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(7.0),
|
||||
child: Container(
|
||||
width: 247,
|
||||
color: Color(0xFF272727),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 28),
|
||||
child: Text(
|
||||
'确认注销账号吗?\n 账号所有数据都将删除!',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 15, color: Color(0xFFBABABA)),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 38, left: 22, right: 22, bottom: 19),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Container(
|
||||
width: 80,
|
||||
height: 28,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(14)),
|
||||
border: Border.all(color: Color(0xFF074CE7), width: 1),
|
||||
),
|
||||
child: Text(
|
||||
'取消',
|
||||
style: TextStyle(color: Color(0xFF074CE7), fontSize: 12),
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
widget.onTap();
|
||||
},
|
||||
child: Container(
|
||||
width: 80,
|
||||
height: 28,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFF074CE7),
|
||||
borderRadius: BorderRadius.all(Radius.circular(14)),
|
||||
),
|
||||
child: Text(
|
||||
'确定',
|
||||
style: TextStyle(color: Colors.white, fontSize: 12),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -9,8 +9,8 @@ class NetworkConfig {
|
|||
static int SELECT_INDEX = 0;
|
||||
|
||||
static List BASE_URLS = [
|
||||
"https://admin.shhuanmeng.com/",
|
||||
// "https://test.steamcloud.co/swagger/",
|
||||
// "https://admin.shhuanmeng.com/",
|
||||
"http://192.168.1.23:81/",
|
||||
];
|
||||
|
||||
// static List BASE_URLS_AI = [
|
||||
|
|
@ -19,7 +19,7 @@ class NetworkConfig {
|
|||
|
||||
static bool isTest = true;
|
||||
|
||||
static String token = "";
|
||||
static String token = ""; //请求头
|
||||
static String userToken = ""; //用户登录验签
|
||||
static String signKey = ""; //加密key
|
||||
static String deviceID = ""; //设备号
|
||||
|
|
@ -110,4 +110,7 @@ class NetworkConfig {
|
|||
static const String cancelQueue = "api/PlayGame/CancelQueue"; //取消排队
|
||||
|
||||
static const String exitApp = "api/Account/ExitApp"; //应用退出
|
||||
|
||||
static const String accountLogOff = "api/Account/AccountLogOff"; //注销账号
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:game/common/func.dart';
|
||||
import 'package:game/network/NetworkConfig.dart';
|
||||
|
||||
import '../me/set/agreement_page.dart';
|
||||
import 'login_model.dart';
|
||||
|
|
@ -289,9 +290,9 @@ class _LoginPageState extends State<LoginPage> {
|
|||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const AgreementPage(
|
||||
builder: (context) => AgreementPage(
|
||||
title: "用户协议",
|
||||
url: "https://shhuanmeng.com/yonghuxieyi.html",
|
||||
url: "${NetworkConfig.configBean?.userAgreement}",
|
||||
)),
|
||||
);
|
||||
}),
|
||||
|
|
@ -304,9 +305,9 @@ class _LoginPageState extends State<LoginPage> {
|
|||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const AgreementPage(
|
||||
builder: (context) => AgreementPage(
|
||||
title: "隐私政策",
|
||||
url: "https://shhuanmeng.com/yinsixieyi.html",
|
||||
url: "${NetworkConfig.configBean?.privacyAgreement}",
|
||||
)),
|
||||
);
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -243,4 +243,23 @@ class MeModel {
|
|||
print("errorEntity==${errorEntity.message}");
|
||||
});
|
||||
}
|
||||
|
||||
///反馈
|
||||
Future<void> accountLogOff() async {
|
||||
RequestCenter.instance.request(NetworkConfig.accountLogOff, {}, (BaseEntity dataEntity) {
|
||||
if (dataEntity.code == 0) {
|
||||
streamController.sink.add({
|
||||
'code': "accountLogOff",
|
||||
'data': dataEntity.data,
|
||||
});
|
||||
} else {
|
||||
streamController.sink.add({
|
||||
'code': "codeError", //
|
||||
'data': dataEntity.message
|
||||
});
|
||||
}
|
||||
}, (ErrorEntity errorEntity) {
|
||||
print("errorEntity==${errorEntity.message}");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../../../common/func.dart';
|
||||
import '../../../dialog/cancel_dialog.dart';
|
||||
import '../../../network/NetworkConfig.dart';
|
||||
import '../me_model.dart';
|
||||
|
||||
class AboutPage extends StatefulWidget {
|
||||
const AboutPage({super.key});
|
||||
|
|
@ -10,10 +16,33 @@ class AboutPage extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _AboutPageState extends State<AboutPage> {
|
||||
late StreamSubscription subscription;
|
||||
final MeModel _viewModel = MeModel();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
subscription = _viewModel.streamController.stream.listen((event) async {
|
||||
String code = event['code'];
|
||||
if (code.isNotEmpty) {
|
||||
switch (code) {
|
||||
case "accountLogOff":
|
||||
NetworkConfig.token = "";
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setString('token', "");
|
||||
Navigator.pushReplacementNamed(context, "/HomePage");
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
subscription.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -31,53 +60,83 @@ class _AboutPageState extends State<AboutPage> {
|
|||
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFF17181A),
|
||||
body: Column(
|
||||
body: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: size.width,
|
||||
height: h50,
|
||||
margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"关于我们",
|
||||
style: TextStyle(fontSize: s16, color: Color(0xFFD6D6D7)),
|
||||
),
|
||||
Positioned(
|
||||
left: l14,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Image(
|
||||
width: w19,
|
||||
height: h26,
|
||||
image: AssetImage('assets/images/btn_fanhui.png'),
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
width: size.width,
|
||||
height: h50,
|
||||
margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"关于我们",
|
||||
style: TextStyle(fontSize: s16, color: Color(0xFFD6D6D7)),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: w57,
|
||||
height: w57,
|
||||
margin: EdgeInsets.only(top: t18),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(s11)),
|
||||
child: Image(
|
||||
image: AssetImage('assets/images/ic_launcher.png'),
|
||||
Positioned(
|
||||
left: l14,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Image(
|
||||
width: w19,
|
||||
height: h26,
|
||||
image: AssetImage('assets/images/btn_fanhui.png'),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: t18),
|
||||
child: Text(
|
||||
"当前版本:${NetworkConfig.Version}",
|
||||
style: TextStyle(fontSize: t13, color: Color(0xFF868686)),
|
||||
),
|
||||
Container(
|
||||
width: w57,
|
||||
height: w57,
|
||||
margin: EdgeInsets.only(top: t18),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(s11)),
|
||||
child: Image(
|
||||
image: AssetImage('assets/images/ic_launcher.png'),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: t18),
|
||||
child: Text(
|
||||
"当前版本:${NetworkConfig.Version}",
|
||||
style: TextStyle(fontSize: t13, color: Color(0xFF868686)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Positioned(
|
||||
bottom: 30,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
FunctionUtil.popDialog(context, CancelDialog(
|
||||
onTap: () {
|
||||
// EasyLoading.show(status: "loading...");
|
||||
FunctionUtil.loading();
|
||||
_viewModel.accountLogOff();
|
||||
},
|
||||
));
|
||||
},
|
||||
child: Container(
|
||||
width: 102,
|
||||
height: 35,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFF074CE7),
|
||||
borderRadius: BorderRadius.all(Radius.circular(18)),
|
||||
),
|
||||
child: Text(
|
||||
"注销账号",
|
||||
style: TextStyle(color: Colors.white),
|
||||
)),
|
||||
)),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:game/network/NetworkConfig.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'agreement_page.dart';
|
||||
|
||||
|
|
@ -68,9 +70,9 @@ class _SettingPageState extends State<SettingPage> {
|
|||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const AgreementPage(
|
||||
builder: (context) => AgreementPage(
|
||||
title: "用户协议",
|
||||
url: "https://shhuanmeng.com/yonghuxieyi.html",
|
||||
url: "${NetworkConfig.configBean?.userAgreement}",
|
||||
)),
|
||||
);
|
||||
},
|
||||
|
|
@ -110,9 +112,9 @@ class _SettingPageState extends State<SettingPage> {
|
|||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const AgreementPage(
|
||||
builder: (context) => AgreementPage(
|
||||
title: "隐私政策",
|
||||
url: "https://shhuanmeng.com/yinsixieyi.html",
|
||||
url: "${NetworkConfig.configBean?.privacyAgreement}",
|
||||
)),
|
||||
);
|
||||
},
|
||||
|
|
@ -181,6 +183,45 @@ class _SettingPageState extends State<SettingPage> {
|
|||
),
|
||||
),
|
||||
|
||||
///退出登录
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
// Navigator.pushNamed(context, "/AboutPage");
|
||||
NetworkConfig.token = "";
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setString('token', "");
|
||||
Navigator.pushReplacementNamed(context, "/HomePage");
|
||||
},
|
||||
child: Container(
|
||||
height: h60,
|
||||
margin: EdgeInsets.only(top: t18, left: l15, right: l15),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFF202530),
|
||||
borderRadius: BorderRadius.all(Radius.circular(s11)),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: l14),
|
||||
child: Text(
|
||||
"退出登录",
|
||||
style: TextStyle(fontSize: s14, color: Color(0xFFD6D6D7)),
|
||||
),
|
||||
),
|
||||
Expanded(child: Container()),
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: l23),
|
||||
child: Image(
|
||||
width: w4,
|
||||
height: h8,
|
||||
image: AssetImage('assets/images/ic_arrow.png'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
///关于
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user