Browse Source

增加注销功能

remove_uniapp
w-R 3 years ago
parent
commit
1e23235fba
  1. 4
      android/app/build.gradle
  2. 2
      android/app/src/main/kotlin/com/zsw/huixiang/wxapi/WXPayEntryActivity.kt
  3. BIN
      assets/image/2x/logout.png
  4. BIN
      assets/image/2x/logout_s.png
  5. BIN
      assets/image/3x/logout.png
  6. BIN
      assets/image/3x/logout_s.png
  7. BIN
      assets/image/logout.png
  8. BIN
      assets/image/logout_s.png
  9. 1
      lib/community/community_page.dart
  10. 4
      lib/community/community_view/class_details.dart
  11. 76
      lib/community/order_page.dart
  12. 2
      lib/home/home_page.dart
  13. 1
      lib/login/login_page.dart
  14. 6
      lib/main.dart
  15. 5
      lib/main_page.dart
  16. 4
      lib/retrofit/retrofit_api.dart
  17. 21
      lib/retrofit/retrofit_api.g.dart
  18. 459
      lib/setting/logout_ing.dart
  19. 293
      lib/setting/logout_page.dart
  20. 6
      lib/setting/setting_page.dart
  21. 4
      pubspec.lock

4
android/app/build.gradle

@ -90,7 +90,7 @@ def mfph = [
]
android {
compileSdkVersion 30
compileSdkVersion 31
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
@ -106,7 +106,7 @@ android {
defaultConfig {
applicationId "com.zsw.huixiang"
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName

2
android/app/src/main/kotlin/com/zsw/huixiang/wxapi/WXPayEntryActivity.kt

@ -22,7 +22,7 @@ class WXPayEntryActivity : AbsWXPayCallbackActivity() {
val wechatAppId = appInfo.metaData.getString("weChatAppId")
if (wechatAppId != null ){
WXAPiHandler.setupWxApi(wechatAppId, this)
WXAPiHandler.setCoolBool(true)
// WXAPiHandler.setCoolBool(true)
io.flutter.Log.d("fluwx", "weChatAppId:$wechatAppId")
}else {
io.flutter.Log.e("fluwx", "can't load meta-data weChatAppId")

BIN
assets/image/2x/logout.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
assets/image/2x/logout_s.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
assets/image/3x/logout.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
assets/image/3x/logout_s.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
assets/image/logout.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
assets/image/logout_s.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

1
lib/community/community_page.dart

@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:huixiang/community/community_child_list.dart';
import 'package:huixiang/community/community_child_page.dart';
import 'package:huixiang/home/huixiang_brand_page.dart';
import 'package:huixiang/view_widget/my_appbar.dart';

4
lib/community/community_view/class_details.dart

@ -135,7 +135,8 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
physics: BouncingScrollPhysics(),
child: Column(
children: [
Stack(
Container(
child:Stack(
children: [
ClassDetailsVideo(key:videoKey,exitFull: (){setState(() {});},
coverImg: chapterList.length > chapterIndex
@ -179,6 +180,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
),
],
),
),
Container(
margin: EdgeInsets.only(bottom: 16.h),
padding: EdgeInsets.only(left: 16, top: 16, right: 10),

76
lib/community/order_page.dart

@ -0,0 +1,76 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/order/order_history_page.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_tab.dart';
import 'package:shared_preferences/shared_preferences.dart';
class OrderPage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _OrderPage();
}
}
class _OrderPage extends State<OrderPage>
with SingleTickerProviderStateMixin {
TabController tabcontroller;
List<String> lables = [
"全部",
"待付款",
"未完成",
"已完成",
];
@override
void initState() {
super.initState();
if (tabcontroller == null)
tabcontroller = TabController(length: lables.length, vsync: this, initialIndex: 1);
}
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 4,
child: Scaffold(
appBar: MyAppBar(
title: "",
leading: false,
bottom: TabBar(
// isScrollable: true, //
indicatorColor: Color(0xff39B54A),
labelColor: Colors.black,
labelStyle: TextStyle(
fontSize: 17.sp,
fontWeight: FontWeight.bold,
),
unselectedLabelStyle: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.normal,
),
// controller: tabController,
//
unselectedLabelColor: Color(0xffA29E9E),
indicatorSize: TabBarIndicatorSize.label,
//
tabs: <Widget>[
MyTab(text: S.of(context).quanbu),
MyTab(text: S.of(context).daifukuan),
MyTab(text: S.of(context).weiwancheng),
MyTab(text: S.of(context).yiwancheng),
],
),
),
body: TabBarView(
children: [OrderHistoryList(0),OrderHistoryList(1),OrderHistoryList(2),OrderHistoryList(3), ],
),
),
);
}
}

2
lib/home/home_page.dart

@ -85,7 +85,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
}
///
///
inviteShowAlertDialog(invite, InterviewCouponList interviewCouponList) {
//
showDialog(

1
lib/login/login_page.dart

@ -19,7 +19,6 @@ import 'package:flutter/services.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:dio/dio.dart';
import 'package:huixiang/view_widget/invite_success_dialog.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:photo_view/photo_view.dart';
import 'package:shared_preferences/shared_preferences.dart';

6
lib/main.dart

@ -48,6 +48,8 @@ import 'package:huixiang/qr/qr_code_scan.dart';
import 'package:huixiang/qr/qr_share.dart';
import 'package:huixiang/setting/about_page.dart';
import 'package:huixiang/setting/help_feedback_page.dart';
import 'package:huixiang/setting/logout_ing.dart';
import 'package:huixiang/setting/logout_page.dart';
import 'package:huixiang/setting/permission_setting_page.dart';
import 'package:huixiang/setting/setting_page.dart';
import 'package:huixiang/setting/treaty_page.dart';
@ -361,4 +363,8 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
ReportNotice(),
'/router/report_success': (context, {arguments}) =>
ReportSuccess(),
'/router/logout_page': (context, {arguments}) =>
LogoutPage(),
'/router/logout_ing': (context, {arguments}) =>
LogoutIng(),
};

5
lib/main_page.dart

@ -22,6 +22,8 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
import 'community/order_page.dart';
class MainPage extends StatefulWidget {
final Map<String, dynamic> arguments;
@ -103,6 +105,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
},invite:invite,interviewCouponList:interviewCouponList,firstLoginCouponList:firstLoginCouponList,),
// MainHomePage(),
UnionPage(),
// (Theme.of(context).platform == TargetPlatform.android) ? OrderPage() :CommunityPage(),
CommunityPage(),
MinePage(),
];
@ -303,7 +306,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
// bottomNavigationBigItem(S.of(context).pinpai, 0),
bottomNavigationItem(S.of(context).main_menu1, 0),
bottomNavigationItem(S.of(context).main_menu2, 1),
bottomNavigationItem(S.of(context).main_menu3, 2),
bottomNavigationItem((Theme.of(context).platform == TargetPlatform.android) ? "订单" :S.of(context).main_menu3 , 2),
bottomNavigationItem(S.of(context).main_menu4, 3),
],
),

