diff --git a/circle_app/assets/images/mine/icon_block.png b/circle_app/assets/images/mine/icon_block.png new file mode 100644 index 0000000..490bca8 Binary files /dev/null and b/circle_app/assets/images/mine/icon_block.png differ diff --git a/circle_app/assets/images/mine/icon_dialog_black.png b/circle_app/assets/images/mine/icon_dialog_black.png new file mode 100644 index 0000000..2de0b6b Binary files /dev/null and b/circle_app/assets/images/mine/icon_dialog_black.png differ diff --git a/circle_app/assets/images/mine/icon_report.png b/circle_app/assets/images/mine/icon_report.png new file mode 100644 index 0000000..7a57447 Binary files /dev/null and b/circle_app/assets/images/mine/icon_report.png differ diff --git a/circle_app/lib/app/account/view.dart b/circle_app/lib/app/account/view.dart index 37f40a0..8c0f7dd 100644 --- a/circle_app/lib/app/account/view.dart +++ b/circle_app/lib/app/account/view.dart @@ -25,7 +25,7 @@ class AccountPage extends StatelessWidget { child: Scaffold( backgroundColor: Colors.transparent, appBar: MyAppBar( - centerTitle: '设置', + centerTitle: '账号中心', ), body: Scaffold( backgroundColor: Colors.transparent, @@ -53,35 +53,39 @@ class AccountPage extends StatelessWidget { // ], // ), // ), - - // Container( - // margin: EdgeInsets.only(top: 16.0), - // child: Row( - // children: [ - // Text( - // "换绑手机号", - // style: TextStyle( - // color: Color(0xFFF7FAFA), - // fontSize: 16.0, - // ), - // ), - // Spacer(), - // Text( - // "16677778888", - // style: TextStyle( - // color: Color(0xFFB7BECC), - // fontSize: 16.0, - // ), - // ), - // SizedBox(width: 8.0), - // Image.asset( - // getHomeImage("icon_in"), - // width: 24.0, - // height: 24.0, - // ), - // ], - // ), - // ), + GestureDetector( + onTap: () { + Get.toNamed(AppRoutes.PhotoActivity); + }, + child: Container( + margin: EdgeInsets.only(top: 16.0), + child: Row( + children: [ + Text( + "换绑手机号", + style: TextStyle( + color: Color(0xFFF7FAFA), + fontSize: 16.0, + ), + ), + Spacer(), + Text( + "16677778888", + style: TextStyle( + color: Color(0xFFB7BECC), + fontSize: 16.0, + ), + ), + SizedBox(width: 8.0), + Image.asset( + getHomeImage("icon_in"), + width: 24.0, + height: 24.0, + ), + ], + ), + ), + ), // Container( // margin: EdgeInsets.only(top: 16.0), // child: Row( @@ -102,149 +106,160 @@ class AccountPage extends StatelessWidget { // ], // ), // ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Get.toNamed(AppRoutes.OffAccountActivity); + }, + child: Container( + margin: EdgeInsets.only(top: 16.0), + child: Row( + children: [ + Text( + "注销账号", + style: TextStyle( + color: Color(0xFFF7FAFA), + fontSize: 16.0, + ), + ), + Spacer(), + Image.asset( + getHomeImage("icon_in"), + width: 24.0, + height: 24.0, + ), + ], + ), + ) ,) + , // Container( - // margin: EdgeInsets.only(top: 16.0), + // margin: EdgeInsets.only(top: 0.0.sp, left: 0.sp), + // child: Text( + // "账号绑定", + // style: TextStyle( + // color: Color(0xFFF7FAFA), + // fontSize: 16.0.sp, + // ), + // ), + // ), + // Container( + // margin: EdgeInsets.only(top: 16.0.sp), // child: Row( // children: [ // Text( - // "注销账号", + // "已绑定手机号", // style: TextStyle( - // color: Color(0xFFF7FAFA), - // fontSize: 16.0, + // color: Color(0xFFB7BECC), + // fontSize: 16.0.sp, // ), // ), // Spacer(), - // Image.asset( - // getHomeImage("icon_in"), - // width: 24.0, - // height: 24.0, - // ), + // Container( + // alignment: Alignment.center, + // width: 60.sp, + // height: 28.sp, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(14.0.sp), + // border: Border.all( + // width: 0.4.sp, + // color: Colors.white, + // ), + // ), + // child: GestureDetector( + // onTap: (){ + // Get.toNamed(AppRoutes.PhotoActivity); + // }, + // child:Text( + // "换绑", + // style: TextStyle( + // color: Color(0xFFB7BECC), + // fontSize: 14.0.sp, + // ), + // )) ,) // ], // ), // ), - Container( - margin: EdgeInsets.only(top: 0.0.sp, left: 16.0.sp), - child: Text( - "账号绑定", - style: TextStyle( - color: Color(0xFFF7FAFA), - fontSize: 16.0.sp, - ), - ), - ), - Container( - margin: EdgeInsets.only(top: 16.0.sp), - child: Row( - children: [ - Text( - "已绑定手机号", - style: TextStyle( - color: Color(0xFFB7BECC), - fontSize: 16.0.sp, - ), - ), - Spacer(), - Container( - alignment: Alignment.center, - width: 60.sp, - height: 28.sp, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(14.0.sp), - border: Border.all( - width: 0.4.sp, - color: Colors.white, - ), - ), - child: GestureDetector( - onTap: (){ - Get.toNamed(AppRoutes.PhotoActivity); - }, - child:Text( - "换绑", - style: TextStyle( - color: Color(0xFFB7BECC), - fontSize: 14.0.sp, - ), - )) ,) - ], - ), - ), - Container( - margin: EdgeInsets.only(top: 16.0.sp), - child: Row( - children: [ - Text( - "微信", - style: TextStyle( - color: Color(0xFFB7BECC), - fontSize: 16.0.sp, - ), - ), - Spacer(), - Container( - alignment: Alignment.center, - width: 60.sp, - height: 28.sp, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(14.0.sp), - border: Border.all( - width: 0.4.sp, - color: Colors.white, - ), - ), - child: Text( - "去绑定", - style: TextStyle( - color: Color(0xFFB7BECC), - fontSize: 14.0.sp, - ), - )), - ], - ), - ), - Container( - margin: EdgeInsets.only(top: 16.0.sp), - child: Row( - children: [ - Text( - "邮箱", - style: TextStyle( - color: Color(0xFFB7BECC), - fontSize: 16.0.sp, - ), - ), - Spacer(), - Container( - alignment: Alignment.center, - width: 60.sp, - height: 28.sp, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(14.0.sp), - border: Border.all( - width: 0.4.sp, - color: Colors.white, - ), - ), - child: Text( - "去绑定", - style: TextStyle( - color: Color(0xFFB7BECC), - fontSize: 14.0.sp, - ), - )), - ], - ), - ), - Container( - margin: EdgeInsets.only(top: 16.0.sp), - child: Text( - "温馨提示:完成账号绑定后,手机丢失或忘记密码也可以通过其他方式登录", - style: TextStyle( - color: Color(0xFFB7BECC), - fontSize: 12.0.sp, - ), - ), - ), + // Container( + // margin: EdgeInsets.only(top: 16.0.sp), + // child: Row( + // children: [ + // Text( + // "微信", + // style: TextStyle( + // color: Color(0xFFB7BECC), + // fontSize: 16.0.sp, + // ), + // ), + // Spacer(), + // Container( + // alignment: Alignment.center, + // width: 60.sp, + // height: 28.sp, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(14.0.sp), + // border: Border.all( + // width: 0.4.sp, + // color: Colors.white, + // ), + // ), + // child: Text( + // "去绑定", + // style: TextStyle( + // color: Color(0xFFB7BECC), + // fontSize: 14.0.sp, + // ), + // )), + // ], + // ), + // ), + // Container( + // margin: EdgeInsets.only(top: 16.0.sp), + // child: Row( + // children: [ + // Text( + // "邮箱", + // style: TextStyle( + // color: Color(0xFFB7BECC), + // fontSize: 16.0.sp, + // ), + // ), + // Spacer(), + // GestureDetector( + // onTap: (){ + // Get.toNamed(AppRoutes.BindMailActivity); + // }, + // child: Container( + // alignment: Alignment.center, + // width: 60.sp, + // height: 28.sp, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(14.0.sp), + // border: Border.all( + // width: 0.4.sp, + // color: Colors.white, + // ), + // ), + // child: Text( + // "去绑定", + // style: TextStyle( + // color: Color(0xFFB7BECC), + // fontSize: 14.0.sp, + // ), + // )),) + // + // ], + // ), + // ), + // Container( + // margin: EdgeInsets.only(top: 16.0.sp), + // child: Text( + // "温馨提示:完成账号绑定后,手机丢失或忘记密码也可以通过其他方式登录", + // style: TextStyle( + // color: Color(0xFFB7BECC), + // fontSize: 12.0.sp, + // ), + // ), + // ), Container( margin: EdgeInsets.only( top: 40.0.sp, left: 72.0.sp, right: 72.0.sp), diff --git a/circle_app/lib/app/bindmail/binding.dart b/circle_app/lib/app/bindmail/binding.dart new file mode 100644 index 0000000..4faad6b --- /dev/null +++ b/circle_app/lib/app/bindmail/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class BindmailBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => BindmailLogic()); + } +} diff --git a/circle_app/lib/app/bindmail/logic.dart b/circle_app/lib/app/bindmail/logic.dart new file mode 100644 index 0000000..73d20ae --- /dev/null +++ b/circle_app/lib/app/bindmail/logic.dart @@ -0,0 +1,7 @@ +import 'package:get/get.dart'; + +import 'state.dart'; + +class BindmailLogic extends GetxController { + final BindmailState state = BindmailState(); +} diff --git a/circle_app/lib/app/bindmail/state.dart b/circle_app/lib/app/bindmail/state.dart new file mode 100644 index 0000000..f617a6c --- /dev/null +++ b/circle_app/lib/app/bindmail/state.dart @@ -0,0 +1,5 @@ +class BindmailState { + BindmailState() { + ///Initialize variables + } +} diff --git a/circle_app/lib/app/bindmail/view.dart b/circle_app/lib/app/bindmail/view.dart new file mode 100644 index 0000000..4b12e9e --- /dev/null +++ b/circle_app/lib/app/bindmail/view.dart @@ -0,0 +1,208 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../components/my_app_bar.dart'; +import '../../util/util.dart'; +import 'logic.dart'; + +class BindmailPage extends StatefulWidget { + BindmailPage({Key? key}) : super(key: key); + + @override + _BindmailPageState createState() => _BindmailPageState(); +} + +class _BindmailPageState extends State { + int _countdownSeconds = 60; + bool _isCountingDown = false; + Timer? _timer; + + @override + void dispose() { + _timer?.cancel(); + super.dispose(); + } + + void startCountdown() { + setState(() { + _isCountingDown = true; + _countdownSeconds = 60; + }); + + _timer = Timer.periodic(Duration(seconds: 1), (timer) { + setState(() { + if (_countdownSeconds > 0) { + _countdownSeconds--; + } else { + _isCountingDown = false; + _timer?.cancel(); + } + }); + }); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar( + centerTitle: '绑定邮箱', + ), + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Existing code... + Container( + margin: EdgeInsets.only( + left: 16.0.sp, + top: 16.0.sp, + right: 16.0.sp, + ), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.0.sp), + color: Color(0xff282733), + ), + height: 40.0.sp, + child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only(left: 16.0.sp, right: 10.sp), + child: Text( + " 邮箱 ", + style: TextStyle( + color: Colors.white, + fontSize: 14.0.sp, + ), + )), + Expanded( + child: Container( + height: 32.sp, + alignment: Alignment.center, + child: TextField( + textAlignVertical: TextAlignVertical.center, + decoration: InputDecoration( + hintText: "请输入邮箱", + hintStyle: TextStyle( + color: Colors.grey.shade300, + fontSize: 14.0, + ), + border: InputBorder.none, + ), + style: TextStyle( + color: Colors.white, + fontSize: 14.0, + height: 1.0, + ), + ), + ), + ) + ], + ), + ), + Row( + children: [ + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.fromLTRB( + 16.0.sp, 20.0.sp, 8.0.sp, 0.0.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.0.sp), + color: Color(0xff282733), + ), + height: 40.0.sp, + child: Row( + children: [ + Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only( + left: 10.0.sp, right: 10.sp), + child: Text( + "验证码", + style: TextStyle(color: Colors.white), + ), + ), + Expanded( + child: Container( + height: 32.sp, + alignment: Alignment.center, + child: TextField( + textAlignVertical: + TextAlignVertical.center, + decoration: InputDecoration( + hintText: "请输入验证码", + hintStyle: TextStyle( + color: Colors.grey.shade300, + fontSize: 14.0, + ), + border: InputBorder.none, + ), + style: TextStyle( + color: Colors.white, + fontSize: 14.0, + height: 1.0, + ), + ), + ), + ) + ], + ), + ), + ), + Expanded( + flex: 2, + child: GestureDetector( + onTap: () { + if (!_isCountingDown) { + // Only start countdown if not already counting down + startCountdown(); + } + }, + child: Container( + margin: EdgeInsets.fromLTRB( + 8.0.sp, 20.0.sp, 16.0.sp, 0.0.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.0.sp), + color: Color(0xff282733), + ), + height: 40.0.sp, + child: Center( + child: Text( + _isCountingDown + ? '$_countdownSeconds 秒' + : '获取验证码', + style: TextStyle( + color: _isCountingDown + ? Colors.grey.shade400 + : Colors.white, + fontSize: 14.0.sp, + ), + ), + ), + ), + ), + ), + ], + ), + + // Existing code... + ], + ), + ), + ), + ); + } +} diff --git a/circle_app/lib/app/feedback/binding.dart b/circle_app/lib/app/feedback/binding.dart new file mode 100644 index 0000000..3b0dd60 --- /dev/null +++ b/circle_app/lib/app/feedback/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class FeedbackBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => FeedbackLogic()); + } +} diff --git a/circle_app/lib/app/feedback/logic.dart b/circle_app/lib/app/feedback/logic.dart new file mode 100644 index 0000000..dc3f8d3 --- /dev/null +++ b/circle_app/lib/app/feedback/logic.dart @@ -0,0 +1,40 @@ +import 'dart:io'; + +import 'package:get/get.dart'; +import 'package:image_picker/image_picker.dart'; +import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart'; + +import 'state.dart'; + +class FeedbackLogic extends GetxController { + final FeedbackState state = FeedbackState(); + + final ImagePicker _picker = ImagePicker(); + var storage = Storage(); + + Future getImageFile() async { + try { + final XFile? pickedFile = await _picker.pickImage( + source: ImageSource.gallery, + ); + _setImageFileListFromFile(pickedFile!); + // setState(() { + // _setImageFileListFromFile(pickedFile); + // }); + } catch (e) { + // setState(() { + // _pickImageError = e; + // }); + } + } + + void _setImageFileListFromFile(XFile pickedFile) { + PutController putController = PutController(); + + // 添加任务状态监听 + putController.addStatusListener((StorageStatus status) { + print('状态变化: 当前任务状态:$status'); + }); + storage.putFile(File(pickedFile.path), "",options: PutOptions(controller: putController)); + } +} diff --git a/circle_app/lib/app/feedback/state.dart b/circle_app/lib/app/feedback/state.dart new file mode 100644 index 0000000..4aeb851 --- /dev/null +++ b/circle_app/lib/app/feedback/state.dart @@ -0,0 +1,5 @@ +class FeedbackState { + FeedbackState() { + ///Initialize variables + } +} diff --git a/circle_app/lib/app/feedback/view.dart b/circle_app/lib/app/feedback/view.dart new file mode 100644 index 0000000..452eb04 --- /dev/null +++ b/circle_app/lib/app/feedback/view.dart @@ -0,0 +1,131 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../components/my_app_bar.dart'; +import '../../util/util.dart'; +import 'logic.dart'; + +class FeedbackPage extends StatelessWidget { + FeedbackPage({Key? key}) : super(key: key); + + final logic = Get.find(); + final state = Get + .find() + .state; + + @override + Widget build(BuildContext context) { + return GetBuilder(builder: (FeedbackLogic controller){ + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar( + centerTitle: '意见反馈', + ), + body: SingleChildScrollView(child: SafeArea( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 200, + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 20), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(13), + color: Color( + 0xFF4C3E5F), // Use your desired background color + ), + padding: EdgeInsets.all(13), + child: TextField( + decoration: InputDecoration( + hintText: '请补充详细问题和意见,我们会认真看完的哦~', + hintStyle: TextStyle( + color: Color(0xFFB7BECC), fontSize: 14.sp), + border: InputBorder.none, + + ), + maxLines: null, + maxLength: 200, + + inputFormatters: [ + LengthLimitingTextInputFormatter(200), + ], + style: TextStyle(color: Colors.white), + + ), + ), + Container( + height: 120.sp, + margin: EdgeInsets.only(left: 16.sp,right: 16.sp), + child: GridView.builder( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, // 每行显示的项目数量 + ), + itemCount: 4, // Replace with your item count + itemBuilder: (context, index) { + if (index == 0) { + // 第一个项目,显示固定的图片 + return GestureDetector( + onTap: () { + controller.getImageFile(); + }, + child: Container( + margin: EdgeInsets.all(5.sp), + child: Image( + image: AssetImage(getMineImage("icon_img_add")), + ), + ), + ); + } else { + // 后续项目,根据接口获取数据 + // 假设通过接口获取到的数据存储在一个名为 data 的列表中 + // var itemData = data[index - 1]; // 减去第一个固定图片的索引 + return Container( + margin: EdgeInsets.all(5.sp), + child: Center( + // child: _buildImageItem( + // 'https://book.flutterchina.club/assets/img/logo.png'), + ), + ); + } + }, + ), + ), + Padding( + padding: EdgeInsets.only(left: 16, top: 10), + child: Text( + '最多选择3张图片', + style: TextStyle(color: Color(0xFFB7BECC), fontSize: 12), + ), + ), + SizedBox(height: 50), + Container( + margin: EdgeInsets.symmetric(horizontal: 72), + height: 42, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(21), + color: Color(0xFF21BEAB), + ), + child: Center( + child: Text( + '提交', + style: TextStyle(color: Colors.white, fontSize: 16), + ), + ), + ), + ], + ), + ),) + ), + ); + }); + } + +} \ No newline at end of file diff --git a/circle_app/lib/app/help/view.dart b/circle_app/lib/app/help/view.dart index cfc9271..9e31afb 100644 --- a/circle_app/lib/app/help/view.dart +++ b/circle_app/lib/app/help/view.dart @@ -3,6 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import '../../components/my_app_bar.dart'; +import '../../router/app_routers.dart'; import '../../util/util.dart'; import 'logic.dart'; @@ -28,13 +29,13 @@ class HelpPage extends StatelessWidget { ), body: SafeArea( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + children: [ Padding( padding: EdgeInsets.only(top: 30.sp), child: Center( child: Text( - '04-10 19:50', + '04-10 19:51', style: TextStyle( color: Color(0xFFB7BECC), fontSize: 12.sp, @@ -44,10 +45,20 @@ class HelpPage extends StatelessWidget { ), SizedBox(height: 16.sp), Padding( - padding: EdgeInsets.only(left: 16.sp,right: 16.sp), + padding: EdgeInsets.only(left: 16.sp, right: 16.sp), child: Row( children: [ - Image.asset(getMineImage("im_feedback"),width: 32.sp,height: 32.sp,), + Container( + height: 200.sp, + child: Align( + alignment: Alignment.topCenter, + child: Image.asset( + getMineImage("im_feedback"), + width: 32.sp, + height: 32.sp, + ), + ), + ), SizedBox(width: 8.sp), Expanded( child: Container( @@ -91,9 +102,14 @@ class HelpPage extends StatelessWidget { children: [ TextButton.icon( onPressed: () { + Get.toNamed(AppRoutes.FeedbackActivity); // Handle feedback button press }, - icon: Image.asset(getMineImage("im_feedback_write"),width: 14.sp,height: 14.sp,), + icon: Image.asset( + getMineImage("im_feedback_write"), + width: 14.sp, + height: 14.sp, + ), label: Text( '意见反馈', style: TextStyle( @@ -103,18 +119,23 @@ class HelpPage extends StatelessWidget { ), style: TextButton.styleFrom( backgroundColor: Color(0xFF21BEAB), - padding: EdgeInsets.symmetric(horizontal: 16.sp, vertical: 4.sp), + padding: EdgeInsets.symmetric( + horizontal: 16.sp, vertical: 4.sp), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20.sp), ), ), ), - SizedBox(width: 10), + SizedBox(width: 20), TextButton.icon( onPressed: () { // Handle contact service button press }, - icon: Image.asset(getMineImage("im_service"),width: 14.sp,height: 14.sp,), + icon: Image.asset( + getMineImage("im_service"), + width: 14.sp, + height: 14.sp, + ), label: Text( '联系客服', style: TextStyle( @@ -124,7 +145,8 @@ class HelpPage extends StatelessWidget { ), style: TextButton.styleFrom( backgroundColor: Color(0xFF21BEAB), - padding: EdgeInsets.symmetric(horizontal: 16.sp, vertical: 4.sp), + padding: EdgeInsets.symmetric( + horizontal: 16.sp, vertical: 4.sp), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20.sp), ), @@ -139,7 +161,4 @@ class HelpPage extends StatelessWidget { ), ); } - - - } diff --git a/circle_app/lib/app/login/complete_material/logic.dart b/circle_app/lib/app/login/complete_material/logic.dart index c62ab85..7f6638e 100644 --- a/circle_app/lib/app/login/complete_material/logic.dart +++ b/circle_app/lib/app/login/complete_material/logic.dart @@ -9,7 +9,7 @@ import 'state.dart'; class Complete_materialLogic extends GetxController { final Complete_materialState state = Complete_materialState(); final ImagePicker _picker = ImagePicker(); - + var type = Get.arguments ?? ""; Future getImageFile() async { try { final XFile? pickedFile = await _picker.pickImage( diff --git a/circle_app/lib/app/login/complete_material/view.dart b/circle_app/lib/app/login/complete_material/view.dart index 359a010..2bc25c3 100644 --- a/circle_app/lib/app/login/complete_material/view.dart +++ b/circle_app/lib/app/login/complete_material/view.dart @@ -18,6 +18,7 @@ class Complete_materialPage extends StatelessWidget { // PickerStyle pickerStyle = PickerStyle(); @override Widget build(BuildContext context) { + return GetBuilder(builder: (Complete_materialLogic controller) { return Stack( children: [ @@ -179,7 +180,12 @@ class Complete_materialPage extends StatelessWidget { ), GestureDetector( onTap: () { - controller.pushHome(); + if(controller.type=="user"){ + Navigator.pop(context); + }else{ + controller.pushHome(); + } + // controller.checkInfo(); }, child: Container( @@ -192,7 +198,7 @@ class Complete_materialPage extends StatelessWidget { image: AssetImage(getLoginImage('start_bg'))), ), child: Text( - '开启小圈之旅', + controller.type=="user"? "完成" : '开启小圈之旅', style: TextStyle( color: Color(0xff00FFF4), fontSize: 16.sp, @@ -211,6 +217,7 @@ class Complete_materialPage extends StatelessWidget { }); } + Widget funcWidget( String leftStr, Widget tipWidget, GestureTapCallback callback, {String img = 'down_arr'}) { diff --git a/circle_app/lib/app/minefragment/view.dart b/circle_app/lib/app/minefragment/view.dart index 54313e7..9ef4358 100644 --- a/circle_app/lib/app/minefragment/view.dart +++ b/circle_app/lib/app/minefragment/view.dart @@ -9,7 +9,7 @@ import 'logic.dart'; class MinefragmentPage extends StatelessWidget { MinefragmentPage({Key? key}) : super(key: key); - // final logic = Get.lazyPut(() => MinefragmentLogic()); + // final logic = Get.lazyPut(() => MinefragmentLogic()); // final state = Get.find().state; @@ -59,55 +59,53 @@ class MinefragmentPage extends StatelessWidget { } Widget _SetUpItemView() { - return GestureDetector( + return GestureDetector( behavior: HitTestBehavior.opaque, - onTap: () { - Get.toNamed(AppRoutes.SetUpActivity); - // controller.state.hearUrl - - }, - child: Container( - // color: Colors.red, - margin: EdgeInsets.only(top: 18), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Image( - image: AssetImage(getHomeImage("mine_setup")), - width: 24, - height: 24, - ), - SizedBox(width: 10), - Text( - "设置", - style: TextStyle(color: Colors.white), - ), - ], - ), - Row( - children: [ - Image( - image: AssetImage(getHomeImage("icon_in")), - width: 24, - height: 24, - ), - ], - ) - ], - ), + onTap: () { + Get.toNamed(AppRoutes.SetUpActivity); + // controller.state.hearUrl + }, + child: Container( + // color: Colors.red, + margin: EdgeInsets.only(top: 18), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Image( + image: AssetImage(getHomeImage("mine_setup")), + width: 24, + height: 24, + ), + SizedBox(width: 10), + Text( + "设置", + style: TextStyle(color: Colors.white), + ), + ], + ), + Row( + children: [ + Image( + image: AssetImage(getHomeImage("icon_in")), + width: 24, + height: 24, + ), + ], + ) + ], ), - ); + ), + ); } Widget _HelpItemView() { - return GestureDetector( + return GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { Get.toNamed(AppRoutes.HelpActivity); // controller.state.hearUrl - }, child: Container( margin: EdgeInsets.only(top: 18), @@ -194,7 +192,7 @@ class MinefragmentPage extends StatelessWidget { behavior: HitTestBehavior.opaque, onTap: () { print("我喜欢的"); - Get.toNamed(AppRoutes.FriendsActivity,arguments: "0"); + Get.toNamed(AppRoutes.FriendsActivity, arguments: "0"); }, child: Container( child: Column( @@ -230,9 +228,9 @@ class MinefragmentPage extends StatelessWidget { behavior: HitTestBehavior.opaque, onTap: () { print("喜欢我的"); - Get.toNamed(AppRoutes.FriendsActivity,arguments: "1"); + Get.toNamed(AppRoutes.FriendsActivity, arguments: "1"); }, - child: Stack( + child: Stack( children: [ Column( mainAxisAlignment: MainAxisAlignment.center, @@ -285,9 +283,9 @@ class MinefragmentPage extends StatelessWidget { behavior: HitTestBehavior.opaque, onTap: () { print("最近来访"); - Get.toNamed(AppRoutes.FriendsActivity,arguments: "2"); + Get.toNamed(AppRoutes.FriendsActivity, arguments: "2"); }, - child: Stack( + child: Stack( children: [ Column( mainAxisAlignment: MainAxisAlignment.center, @@ -336,8 +334,6 @@ class MinefragmentPage extends StatelessWidget { ], ), ), - - ], ), ), @@ -348,7 +344,7 @@ class MinefragmentPage extends StatelessWidget { return GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { - Get.toNamed(AppRoutes.UserInfoActivity,arguments: ""); + Get.toNamed(AppRoutes.UserInfoActivity, arguments: ""); }, child: Container( width: Get.width, @@ -378,12 +374,10 @@ class MinefragmentPage extends StatelessWidget { } Widget _buildAvatar1() { - return ClipOval( + return ClipOval( child: GestureDetector( onTap: () { - // controller.state.hearUrl = - // 'https://book.flutterchina.club/assets/img/logo.png'; - // controller.update(); + // Get.toNamed(AppRoutes.Swiper,arguments:imgList); }, child: Image.network( 'https://book.flutterchina.club/assets/img/logo.png', @@ -391,8 +385,8 @@ class MinefragmentPage extends StatelessWidget { height: 65, ), ), - ); + ); } Widget _buildNameRow() { diff --git a/circle_app/lib/app/offaccount/binding.dart b/circle_app/lib/app/offaccount/binding.dart new file mode 100644 index 0000000..a26fffb --- /dev/null +++ b/circle_app/lib/app/offaccount/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class OffaccountBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => OffaccountLogic()); + } +} diff --git a/circle_app/lib/app/offaccount/logic.dart b/circle_app/lib/app/offaccount/logic.dart new file mode 100644 index 0000000..0783eb8 --- /dev/null +++ b/circle_app/lib/app/offaccount/logic.dart @@ -0,0 +1,10 @@ +import 'package:flutter/cupertino.dart'; +import 'package:get/get.dart'; + +import 'state.dart'; + +class OffaccountLogic extends GetxController { + final OffaccountState state = OffaccountState(); + + +} diff --git a/circle_app/lib/app/offaccount/state.dart b/circle_app/lib/app/offaccount/state.dart new file mode 100644 index 0000000..b99fba8 --- /dev/null +++ b/circle_app/lib/app/offaccount/state.dart @@ -0,0 +1,12 @@ +import 'package:flutter/cupertino.dart'; + +class OffaccountState { + OffaccountState() { + ///Initialize variables + } + + String offReasonMsg = "请选择"; + TextEditingController photoController = TextEditingController(); + + +} diff --git a/circle_app/lib/app/offaccount/view.dart b/circle_app/lib/app/offaccount/view.dart new file mode 100644 index 0000000..3ac36fb --- /dev/null +++ b/circle_app/lib/app/offaccount/view.dart @@ -0,0 +1,322 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../components/my_app_bar.dart'; +import '../../util/util.dart'; +import 'logic.dart'; + +class OffaccountPage extends StatefulWidget { + OffaccountPage({Key? key}) : super(key: key); + + @override + _OffaccountState createState() => _OffaccountState(); +} + +class _OffaccountState extends State { + int countdown = 10; // 初始倒计时时间 + bool isButtonDisabled = false; // 按钮是否禁用 + late Timer timer; + + @override + void initState() { + super.initState(); + startCountdown(); + } + + @override + void dispose() { + timer.cancel(); + super.dispose(); + } + + void startCountdown() { + timer = Timer.periodic(Duration(seconds: 1), (Timer t) { + setState(() { + if (countdown > 0) { + countdown--; + } else { + timer.cancel(); + } + }); + }); + } + + void handleLogout(OffaccountLogic logic) { + if(countdown > 0 ){ + + }else{ + showToast(logic.state.photoController.text.toString()+""); + } + + // 执行注销操作 + } + + @override + Widget build(BuildContext context) { + return GetBuilder(builder: (logic) { + + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar(centerTitle: '注销账号'), + body: Scaffold( + backgroundColor: Colors.transparent, + body: SingleChildScrollView( + child: Container( + padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // 注销提示信息 + Text( + "注销后,你的账号将", + style: TextStyle( + color: Colors.white, + fontSize: 16, + ), + ), + SizedBox(height: 8), + Text( + "1、无法登录跨友app;", + style: TextStyle( + color: Color(0xFFB7BECC), + fontSize: 12, + ), + ), + Text( + "2、所有信息将被永远删除:身份信息、账户信息、会员、喊话、相册等内容;", + style: TextStyle( + color: Color(0xFFB7BECC), + fontSize: 12, + ), + ), + Text( + "3、您的好友无法与你取得联系(包括关注、粉丝等);", + style: TextStyle( + color: Color(0xFFB7BECC), + fontSize: 12, + ), + ), + Text( + "4、注销后,一个月内该手机号将无法注册新的账号。", + style: TextStyle( + color: Color(0xFFB7BECC), + fontSize: 12, + ), + ), + SizedBox(height: 10), + + // 输入手机号或邮箱 + Text( + "请输入绑定的手机号", + style: TextStyle( + color: Color(0xFF898F99), + fontSize: 10, + ), + ), + SizedBox(height: 10), + TextFormField( + controller: logic.state.photoController, + keyboardType: TextInputType.phone, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + FilteringTextInputFormatter.deny(RegExp('[^0-9]')), + ], + decoration: InputDecoration( + hintText: "请输入手机号", + hintStyle: TextStyle( + color: Colors.white, + fontSize: 14, + ), + filled: true, + fillColor: Color(0xFF000000), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(4), + borderSide: BorderSide.none, + ), + contentPadding: EdgeInsets.symmetric(horizontal: 16), + ), + style: TextStyle( + color: Colors.white, + fontSize: 14, + ), + // enabled: countdown == 0, // 当倒计时结束后才可编辑 + ), + SizedBox(height: 16), + + // 选择注销原因 + Text( + "请选择你的注销原因", + style: TextStyle( + color: Color(0xFF898F99), + fontSize: 10, + ), + ), + SizedBox(height: 10), + GestureDetector(onTap: () { + showBottomSheetDialog(context,logic); + }, + child: Container( + width: double.infinity, + height: 40, + margin: EdgeInsets.only(top: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + color: Color(0xFF000000), + ), + child: Row( + children: [ + Expanded( + child: TextFormField( + enabled: false, + decoration: InputDecoration( + hintText: logic.state.offReasonMsg, + hintStyle: TextStyle( + color: Color(0xFFF7FAFA), + fontSize: 14, + ), + border: InputBorder.none, + contentPadding: EdgeInsets.only(left: 16), + ), + style: TextStyle( + color: Color(0xFFF7FAFA), + fontSize: 14, + ), + ), + ), + Image.asset( + getHomeImage("icon_in"), + width: 14, + height: 14, + ), + ], + ), + ),) + , + SizedBox(height: 42), + + // 注销按钮 + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + + }, child: Align( + alignment: Alignment.bottomCenter, + child: Container( + width: 160, + child: ElevatedButton( + onPressed: (){ + handleLogout(logic); + }, + child: Text( + countdown > 0 ? "注销($countdown s)" : "注销", + ), + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all( + countdown > 0 ? Colors.grey : Color(0xFF21BEAB), + ), + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(17), + ), + ), + ), + ), + ), + ),) + , + ], + ), + ), + ), + ), + ), + ); + }); + } + + + void showBottomSheetDialog(BuildContext context,OffaccountLogic logic) { + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + builder: (BuildContext context) { + return Container( + decoration: BoxDecoration( + color: Colors.black.withOpacity(0.6), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + buildOptionItem("体验太差", context,logic), + buildDivider(), + buildOptionItem("换平台了", context,logic), + buildDivider(), + buildOptionItem("担心隐私泄露", context,logic), + ], + ), + ); + }, + ); + } + + Widget buildOptionItem(String title, BuildContext context,OffaccountLogic logic) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + // 处理选项点击事件 + Navigator.pop(context); + logic.state.offReasonMsg = title; + logic.update(); + // 执行相应操作 + // switch (title) { + // case "体验太差": + // + // // 执行体验操作 + // break; + // case "换平台了": + // // 执行换平台操作 + // break; + // case "担心隐私泄露": + // // 执行泄露隐私操作 + // break; + // } + }, + child: Container( + width: Get.width, + alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical: 16), + child: Text( + title, + style: TextStyle( + fontSize: 16, + color: Colors.white, + ), + ), + ), + ); + } + + Widget buildDivider() { + return Container( + height: 0.5, + color: Color(0xff2E2E3B), + margin: EdgeInsets.symmetric(horizontal: 16), + ); + } + +} \ No newline at end of file diff --git a/circle_app/lib/app/photoinfo/logic.dart b/circle_app/lib/app/photoinfo/logic.dart index 512353f..9e016ac 100644 --- a/circle_app/lib/app/photoinfo/logic.dart +++ b/circle_app/lib/app/photoinfo/logic.dart @@ -1,7 +1,11 @@ +import 'package:circle_app/util/util.dart'; +import 'package:flutter/cupertino.dart'; import 'package:get/get.dart'; import 'state.dart'; class PhotoinfoLogic extends GetxController { final PhotoinfoState state = PhotoinfoState(); + + } diff --git a/circle_app/lib/app/photoinfo/view.dart b/circle_app/lib/app/photoinfo/view.dart index f71a461..0e034ce 100644 --- a/circle_app/lib/app/photoinfo/view.dart +++ b/circle_app/lib/app/photoinfo/view.dart @@ -1,4 +1,7 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -6,281 +9,373 @@ import '../../components/my_app_bar.dart'; import '../../util/util.dart'; import 'logic.dart'; -class PhotoinfoPage extends StatelessWidget { +class PhotoinfoPage extends StatefulWidget { PhotoinfoPage({Key? key}) : super(key: key); - final logic = Get.find(); - final state = Get.find().state; + @override + _PhotoinfoPage createState() => _PhotoinfoPage(); +} + +class _PhotoinfoPage extends State { + + int _countdownSeconds = 60; + bool _isCountingDown = false; + Timer? _timer; + TextEditingController _photoController = TextEditingController(); + TextEditingController _passwordController = TextEditingController(); + TextEditingController _newPhotoController = TextEditingController(); + TextEditingController _codeController = TextEditingController(); + @override + void dispose() { + _timer?.cancel(); + super.dispose(); + } + + void startCountdown() { + setState(() { + _isCountingDown = true; + _countdownSeconds = 60; + }); + + _timer = Timer.periodic(Duration(seconds: 1), (timer) { + setState(() { + if (_countdownSeconds > 0) { + _countdownSeconds--; + } else { + _isCountingDown = false; + _timer?.cancel(); + } + }); + }); + } + @override Widget build(BuildContext context) { - return Container( - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage(getBaseImage("home_back")), - fit: BoxFit.cover, + return GetBuilder(builder: (logic) { + + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), ), - ), - child: Scaffold( - backgroundColor: Colors.transparent, - appBar: MyAppBar( - centerTitle: '换绑手机号', - ), - body: Scaffold( + child: Scaffold( backgroundColor: Colors.transparent, - body: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only( - left: 16.0.sp, - top: 16.0.sp, - right: 16.0.sp, - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4.0.sp), - color: Color(0xff282733), - ), - height: 40.0.sp, - child: Row( - // mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - alignment: Alignment.centerLeft, - padding: EdgeInsets.only(left: 16.0.sp, right: 10.sp), - child: Text( - "+86", - style: TextStyle( - color: Colors.white, - fontSize: 14.0.sp, - ), - )), - Expanded( - child: Container( - height: 32.sp, - alignment: Alignment.center, - child: TextField( - textAlignVertical: TextAlignVertical.center, - decoration: InputDecoration( - hintText: "请输入已绑定手机号", - hintStyle: TextStyle( - color: Colors.grey.shade300, - fontSize: 14.0, - ), - border: InputBorder.none, - ), - style: TextStyle( - color: Colors.white, - fontSize: 14.0, - height: 1.0, - ), - ), - ), - ) - ], - ), - ), - Container( - margin: EdgeInsets.fromLTRB(16.0, 20.0, 16.0, 0.0), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4.0), - color: Color(0xff282733), - ), - height: 40.0, - child: Row( - children: [ - Container( - alignment: Alignment.centerLeft, - padding: EdgeInsets.only(left: 10.0.sp, right: 10.sp), - child: Image( - image: AssetImage(getMineImage("im_lock")), - width: 24.sp, - height: 24.sp, - ), - ), - Expanded( - child: Container( - height: 32.sp, - alignment: Alignment.center, - child: TextField( - textAlignVertical: TextAlignVertical.center, - decoration: InputDecoration( - hintText: "请输入密码", - hintStyle: TextStyle( - color: Colors.grey.shade300, - fontSize: 14.0, - ), - border: InputBorder.none, - ), - style: TextStyle( - color: Colors.white, - fontSize: 14.0, - height: 1.0, - ), - ), - ), - ) - ], - ), - ), - Container( - margin: - EdgeInsets.fromLTRB(16.0.sp, 20.0.sp, 16.0.sp, 0.0.sp), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4.0.sp), - color: Color(0xff282733), - ), - height: 40.0.sp, - child: Row( - children: [ - Padding( - padding: EdgeInsets.only(left: 16.0.sp,right: 10.sp), - child: Center( + appBar: MyAppBar( + centerTitle: '换绑手机号', + ), + body: Scaffold( + backgroundColor: Colors.transparent, + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only( + left: 16.0.sp, + top: 16.0.sp, + right: 16.0.sp, + ), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.0.sp), + color: Color(0xff282733), + ), + height: 40.0.sp, + child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only( + left: 16.0.sp, right: 10.sp), child: Text( "+86", style: TextStyle( color: Colors.white, fontSize: 14.0.sp, ), - ), - )), - Expanded( - child: Container( - height: 32.sp, - alignment: Alignment.center, - child: TextField( - textAlignVertical: TextAlignVertical.center, - decoration: InputDecoration( - hintText: "请输入新手机号", - hintStyle: TextStyle( - color: Colors.grey.shade300, - fontSize: 14.0, + )), + Expanded( + child: Container( + height: 32.sp, + alignment: Alignment.center, + child: TextField( + controller: _photoController, + textAlignVertical: TextAlignVertical.center, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + FilteringTextInputFormatter.deny(RegExp('[^0-9]')), + ], + keyboardType: TextInputType.phone, + decoration: InputDecoration( + hintText: "请输入已绑定手机号", + hintStyle: TextStyle( + color: Colors.grey.shade300, + fontSize: 14.0, + ), + border: InputBorder.none, + ), + style: TextStyle( + color: Colors.white, + fontSize: 14.0, + height: 1.0, ), - border: InputBorder.none, - ), - style: TextStyle( - color: Colors.white, - fontSize: 14.0, - height: 1.0, ), ), - ), - ) - ], + ) + ], + ), ), - ), - Row( - children: [ - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.fromLTRB( - 16.0.sp, 20.0.sp, 8.0.sp, 0.0.sp), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4.0.sp), - color: Color(0xff282733), + Container( + margin: EdgeInsets.fromLTRB(16.0, 20.0, 16.0, 0.0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.0), + color: Color(0xff282733), + ), + height: 40.0, + child: Row( + children: [ + Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only(left: 10.0.sp, right: 10.sp), + child: Image( + image: AssetImage(getMineImage("im_lock")), + width: 24.sp, + height: 24.sp, + ), ), - height: 40.0.sp, - child: Row( - children: [ - Container( - alignment: Alignment.centerLeft, - padding: EdgeInsets.only(left: 10.0.sp, right: 10.sp), - child: Image( - image: AssetImage(getMineImage("im_shield")), - width: 24.sp, - height: 24.sp, + Expanded( + child: Container( + height: 32.sp, + alignment: Alignment.center, + child: TextField( + controller: _passwordController, + textAlignVertical: TextAlignVertical.center, + obscureText: true, // 设置为true以隐藏用户输入的内容 + + decoration: InputDecoration( + hintText: "请输入密码", + hintStyle: TextStyle( + color: Colors.grey.shade300, + fontSize: 14.0, + ), + border: InputBorder.none, + ), + style: TextStyle( + color: Colors.white, + fontSize: 14.0, + height: 1.0, ), ), - Expanded( - child: Container( - height: 32.sp, - alignment: Alignment.center, - child: TextField( - textAlignVertical: TextAlignVertical.center, - decoration: InputDecoration( - hintText: "请输入验证码", - hintStyle: TextStyle( - color: Colors.grey.shade300, - fontSize: 14.0, - ), - border: InputBorder.none, - ), - style: TextStyle( - color: Colors.white, - fontSize: 14.0, - height: 1.0, - ), + ), + ) + ], + ), + ), + Container( + margin: + EdgeInsets.fromLTRB(16.0.sp, 20.0.sp, 16.0.sp, 0.0.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.0.sp), + color: Color(0xff282733), + ), + height: 40.0.sp, + child: Row( + children: [ + Padding( + padding: EdgeInsets.only( + left: 16.0.sp, right: 10.sp), + child: Center( + child: Text( + "+86", + style: TextStyle( + color: Colors.white, + fontSize: 14.0.sp, ), ), - ) - ], + )), + Expanded( + child: Container( + height: 32.sp, + alignment: Alignment.center, + child: TextField( + controller: _newPhotoController, + textAlignVertical: TextAlignVertical.center, + keyboardType: TextInputType.phone, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + FilteringTextInputFormatter.deny(RegExp('[^0-9]')), + ], + decoration: InputDecoration( + hintText: "请输入新手机号", + hintStyle: TextStyle( + color: Colors.grey.shade300, + fontSize: 14.0, + ), + border: InputBorder.none, + ), + style: TextStyle( + color: Colors.white, + fontSize: 14.0, + height: 1.0, + ), + ), + ), + ) + ], + ), + ), + Row( + children: [ + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.fromLTRB( + 16.0.sp, 20.0.sp, 8.0.sp, 0.0.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.0.sp), + color: Color(0xff282733), + ), + height: 40.0.sp, + child: Row( + children: [ + Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only( + left: 10.0.sp, right: 10.sp), + child: Image( + image: AssetImage(getMineImage("im_shield")), + width: 24.sp, + height: 24.sp, + ), + ), + Expanded( + child: Container( + height: 32.sp, + alignment: Alignment.center, + child: TextField( + controller: _codeController, + textAlignVertical: TextAlignVertical.center, + decoration: InputDecoration( + hintText: "请输入验证码", + hintStyle: TextStyle( + color: Colors.grey.shade300, + fontSize: 14.0, + ), + border: InputBorder.none, + ), + style: TextStyle( + color: Colors.white, + fontSize: 14.0, + height: 1.0, + ), + ), + ), + ) + ], + ), ), ), - ), - Expanded( - flex: 2, - child: Container( - margin: EdgeInsets.fromLTRB( - 8.0.sp, 20.0.sp, 16.0.sp, 0.0.sp), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4.0.sp), - color: Color(0xff282733), - ), - height: 40.0.sp, - child: Center( - child: Text( - "获取验证码", - style: TextStyle( - color: Colors.grey.shade400, - fontSize: 14.0.sp, + Expanded( + flex: 2, + child: GestureDetector( + onTap: () { + if (!_isCountingDown) { + // Only start countdown if not already counting down + startCountdown(); + } + }, + child: Container( + margin: EdgeInsets.fromLTRB( + 8.0.sp, 20.0.sp, 16.0.sp, 0.0.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.0.sp), + color: Color(0xff282733), + ), + height: 40.0.sp, + child: Center( + child: Text( + _isCountingDown + ? '$_countdownSeconds 秒' + : '获取验证码', + style: TextStyle( + color: _isCountingDown + ? Colors.grey.shade400 + : Colors.white, + fontSize: 14.0.sp, + ), + ), ), ), ), ), - ), - ], - ), - Padding( - padding: - EdgeInsets.fromLTRB(20.0.sp, 20.0.sp, 20.0.sp, 0.0.sp), - child: Text( - "温馨提示:换绑成功后,将退出软件使用新手机号重新登录,旧手机号无法登录此账号,但可以重新注册。", - style: TextStyle( - color: Colors.grey.shade400, - fontSize: 12.0.sp, + ], + ), + Padding( + padding: + EdgeInsets.fromLTRB(20.0.sp, 20.0.sp, 20.0.sp, 0.0.sp), + child: Text( + "温馨提示:换绑成功后,将退出软件使用新手机号重新登录,旧手机号无法登录此账号,但可以重新注册。", + style: TextStyle( + color: Colors.grey.shade400, + fontSize: 12.0.sp, + ), ), ), - ), - GestureDetector( - onTap: () { - // Perform action on button press - }, - child: Container( - margin: - EdgeInsets.fromLTRB(72.0.sp, 40.0.sp, 72.0.sp, 0.0.sp), - height: 42.0.sp, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(21.0.sp), - color: Colors.blue, - ), - child: Center( - child: Text( - "确定", - style: TextStyle( - color: Colors.white, - fontSize: 16.0.sp, + GestureDetector( + onTap: () { + String photo = _photoController.text; + String password = _passwordController.text; + String newphoto = _newPhotoController.text; + String code = _codeController.text; + if(photo==""||photo.length<11){ + showToast("已绑定的手机号输入有误"); + return ; + } + if(password==""){ + showToast("请输入密码"); + return ; + } + if(newphoto==""||newphoto.length<11){ + showToast("新手机号输入有误"); + return ; + } + if(code==""){ + showToast("请输入验证码"); + return ; + } + + // Perform action on button press + }, + child: Container( + margin: + EdgeInsets.fromLTRB(72.0.sp, 40.0.sp, 72.0.sp, 0.0.sp), + height: 42.0.sp, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(21.0.sp), + color: Colors.blue, + ), + child: Center( + child: Text( + "确定", + style: TextStyle( + color: Colors.white, + fontSize: 16.0.sp, + ), ), ), ), ), - ), - ], + ], + ), ), ), ), - ), - ); + ); + }); } + } + diff --git a/circle_app/lib/app/report/binding.dart b/circle_app/lib/app/report/binding.dart new file mode 100644 index 0000000..9d00222 --- /dev/null +++ b/circle_app/lib/app/report/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class ReportBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => ReportLogic()); + } +} diff --git a/circle_app/lib/app/report/logic.dart b/circle_app/lib/app/report/logic.dart new file mode 100644 index 0000000..822cdfd --- /dev/null +++ b/circle_app/lib/app/report/logic.dart @@ -0,0 +1,44 @@ +import 'package:get/get.dart'; +import 'package:image_picker/image_picker.dart'; + +import 'state.dart'; + +class ReportLogic extends GetxController { + final ReportState state = ReportState(); + List arrList = [ + MyObject("涉嫌欺诈", false), + MyObject("色情低俗", false), + MyObject("侮辱谩骂", false), + MyObject("骚扰广告", false), + MyObject("扰乱平台", false), + MyObject("散布谣言", false), + MyObject("盗图侵权", false), + MyObject("其他违规", false) + ]; + + List getItemList() { + return arrList; + } + final ImagePicker _picker = ImagePicker(); + Future getImageFile() async { + try { + final XFile? pickedFile = await _picker.pickImage( + source: ImageSource.gallery, + ); + // setState(() { + // _setImageFileListFromFile(pickedFile); + // }); + } catch (e) { + // setState(() { + // _pickImageError = e; + // }); + } + } +} + +class MyObject { + String name; + bool isSelect; + + MyObject(this.name, this.isSelect); +} diff --git a/circle_app/lib/app/report/state.dart b/circle_app/lib/app/report/state.dart new file mode 100644 index 0000000..c5ce25d --- /dev/null +++ b/circle_app/lib/app/report/state.dart @@ -0,0 +1,13 @@ +import 'logic.dart'; + +class ReportState { + + ReportState() { + + ///Initialize variables + /// + } + + + +} \ No newline at end of file diff --git a/circle_app/lib/app/report/view.dart b/circle_app/lib/app/report/view.dart new file mode 100644 index 0000000..451fa42 --- /dev/null +++ b/circle_app/lib/app/report/view.dart @@ -0,0 +1,234 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../components/my_app_bar.dart'; +import '../../util/util.dart'; +import 'logic.dart'; + +class ReportPage extends StatelessWidget { + ReportPage({Key? key}) : super(key: key); + + final logic = Get.find(); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + return GetBuilder(builder: (ReportLogic controller) { + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar( + centerTitle: '举报', + actionWdiget: Text( + "提交", + style: TextStyle(color: Colors.white), + ), + onPressed: () { + showToast("提交"); + }, + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 16, top: 16), + child: Text( + '举报类目', + style: TextStyle( + color: Colors.white, + fontSize: 16, + ), + ), + ), + Container( + height: 120.sp, + child: _reportAdapter(controller), + ), + Expanded( + child: Padding( + padding: EdgeInsets.fromLTRB(16, 20, 16, 0), + child: ListView( + children: [ + Text( + '详细截图(请至少上传一张图片,帮助审核处理)', + style: TextStyle( + color: Colors.white70, + fontSize: 16, + ), + ), + SizedBox(height: 20), + // 添加 RecyclerView(ListView) 的内容 + // 例如: MyRecyclerViewWidget(), + Container( + height: 130.sp, + child: _imageAdapter(controller)), + Text( + '补充说明', + style: TextStyle( + color: Colors.white, + fontSize: 14, + ), + ), + SizedBox(height: 30), + Container( + margin: EdgeInsets.only(left: 16, right: 16), + height: 200, + decoration: BoxDecoration( + color: Color(0xFF4C3E5F), + borderRadius: BorderRadius.circular(10), + ), + padding: EdgeInsets.all(16.sp), + child: Stack( + children: [ + TextField( + decoration: InputDecoration.collapsed( + hintText: '违规补充说明,帮助审核处理,选填', + hintStyle: TextStyle( + color: Color(0xFFB7BECC), + fontSize: 12, + ), + ), + maxLines: null, + maxLength: 200, + style: TextStyle( + color: Color(0xFF000000), + fontSize: 12, + ), + ), + ], + ), + ), + ], + ), + ), + ), + ], + ), + ), + ); + }); + } + + Widget _reportAdapter(ReportLogic controller) { + return GridView.builder( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + // crossAxisSpacing: 6.sp, + childAspectRatio: 3, + ), + itemCount: controller.getItemList().length, + shrinkWrap: true, + itemBuilder: (BuildContext context, int index) { + return GestureDetector( + onTap: () { + controller.arrList[index].isSelect = + !controller.arrList[index].isSelect; + controller.update(); + }, + child: _getItemSelect(controller.arrList[index]), + ); + }, + ); + } + + Widget _imageAdapter(ReportLogic controller) { + return GridView.builder( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, // 每行显示的项目数量 + ), + itemCount: 20, // 项目的总数量,包括固定图片和接口获取的项目 + itemBuilder: (BuildContext context, int index) { + if (index == 0) { + // 第一个项目,显示固定的图片 + return GestureDetector( + onTap: () { + controller.getImageFile(); + }, + child: Container( + margin: EdgeInsets.all(5.sp), + child: Image( + image: AssetImage(getMineImage("icon_img_add")), + ), + ), + ); + } else { + // 后续项目,根据接口获取数据 + // 假设通过接口获取到的数据存储在一个名为 data 的列表中 + // var itemData = data[index - 1]; // 减去第一个固定图片的索引 + return Container( + margin: EdgeInsets.all(5.sp), + child: Center( + // child: _buildImageItem( + // 'https://book.flutterchina.club/assets/img/logo.png'), + ), + ); + } + }, + ); + } + + Widget _getItemSelect(MyObject bean) { + if (bean.isSelect) { + return Container( + margin: + EdgeInsets.only(left: 8.sp, right: 8.sp, top: 6.sp, bottom: 6.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20.sp), + gradient: LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: + EdgeInsets.only(top: 2.sp, bottom: 2.sp, left: 15.sp, right: 15.sp), + child: Center( + child: Text( + bean.name, + style: TextStyle( + color: Colors.white, + fontSize: 11.sp, + ), + ), + ), + ); + } else { + return Container( + margin: + EdgeInsets.only(left: 8.sp, right: 8.sp, top: 6.sp, bottom: 6.sp), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20.0), // 设置圆角半径 + border: Border.all( + color: Color(0xFF392D53), + ), + color: Color(0xFF392D53), + ), + child: Padding( + padding: EdgeInsets.only( + top: 2.sp, bottom: 2.sp, left: 15.sp, right: 15.sp), + child: Center( + child: Text( + bean.name, + style: TextStyle( + fontSize: 11.0, + color: Colors.white, + ), + ), + ), + ), + ), + ); + } + } +} diff --git a/circle_app/lib/app/swiper/binding.dart b/circle_app/lib/app/swiper/binding.dart new file mode 100644 index 0000000..f6d8380 --- /dev/null +++ b/circle_app/lib/app/swiper/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class SwiperBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => SwiperLogic()); + } +} diff --git a/circle_app/lib/app/swiper/logic.dart b/circle_app/lib/app/swiper/logic.dart new file mode 100644 index 0000000..ff2fe7c --- /dev/null +++ b/circle_app/lib/app/swiper/logic.dart @@ -0,0 +1,8 @@ +import 'package:get/get.dart'; + +import 'state.dart'; + +class SwiperLogic extends GetxController { + final SwiperState state = SwiperState(); + List imgList = Get.arguments ; +} diff --git a/circle_app/lib/app/swiper/state.dart b/circle_app/lib/app/swiper/state.dart new file mode 100644 index 0000000..92ac8a3 --- /dev/null +++ b/circle_app/lib/app/swiper/state.dart @@ -0,0 +1,5 @@ +class SwiperState { + SwiperState() { + ///Initialize variables + } +} diff --git a/circle_app/lib/app/swiper/view.dart b/circle_app/lib/app/swiper/view.dart new file mode 100644 index 0000000..d786c80 --- /dev/null +++ b/circle_app/lib/app/swiper/view.dart @@ -0,0 +1,44 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:get/get_state_manager/src/simple/get_state.dart'; + +import 'logic.dart'; + +class SwiperPage extends StatefulWidget { + const SwiperPage({Key? key}) : super(key: key); + + @override + State createState() => _SwiperPageState(); +} + +class _SwiperPageState extends State { + + @override + Widget build(BuildContext context) { + return GetBuilder(builder: (logic) { + return Scaffold( + appBar: null, + backgroundColor: Colors.black87, + body: GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: (() { + //点击任意地方都能关闭页面,并且不影响你的滑动查看 + Navigator.pop(context); + }), + child: Swiper( + itemBuilder: (BuildContext context, int index) { + return Container( + width: double.infinity, + child: Image.network( + logic.imgList[index]['url'], fit: BoxFit.contain,) + ); + }, + itemCount: logic.imgList.length, + pagination: SwiperPagination(), //下面的分页小点 +// control: new SwiperControl(), //左右的那个箭头,在某模拟器中会出现蓝线 + ), + ), + ); + }); + } +} \ No newline at end of file diff --git a/circle_app/lib/app/text/binding.dart b/circle_app/lib/app/text/binding.dart new file mode 100644 index 0000000..85c4802 --- /dev/null +++ b/circle_app/lib/app/text/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class TextBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => TextLogic()); + } +} diff --git a/circle_app/lib/app/text/logic.dart b/circle_app/lib/app/text/logic.dart new file mode 100644 index 0000000..dfcb921 --- /dev/null +++ b/circle_app/lib/app/text/logic.dart @@ -0,0 +1,7 @@ +import 'package:get/get.dart'; + +import 'state.dart'; + +class TextLogic extends GetxController { + final TextState state = TextState(); +} diff --git a/circle_app/lib/app/text/state.dart b/circle_app/lib/app/text/state.dart new file mode 100644 index 0000000..4f50ea6 --- /dev/null +++ b/circle_app/lib/app/text/state.dart @@ -0,0 +1,5 @@ +class TextState { + TextState() { + ///Initialize variables + } +} diff --git a/circle_app/lib/app/text/view.dart b/circle_app/lib/app/text/view.dart new file mode 100644 index 0000000..9c331e3 --- /dev/null +++ b/circle_app/lib/app/text/view.dart @@ -0,0 +1,998 @@ +import 'package:circle_app/app/text/logic.dart'; +import 'package:circle_app/util/util.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get_core/src/get_main.dart'; +import 'package:get/get_state_manager/src/simple/get_state.dart'; + +import '../../components/my_app_bar.dart'; + +class TextPage extends StatefulWidget { + @override + State createState() => _MyTabbedScreenState(); +} +class _MyTabbedScreenState extends State + with SingleTickerProviderStateMixin { + late TabController _tabController; + + ScrollController scrollController = ScrollController(); + bool isShowBlackTitle = false; + + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + _tabController.dispose(); + super.dispose(); + } + void _onScroll(offset) { + if (offset > 100) { + setState(() { + isShowBlackTitle = true; + }); + } else { + setState(() { + isShowBlackTitle = false; + }); + } + } + + + + + + @override + Widget build(BuildContext context) { + return GetBuilder(builder: (TextLogic controller) { + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar( + centerTitle: '个人主页', + ), + body:Container( + margin: EdgeInsets.all(10.sp), + child: Stack(children: [ + + NotificationListener( + onNotification: (scrollNotification) { + if (scrollNotification is ScrollUpdateNotification && + scrollNotification.depth == 0) { + //滚动并且是列表滚动的时候 + _onScroll(scrollNotification.metrics.pixels); + } + return true; + }, + child: Stack( + children: [ + NestedScrollView( + headerSliverBuilder: + (BuildContext context, bool innerBoxIsScrolled) { + return [ + SliverOverlapAbsorber( + handle: NestedScrollView + .sliverOverlapAbsorberHandleFor(context), + sliver: SliverAppBar( + leading: new Container( + child: Container(), + ), + title: isShowBlackTitle ? Text('') : Text(''), + centerTitle: false, + pinned: false, + floating: false, + snap: false, + primary: false, + expandedHeight: 165.0.sp, + backgroundColor: Colors.transparent, + elevation: 0, + //是否显示阴影,直接取值innerBoxIsScrolled,展开不显示阴影,合并后会显示 + forceElevated: innerBoxIsScrolled, + actions: [ + new Container( + margin: EdgeInsets.only( + right: 10, top: 20, bottom: 10), + child: Container(), + ), + new Container( + margin: EdgeInsets.only( + right: 10, top: 20, bottom: 10), + child: Container(), + ), + ], + + flexibleSpace: FlexibleSpaceBar( + collapseMode: CollapseMode.pin, + background: new Column( + children: [ + new Container( + height: 165.sp, + child: new Column( + children: [ + Row( + children: [ + _imagelistView(controller), + Flexible( + child: buildUserContainer(), + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Row( + children: [ + Text( + "name", + style: TextStyle( + color: Color.fromRGBO( + 247, 250, 250, 1.0), + fontSize: 16, + ), + ), + SizedBox(width: 10.sp), + _buildInfoRow(), + ], + ), + Row( + children: [ + Container( + margin: EdgeInsets.only( + right: 5.sp), + width: 10.sp, + height: 10.sp, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: + Color(0xFF00FFF4), + ), + ), + Text( + "在线·深圳", + style: TextStyle( + color: Color( + 0xFF00FFF4)), + ) + ], + ), + ], + ), + Container( + // margin: EdgeInsets.only(top: 18.sp, bottom: 18.sp), + height: 59.sp, + child: ListView.builder( + itemCount: 8, + // 替换为实际的 item 数量 + scrollDirection: + Axis.horizontal, + // 设置为水平方向 + padding: EdgeInsets.symmetric( + vertical: 18.sp), + // 替换为实际的边距值 + itemBuilder: (context, index) { + return Container( + margin: EdgeInsets.only( + right: 11.sp), + // 替换为实际的 item 间距 + child: Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius + .circular(17.0), + // 设置圆角半径 + gradient: + LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + ), + color: + Color(0xFF392D53), + ), + child: Container( + margin: EdgeInsets.all( + 0.2.sp), + decoration: + BoxDecoration( + borderRadius: + BorderRadius + .circular( + 17.0), + // shape: BoxShape.circle, + color: + Color(0xFF392D53), + ), + child: Padding( + padding: + EdgeInsets.only( + top: 2.sp, + bottom: 2.sp, + left: 15.sp, + right: 15.sp), + child: Center( + child: Text( + "圆角背景边框", + style: TextStyle( + fontSize: 11.0, + color: Colors + .white, + ), + ), + ), + ), + ), + ), // 替换为实际的列表项小部件 + ); + }, + ), + ), + ], + ), + ), + ], + ), + ), + ), + ), + SliverPersistentHeader( + delegate: _SliverAppBarDelegate2(titleTab()), + pinned: true, + ), + ]; + }, + body: Container( + margin: EdgeInsets.all(0), + child: TabBarView( + controller: _tabController, + children: [ + _imageAdapter(controller), + _imageAdapter(controller), + ], + ), + ), + ), + ], + )), + Positioned( + bottom: 27.sp, + width:100, + child: _MeInfoButton(controller), + ) + ]),), + )); + }); + } + Widget _MeInfoButton(TextLogic controller) { + if ("" == "") { + return GestureDetector( + onTap: () { + // showToast("完善资料"); + // Get.toNamed(AppRoutes.TextActivity); + // Get.toNamed(AppRoutes.Complete_materialPage, arguments: "user"); + }, + child: Center( + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 10.sp, bottom: 10.sp, left: 55.sp, right: 55.sp), + child: Text( + "完善个人形象照", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ), + ); + } else { + return Container( + margin: EdgeInsets.only(left: 18.sp, right: 18.sp), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () { + showToast("鼓掌"); + _showBottomSheet(context); + }, + child: Image( + image: AssetImage(getMineImage("icon_like")), + width: 40.sp, + height: 40.sp, + ), + ), + GestureDetector( + onTap: () { + showToast("喜欢"); + }, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17.sp), + gradient: LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 10.sp, bottom: 10.sp, left: 52.sp, right: 52.sp), + child: Text( + "喜欢", + style: TextStyle( + color: Colors.white, + fontSize: 12.sp, + ), + ), + ), + ), + GestureDetector( + onTap: () { + showToast("私聊"); + }, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17.sp), + gradient: LinearGradient( + colors: [ + Color(0x26FFFFFF), + Color(0x26FFFFFF), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 10.sp, bottom: 10.sp, left: 52.sp, right: 52.sp), + child: Text( + "私聊", + style: TextStyle( + color: Colors.white, + fontSize: 12.sp, + ), + ), + ), + ) + ], + ), + ); + } + } + + Widget buildContent(TextLogic controller) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 19.sp, vertical: 14.sp), + child: Column( + children: [ + Row( + children: [ + _imagelistView(controller), + Flexible( + child: buildUserContainer(), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Text( + "name", + style: TextStyle( + color: Color.fromRGBO(247, 250, 250, 1.0), + fontSize: 16, + ), + ), + SizedBox(width: 10.sp), + _buildInfoRow(), + ], + ), + Row( + children: [ + Container( + margin: EdgeInsets.only(right: 5.sp), + width: 10.sp, + height: 10.sp, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Color(0xFF00FFF4), + ), + ), + Text( + "在线·深圳", + style: TextStyle(color: Color(0xFF00FFF4)), + ) + ], + ), + ], + ), + Container( + // margin: EdgeInsets.only(top: 18.sp, bottom: 18.sp), + height: 59.sp, + child: ListView.builder( + itemCount: 8, + // 替换为实际的 item 数量 + scrollDirection: Axis.horizontal, + // 设置为水平方向 + padding: EdgeInsets.symmetric(vertical: 18.sp), + // 替换为实际的边距值 + itemBuilder: (context, index) { + return Container( + margin: EdgeInsets.only(right: 11.sp), // 替换为实际的 item 间距 + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17.0), // 设置圆角半径 + gradient: LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + ), + color: Color(0xFF392D53), + ), + child: Container( + margin: EdgeInsets.all(0.2.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17.0), + // shape: BoxShape.circle, + color: Color(0xFF392D53), + ), + child: Padding( + padding: EdgeInsets.only( + top: 2.sp, bottom: 2.sp, left: 15.sp, right: 15.sp), + child: Center( + child: Text( + "圆角背景边框", + style: TextStyle( + fontSize: 11.0, + color: Colors.white, + ), + ), + ), + ), + ), + ), // 替换为实际的列表项小部件 + ); + }, + ), + ), + titleTab(), + Container( + margin: EdgeInsets.only(top: 18.sp, bottom: 14.sp), + child: Text( + "1314位圈友感兴趣,其中10位已催您更新", + style: TextStyle(color: Colors.white30), + )), + Expanded( + child: Container( + // color: Colors.blue, + child: TabBarView( + controller: _tabController, + children: [ + _imageAdapter(controller), + Text("喊话"), + ], + ), + )) + ], + ), + ); + } + + + // Widget titleTab1() { + // return SliverAppBar( + // backgroundColor: Colors.transparent, + // pinned: true, + // floating: true, + // expandedHeight: 100.sp, + // flexibleSpace: FlexibleSpaceBar( + // background: Container( + // padding: EdgeInsets.symmetric(horizontal: 16.sp), + // alignment: Alignment.bottomLeft, + // child: Text( + // '标题', + // style: TextStyle( + // color: Colors.white, + // fontSize: 24.sp, + // fontWeight: FontWeight.bold, + // ), + // ), + // ), + // ), + // ); + // } + + Column titleTab(){ + return Column( + children: [ + Container( + alignment: Alignment.centerLeft, + height: 27.sp, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + TabBar( + isScrollable: true, + controller: _tabController, + indicatorColor: Color(0xFF00FFF4), + indicatorWeight: 2.sp, + labelColor: Color(0xFF00FFF4), + unselectedLabelColor: Color(0xB3FFFFFF), + indicatorSize: TabBarIndicatorSize.label, + tabs: [ + Tab( + text: "形象照", + ), + Tab(text: "喊话") + ], + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 2.sp, bottom: 2.sp, left: 12.sp, right: 12.sp), + child: Text( + "完成", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ], + )), + ], + ); + } + + Widget _imageAdapter(TextLogic controller) { + return GridView.builder( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, // 每行显示的项目数量 + ), + itemCount: 20, // 项目的总数量,包括固定图片和接口获取的项目 + itemBuilder: (BuildContext context, int index) { + if (index == 0) { + // 第一个项目,显示固定的图片 + return GestureDetector( + onTap: () { + // controller.getImageFile(); + }, + child: Container( + margin: EdgeInsets.all(5.sp), + child: Image( + image: AssetImage(getMineImage("icon_img_add")), + ), + ), + ); + } else { + // 后续项目,根据接口获取数据 + // 假设通过接口获取到的数据存储在一个名为 data 的列表中 + // var itemData = data[index - 1]; // 减去第一个固定图片的索引 + return Container( + margin: EdgeInsets.all(5.sp), + child: Center( + child: _buildImageItem( + 'https://book.flutterchina.club/assets/img/logo.png', + controller)), + ); + } + }, + ); + } + + Widget _buildInfoRow() { + return Row( + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: LinearGradient( + colors: [ + Color.fromRGBO(141, 255, 248, 1.0), + Color.fromRGBO(181, 211, 255, 1.0), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 2.sp, bottom: 2.sp, left: 10.sp, right: 10.sp), + child: Text( + "男,33,CD", + style: TextStyle( + color: Colors.black, + fontSize: 10, + ), + ), + ), + SizedBox(width: 6.sp), + Image( + image: AssetImage(getBaseImage("vip")), + width: 44.sp, + height: 18.sp, + ), + ], + ); + } + + Widget buildUserContainer() { + return Container( + margin: EdgeInsets.symmetric(horizontal: 1.sp, vertical: 14.sp), + height: 58.sp, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getMineImage("icon_user_content")), + fit: BoxFit.fill, + ), + ), + child: Container( + margin: EdgeInsets.only(left: 24.sp), + child: Center( + child: Text( + '动物是灵性的动物是灵性的动物是灵性的动物是灵性的动物是灵性的动物是灵性的动物是灵性的,不同于植物。 你若孤独, 它陪伴你。在阳光的午后,蜷缩在你的...', + maxLines: 2, + style: TextStyle(color: Colors.white), + overflow: TextOverflow.ellipsis, + ), + ), + ), + ); + } + + Widget _imagelistView(TextLogic controller) { + return Stack( + alignment: Alignment.center, + children: [ + Container( + width: 68.sp, + height: 68.sp, + decoration: BoxDecoration( + shape: BoxShape.circle, + gradient: LinearGradient( + colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), + ), + ), + SizedBox( + width: 66.sp, + height: 66.sp, + child: _buildAvatar1(controller), + ) + ], + ); + } + + Widget _buildAvatar1(TextLogic controller) { + return ClipOval( + child: GestureDetector( + onTap: () {}, + child: Image.network( + 'https://book.flutterchina.club/assets/img/logo.png', + width: 66.sp, + height: 66.sp, + ), + ), + ); + } + + Widget _buildImageItem(String url, TextLogic controller) { + return Stack( + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(0.0), + child: GestureDetector( + onTap: () { + showToast("点击了图片"); + }, + child: Image.network( + url, + ), + ), + ), + if ("" == "") + Positioned( + top: 0, + right: 0, + child: GestureDetector( + onTap: () { + showToast("删除"); + }, + child: Image( + image: AssetImage(getMineImage("icon_img_del")), + width: 20.sp, + height: 20.sp, + ), + )) + ], + ); + } + + void _showBottomSheet(BuildContext context) { + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + builder: (BuildContext context) { + return Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(16.0), + topRight: Radius.circular(16.0), + ), + gradient: LinearGradient( + colors: [ + Color(0xFF4A3E5D), + Color(0xFF344143), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + height: 118.0, + width: double.infinity, + child: Container( + alignment: Alignment.center, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () { + Navigator.pop(context); + // Get.toNamed(AppRoutes.ReportActivity); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image( + image: AssetImage(getMineImage("icon_report")), + width: 40.sp, + height: 40.sp, + ), + Container( + margin: EdgeInsets.only(top: 2.sp), + child: Text( + "举报", + style: TextStyle(color: Colors.white), + ), + ) + ], + ), + ), + SizedBox(width: 75.sp), + GestureDetector( + onTap: () { + Navigator.pop(context); + _showReportDialog(context); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image( + image: AssetImage(getMineImage("icon_block")), + width: 40.sp, + height: 40.sp, + ), + Container( + margin: EdgeInsets.only(top: 2.sp), + child: Text( + "拉黑", + style: TextStyle(color: Colors.white), + ), + ) + ], + ), + ), + ], + ), + )); + }, + ); + } + + void _showReportDialog(BuildContext context) { + showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.transparent, + child: Container( + height: 277.sp, + padding: EdgeInsets.all(1.0), + child: Stack( + children: [ + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10.0), + gradient: LinearGradient( + colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), + ), + ), + Container( + margin: EdgeInsets.all(1.sp), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10.0), + gradient: LinearGradient( + colors: [Color(0xFF4C3E5F), Color(0xFF324140)], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), + ), + ), + Container( + margin: EdgeInsets.only(top: 24.sp), + child: Column( + children: [ + Center( + child: Text( + "是否拉黑", + style: + TextStyle(color: Colors.white, fontSize: 16.sp), + ), + ), + Container( + margin: EdgeInsets.only(top: 14.sp), + alignment: Alignment.center, + child: Image( + image: AssetImage(getMineImage("icon_dialog_black")), + width: 70.sp, + height: 70.sp, + ), + ), + Container( + margin: EdgeInsets.only( + top: 12.sp, left: 14.sp, right: 14.sp), + alignment: Alignment.center, + child: Text( + "拉黑后,你将屏蔽对方的任何信息若您关注了对方,将自动取消关注。", + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xCCF7FAFA), fontSize: 16.sp), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () { + Navigator.pop(context); + }, + child: Container( + margin: EdgeInsets.only(top: 24.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: LinearGradient( + colors: [ + Color(0x26FFFFFF), + Color(0x26FFFFFF), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 10.sp, + bottom: 10.sp, + left: 52.sp, + right: 52.sp), + child: Text( + "否", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ), + SizedBox(width: 24.sp), + GestureDetector( + onTap: () {}, + child: Container( + margin: EdgeInsets.only(top: 24.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 10.sp, + bottom: 10.sp, + left: 52.sp, + right: 52.sp), + child: Text( + "是", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ) + ], + ) + ], + ), + ) + ], + ), + ), + ); + }, + ); + } +} +class _SliverAppBarDelegate2 extends SliverPersistentHeaderDelegate { + _SliverAppBarDelegate2(this._tabBar); + + final Column _tabBar; + + @override + Widget build( + BuildContext context, double shrinkOffset, bool overlapsContent) { + return _tabBar; + } + + @override + double get maxExtent => 52; + + @override + double get minExtent => 52; + + @override + bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) { + return true; + } +} + diff --git a/circle_app/lib/app/userinfo/logic.dart b/circle_app/lib/app/userinfo/logic.dart index 18bf7e3..6a92fb7 100644 --- a/circle_app/lib/app/userinfo/logic.dart +++ b/circle_app/lib/app/userinfo/logic.dart @@ -4,6 +4,7 @@ import 'package:image_picker/image_picker.dart'; import 'state.dart'; class UserinfoLogic extends GetxController { + var userId = Get.arguments ?? ""; final UserinfoState state = UserinfoState(); final ImagePicker _picker = ImagePicker(); Future getImageFile() async { diff --git a/circle_app/lib/app/userinfo/view.dart b/circle_app/lib/app/userinfo/view.dart index 0a8ed3b..f8dbe5d 100644 --- a/circle_app/lib/app/userinfo/view.dart +++ b/circle_app/lib/app/userinfo/view.dart @@ -3,6 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import '../../components/my_app_bar.dart'; +import '../../router/app_routers.dart'; import '../../util/util.dart'; import 'logic.dart'; @@ -15,11 +16,12 @@ class _MyTabbedScreenState extends State with SingleTickerProviderStateMixin { late TabController _tabController; - get data => null; + ScrollController scrollController = ScrollController(); + bool isShowBlackTitle = false; + @override void initState() { - // TODO: implement initState super.initState(); _tabController = TabController(length: 2, vsync: this); } @@ -29,13 +31,27 @@ class _MyTabbedScreenState extends State _tabController.dispose(); super.dispose(); } + void _onScroll(offset) { + if (offset > 100) { + setState(() { + isShowBlackTitle = true; + }); + } else { + setState(() { + isShowBlackTitle = false; + }); + } + } + + + + final logic = Get.find(); final state = Get.find().state; @override Widget build(BuildContext context) { - var userId = Get.arguments ?? ""; return GetBuilder(builder: (UserinfoLogic controller) { return Container( decoration: BoxDecoration( @@ -57,7 +73,7 @@ class _MyTabbedScreenState extends State Positioned( bottom: 27.sp, width: Get.width, - child: _MeInfoButton(userId), + child: _MeInfoButton(controller), ) ], ), @@ -65,11 +81,12 @@ class _MyTabbedScreenState extends State }); } - Widget _MeInfoButton(String userId) { - if (userId == "1") { + Widget _MeInfoButton(UserinfoLogic controller) { + if (controller.userId == "") { return GestureDetector( onTap: () { - showToast("完善资料"); + // showToast("完善资料"); + Get.toNamed(AppRoutes.Complete_materialPage, arguments: "user"); }, child: Center( child: Container( @@ -118,7 +135,6 @@ class _MyTabbedScreenState extends State showToast("喜欢"); }, child: Container( - // height: 40, decoration: BoxDecoration( borderRadius: BorderRadius.circular(17.sp), gradient: LinearGradient( @@ -181,7 +197,7 @@ class _MyTabbedScreenState extends State children: [ Row( children: [ - _headView(), + _imagelistView(controller), Flexible( child: buildUserContainer(), ), @@ -223,87 +239,56 @@ class _MyTabbedScreenState extends State ], ), Container( - // margin: EdgeInsets.only(top: 18.sp, bottom: 18.sp), - height: 59.sp, + // margin: EdgeInsets.only(top: 18.sp, bottom: 18.sp), + height: 59.sp, child: ListView.builder( itemCount: 8, // 替换为实际的 item 数量 scrollDirection: Axis.horizontal, // 设置为水平方向 - padding: EdgeInsets.symmetric( vertical: 18.sp), + padding: EdgeInsets.symmetric(vertical: 18.sp), // 替换为实际的边距值 itemBuilder: (context, index) { return Container( margin: EdgeInsets.only(right: 11.sp), // 替换为实际的 item 间距 child: Container( decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.0), // 设置圆角半径 - border: Border.all( - color: Color(0xFF392D53), // 边框颜色 - width: 1.0, // 边框宽度 - ), - color: Color(0xFF392D53), - ), - child: Padding( - padding: EdgeInsets.only(top: 2.sp,bottom: 2.sp,left: 15.sp,right: 15.sp), - child: Center( - child: Text( - "圆角背景边框", - style: TextStyle( - fontSize: 11.0, - color: Colors.white, - ), - ),),), - ),// 替换为实际的列表项小部件 - ); - }, - ), - ), - Container( - alignment: Alignment.centerLeft, - height: 27.sp, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - TabBar( - isScrollable: true, - controller: _tabController, - indicatorColor: Color(0xFF00FFF4), - indicatorWeight: 2.sp, - labelColor: Color(0xFF00FFF4), - unselectedLabelColor: Color(0xB3FFFFFF), - indicatorSize: TabBarIndicatorSize.label, - tabs: [ - Tab( - text: "形象照", - ), - Tab(text: "喊话") - ], - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(17), + borderRadius: BorderRadius.circular(17.0), // 设置圆角半径 gradient: LinearGradient( colors: [ Color(0xFF06F9FA), Color(0xFFDC5BFD), ], - begin: Alignment.centerLeft, - end: Alignment.centerRight, + ), + color: Color(0xFF392D53), + ), + child: Container( + margin: EdgeInsets.all(0.2.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17.0), + // shape: BoxShape.circle, + color: Color(0xFF392D53), + ), + child: Padding( + padding: EdgeInsets.only( + top: 2.sp, bottom: 2.sp, left: 15.sp, right: 15.sp), + child: Center( + child: Text( + "圆角背景边框", + style: TextStyle( + fontSize: 11.0, + color: Colors.white, + ), + ), + ), ), ), - padding: EdgeInsets.only( - top: 2.sp, bottom: 2.sp, left: 12.sp, right: 12.sp), - child: Text( - "完成", - style: TextStyle( - color: Colors.white, - fontSize: 12, - ), - ), - ), - ], - )), + ), // 替换为实际的列表项小部件 + ); + }, + ), + ), + titleTab(), Container( margin: EdgeInsets.only(top: 18.sp, bottom: 14.sp), child: Text( @@ -325,6 +310,53 @@ class _MyTabbedScreenState extends State ), ); } + Widget titleTab(){ + return Container( + alignment: Alignment.centerLeft, + height: 27.sp, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + TabBar( + isScrollable: true, + controller: _tabController, + indicatorColor: Color(0xFF00FFF4), + indicatorWeight: 2.sp, + labelColor: Color(0xFF00FFF4), + unselectedLabelColor: Color(0xB3FFFFFF), + indicatorSize: TabBarIndicatorSize.label, + tabs: [ + Tab( + text: "形象照", + ), + Tab(text: "喊话") + ], + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 2.sp, bottom: 2.sp, left: 12.sp, right: 12.sp), + child: Text( + "完成", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ], + )); + } Widget _imageAdapter(UserinfoLogic controller) { return GridView.builder( @@ -353,9 +385,9 @@ class _MyTabbedScreenState extends State return Container( margin: EdgeInsets.all(5.sp), child: Center( - child: _buildImageItem( - 'https://book.flutterchina.club/assets/img/logo.png'), - ), + child: _buildImageItem( + 'https://book.flutterchina.club/assets/img/logo.png', + controller)), ); } }, @@ -377,7 +409,8 @@ class _MyTabbedScreenState extends State end: Alignment.centerRight, ), ), - padding: EdgeInsets.only(top: 2.sp, bottom: 2.sp, left: 10.sp, right: 10.sp), + padding: EdgeInsets.only( + top: 2.sp, bottom: 2.sp, left: 10.sp, right: 10.sp), child: Text( "男,33,CD", style: TextStyle( @@ -420,7 +453,7 @@ class _MyTabbedScreenState extends State ); } - Widget _headView() { + Widget _imagelistView(UserinfoLogic controller) { return Stack( alignment: Alignment.center, children: [ @@ -439,13 +472,13 @@ class _MyTabbedScreenState extends State SizedBox( width: 66.sp, height: 66.sp, - child: _buildAvatar1(), + child: _buildAvatar1(controller), ) ], ); } - Widget _buildAvatar1() { + Widget _buildAvatar1(UserinfoLogic controller) { return ClipOval( child: GestureDetector( onTap: () {}, @@ -458,7 +491,7 @@ class _MyTabbedScreenState extends State ); } - Widget _buildImageItem(String url) { + Widget _buildImageItem(String url, UserinfoLogic controller) { return Stack( children: [ ClipRRect( @@ -472,61 +505,246 @@ class _MyTabbedScreenState extends State ), ), ), - Positioned( - top: 0, - right: 0, - child: GestureDetector( - onTap: () { - showToast("删除"); - }, - child: Image( - image: AssetImage(getMineImage("icon_img_del")), - width: 20.sp, - height: 20.sp, - ), - )) + if (controller.userId == "") + Positioned( + top: 0, + right: 0, + child: GestureDetector( + onTap: () { + showToast("删除"); + }, + child: Image( + image: AssetImage(getMineImage("icon_img_del")), + width: 20.sp, + height: 20.sp, + ), + )) ], ); } - - - void _showBottomSheet(BuildContext context) { showModalBottomSheet( context: context, backgroundColor: Colors.transparent, builder: (BuildContext context) { return Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(16.0), - topRight: Radius.circular(16.0), + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(16.0), + topRight: Radius.circular(16.0), + ), + gradient: LinearGradient( + colors: [ + Color(0xFF4A3E5D), + Color(0xFF344143), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), ), - gradient: LinearGradient( - colors: [ - Color(0xFF4A3E5D), - Color(0xFF344143), - ], - begin: Alignment.centerLeft, - end: Alignment.centerRight, - ), - ), - - height: 118.0, - width: double.infinity, - child: Text( - '顶部圆角容器', - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 20.0, - color: Colors.white, - ), - ), - ); - + height: 118.0, + width: double.infinity, + child: Container( + alignment: Alignment.center, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () { + Navigator.pop(context); + Get.toNamed(AppRoutes.ReportActivity); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image( + image: AssetImage(getMineImage("icon_report")), + width: 40.sp, + height: 40.sp, + ), + Container( + margin: EdgeInsets.only(top: 2.sp), + child: Text( + "举报", + style: TextStyle(color: Colors.white), + ), + ) + ], + ), + ), + SizedBox(width: 75.sp), + GestureDetector( + onTap: () { + Navigator.pop(context); + _showReportDialog(context); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image( + image: AssetImage(getMineImage("icon_block")), + width: 40.sp, + height: 40.sp, + ), + Container( + margin: EdgeInsets.only(top: 2.sp), + child: Text( + "拉黑", + style: TextStyle(color: Colors.white), + ), + ) + ], + ), + ), + ], + ), + )); }, ); } + void _showReportDialog(BuildContext context) { + showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.transparent, + child: Container( + height: 277.sp, + padding: EdgeInsets.all(1.0), + child: Stack( + children: [ + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10.0), + gradient: LinearGradient( + colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), + ), + ), + Container( + margin: EdgeInsets.all(1.sp), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10.0), + gradient: LinearGradient( + colors: [Color(0xFF4C3E5F), Color(0xFF324140)], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), + ), + ), + Container( + margin: EdgeInsets.only(top: 24.sp), + child: Column( + children: [ + Center( + child: Text( + "是否拉黑", + style: + TextStyle(color: Colors.white, fontSize: 16.sp), + ), + ), + Container( + margin: EdgeInsets.only(top: 14.sp), + alignment: Alignment.center, + child: Image( + image: AssetImage(getMineImage("icon_dialog_black")), + width: 70.sp, + height: 70.sp, + ), + ), + Container( + margin: EdgeInsets.only( + top: 12.sp, left: 14.sp, right: 14.sp), + alignment: Alignment.center, + child: Text( + "拉黑后,你将屏蔽对方的任何信息若您关注了对方,将自动取消关注。", + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xCCF7FAFA), fontSize: 16.sp), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () { + Navigator.pop(context); + }, + child: Container( + margin: EdgeInsets.only(top: 24.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: LinearGradient( + colors: [ + Color(0x26FFFFFF), + Color(0x26FFFFFF), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 10.sp, + bottom: 10.sp, + left: 52.sp, + right: 52.sp), + child: Text( + "否", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ), + SizedBox(width: 24.sp), + GestureDetector( + onTap: () {}, + child: Container( + margin: EdgeInsets.only(top: 24.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 10.sp, + bottom: 10.sp, + left: 52.sp, + right: 52.sp), + child: Text( + "是", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ) + ], + ) + ], + ), + ) + ], + ), + ), + ); + }, + ); + } } diff --git a/circle_app/lib/router/app_pages.dart b/circle_app/lib/router/app_pages.dart index 737f765..f101925 100644 --- a/circle_app/lib/router/app_pages.dart +++ b/circle_app/lib/router/app_pages.dart @@ -2,9 +2,13 @@ import 'package:circle_app/app/aboutapp/binding.dart'; import 'package:circle_app/app/aboutapp/view.dart'; import 'package:circle_app/app/account/binding.dart'; import 'package:circle_app/app/account/view.dart'; +import 'package:circle_app/app/bindmail/binding.dart'; +import 'package:circle_app/app/bindmail/view.dart'; import 'package:circle_app/app/blacklist/binding.dart'; import 'package:circle_app/app/call_out/binding.dart'; import 'package:circle_app/app/call_out/view.dart'; +import 'package:circle_app/app/feedback/binding.dart'; +import 'package:circle_app/app/feedback/view.dart'; import 'package:circle_app/app/friendslist/binding.dart'; import 'package:circle_app/app/friendslist/view.dart'; import 'package:circle_app/app/help/binding.dart'; @@ -14,12 +18,20 @@ import 'package:circle_app/app/home/view.dart'; import 'package:circle_app/app/login/login/view.dart'; import 'package:circle_app/app/minefragment/binding.dart'; import 'package:circle_app/app/minefragment/view.dart'; +import 'package:circle_app/app/offaccount/binding.dart'; +import 'package:circle_app/app/offaccount/view.dart'; import 'package:circle_app/app/photoinfo/binding.dart'; import 'package:circle_app/app/photoinfo/view.dart'; +import 'package:circle_app/app/report/binding.dart'; +import 'package:circle_app/app/report/view.dart'; import 'package:circle_app/app/setup/binding.dart'; import 'package:circle_app/app/setup/view.dart'; import 'package:circle_app/app/login/complete_material/binding.dart'; import 'package:circle_app/app/login/complete_material/view.dart'; +import 'package:circle_app/app/swiper/binding.dart'; +import 'package:circle_app/app/swiper/view.dart'; +import 'package:circle_app/app/text/binding.dart'; +import 'package:circle_app/app/text/view.dart'; import 'package:circle_app/app/userinfo/binding.dart'; import 'package:circle_app/app/userinfo/view.dart'; import 'package:get/get_navigation/src/routes/get_route.dart'; @@ -91,6 +103,36 @@ class AppPages { page: () => Call_outPage(), binding: Call_outBinding(), ), - GetPage(name: AppRoutes.Login, page: () => LoginPage()) + GetPage(name: AppRoutes.Login, page: () => LoginPage()), + GetPage( + name: AppRoutes.ReportActivity, + page: () => ReportPage(), + binding: ReportBinding(), + ), + GetPage( + name: AppRoutes.FeedbackActivity, + page: () => FeedbackPage(), + binding: FeedbackBinding(), + ), + GetPage( + name: AppRoutes.BindMailActivity, + page: () => BindmailPage(), + binding: BindmailBinding(), + ), + GetPage( + name: AppRoutes.TextActivity, + page: () => TextPage(), + binding: TextBinding(), + ), + GetPage( + name: AppRoutes.Swiper, + page: () => SwiperPage(), + binding: SwiperBinding(), + ), + GetPage( + name: AppRoutes.OffAccountActivity, + page: () => OffaccountPage(), + binding: OffaccountBinding(), + ), ]; } diff --git a/circle_app/lib/router/app_routers.dart b/circle_app/lib/router/app_routers.dart index 7a639ba..4380617 100644 --- a/circle_app/lib/router/app_routers.dart +++ b/circle_app/lib/router/app_routers.dart @@ -12,4 +12,10 @@ abstract class AppRoutes { static const HelpActivity = '/user/HelpActivity'; static const FriendsActivity = '/user/FriendsActivity'; static const UserInfoActivity = '/user/UserInfoActivity'; + static const ReportActivity = '/user/ReportActivity'; + static const FeedbackActivity = '/user/FeedbackActivity'; + static const BindMailActivity = '/user/BindMailActivity'; + static const TextActivity = '/user/TextActivity'; + static const Swiper = '/user/Swiper'; + static const OffAccountActivity = '/user/OffAccountActivity'; } \ No newline at end of file diff --git a/circle_app/pubspec.yaml b/circle_app/pubspec.yaml index c71df89..b20e4e2 100644 --- a/circle_app/pubspec.yaml +++ b/circle_app/pubspec.yaml @@ -52,6 +52,8 @@ dependencies: flutter_swiper: ^1.1.6 # 选择器弹窗 flutter_pickers: ^2.1.9 + #七牛 + qiniu_flutter_sdk: ^0.5.0 dev_dependencies: flutter_test: