diff --git a/circle_app/android/app/build.gradle b/circle_app/android/app/build.gradle index dc5c32e..124700c 100644 --- a/circle_app/android/app/build.gradle +++ b/circle_app/android/app/build.gradle @@ -71,8 +71,8 @@ android { // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion 21 targetSdkVersion flutter.targetSdkVersion - versionCode 37 - versionName "1.4.5" + versionCode 39 + versionName "1.4.7" manifestPlaceholders = [ vivo_APPID: "105669716", vivo_APPKEY:"84f750207787376b310ca5b0d5969122", diff --git a/circle_app/assets/images/mine/save.png b/circle_app/assets/images/mine/save.png new file mode 100644 index 0000000..c662df7 Binary files /dev/null and b/circle_app/assets/images/mine/save.png differ diff --git a/circle_app/ios/Runner.xcodeproj/project.pbxproj b/circle_app/ios/Runner.xcodeproj/project.pbxproj index 0caae0b..e034526 100644 --- a/circle_app/ios/Runner.xcodeproj/project.pbxproj +++ b/circle_app/ios/Runner.xcodeproj/project.pbxproj @@ -381,7 +381,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.4.2; + MARKETING_VERSION = 1.4.4; PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -530,7 +530,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.4.2; + MARKETING_VERSION = 1.4.4; PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -573,7 +573,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.4.2; + MARKETING_VERSION = 1.4.4; PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; diff --git a/circle_app/lib/app/bill/view.dart b/circle_app/lib/app/bill/view.dart index 1a934ca..ce51b4c 100644 --- a/circle_app/lib/app/bill/view.dart +++ b/circle_app/lib/app/bill/view.dart @@ -89,9 +89,10 @@ class _BillState extends State with SingleTickerProviderStateMixin { // _tabController.animateTo(index); // }, children: [ + billListView(3), billListView(1), billListView(2), - billListView(3), + // billListView(4), ], ), @@ -192,11 +193,12 @@ class _BillState extends State with SingleTickerProviderStateMixin { indicatorSize: TabBarIndicatorSize.label, labelStyle: TextStyle(fontSize: 16.sp), tabs: const [ - Tab( - text: "充值", - ), - Tab(text: "消耗"), Tab(text: "收入"), + Tab( + text: "充值/奖励", + ), + Tab(text: "支出"), + ], onTap: (index) { // _pageController.animateToPage( @@ -258,7 +260,7 @@ class ListItemWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - type==2 ? '-'+item.amount.toString(): '+'+item.amount.toString(), + type==2 ? '-'+item.amount.toString() + '小票' : '+'+ '${type == 3 ? (item.amount * 0.01).toStringAsFixed(2) + '元' : item.amount.toString() + '小票'}', style: TextStyle( color: const Color(0xffefd84e), fontSize: 14.0.sp, diff --git a/circle_app/lib/app/circle/logic.dart b/circle_app/lib/app/circle/logic.dart index e87aa3d..aed6b4e 100644 --- a/circle_app/lib/app/circle/logic.dart +++ b/circle_app/lib/app/circle/logic.dart @@ -299,6 +299,7 @@ class CircleLogic extends GetxController { deep = bean.data.deep; } catch (Exception) {} + myVip = bean.data.isVip ? 1 : 0; if (vicinityPage == 1) { cityName = bean.data.city; @@ -362,12 +363,14 @@ class CircleLogic extends GetxController { class VicinityBean { String city; int offset; + bool isVip; int deep; List users; VicinityBean( {required this.city, required this.users, + required this.isVip, required this.offset, required this.deep}); @@ -377,6 +380,7 @@ class VicinityBean { listsJson.map((e) => VicinityItemBean.fromJson(e)).toList(); return VicinityBean( users: lists, + isVip: json['isVip'] ?? false, city: json['city'], offset: json['offset'], deep: json['deep']); @@ -397,6 +401,7 @@ class VicinityItemBean { final double lng; final double lat; final String city; + final List interests; final List images; final String avatarThumb; diff --git a/circle_app/lib/app/circle/view.dart b/circle_app/lib/app/circle/view.dart index 8ee0021..b8a454e 100644 --- a/circle_app/lib/app/circle/view.dart +++ b/circle_app/lib/app/circle/view.dart @@ -694,7 +694,7 @@ class _CirclePageState extends State TabBar( isScrollable: true, controller: _tabController, - labelPadding: EdgeInsets.symmetric(horizontal: 4.0.sp), + labelPadding: EdgeInsets.symmetric(horizontal: 12.0.sp), indicator: UnderlineTabIndicator( borderSide: BorderSide( color: const Color(0xFF00FFF4), @@ -786,7 +786,7 @@ class _CirclePageState extends State }, child: Image.asset( getCircleImage('callout_icon'), - width: 75.sp, + height: 24.5.sp, ), ) : Row( diff --git a/circle_app/lib/app/circle/widgets/discover.dart b/circle_app/lib/app/circle/widgets/discover.dart index b741dac..45e9495 100644 --- a/circle_app/lib/app/circle/widgets/discover.dart +++ b/circle_app/lib/app/circle/widgets/discover.dart @@ -151,6 +151,7 @@ class _DiscoverState extends State lastPage = 0; _scrollController.animateTo(0, duration: const Duration(milliseconds: 300), curve: Curves.easeInOut); + refreshData(); }); sub1 = EventBusManager.on().listen((event) { genderList = event.genderList!; @@ -312,11 +313,11 @@ class _DiscoverState extends State var user = Users.fromJson(list[index]); String onLineStr = ''; - if (user.online! ?? false) { - onLineStr = '当前在线'; + if (user.online_flag?.isNotEmpty ?? false) { + onLineStr = user.online_flag!; if (user.distance != null) { if (user.distance! < 100) { - onLineStr = '当前在线 · ${user.distance!.toInt()}km'; + onLineStr = '${user.online_flag!}· ${user.distance!.toInt()}km'; } } } else { @@ -357,36 +358,57 @@ class _DiscoverState extends State // clipBehavior: Clip.hardEdge, child: Container( // padding: EdgeInsets.all(2.sp), - child: Swiper( - autoplay: false, - loop: user.images!.length == 1 - ? false - : true, - itemBuilder: - (BuildContext context, int index) { - // print(index); - return GestureDetector( - onTap: () { - List imgList = []; - user.images!.forEach((element) { - imgList.add(element); - }); - - Get.toNamed(AppRoutes.Swiper, - arguments: { - 'imaglist': imgList, - 'index': index - }); - }, - child: CachedNetworkImage( - imageUrl: user.images![index], - fit: BoxFit.cover, - width: Get.width, - height: screenHeight, - )); + child: PageView.builder( + //当页面选中后回调此方法 + //参数[index]是当前滑动到的页面角标索引 从0开始 + onPageChanged: (int index) { + print("当前的页面是 $index"); + // currentPage = index; }, - itemCount: user.images!.length, - ), + //值为flase时 显示第一个页面 然后从左向右开始滑动 + //值为true时 显示最后一个页面 然后从右向左开始滑动 + reverse: false, + //滑动到页面底部无回弹效果 + physics: BouncingScrollPhysics(), + //纵向滑动切换 + scrollDirection: Axis.horizontal, + //页面控制器 + // controller: pageController, + //所有的子Widget + itemBuilder: (BuildContext context, int index) { + return GestureDetector( + onTap: () { + List imgList = []; + user.images!.forEach((element) { + imgList.add(element); + }); + + Get.toNamed(AppRoutes.Swiper, + arguments: { + 'imaglist': imgList, + 'index': index + }); + }, + child: CachedNetworkImage( + imageUrl: user.images![index], + fit: BoxFit.cover, + width: Get.width, + height: screenHeight, + )); + },itemCount: user.images!.length,) + + // Swiper( + // autoplay: false, + // loop: user.images!.length == 1 + // ? false + // : true, + // itemBuilder: + // (BuildContext context, int index) { + // // print(index); + + // }, + // itemCount: user.images!.length, + // ), )), ), Positioned( @@ -433,7 +455,7 @@ class _DiscoverState extends State ], ), ), - if (user.both_cities!.isNotEmpty) + if (onLineStr!.isNotEmpty) SizedBox( height: 8.sp, ), @@ -1056,6 +1078,7 @@ class Users { String? nicknameNote; bool? online; String? openId; + String? online_flag; bool? partner; bool? is_follow; String? phoneNum; @@ -1084,6 +1107,7 @@ class Users { this.bgPicUrl, this.birthday, this.blacklist, + this.online_flag, this.city, this.both_interests, this.distance, @@ -1136,6 +1160,7 @@ class Users { vip = json['vip']; role = json['role']; auth = json['auth']; + online_flag = json['online_flag']; both_interests = json['both_interests'] ?? []; both_cities = json['both_cities'] ?? []; is_follow = json['is_follow']; diff --git a/circle_app/lib/app/circle/widgets/discover_item.dart b/circle_app/lib/app/circle/widgets/discover_item.dart new file mode 100644 index 0000000..1941a4e --- /dev/null +++ b/circle_app/lib/app/circle/widgets/discover_item.dart @@ -0,0 +1,695 @@ +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:get/get.dart'; +import 'package:gradient_borders/box_borders/gradient_box_border.dart'; + +import '../../../common/colors/app_color.dart'; +import '../../../common/const.dart'; +import '../../../network/api.dart'; +import '../../../network/dio_manager.dart'; +import '../../../router/app_routers.dart'; +import '../../../util/util.dart'; +import '../../chat/TIMUIKitChat/TIMUIKitMessageItem/TIMUIKitMessageReaction/tim_uikit_chat_gift_elem.dart'; +import '../../home/logic.dart'; +import 'discover.dart'; + + +class DiscoverItem extends StatefulWidget { + double screenHeight; + Function deleteCallBack; + Function likeCallBack; + List list; + int index; + String onLineStr; + + DiscoverItem(this.screenHeight,this.list,this.index,this.onLineStr,this.deleteCallBack,this.likeCallBack, {super.key}); + + + // screenHeight + @override + _DiscoverItemState createState() => new _DiscoverItemState(); + +} + +class _DiscoverItemState extends State { + // TODO: add state variables and methods + var user; + String onLineStr = ''; + HomeLogic logic = Get.find(); + + @override + void initState() { + // TODO: implement initState + super.initState(); + user = Users.fromJson(widget.list[widget.index]); + onLineStr= widget.onLineStr; + } + + @override + Widget build(BuildContext context) { + // TODO: add widget build method + return Container( + height: widget.screenHeight, + width: Get.width, + margin: EdgeInsets.only( + top: 5.sp, left: 16.sp, right: 16.sp), + child: Stack( + children: [ + Container( + clipBehavior: Clip.hardEdge, + decoration: BoxDecoration( + color: Colors.black.withOpacity(0.25), + borderRadius: BorderRadius.circular(10.sp), + border: GradientBoxBorder( + gradient: + AppColor.mainVerLinearGradient, + width: 1.sp, + ), + // image: DecorationImage( + // fit: BoxFit.fill, + // image: AssetImage( + // getCircleImage('open_vip_bg'), + // )) + ), + height: widget.screenHeight, + width: Get.width, + child: ClipRRect( + borderRadius: BorderRadius.circular(10), + // clipBehavior: Clip.hardEdge, + child: Container( + // padding: EdgeInsets.all(2.sp), + child: Swiper( + autoplay: false, + loop: user.images!.length == 1 + ? false + : true, + itemBuilder: + (BuildContext context, int index) { + // print(index); + return GestureDetector( + onTap: () { + List imgList = []; + user.images!.forEach((element) { + imgList.add(element); + }); + + Get.toNamed(AppRoutes.Swiper, + arguments: { + 'imaglist': imgList, + 'index': index + }); + }, + child: CachedNetworkImage( + imageUrl: user.images![index], + fit: BoxFit.cover, + width: Get.width, + height:widget.screenHeight, + )); + }, + itemCount: user.images!.length, + ), + )), + ), + Positioned( + left: 5.sp, + top: 10.sp, + child: Container( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + if (onLineStr.isNotEmpty) + Container( + height: 24.sp, + padding: EdgeInsets.only( + left: 6.sp, right: 6.sp), + decoration: BoxDecoration( + color: Colors.black + .withOpacity(0.35), + borderRadius: + BorderRadius.circular( + 12.sp)), + child: Row( + children: [ + Container( + width: 6.sp, + height: 6.sp, + margin: EdgeInsets.only( + right: 4.sp), + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular( + 3.sp), + color: + const Color(0xFFCE51FF), + ), + ), + // if (logic.online) + Text( + onLineStr, + style: TextStyle( + color: Colors.white, + fontSize: 16.sp), + ), + ], + ), + ), + if (user.both_cities!.isNotEmpty) + SizedBox( + height: 8.sp, + ), + if (user.both_cities!.isNotEmpty) + Container( + height: 24.sp, + padding: EdgeInsets.only( + left: 6.sp, right: 6.sp), + decoration: BoxDecoration( + color: Colors.black + .withOpacity(0.35), + borderRadius: + BorderRadius.circular( + 12.sp)), + child: Row( + children: [ + Container( + width: 6.sp, + height: 6.sp, + margin: EdgeInsets.only( + right: 4.sp), + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular( + 3.sp), + color: const Color( + 0xFFCE51FF), + ), + ), + // if (logic.online) + Text( + "你们都来过${user.both_cities!.first}", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp), + ), + ], + )), + if (user.both_cities!.isNotEmpty) + SizedBox( + height: 8.sp, + ), + if (user.both_interests!.isNotEmpty) + Container( + height: 24.sp, + padding: EdgeInsets.only( + left: 6.sp, right: 6.sp), + decoration: BoxDecoration( + color: Colors.black + .withOpacity(0.35), + borderRadius: + BorderRadius.circular( + 12.sp)), + child: Row( + children: [ + Container( + width: 6.sp, + height: 6.sp, + margin: EdgeInsets.only( + right: 4.sp), + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular( + 3.sp), + color: const Color( + 0xFFCE51FF), + ), + ), + // if (logic.online) + Text( + "你们有共同的圈子:${user.both_interests!.first['title']}", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp), + ), + ], + )), + ], + ), + )), + Positioned( + right: 16.sp, + top: 16.sp, + child: GestureDetector( + onTap: () { + Get.toNamed(AppRoutes.UserInfoActivity, + arguments: user.userId!.toString()); + }, + child: Container( + width: 73.sp, + height: 25.sp, + decoration: BoxDecoration( + gradient: + AppColor.mainVerLinearGradient, + borderRadius: + BorderRadius.circular(12.5.sp)), + child: Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.only(left: 5.sp), + child: Text( + '查看主页', + style: TextStyle( + color: Colors.white, + fontSize: 10.sp, + ), + ), + ), + Image( + width: 15.sp, + image: AssetImage( + getDisCoverImage("right_icon")), + // width: 44.sp, + ), + ], + ), + ), + )), + + Positioned( + left: 6.sp, + bottom: 6.sp, + child: Container( + width: Get.width - 32.sp, + padding: EdgeInsets.only(right: 0.sp), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + if (user.wxNum != null && logic.isProd) + wxStatusWidget( + user.unLockWxNum == 1, + user.wxNum!, + user.userId.toString(), + user.avatarUrl!, () { + loadSignDiscoverData( + user.userId.toString()); + }), + SizedBox( + height: 15.sp, + ), + Row( + children: [ + Text( + user.nickname ?? '', + style: TextStyle( + fontSize: 18.sp, + color: Color(0XFFF7FAFA), + fontWeight: FontWeight.bold), + ), + Container( + margin: + EdgeInsets.only(left: 5.sp), + alignment: Alignment.center, + height: 18.sp, + padding: EdgeInsets.only( + left: 6.sp, right: 6.sp), + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular( + 9.sp), + gradient: + const LinearGradient( + begin: Alignment( + 0.25, 0.5), + end: Alignment( + 0.75, 0.5), + colors: [ + Color(0xff8DFFF8), + Color(0xffB5D3FF) + ])), + child: Text( + getAgeCOntent( + user!.gender ?? 0, + user!.age ?? 0, + user!.role ?? 0, + user!.orientation ?? 0), + style: TextStyle( + color: Colors.black, + fontSize: 12.sp, + ), + ), + ), + if (user.vip! > 0) + Container( + margin: EdgeInsets.only( + left: 4.sp, + ), + child: Image.asset( + getCircleImage(user!.vip == 1 + ? 'vip' + : 'year_vip'), + width: 36.sp, + ), + ), + ], + ), + Container( + width: Get.width - 120.sp, + margin: EdgeInsets.only( + top: 15.sp, bottom: 15.sp), + child: Text( + user.signature! ?? '', + overflow: TextOverflow.ellipsis, + maxLines: + (user.signature! ?? '').length > + 15 + ? 2 + : 1, + style: TextStyle( + fontSize: 16.sp, + color: const Color(0XFFF7FAFA)), + ), + ), + Container( + width: Get.width - 110.sp, + height: 35.sp, + child: tagItem(user.interests!), + ), + ], + ), + )), + Positioned( + bottom: 5.sp, + right: 15.sp, + child: Container( + child: Column( + children: [ + GestureDetector( + onTap: () async { + showGiftPannel(user.imAccid!.toString()); + }, + child: Image.asset( + getMsgImage('gift'), + width: 50.sp, + ), + ), + SizedBox( + height: 25.sp, + ), + GestureDetector( + onTap: () { + pushChatPage( + user.userId.toString(), + user.imAccid!.toString(), + user.nickname!); + }, + child: Image.asset( + getCircleImage( + 'chat_icon', + ), + width: 50.sp, + ), + ), + SizedBox( + height: 25.sp, + ), + GestureDetector( + onTap: () { + widget.likeCallBack(); + }, + child: Image.asset( + getCircleImage( + user.is_follow! + ? 'like_icon' + : 'nor_like_icon', + ), + width: 50.sp, + ), + ), + SizedBox( + height: 20.sp, + ), + GestureDetector( + onTap: () { + _showReportDialog(context, + user.userId!.toString(), widget.index); + }, + child: Image.asset( + getCircleImage( + 'no_look_icon', + ), + width: 50.sp, + ), + ) + ], + ), + )) + ], + )); + } + + + void _showReportDialog( + BuildContext context, String userId, int currentIndex) { + showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.transparent, + child: Container( + height: 277.sp, + padding: const EdgeInsets.all(1.0), + child: Stack( + children: [ + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10.0), + gradient: const 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: const 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(getCircleImage("no_look_icon_h")), + width: 70.sp, + height: 70.sp, + ), + ), + Container( + margin: EdgeInsets.only( + top: 12.sp, left: 14.sp, right: 14.sp), + alignment: Alignment.center, + child: Text( + "您确认对TA不感兴趣吗?确认之后在这个板块就看不见TA了。", + textAlign: TextAlign.center, + style: TextStyle( + color: const 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: const LinearGradient( + colors: [ + Color(0x26FFFFFF), + Color(0x26FFFFFF), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 10.sp, + bottom: 10.sp, + left: 27.sp, + right: 27.sp), + child: const Text( + "再考虑考虑", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ), + SizedBox(width: 24.sp), + GestureDetector( + onTap: () { + Get.back(); + sendNoLookData(userId, currentIndex); + }, + child: Container( + margin: EdgeInsets.only(top: 24.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: const 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: const Text( + "确定", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ) + ], + ) + ], + ), + ) + ], + ), + ), + ); + }, + ); + } + + void sendNoLookData(String userId, int index) async { + var data = await DioManager.instance.post(url: Api.uninterested + userId); + if (data['code'] == 200) { + showOKToast('操作成功'); + // widget.list.removeAt(index); + widget.deleteCallBack(); + // setState(() {}); + } + } + + + loadSignDiscoverData(String userId) async { + try { + var result = await DioManager.instance + .get(url: Api.getFindPageUserByUserId, params: { + 'userId': userId, + 'lat': '0', + 'lng': '0', + }); + + int initIndex = 0; + widget.list.forEach((element) { + if (element['id'].toString() == userId) { + initIndex = widget.list.indexOf(element); + } + }); + + widget.list[initIndex] = result['data']; + setState(() {}); + } catch (e) {} + } + + + tagItem(List item) { + return Container( + width: Get.width, + margin: EdgeInsets.only(top: 5.sp, bottom: 5.sp), + // color: Colors.red, + // height: 45.sp, + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: item.length, + itemBuilder: (context, index) { + return tagWidget(item[index]['title'], item[index]['id']); + }), + ); + } + + tagWidget(String tagName, int id) { + return GestureDetector( + onTap: () { + Get.toNamed(AppRoutes.Signal_circle_list, arguments: id); + }, + child: Container( + margin: EdgeInsets.only(right: 6.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17.0), + gradient: const LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + ), + color: const Color(0xFF392D53), + ), + child: Container( + margin: EdgeInsets.all(0.2.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17.0), + color: const Color(0xFF392D53), + ), + child: Padding( + padding: EdgeInsets.only( + top: 2.sp, + bottom: 2.sp, + left: 10.sp, + right: 10.sp, + ), + child: Center( + child: Text( + tagName, + style: const TextStyle( + fontSize: 11.0, + color: Colors.white, + ), + ), + ), + ), + ), + ), + ); + } + +} diff --git a/circle_app/lib/app/circle/widgets/vicinity.dart b/circle_app/lib/app/circle/widgets/vicinity.dart index f672de0..a07fde9 100644 --- a/circle_app/lib/app/circle/widgets/vicinity.dart +++ b/circle_app/lib/app/circle/widgets/vicinity.dart @@ -69,7 +69,7 @@ class _VicinityState extends State with AutomaticKeepAliveClientMixin controller: widget.logic.refreshController, onRefresh: _onRefresh, onLoading: _onLoading, - enablePullUp: widget.logic.myVip == 0 ? false : true, + enablePullUp: true, child: ListView.builder( controller: _scrollController, padding: EdgeInsets.all(10.sp), @@ -78,17 +78,17 @@ class _VicinityState extends State with AutomaticKeepAliveClientMixin if (index == 0) { return bannerView(widget.logic); } else { - if (widget.logic.myVip == 0 && index == widget.logic.vicinityList.length) { - // return; - return Stack( - children: [ - ListItem(widget.logic.vicinityList[index - 1], index - 1), - showVipView() - ], - ); - } else { + // if (widget.logic.myVip == 0 && index == widget.logic.vicinityList.length) { + // // return; + // return Stack( + // children: [ + // ListItem(widget.logic.vicinityList[index - 1], index - 1), + // showVipView() + // ], + // ); + // } else { return ListItem(widget.logic.vicinityList[index - 1], index - 1); - } + // } } }, ), @@ -172,79 +172,115 @@ class _VicinityState extends State with AutomaticKeepAliveClientMixin Widget showVipView() { return Container( - margin: EdgeInsets.only(top: 10.sp), - child: Stack( - children: [ - Positioned( - bottom: 0, - child: Container( - color: Colors.black, - width: Get.width, - height: 100.sp, - padding: EdgeInsets.symmetric(vertical: 25.sp), - )), - Container( - width: Get.width, - // margin: EdgeInsets.only(top: 10.sp), - color: Colors.black.withOpacity(0.87), - padding: EdgeInsets.symmetric(vertical: 25.sp, horizontal: 20.sp), - child: Column( - children: [ - Center( - child: Text( - "VIP特权", - style: TextStyle(color: Colors.white, fontSize: 16.sp), - ), - ), - Container( - padding: EdgeInsets.only(top: 18.sp), - child: Text( - "开通VIP后,才能查看更多附近的圈友,也可以根据您的喜好、属性、角色、取向等筛选出想要认识的人,还可以获得其他十几种会员特权,拥有更多不一样的体验", - style: TextStyle(color: Colors.white, fontSize: 14.sp), - ), - ), - GestureDetector( - onTap: () async { - widget.logic.showRechargeDialog(); - }, - child: Center( - child: Container( - margin: EdgeInsets.only(top: 14.sp), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(17), - gradient: const LinearGradient( - colors: [ - Color(0xFF06F9FA), - Color(0xFFDC5BFD), - ], - begin: Alignment.centerLeft, - end: Alignment.centerRight, - ), - ), - padding: EdgeInsets.symmetric( - vertical: 10.sp, - horizontal: 55.sp, - ), - child: const Text( - "前往开通VIP", - style: TextStyle( - color: Colors.white, - fontSize: 12, - ), + width: Get.width, + height: 200.sp, + // margin: EdgeInsets.only(top: 10.sp), + + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.sp), + color: Colors.black.withOpacity(0.87), + ), + margin: EdgeInsets.only(left: 15.sp,right: 15.sp), + padding: EdgeInsets.symmetric(vertical: 15.sp, horizontal: 20.sp), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Center( + child: Text( + "VIP特权", + style: TextStyle(color: Colors.white, fontSize: 16.sp), + ), + ), + Container( + padding: EdgeInsets.only(top: 18.sp), + child: Text( + "开通VIP后,才能查看更多附近的圈友,也可以根据您的喜好、属性、角色、取向等筛选出想要认识的人,还可以获得其他十几种会员特权,拥有更多不一样的体验", + style: TextStyle(color: Colors.white, fontSize: 14.sp), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + GestureDetector( + onTap: () { + Get.back(); + }, + child: Container( + // height: 40.sp, + // width: 120.sp, + margin: EdgeInsets.only(top: 14.sp), + alignment: Alignment.center, + padding: EdgeInsets.symmetric( + vertical: 10.sp, + horizontal: 30.sp, + ), + decoration: BoxDecoration( + color: Colors.grey.withOpacity(0.7), + borderRadius: BorderRadius.circular(20), + ), + child: Text( + '再考虑考虑', + style: TextStyle( + color: Colors.white.withOpacity(0.6), + fontSize: 12, + fontWeight: FontWeight.w500), + )), + ), + GestureDetector( + onTap: () async { + Get.back(); + widget.logic.showRechargeDialog(); + }, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 14.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: const LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, ), ), - )) - ], - )), - ], - ), - ); + padding: EdgeInsets.symmetric( + vertical: 10.sp, + horizontal: 30.sp, + ), + child: const Text( + "前往开通VIP", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + )), + ], + ) + ], + )); } Widget ListItem(VicinityItemBean item, int index) { return GestureDetector( onTap: () { - Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString()); + if (index < 5) { + Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString()); + } else { + if (widget.logic + .myVip > 0) { + Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString()); + } else { + Get.bottomSheet(Scaffold(backgroundColor: Colors.transparent,body: Center( + child: showVipView(), + ),),isScrollControlled: true,backgroundColor: Colors.transparent,barrierColor: Colors.black.withOpacity(0.6)); + } + } + + }, child: Container( margin: EdgeInsets.only(top: 10.sp), diff --git a/circle_app/lib/app/home/logic.dart b/circle_app/lib/app/home/logic.dart index 659ca62..e936c8b 100644 --- a/circle_app/lib/app/home/logic.dart +++ b/circle_app/lib/app/home/logic.dart @@ -332,32 +332,32 @@ class HomeLogic extends GetxController with WidgetsBindingObserver { data['data']['account_id'].toString(), data['data']['user_sig']); accountId = data['data']['account_id'].toString(); - SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance(); - var date = DateTime.now(); - var date2 = '${date.year}-${date.month}-${date.day}-${accountId}'; - String firspop = 'firspop-${accountId}'; - if (sp.preferences!.containsKey(firspop)) { - var lastDate = sp.preferences!.getString(firspop); - if (lastDate != date2) { - Future.delayed(Duration(seconds: 15), () { - if (Get.currentRoute != AppRoutes.Login) { - sp.preferences!.setString(firspop, date2); - Get.bottomSheet(TodayPeopleDialog(), isScrollControlled: true, - enableDrag: false,); - } - }); - } - } else { - Future.delayed(Duration(seconds: 15), () { - if (Get.currentRoute != AppRoutes.Login) { - sp.preferences!.setString(firspop, date2); - Get.bottomSheet(TodayPeopleDialog(),isScrollControlled: true, - enableDrag: false,); - } - }); - - - } + // SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance(); + // var date = DateTime.now(); + // var date2 = '${date.year}-${date.month}-${date.day}-${accountId}'; + // String firspop = 'firspop-${accountId}'; + // if (sp.preferences!.containsKey(firspop)) { + // var lastDate = sp.preferences!.getString(firspop); + // if (lastDate != date2) { + // Future.delayed(Duration(seconds: 15), () { + // if (Get.currentRoute != AppRoutes.Login) { + // sp.preferences!.setString(firspop, date2); + // Get.bottomSheet(TodayPeopleDialog(), isScrollControlled: true, + // enableDrag: false,); + // } + // }); + // } + // } else { + // Future.delayed(Duration(seconds: 15), () { + // if (Get.currentRoute != AppRoutes.Login) { + // sp.preferences!.setString(firspop, date2); + // Get.bottomSheet(TodayPeopleDialog(),isScrollControlled: true, + // enableDrag: false,); + // } + // }); + // + // + // } } } diff --git a/circle_app/lib/app/invite/share.dart b/circle_app/lib/app/invite/share.dart index a9f5183..daf79d0 100644 --- a/circle_app/lib/app/invite/share.dart +++ b/circle_app/lib/app/invite/share.dart @@ -262,13 +262,10 @@ class _ShareState extends State { shareAction('wxq', '朋友圈', () { shareWxData(2); }), - shareAction('qq', 'QQ', () { + shareAction('save', '复制邀请链接', () { copyInviteText(logic.name); }), - shareAction('wb', '微博', () { - copyInviteText(logic.name); - }), - shareAction('hb', '保存海报', () { + shareAction('hb', '保存邀请海报', () { _saveLocalImage(); }), ], diff --git a/circle_app/lib/app/login/complete_material/logic.dart b/circle_app/lib/app/login/complete_material/logic.dart index dee0de2..5dd6363 100644 --- a/circle_app/lib/app/login/complete_material/logic.dart +++ b/circle_app/lib/app/login/complete_material/logic.dart @@ -293,6 +293,41 @@ class Complete_materialLogic extends GetxController { } + if (state.wxEditingController.text.isNotEmpty) { + bool isPass = false; + if (state.wxEditingController.text.length == 11) { + RegExp exp = RegExp( + r'^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\d{8}$'); + isPass = exp.hasMatch(state.wxEditingController.text); + } + + if (state.wxEditingController.text.isNotEmpty && !isPass) { + RegExp wxReg = RegExp(r'^[-_a-zA-Z][-_a-zA-Z0-9]{5,19}$'); + if (!wxReg.hasMatch(state.wxEditingController.text)) { + showOKToast('请输入正确的微信号'); + return; + } + } + + if (wxStatusInfo.containsKey('4000')) { + showOKToast(wxStatusInfo['40000']); + return; + } + + var result = await DioManager().post(url: Api.updateWxNum,params: {'type':2,'wxNum':state.wxEditingController.text}); + if (result['code'] == 31201) { + // showToast. + showOKToast(result['msg']); + showRechargeScreenDialog(); + return; + } else if (result['code'] == 200) { + if (wxStatusInfo.containsKey('32100')) { + showOKToast(wxStatusInfo['32100']); + } + } + print(result); + } + var data = await DioManager.instance.put(url: Api.UpdataUserInfo, params: { 'avatar_url': headUrl, 'birthday': state.brithday, @@ -332,9 +367,9 @@ class Complete_materialLogic extends GetxController { showOKToast('请选择您的常驻城市'); return; } else if (state.role.isEmpty) { - showOKToast('请选择您的角色'); + showOKToast('请选择您的属性'); return; - } else if (state.role.isEmpty) { + } else if (state.sex.isEmpty) { showOKToast('请选择您的角色'); return; } else if (state.orientation.isEmpty) { diff --git a/circle_app/lib/app/login/complete_material/view.dart b/circle_app/lib/app/login/complete_material/view.dart index fb379e5..3b664d0 100644 --- a/circle_app/lib/app/login/complete_material/view.dart +++ b/circle_app/lib/app/login/complete_material/view.dart @@ -145,7 +145,7 @@ class _Complete_materialPageState extends State { ), () {}, img: 'edit'), - if (isShowWx) + // if (isShowWx) funcWidget( '微信', TextField( @@ -180,6 +180,7 @@ class _Complete_materialPageState extends State { fontSize: 14.sp, fontWeight: FontWeight.w500), ), () { + showOKToast('为了确保角色的真实性,选错了需联系客服更正'); showSexPiker(context, controller); }), funcWidget( diff --git a/circle_app/lib/app/my_assets/view.dart b/circle_app/lib/app/my_assets/view.dart index cb77bbd..41f4c34 100644 --- a/circle_app/lib/app/my_assets/view.dart +++ b/circle_app/lib/app/my_assets/view.dart @@ -115,7 +115,7 @@ class My_assetsPage extends StatelessWidget { Container( margin: EdgeInsets.only(right: 15.sp), child: Text( - "收入金额", + "收入余额", style: TextStyle( color: Colors.white, fontSize: 13.sp), @@ -170,7 +170,6 @@ class My_assetsPage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - "${logic.myAssest!.balance!}小票", style: TextStyle( color: Colors.white, @@ -185,7 +184,7 @@ class My_assetsPage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - "${logic.myAssest!.incomeBalance!}小票", + "${(logic.myAssest!.incomeBalance! * 0.01).toStringAsFixed(2)}元", style: TextStyle( color: Colors.white, fontSize: 18.sp), @@ -213,12 +212,13 @@ class My_assetsPage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - "总充值", + "总收入", style: TextStyle( color: Colors.white, fontSize: 14.sp), ), - Text("${logic.myAssest!.totalRechargeBalance!}小票", + Text( + "${(logic.myAssest!.totalIncomeBalance! * 0.01).toStringAsFixed(2)}元", style: TextStyle( color: Colors.white, fontSize: 14.sp), @@ -237,13 +237,12 @@ class My_assetsPage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - "总收入", + "总充值/奖励", style: TextStyle( color: Colors.white, fontSize: 14.sp), ), - Text( - "${logic.myAssest!.totalIncomeBalance!}小票", + Text("${logic.myAssest!.totalRechargeBalance!}小票", style: TextStyle( color: Colors.white, fontSize: 14.sp), @@ -256,6 +255,7 @@ class My_assetsPage extends StatelessWidget { width: 1.sp, color:Color(0x4DFFFFFF), ), + Expanded( flex: 1, child: Column( diff --git a/circle_app/lib/common/Widgets/circle_share.dart b/circle_app/lib/common/Widgets/circle_share.dart index 9c959de..fa4f40a 100644 --- a/circle_app/lib/common/Widgets/circle_share.dart +++ b/circle_app/lib/common/Widgets/circle_share.dart @@ -353,13 +353,10 @@ class _CircleShareState extends State { shareAction('wxq', '朋友圈', () { shareWxData(2); }), - shareAction('qq', 'QQ', () { + shareAction('save', '复制邀请链接', () { copyInviteText(logic.name); }), - shareAction('wb', '微博', () { - copyInviteText(logic.name); - }), - shareAction('hb', '保存海报', () { + shareAction('hb', '保存邀请海报', () { _saveLocalImage(); }), ], diff --git a/circle_app/lib/common/Widgets/unlock_wx_tip.dart b/circle_app/lib/common/Widgets/unlock_wx_tip.dart index 4f5556b..5ca89d2 100644 --- a/circle_app/lib/common/Widgets/unlock_wx_tip.dart +++ b/circle_app/lib/common/Widgets/unlock_wx_tip.dart @@ -12,6 +12,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; +import '../const.dart'; import 'base_tip_widget.dart'; class UnlockWxTip extends StatefulWidget { @@ -51,7 +52,7 @@ class _UnlockWxTipState extends State { Container( margin: EdgeInsets.only(left: 20.sp,right: 20.sp), padding: EdgeInsets.all(15.sp), - height: !Platform.isIOS ? 440.sp : 350.sp, + height: !Platform.isIOS ? 440.sp : 410.sp, decoration: BoxDecoration( color: const Color(0xFF393949), borderRadius: BorderRadius.circular(10.sp) @@ -174,7 +175,7 @@ class _UnlockWxTipState extends State { } else { unlockingPayment(prices[selectedIndex].id.toString(), (){ Get.back(); - showOKToast('微信号解锁成功'); + checkMyUserStatus(); unLockWxSuccessResult(widget.userId); }); } diff --git a/circle_app/lib/common/const.dart b/circle_app/lib/common/const.dart index ff990cc..da5d17e 100644 --- a/circle_app/lib/common/const.dart +++ b/circle_app/lib/common/const.dart @@ -8,6 +8,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:oktoast/oktoast.dart'; +import '../app/userinfo/logic.dart'; + const bgAssetImage = DecorationImage( image: AssetImage('assets/images/base/bg.png'), fit: BoxFit.cover, @@ -24,7 +26,7 @@ wxStatusWidget(bool isUnclock, String wx, String userId, String avatarUrl, var result = await DioManager() .post(url: Api.UnlockWx, params: {'targetUserId': userId}); if (result['code'] == 200) { - showToast('解锁成功'); + checkMyUserStatus(); callBack(); } else { Get.bottomSheet(UnlockWxTip(userId, avatarUrl), @@ -90,3 +92,19 @@ wxStatusWidget(bool isUnclock, String wx, String userId, String avatarUrl, ), )); } + + +checkMyUserStatus() async { + var data = await DioManager.instance.get(url: Api.getUserInfo); + var bean = BaseResponse.fromJson( + data, (data) => ResponseBean.fromJson(data)); + + if (bean.isSuccess()) { + UserBean userInfoBean = bean.data.user; + if (userInfoBean.wx_num.isNotEmpty) { + showToast('已成功解锁TA的微信,快去和TA私聊呗~'); + } else { + showToast('你已成功解锁TA的微信,建议您也填写微信,方便对方快速找到您哦~'); + } + } +} \ No newline at end of file