4
lib/retrofit/retrofit_api.dart

@ -508,4 +508,8 @@ abstract class ApiService {
@GET("/home/appPopup")
Future<BaseData<ActivityPos>> appPopup();
///
@GET("/member/deleteMine")
Future<BaseData> deleteMine();
}

21
lib/retrofit/retrofit_api.g.dart

@ -1894,4 +1894,25 @@ class _ApiService implements ApiService {
);
return value;
}
@override
Future<BaseData<dynamic>> deleteMine() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/member/deleteMine',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
}

459
lib/setting/logout_ing.dart

@ -0,0 +1,459 @@
import 'dart:async';
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../main.dart';
class LogoutIng extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _LogoutIng();
}
}
class _LogoutIng extends State<LogoutIng> {
final TextEditingController phoneController = TextEditingController();
final TextEditingController provingController = TextEditingController();
String money;
String balance;
String phone = "";
MinApiService minService;
ApiService apiService;
var btnText = S.current.send_code;
var _sendCodeStatus = 0;
Timer _timer;
UserInfo userInfo;
@override
void initState() {
super.initState();
queryUserBalance();
}
queryUserBalance() async {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: false,
);
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
balance = userInfo?.balance ?? "0.00";
money = userInfo?.money ??"0.00";
phone = userInfo?.phone ?? "";
if (mounted) setState(() {});
}
}
proving(mobile) async {
if(phoneController.text != phone){
SmartDialog.showToast("手机号码不正确",
alignment: Alignment.center);
return ;
}
if (_sendCodeStatus != 0)
return;
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: true
);
}
BaseData baseData = await apiService.sendVerify(mobile).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
countdown();
SmartDialog.showToast(baseData.data,
alignment: Alignment.center);
}else{
SmartDialog.showToast(baseData.msg,
alignment: Alignment.center);
}
}
///
logout() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: true
);
}
BaseData baseData = await apiService.deleteMine().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
logOut();
SmartDialog.showToast(baseData.data,
alignment: Alignment.center);
}else{
SmartDialog.showToast(baseData.msg,
alignment: Alignment.center);
Navigator.of(context).pop();
}
}
countdown() {
if (_timer != null && _timer.isActive) return;
int countdown = 60;
_timer = Timer.periodic(Duration(seconds: 1), (timer) {
countdown--;
if (countdown == 0) {
setState(() {
btnText = S.of(context).send_code;
});
_sendCodeStatus = 0;
_timer.cancel();
} else {
setState(() {
btnText = S.of(context).resend_in_seconds(countdown);
});
}
});
}
@override
void dispose() {
if (_timer != null && _timer.isActive) _timer.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
title: "",
titleColor: Colors.black,
titleSize: 18.sp,
background: Colors.transparent,
leadingColor: Colors.black,
),
body: Stack(
children: [
Container(
width: double.infinity,
height: double.infinity,
margin: EdgeInsets.only(left: 16, right: 17),
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
top: 16,
bottom: 4,
),
child: Text(
"进行帐号注销",
style: TextStyle(
fontSize: 21.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF181818),
),
),
),
Text(
"再次提醒:注销帐号后不可恢复,相关数据和信息会永久删除。",
style: TextStyle(
fontSize: 14.sp,
height: 1.5,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
),
Padding(
padding: EdgeInsets.only(
top: 24,
bottom: 16,
),
child: Text(
S.of(context).shoujihao,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF181818),
),
),
),
Container(
margin: EdgeInsets.fromLTRB(0.w, 0, 20.w, 0),
alignment: Alignment.topLeft,
child: TextField(
controller: phoneController,
inputFormatters: [LengthLimitingTextInputFormatter(11)],
decoration: InputDecoration(
border: InputBorder.none,
hintText: S.of(context).qingshurushoujihao,
hintStyle: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xffA29E9E),
),
),
),
),
Container(
height: 1.h,
width: MediaQuery.of(context).size.width,
color: Color(0xFFF4F4F4),
),
Padding(
padding: EdgeInsets.only(
top: 15,
bottom: 16,
),
child: Text(
"验证码",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF181818),
),
),
),
Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.fromLTRB(0.w, 0, 20.w, 0),
alignment: Alignment.topLeft,
child: TextField(
controller: provingController,
inputFormatters: [
LengthLimitingTextInputFormatter(6)
],
textInputAction: TextInputAction.next,
decoration: InputDecoration(
border: InputBorder.none,
hintText: S.of(context).qingshuruyanzhengma,
hintStyle: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xffA29E9E),
),
),
),
)),
GestureDetector(
onTap: (){
if(phoneController.text == ""){
SmartDialog.showToast("请输入手机号码",
alignment: Alignment.center);
return;
}
proving(phoneController.text);
},
child:
Text(
btnText,
style: TextStyle(
fontSize: 14.sp,
height: 1.5,
fontWeight: MyFontWeight.medium,
color:Color(0xFF32A060),
),
),
)
],
),
Container(
height: 1.h,
width: MediaQuery.of(context).size.width / 1.6,
color: Color(0xFFF4F4F4),
),
],
),
),
),
Align(
alignment: Alignment.bottomCenter,
child: GestureDetector(
onTap: () {
if(phoneController.text == ""){
SmartDialog.showToast("请输入手机号码",
alignment: Alignment.center);
}else if(provingController.text == ""){
SmartDialog.showToast("请输入验证码",
alignment: Alignment.center);
}
if(phoneController.text != "" && provingController.text != ""){
showDeleteDialog();
}
},
child: Container(
width: double.infinity,
height: 54.h,
alignment: Alignment.center,
color: (phoneController.text == "" &&
provingController.text == "")
? Color(0xFFD8D8D8)
: Color(0xFF32A060),
child: Text(
"确认注销",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFFFFFFF),
),
)),
))
],
),
);
}
///
showDeleteDialog() {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
content:Container(
width: double.infinity,
height: 350.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
onTap: (){
Navigator.of(context).pop();
},
child: Container(
alignment: Alignment.topRight,
child:Image.asset(
"assets/image/yq_qx.png",
width: 20,
height: 20,
color: Color(0xFF353535),
),
),),
(balance == "0.00" && money == "0.00")?
Image.asset(
"assets/image/logout.png",
width: 80,
height: 80,
)
:
Image.asset(
"assets/image/logout_s.png",
width: 80,
height: 80,
),
Padding(
padding: EdgeInsets.only(top: 10, bottom: 6),
child: Text(
(balance == "0.00" && money == "0.00") ? "注销账号成功!" : "注销申请提交失败!",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF353535),
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 13),
child: Text(
(balance == "0.00" && money == "0.00") ? "由于当于帐号已注销,系统将自动退出登录":"您的平台余额及店铺余额未使用完!",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16.sp,
height: 1.2,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
),
),
if(balance != "0.00" && money != "0.00" || balance != "0.00" || money != "0.00")
Text(
"平台余额:¥ $money",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
),
),
if(balance != "0.00" && money != "0.00" || balance != "0.00" || money != "0.00")
Text(
"店铺余额:¥ $balance",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
),
),
SizedBox(
height:36.h,
),
InkWell(
child: BorderText(
text: "我知道了",
textColor: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
borderColor: Color(0xFF32A060),
radius:25,
padding: EdgeInsets.all(12),
borderWidth: 1,
),
onTap: () {
if(balance != "0.00" && money != "0.00" || balance != "0.00" || money != "0.00"){
Navigator.of(context).pop();
return;
}
logout();
},
)
],
),
),
);
},
);
}
logOut() async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
sharedPreferences.setString("token", "");
sharedPreferences.setString("user", "");
sharedPreferences.setString("userJson", "");
sharedPreferences.setString("userId", "");
sharedPreferences.setString("mobile", "");
sharedPreferences.setString("nick", "");
Navigator.of(context)
.pushNamedAndRemoveUntil('/router/login_page', (route) => false);
if (xgFlutterPlugin != null) {
xgFlutterPlugin.stopXg();
}
}
}

293
lib/setting/logout_page.dart

@ -0,0 +1,293 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/round_button.dart';
class LogoutPage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _LogoutPage();
}
}
class _LogoutPage extends State<LogoutPage> {
var controller = new ScrollController();
var checkStatus = false;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
title: "帐号注销说明",
titleColor: Colors.black,
titleSize: 18.sp,
background: Colors.transparent,
leadingColor: Colors.black,
),
body: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
// child: Column(
// children: [
// WebView(
// initialUrl: 'http://huixiang.lotus-wallet.com/user.html',
// ),
// ],
// ),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 5),
child: Align(
alignment: Alignment.center,
child: Text(
"注销协议",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF1A1A1A),
),
),
),
),
Padding(
padding:
EdgeInsets.only(top: 16, bottom: 8, right: 20, left: 20),
child: Text(
"特别提示",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF1A1A1A),
),
),
),
_textRich(
"您在申请注销流程中点击同意前,应当认真阅读《帐号注销协议》(以下简称“本协议”)。特别提醒您,当您成功提交注销申请后,即表示您已充分阅读、理解并接受本协议的全部内容。阅读本协议的过程中,如果您不同意相关任何条款,请您立即停止帐号注销程序"),
Padding(
padding:
EdgeInsets.only(top: 12, bottom: 8, right: 20, left: 20),
child: Text(
"您已了解并同意帐号注销后,将要自行承担以下后果:",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
height: 1.5,
color: Color(0xFF1A1A1A),
),
),
),
_textRich(
"1.账号一旦注销,您将无法登录、使用该账号(也包括无法再使用该账号作为第三方账号登录其他产品),也就是说您将无法再以此账号登录/使用/继续使用一心回乡集团旗下的相关产品与服务"),
_textRich(
"2.帐号注销说明我们将删除您的相关信息。您在该帐号下的个人信息、交易记录、业务数据、历史信息等删除后均将无法找回。"),
_textRich(
"3.账号一旦注销,您曾通过该账号登录、使用的一心回乡集团旗下的产品与服务下的所有内容、信息、数据、记录将会被删除,您也无法再检索、访问、获取、继续使用和找回,也无权要求我们找回(但法律法规另有规定或监管部门另有要求的除外),包括:"
"\n   •该账号下的个人资料(例如:头像、昵称等)及绑定信息(例如:绑定手机号);"
"\n   •该账号下的您的个人信息(同时您亦不再享有《一心回乡隐私政策》中约定的您的用户权利,但法律法规另有规定的除外);"
"\n   •该账号曾发表的所有内容(例如:音频、图片、照片、评论、互动、点赞等);"
"\n   •该账号所登录的门店小程序也将无法使用。同时,小程序内的个人信息,账户信息等也将删除"),
_textRich(
"4.您理解并同意,注销帐号后,您曾获得的充值余额、积分、优惠券及其他虚拟财产等将视为您自愿、主动放弃,无法继续使用,由此引起一切纠纷由您自行处理,我们不承担任何责任。"),
_textRich("5.请注意,注销您的帐号并不代表本帐号注销前的帐号行为和相关责任得到豁免或减轻。"),
Padding(
padding:
EdgeInsets.only(top: 12, bottom: 8, right: 20, left: 20),
child: Text(
"注销流程:",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF1A1A1A),
),
),
),
_textRich("1.首先,保在您开始注销操作前,请先进行以下确认,保证帐号、财产完全:"
"\n   •帐号处于安全状态;"
"\n   •请确认平台余额以及店铺余额清零,否则将不予注销;"
"\n   •请确认当下无正在进行中的交易,否则无法进行注销操作;。"),
_textRich(
"2.勾选《一心回乡账号注销协议》,点击注销后,系统将判定帐号是否符合注销条件,符合后进行手机号验证,输入正确验证码后既注销完成。"),
Padding(
padding:
EdgeInsets.only(top: 12, bottom: 8, right: 20, left: 20),
child: Text(
"协议附则:",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF1A1A1A),
),
),
),
_textRich(
"1.一心回乡有权在必要时修改本协议,您可以在相关页面查阅最新的本协议。您的任何使用本功能的行为,即视为您已经阅读并同意本协议及相应更新。"),
_textRich(
"2.本协议的拟定、解释均以中文为准。除双方另有约定外,任何有关本协议的翻译不得作为解释本协议或判定双方当事人意图之依据。"),
SizedBox(
height: 24.h,
),
Container(
width: double.infinity,
margin: EdgeInsets.only(bottom: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Checkbox(
value: checkStatus,
onChanged: (a) {
setState(() {
checkStatus = !checkStatus;
});
},
checkColor: Color(0xFFFFFFFF),
fillColor: MaterialStateProperty.all(Color(0xFF32A060)),
),
Text(
"已了解《一心回乡账号注销协议》,并自行承担相关后果",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 11.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF010101),
),
)
],
),
),
GestureDetector(
onTap: () {
if (!checkStatus) {
SmartDialog.showToast("请勾选同意《一心回乡账号注销协议》",
alignment: Alignment.center);
return;
}
showDeleteDialog();
},
child: Container(
width: double.infinity,
height: 54.h,
alignment: Alignment.center,
color: checkStatus ? Color(0xFF32A060) : Color(0xFFD8D8D8),
child: Text(
"注销",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFFFFFFF),
),
)),
)
],
),
),
),
);
}
Widget _textRich(var text) {
return Padding(
padding: EdgeInsets.only(bottom: 8, right: 20, left: 20),
child: Text(
text,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.regular,
height: 1.7,
color: Colors.black),
),
);
}
///
showDeleteDialog() {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
content: Container(
width: MediaQuery.of(context).size.width - 84,
height: 130.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"注销账户会清空所有的信息和数据,确认要进行注销吗?",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 17.sp,
height: 1.2,
fontWeight: MyFontWeight.medium,
color: Colors.black,
),
),
SizedBox(
height: 20.h,
),
Row(
children: [
Expanded(
child: InkWell(
child: BorderText(
text: "确认注销",
textColor: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
borderColor: Color(0xFF32A060),
radius: 4,
padding: EdgeInsets.all(12),
borderWidth: 1,
),
onTap: () {
Navigator.of(context).popAndPushNamed(
'/router/logout_ing');
},
),
flex: 1,
),
SizedBox(
width: 16.w,
),
Expanded(
child: InkWell(
child: RoundButton(
text: "我再想想",
textColor: Colors.white,
radius: 4,
padding: EdgeInsets.all(12),
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
onTap: () {
Navigator.of(context).pop();
},
),
flex: 1,
),
],
)
],
),
),
);
},
);
}
}

6
lib/setting/setting_page.dart

@ -146,6 +146,12 @@ class _SettingPage extends State<SettingPage> {
Navigator.of(context).pushNamed('/router/about_page');
},
),
GestureDetector(
child: settingSingleItem("注销账号"),
onTap: () {
Navigator.of(context).pushNamed('/router/logout_page');
},
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.end,

4
pubspec.lock

@ -222,7 +222,7 @@ packages:
name: flutter_layout_grid
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.3"
version: "1.0.6"
flutter_localizations:
dependency: "direct main"
description: flutter
@ -307,7 +307,7 @@ packages:
name: fluwx
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.6.1+4"
version: "3.8.1"
font_awesome_flutter:
dependency: "direct main"
description:

Loading…
Cancel
Save