diff --git a/circle_app/assets/images/mine/add_code_icon.png b/circle_app/assets/images/mine/add_code_icon.png new file mode 100644 index 0000000..a2d51d6 Binary files /dev/null and b/circle_app/assets/images/mine/add_code_icon.png differ diff --git a/circle_app/assets/images/mine/hb.png b/circle_app/assets/images/mine/hb.png new file mode 100644 index 0000000..a147ca4 Binary files /dev/null and b/circle_app/assets/images/mine/hb.png differ diff --git a/circle_app/assets/images/mine/invite_count_bg.png b/circle_app/assets/images/mine/invite_count_bg.png new file mode 100644 index 0000000..f8832d5 Binary files /dev/null and b/circle_app/assets/images/mine/invite_count_bg.png differ diff --git a/circle_app/assets/images/mine/invite_icon.png b/circle_app/assets/images/mine/invite_icon.png new file mode 100644 index 0000000..be4c34e Binary files /dev/null and b/circle_app/assets/images/mine/invite_icon.png differ diff --git a/circle_app/assets/images/mine/invite_line.png b/circle_app/assets/images/mine/invite_line.png new file mode 100644 index 0000000..2fb034e Binary files /dev/null and b/circle_app/assets/images/mine/invite_line.png differ diff --git a/circle_app/assets/images/mine/invite_right_icon.png b/circle_app/assets/images/mine/invite_right_icon.png new file mode 100644 index 0000000..1290742 Binary files /dev/null and b/circle_app/assets/images/mine/invite_right_icon.png differ diff --git a/circle_app/assets/images/mine/invite_sys_bg.png b/circle_app/assets/images/mine/invite_sys_bg.png new file mode 100644 index 0000000..238b719 Binary files /dev/null and b/circle_app/assets/images/mine/invite_sys_bg.png differ diff --git a/circle_app/assets/images/mine/invite_title.png b/circle_app/assets/images/mine/invite_title.png new file mode 100644 index 0000000..6c1bee7 Binary files /dev/null and b/circle_app/assets/images/mine/invite_title.png differ diff --git a/circle_app/assets/images/mine/invite_vip_desc.png b/circle_app/assets/images/mine/invite_vip_desc.png new file mode 100644 index 0000000..eeb4bfb Binary files /dev/null and b/circle_app/assets/images/mine/invite_vip_desc.png differ diff --git a/circle_app/assets/images/mine/qq.png b/circle_app/assets/images/mine/qq.png new file mode 100644 index 0000000..98f50f0 Binary files /dev/null and b/circle_app/assets/images/mine/qq.png differ diff --git a/circle_app/assets/images/mine/share_content_bg.png b/circle_app/assets/images/mine/share_content_bg.png new file mode 100644 index 0000000..7aed732 Binary files /dev/null and b/circle_app/assets/images/mine/share_content_bg.png differ diff --git a/circle_app/assets/images/mine/share_title.png b/circle_app/assets/images/mine/share_title.png new file mode 100644 index 0000000..76badff Binary files /dev/null and b/circle_app/assets/images/mine/share_title.png differ diff --git a/circle_app/assets/images/mine/wb.png b/circle_app/assets/images/mine/wb.png new file mode 100644 index 0000000..f6a314f Binary files /dev/null and b/circle_app/assets/images/mine/wb.png differ diff --git a/circle_app/assets/images/mine/wx.png b/circle_app/assets/images/mine/wx.png new file mode 100644 index 0000000..001705a Binary files /dev/null and b/circle_app/assets/images/mine/wx.png differ diff --git a/circle_app/assets/images/mine/wxq.png b/circle_app/assets/images/mine/wxq.png new file mode 100644 index 0000000..fd71535 Binary files /dev/null and b/circle_app/assets/images/mine/wxq.png differ diff --git a/circle_app/ios/Runner.xcodeproj/project.pbxproj b/circle_app/ios/Runner.xcodeproj/project.pbxproj index 6f3ed21..9f6e132 100644 --- a/circle_app/ios/Runner.xcodeproj/project.pbxproj +++ b/circle_app/ios/Runner.xcodeproj/project.pbxproj @@ -141,7 +141,6 @@ 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 596550B3B6FD4574F751EEF4 /* [CP] Embed Pods Frameworks */, - 043A78F4D9CB2782E40309BF /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -200,23 +199,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 043A78F4D9CB2782E40309BF /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -386,6 +368,7 @@ INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "应用想要访问您的位置,用于设置个人资料"; INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "应用想要访问您的位置,用于设置个人资料"; INFOPLIST_KEY_NSMicrophoneUsageDescription = "应用想要访问您的麦克风,用于发送语音消息"; + INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "是否同意应用将图片保存到相册中?"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "应用想要访问您的相册,用于设置头像/动态发布"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; @@ -399,7 +382,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp123; + PRODUCT_BUNDLE_IDENTIFIER = com.exampe.circleApp; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; @@ -534,6 +517,7 @@ INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "应用想要访问您的位置,用于设置个人资料"; INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "应用想要访问您的位置,用于设置个人资料"; INFOPLIST_KEY_NSMicrophoneUsageDescription = "应用想要访问您的麦克风,用于发送语音消息"; + INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "是否同意应用将图片保存到相册中?"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "应用想要访问您的相册,用于设置头像/动态发布"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; @@ -547,7 +531,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp123; + PRODUCT_BUNDLE_IDENTIFIER = com.exampe.circleApp; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; @@ -576,6 +560,7 @@ INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "应用想要访问您的位置,用于设置个人资料"; INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "应用想要访问您的位置,用于设置个人资料"; INFOPLIST_KEY_NSMicrophoneUsageDescription = "应用想要访问您的麦克风,用于发送语音消息"; + INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "是否同意应用将图片保存到相册中?"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "应用想要访问您的相册,用于设置头像/动态发布"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; @@ -589,7 +574,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp123; + PRODUCT_BUNDLE_IDENTIFIER = com.exampe.circleApp; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; diff --git a/circle_app/ios/Runner/Info.plist b/circle_app/ios/Runner/Info.plist index 3f0d656..192af0b 100644 --- a/circle_app/ios/Runner/Info.plist +++ b/circle_app/ios/Runner/Info.plist @@ -2,41 +2,6 @@ - LSApplicationQueriesSchemes - - weixinULAPI - weixin - wechat - mqqapi - mqq - mqqOpensdkSSoLogin - mqqconnect - mqqopensdkdataline - mqqopensdkgrouptribeshare - mqqopensdkfriend - mqqopensdkapi - mqqopensdkapiV2 - mqqopensdkapiV3 - mqzoneopensdk - wtloginmqq - wtloginmqq2 - mqqwpa - mqzone - mqzonev2 - mqzoneshare - wtloginqzone - mqzonewx - mqzoneopensdkapiV2 - mqzoneopensdkapi19 - mqzoneopensdkapi - mqqbrowser - mttbrowser - baidumap - iosamap - weibosdk - sinaweibo - sinaweibohd - App Transport Security Settings CADisableMinimumFrameDurationOnPhone @@ -56,11 +21,15 @@ - MOBAppKey - 3872b1e955498 - MOBAppSecret - 30dc517b609c8aefe297b9ac3eb8dbde + LSApplicationQueriesSchemes + + weixinULAPI + weixin + wechat + UIViewControllerBasedStatusBarAppearance + UIApplicationSupportsIndirectInputEvents + diff --git a/circle_app/ios/Runner/Runner.entitlements b/circle_app/ios/Runner/Runner.entitlements index 0c67376..ab3837e 100644 --- a/circle_app/ios/Runner/Runner.entitlements +++ b/circle_app/ios/Runner/Runner.entitlements @@ -1,5 +1,10 @@ - + + com.apple.developer.associated-domains + + applinks:https://www.leyuan666.com/ + + diff --git a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart index c3e1afb..0f52602 100644 --- a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart +++ b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart @@ -6,6 +6,7 @@ import 'package:circle_app/app/minefragment/logic.dart'; import 'package:circle_app/common/Widgets/open_vip_tip/view.dart'; import 'package:circle_app/network/api.dart'; import 'package:circle_app/network/dio_manager.dart'; +import 'package:circle_app/util/SharedPreferencesHelper.dart'; import 'package:circle_app/util/util.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -776,14 +777,19 @@ class _TIMTextFieldLayoutNarrowState Future checkVipStatus() async { if (!isVip) { - var data = await DioManager.instance.get(url: Api.getUserMine); - var bean = BaseResponse.fromJson( - data, (data) => MineResponseBean.fromJson(data)); - if (bean.isSuccess()) { - User userInfoBean = bean.data.user!; - isVip = userInfoBean.vip > 0; + SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance(); + if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') { + isVip = true; + return true; + } else { + var data = await DioManager.instance.get(url: Api.getUserMine); + var bean = BaseResponse.fromJson( + data, (data) => MineResponseBean.fromJson(data)); + if (bean.isSuccess()) { + User userInfoBean = bean.data.user!; + isVip = userInfoBean.vip > 0; + } } - } if (!isVip) { showOKToast('开通会员之后才能发送图片'); diff --git a/circle_app/lib/app/circle/view.dart b/circle_app/lib/app/circle/view.dart index aaa6ee2..2a8d98f 100644 --- a/circle_app/lib/app/circle/view.dart +++ b/circle_app/lib/app/circle/view.dart @@ -18,6 +18,11 @@ import '../select_circle/logic.dart'; import '../userinfo/logic.dart'; import 'logic.dart'; + +const bgWidget = DecorationImage( +fit: BoxFit.fill, +image: AssetImage('assets/images/base/home_back.png')); + class CirclePage extends StatefulWidget { CirclePage({Key? key}) : super(key: key); @@ -71,11 +76,9 @@ class _CirclePageState extends State return Container( width: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.height, - decoration: BoxDecoration( - color: const Color(0xFF423055), - image: DecorationImage( - fit: BoxFit.fill, - image: AssetImage(getBaseImage('home_back')))), + decoration: const BoxDecoration( + color: Color(0xFF423055), + image: bgWidget), child: Scaffold( backgroundColor: Colors.transparent, body: SafeArea( @@ -541,7 +544,7 @@ class _CirclePageState extends State viewportFraction: 0.93, // scale: 0.9, loop: false, - key: UniqueKey(), + // key: UniqueKey(), // pagination: new SwiperPagination(),//如果不填则不显示指示点 // control: new SwiperControl(),//如果不填则不显示左右按钮 ); diff --git a/circle_app/lib/app/circle/widgets/info_list_view.dart b/circle_app/lib/app/circle/widgets/info_list_view.dart index 959c59c..d12c969 100644 --- a/circle_app/lib/app/circle/widgets/info_list_view.dart +++ b/circle_app/lib/app/circle/widgets/info_list_view.dart @@ -20,7 +20,10 @@ import 'package:shared_preferences/shared_preferences.dart'; import '../../../util/SharedPreferencesHelper.dart'; import '../../../util/eventBus.dart'; - +const listBgWidget = Image( + image: AssetImage('assets/images/circle/circle_bg.png'), + fit: BoxFit.fill, +); class InfoListView extends StatefulWidget { // Get.lazyPut(() => ListLogic()); @@ -267,10 +270,7 @@ class InfoListViewState extends State with AutomaticKeepAliveClien borderRadius: BorderRadius.circular(10.sp), child: SizedBox( width: Get.width, - child: Image.asset( - getCircleImage('circle_bg'), - fit: BoxFit.fill, - ), + child: listBgWidget )), Container( height: Get.height, diff --git a/circle_app/lib/app/home/logic.dart b/circle_app/lib/app/home/logic.dart index 06bace7..964fab1 100644 --- a/circle_app/lib/app/home/logic.dart +++ b/circle_app/lib/app/home/logic.dart @@ -55,14 +55,12 @@ class HomeLogic extends GetxController { userInfo, text, ) async { - print("收到新消息"+text); - unreadSIze.value = (int.parse(unreadSIze.value)+1).toString(); + print("收到新消息" + text); + unreadSIze.value = (int.parse(unreadSIze.value) + 1).toString(); //getUnreadSize(); }); _messageService.addSimpleMsgListener(listener: msgListener); - - var data = await DioManager.instance.get(url: Api.APP_VERSION); var bean = BaseResponse.fromJson( data, (data) => UpdateInfo.fromJson(data)); @@ -76,35 +74,37 @@ class HomeLogic extends GetxController { await TencentImSDKPlugin.v2TIMManager .getConversationManager() .getTotalUnreadMessageCount(); - print("未读数量desc=" + getTotalUnreadMessageCountRes.desc.toString()+"code="+getTotalUnreadMessageCountRes.code.toString()+"data="+getTotalUnreadMessageCountRes.data.toString()); + print("未读数量desc=" + + getTotalUnreadMessageCountRes.desc.toString() + + "code=" + + getTotalUnreadMessageCountRes.code.toString() + + "data=" + + getTotalUnreadMessageCountRes.data.toString()); if (getTotalUnreadMessageCountRes.code == 0) { unreadSIze.value = getTotalUnreadMessageCountRes.data.toString(); if (Platform.isAndroid) { setOfflinePushStatus(status: AppStatus.foreground); } - - }else{ + } else { getUnreadSize(); } - } @override Future setOfflinePushStatus( {required AppStatus status, int? totalCount}) { - - if (status == AppStatus.foreground) { - // 当应用status为前台时,上报doForeground() - return TencentImSDKPlugin.v2TIMManager - .getOfflinePushManager() - .doForeground(); - } else { - // 当应用status为后台时,上报doBackground(),并带上未读数 - return TencentImSDKPlugin.v2TIMManager - .getOfflinePushManager() - .doBackground(unreadCount: totalCount ?? 0); - } + if (status == AppStatus.foreground) { + // 当应用status为前台时,上报doForeground() + return TencentImSDKPlugin.v2TIMManager + .getOfflinePushManager() + .doForeground(); + } else { + // 当应用status为后台时,上报doBackground(),并带上未读数 + return TencentImSDKPlugin.v2TIMManager + .getOfflinePushManager() + .doBackground(unreadCount: totalCount ?? 0); + } } @override @@ -113,7 +113,6 @@ class HomeLogic extends GetxController { super.onReady(); FlutterNativeSplash.remove(); - } void showReportDialog( diff --git a/circle_app/lib/app/invite/logic.dart b/circle_app/lib/app/invite/logic.dart index d986c1f..363b3cd 100644 --- a/circle_app/lib/app/invite/logic.dart +++ b/circle_app/lib/app/invite/logic.dart @@ -1,3 +1,6 @@ +import 'package:circle_app/network/api.dart'; +import 'package:circle_app/network/dio_manager.dart'; +import 'package:circle_app/util/util.dart'; import 'package:flutter/cupertino.dart'; import 'package:get/get.dart'; @@ -5,5 +8,157 @@ import 'state.dart'; class InviteLogic extends GetxController { final InviteState state = InviteState(); + bool isLoad = true; TextEditingController codeEditingController = TextEditingController(); + + Data? homeData; + + List sysData = []; + + + @override + void onInit() { + // TODO: implement onInit + super.onInit(); + loadData(); + } + + void loadData() async { + var data = await DioManager.instance.get(url: Api.inviteMainPage); + if (data['code'] == 200) { + Autogenerated result = Autogenerated.fromJson(data); + + homeData = result.data; + + } + var recorddata = await DioManager.instance.get(url: Api.inviteSysRecord); + if (recorddata['code'] == 200) { + sysData = recorddata['data']; + isLoad = false; + update(); + + } + + } + + addCode(String code) async { + + + var recorddata = await DioManager.instance.post(url: Api.inviteFillIn,params: {'invite_code':code}); + if (recorddata['code'] == 200) { + showOKToast('填写成功'); + } else { + showOKToast(recorddata['msg']); + } + } +} + + +class Autogenerated { + int? code; + Data? data; + String? msg; + + Autogenerated({this.code, this.data, this.msg}); + + Autogenerated.fromJson(Map json) { + code = json['code']; + data = json['data'] != null ? new Data.fromJson(json['data']) : null; + msg = json['msg']; + } + + Map toJson() { + final Map data = new Map(); + data['code'] = this.code; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + data['msg'] = this.msg; + return data; + } +} + +class Data { + int? achieveCount; + int? achieveRewardDay; + int? diffAwardCount; + List? inviteAwardConf; + int? inviteAwardCount; + String? inviteCode; + String? link; + int? inviteCount; + + Data( + {this.achieveCount, + this.achieveRewardDay, + this.diffAwardCount, + this.inviteAwardConf, + this.inviteAwardCount, + this.inviteCode, + this.link, + this.inviteCount}); + + Data.fromJson(Map json) { + achieveCount = json['achieve_count']; + achieveRewardDay = json['achieve_reward_day']; + diffAwardCount = json['diff_award_count']; + if (json['invite_award_conf'] != null) { + inviteAwardConf = []; + json['invite_award_conf'].forEach((v) { + inviteAwardConf!.add(new InviteAwardConf.fromJson(v)); + }); + } + inviteAwardCount = json['invite_award_count']; + inviteCode = json['invite_code']; + link = json['site_link']; + inviteCount = json['invite_count']; + } + + Map toJson() { + final Map data = new Map(); + data['achieve_count'] = this.achieveCount; + data['achieve_reward_day'] = this.achieveRewardDay; + data['diff_award_count'] = this.diffAwardCount; + if (this.inviteAwardConf != null) { + data['invite_award_conf'] = + this.inviteAwardConf!.map((v) => v.toJson()).toList(); + } + data['invite_award_count'] = this.inviteAwardCount; + data['invite_code'] = this.inviteCode; + data['invite_count'] = this.inviteCount; + return data; + } +} + +class InviteAwardConf { + int? achieveId; + int? inviteCount; + int? isAchieved; + double? rebateRate; + int? rewardDay; + + InviteAwardConf( + {this.achieveId, + this.inviteCount, + this.isAchieved, + this.rebateRate, + this.rewardDay}); + + InviteAwardConf.fromJson(Map json) { + achieveId = json['achieve_id']; + inviteCount = json['invite_count']; + isAchieved = json['is_achieved']; + rebateRate = json['rebate_rate']; + rewardDay = json['reward_day']; + } + + Map toJson() { + final Map data = new Map(); + data['achieve_id'] = this.achieveId; + data['invite_count'] = this.inviteCount; + data['is_achieved'] = this.isAchieved; + data['rebate_rate'] = this.rebateRate; + data['reward_day'] = this.rewardDay; + return data; + } } diff --git a/circle_app/lib/app/invite/share.dart b/circle_app/lib/app/invite/share.dart new file mode 100644 index 0000000..dca4a98 --- /dev/null +++ b/circle_app/lib/app/invite/share.dart @@ -0,0 +1,487 @@ +import 'dart:io'; + +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:circle_app/app/minefragment/logic.dart'; +import 'package:circle_app/util/util.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:get/get.dart'; +import 'package:get/get_core/src/get_main.dart'; +import 'package:image_gallery_saver/image_gallery_saver.dart'; +import 'dart:ui' as ui; +import 'package:fluwx/fluwx.dart' as fluwx; +import 'package:path_provider/path_provider.dart'; +import 'package:qr_flutter/qr_flutter.dart'; + +class Share extends StatefulWidget { + String code; + String link; + Share(this.code, this.link); + + @override + State createState() => _ShareState(); +} + +class _ShareState extends State { + GlobalKey _globalKey = GlobalKey(); + + MinefragmentLogic logic = Get.find(); + + @override + Widget build(BuildContext context) { + // TODO: add widget build method + return Scaffold( + backgroundColor: Colors.transparent, + body: Container( + child: Stack( + alignment: Alignment.center, + children: [ + Positioned( + top: 84.sp, + child: Container( + width: Get.width - 40.sp, + height: Get.height - 84.sp - Get.bottomBarHeight - 164.sp - 10.sp, + child:SingleChildScrollView( + child: RepaintBoundary( + key: _globalKey, + child: Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getCircleImage("open_vip_bg")), + fit: BoxFit.fill, + ), + ), + child: Column( + children: [ + Container( + width: Get.width, + height: 65.sp, + margin: EdgeInsets.only(left: 15.sp, top: 20.sp), + child: Row( + children: [ + Center( + child: Stack( + alignment: Alignment.center, + children: [ + Container( + width: 47.sp, + height: 47.sp, + decoration: const BoxDecoration( + shape: BoxShape.circle, + gradient: LinearGradient( + colors: [ + Color(0xFFDD3DF4), + Color(0xFF30FFD9) + ], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), + ), + ), + SizedBox( + width: 46.sp, + height: 46.sp, + child: _buildAvatar1(logic), + ) + ], + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.only(left: 10.sp), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + _buildNameRow(logic), + SizedBox(height: 10.sp), + _buildInfoRow(logic), + ], + ), + ), + ), + Image.asset( + getBaseImage("ic_launcher"), + width: 80.sp, + height: 80.sp, + ) + ], + ), + ), + // Expanded( + // child: + Container( + padding: EdgeInsets.only(left: 10.sp,right: 10.sp), + // color: Colors.red, + // height: 310.sp, + child: Column( + children: [ + SizedBox( + height: 20.sp, + ), + Container( + padding: EdgeInsets.only(left: 15.sp,right: 15.sp), + child: Image.asset( + getMineImage('share_title'), + ), + ), + SizedBox( + height: 10.sp, + ), + Image.asset( + getMineImage('share_content_bg'), + // height: 260.sp, + fit:BoxFit.fitWidth + ), + ], + ), + ), + Container( + height: 90.sp, + // color: Color(0xFF334141), + alignment: Alignment.center, + // color: Colors.yellow, + // width: Get.width-40.sp, + margin: EdgeInsets.only(bottom: 15.sp,top: 10.sp), + padding: EdgeInsets.only(left: 15.sp, right: 15.sp), + child: Row( + + children: [ + Expanded( + child: Container( + // color: Colors.red, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + // color: Colors.blue, + child: Row( + children: [ + Text( + '专属邀请码', + style: TextStyle( + color: Colors.white, + fontSize: 16.sp), + ), + SizedBox( + width: 8.sp, + ), + Container( + alignment: Alignment.center, + padding: EdgeInsets.only( + left: 10.sp, right: 10.sp), + height: 25.sp, + decoration: BoxDecoration( + // color: Color(0xFFDC5BFD), + gradient: + const LinearGradient( + colors: [ + Color(0xFF0DF5F7), + Color(0xFFD263FB) + ], + begin: + Alignment.centerLeft, + end: + Alignment.centerRight, + ), + borderRadius: + BorderRadius.circular( + 12.5.sp)), + child: Text( + widget.code, + style: TextStyle( + color: Colors.black, + fontSize: 12.sp), + ), + ) + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.sp), + width: Get.width - 200.sp, + child: Text( + '扫码或长按识别下载APP,认识更多小众圈子里的人,给生活带来更多乐趣~', + style: TextStyle( + color: Colors.white, + fontSize: 12.sp)), + ) + ], + ), + ), + ), + // Image.asset(getBaseImage("ic_launcher"),width: 80.sp,height: 80.sp,) + Stack( + alignment: Alignment.center, + children: [ + Container( + color: Colors.white, + width: 90.sp, + height: 90.sp, + ), + QrImageView( + data: widget.link, + padding: EdgeInsets.zero, + version: QrVersions.auto, + size: 80.sp, + gapless: false, + // backgroundColor: Colors.black, + ) + ], + ) + ], + ), + ) + ], + ), + )) + ), + ), + ), + Positioned( + bottom: 0, + child: SafeArea( + top: false, + child: Container( + height: 164.sp, + width: Get.width, + color: Color(0xFF292247), + child: Column( + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only( + top: 15.sp, left: 15.sp, right: 15.sp), + alignment: Alignment.center, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + shareAction('wx', '微信', () { + shareWxData(1); + }), + shareAction('wxq', '朋友圈', () { + shareWxData(2); + }), + shareAction('qq', 'QQ', () { + copyInviteText(logic.name); + }), + shareAction('wb', '微博', () { + copyInviteText(logic.name); + }), + shareAction('hb', '保存海报', () { + _saveLocalImage(); + }), + ], + ), + )), + Container( + height: 1.sp, + color: Color(0x33FFFFFF), + ), + GestureDetector( + onTap: () { + Get.back(); + }, + child: Container( + height: 67.sp, + alignment: Alignment.center, + child: Text( + '取消', + style: TextStyle( + color: Colors.white, fontSize: 14.sp), + ), + ), + ) + ], + ), + ))) + ], + ), + ), + ); + } + + Widget _buildAvatar1(MinefragmentLogic logic) { + return ClipOval( + child: GestureDetector( + onTap: () { + if (logic.userInfoBean != null) { + var imgList = []; + imgList.add(logic.userInfoBean!.avatar); + // Get.toNamed(AppRoutes.Swiper,arguments:imgList); + // Get.toNamed(AppRoutes.Swiper, arguments: { + // 'imaglist': imgList, + // 'index': 0 + // }); + } + }, + child: logic.userInfoBean == null + ? SizedBox( + width: 63.sp, + height: 63.sp, + ) + : CachedNetworkImage( + fit: BoxFit.cover, + placeholder: null, + imageUrl: logic.avatar, + width: 63.sp, + height: 63.sp, + ), + ), + ); + } + + Widget _buildNameRow(MinefragmentLogic logic) { + return Container( + margin: EdgeInsets.only(top: 6.sp), + child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + logic.name, + style: TextStyle( + color: const Color.fromRGBO(247, 250, 250, 1.0), + fontSize: 16.sp, + ), + ), + SizedBox( + width: 4.sp, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: const 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( + logic.ageMsg, + style: TextStyle( + color: Colors.black, + fontSize: 10.sp, + ), + ), + ), + ], + ), + ); + } + + Widget _buildInfoRow(MinefragmentLogic logic) { + return Row( + children: [ + Text('邀请您加入', + style: TextStyle( + color: Colors.white, + fontSize: 12.sp, + )), + Text('【微乐园APP】', + style: TextStyle( + color: Color(0xFF0DF5F7), + fontSize: 12.sp, + )), + ], + ); + } + + shareAction(String img, String name, GestureTapCallback onTap) { + return GestureDetector( + onTap: onTap, + child: Container( + child: Column( + children: [ + Image.asset( + getMineImage(img), + width: 40.sp, + ), + SizedBox( + height: 10.sp, + ), + Text( + name, + style: TextStyle(color: Colors.white, fontSize: 12.sp), + ) + ], + ), + ), + ); + } + + _saveLocalImage() async { + RenderRepaintBoundary boundary = + _globalKey.currentContext!.findRenderObject() as RenderRepaintBoundary; + ui.Image image = await boundary.toImage(pixelRatio: ui.window.devicePixelRatio); + ByteData? byteData = + await (image.toByteData(format: ui.ImageByteFormat.png)); + if (byteData != null) { + final result = + await ImageGallerySaver.saveImage(byteData.buffer.asUint8List()); + print(result); + // isSuccess + if (result['isSuccess']) { + showOKToast('保存成功'); + } else { + showOKToast('保存失败,请检查相册权限是否开启'); + } + } + } + + copyInviteText( + String username, + ) { + Clipboard.setData(ClipboardData( + text: '【${username}】邀请你加入“微乐园”,邀请码为${widget.code},点击进入${widget.link}')); + showOKToast('您已成功复制分享链接,前往对应平台粘贴发送即可~'); + } + /** + * 分享图片到微信, + * file=本地路径 + * url=网络地址 + * asset=内置在app的资源图片 + * scene=分享场景,1好友会话,2朋友圈,3收藏 + */ + void shareWxData(int scene) async { + + SmartDialog.showLoading(msg:'正在生成分享图片...'); + RenderRepaintBoundary boundary = + _globalKey.currentContext!.findRenderObject() as RenderRepaintBoundary; + ui.Image image = await boundary.toImage(pixelRatio: ui.window.devicePixelRatio); + ByteData? byteData = + await (image.toByteData(format: ui.ImageByteFormat.png)); + String filePath = ''; + if (byteData != null) { + Uint8List pngBytes = byteData!.buffer.asUint8List(); + Directory directory = await getApplicationDocumentsDirectory(); + filePath = '${directory.path}/widget_image.png'; + File imageFile = File(filePath); + imageFile.writeAsBytesSync(pngBytes); + } + SmartDialog.dismiss(); + fluwx.WeChatScene wxScene = fluwx.WeChatScene.SESSION; + if (scene == 2) { + wxScene = fluwx.WeChatScene.TIMELINE; + } + fluwx.WeChatShareImageModel? model; + + if (filePath.isNotEmpty) { + model = fluwx.WeChatShareImageModel(fluwx.WeChatImage.file(File(filePath)), + title: '', description: '', scene: wxScene); + } + if (model != null) { + fluwx.shareToWeChat(model!); + } + + } +} diff --git a/circle_app/lib/app/invite/view.dart b/circle_app/lib/app/invite/view.dart index 81caff8..4f7092d 100644 --- a/circle_app/lib/app/invite/view.dart +++ b/circle_app/lib/app/invite/view.dart @@ -1,3 +1,5 @@ + +import 'package:circle_app/app/invite/share.dart'; import 'package:circle_app/app/swiper/view.dart'; import 'package:circle_app/common/Widgets/rich_text.dart'; import 'package:circle_app/components/my_app_bar.dart'; @@ -14,7 +16,9 @@ class InvitePage extends StatelessWidget { InvitePage({Key? key}) : super(key: key); final logic = Get.find(); - final state = Get.find().state; + final state = Get + .find() + .state; @override Widget build(BuildContext context) { @@ -28,348 +32,386 @@ class InvitePage extends StatelessWidget { child: Scaffold( backgroundColor: Colors.transparent, appBar: MyAppBar( - centerTitle: "邀请有奖", + centerTitle: "邀请得会员", actionWdiget: Container( alignment: Alignment.center, height: 22.sp, width: 62.sp, - decoration: BoxDecoration( - color: Color(0xffD739EA), - borderRadius: BorderRadius.circular(31.sp)), - child: Text( - '邀请攻略', - style: TextStyle(color: Colors.white, fontSize: 11.sp), + child: Image.asset(getMineImage('invite_right_icon'), ), ), ), - body: SingleChildScrollView( - child: Column(children: [ - Container( - height: 203.sp, - margin: EdgeInsets.only( - left: 20.sp, - right: 20.sp, - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.sp), - color: Color(0x1AFFFFFF), - ), - child: Column( - children: [ + body: GetBuilder(builder: (logic) { + List peopleCountList = []; + List dayCountList = []; + List allSpan = []; + if (logic.isLoad == false) { + logic.homeData!.inviteAwardConf!.forEach((element) { + peopleCountList.add(peopleCountWidget('${element!.inviteCount! ?? '0'}',(element!.inviteCount! ?? 0) <= logic.homeData!.inviteCount!)); + + if ((element.rewardDay! ?? 0) > 365) { + dayCountList.add(timeWidget('${(element.rewardDay! / 365).toInt()}年')); + } else { + dayCountList.add(timeWidget('${element.rewardDay!}天')); + } + // timeWidget( + // '+30天', + // ), + + }); + getTextSpanList( + 'Tip:您已成功邀请 ${logic.homeData!.inviteCount! ?? 0}位同好,免费获得会员${logic.homeData!.achieveRewardDay! ?? '0'}天, 再邀请${logic.homeData!.diffAwardCount}位同友可领取更多奖励~', + Color(0xFFDC5BFD), + 12.sp, + searchContent: 'Tip:'); + + allSpan.addAll(getTextSpanList( + 'Tip:您已成功邀请', + Color(0xFF0DF5F7), + 12.sp, + searchContent: 'Tip:')); + allSpan.addAll(getTextSpanList( + ' ${logic.homeData!.inviteCount! ?? 0} 位同好,', + Color(0xFFDC5BFD), + 12.sp, + searchContent: '${logic.homeData!.inviteCount! ?? 0}')); + allSpan.addAll(getTextSpanList( + '免费获得会员 ${logic.homeData!.achieveRewardDay! ?? '0'} 天,', + Color(0xFFDC5BFD), + 12.sp, + searchContent: '${logic.homeData!.achieveRewardDay! ?? '0'} ')); + allSpan.addAll(getTextSpanList( + ' 再邀请 ${logic.homeData!.diffAwardCount} 位同友可领取更多奖励~', + Color(0xFFDC5BFD), + 12.sp, + searchContent: '${logic.homeData!.diffAwardCount}')); + + } + + + return logic.isLoad ? loaddingWidget(true) : SingleChildScrollView( + child: Column(children: [ Container( - padding: EdgeInsets.only( - left: 14.sp, right: 14.sp, top: 24.sp), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - '我的专属邀请码', - style: TextStyle( - color: Colors.white, - fontSize: 16.sp, - fontWeight: FontWeight.w500), - ), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - showCodePicker(logic); - }, - child: Container( - alignment: Alignment.center, - height: 29.sp, - width: 76.sp, - decoration: BoxDecoration( - border: Border.all( - color: Color(0xffD739EA), width: 1.sp), - borderRadius: BorderRadius.circular(14.5.sp)), - child: Text( - '填码对接', - style: TextStyle( - color: Color(0xffD739EA), fontSize: 12.sp), - ), - ), - ) - ], + height: 203.sp, + margin: EdgeInsets.only( + left: 20.sp, + right: 20.sp, + top: 10.sp ), - ), - Container( - margin: EdgeInsets.only(top: 40.sp), - child: Row( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getCircleImage("pic_bg")), + fit: BoxFit.fill, + ), + ), + child: Column( children: [ - Expanded(child: Container()), - Semantics( - namesRoute: true, - header: true, - child: ShaderMask( - shaderCallback: (Rect bounds) { - return const LinearGradient( - begin: Alignment(0.0, -1.0), - end: Alignment.bottomCenter, - colors: [ - Color(0xff71F3F2), - Color(0xffF657FF) - ], - ).createShader(Offset.zero & bounds.size); - }, - child: Text( - 'F2324424', + Container( + padding: EdgeInsets.only( + left: 14.sp, right: 14.sp, top: 24.sp), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '我的专属邀请码', + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w500), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + showCodePicker(logic); + }, + child: Container( + alignment: Alignment.center, + + width: 84.sp, + + child: Image.asset(getMineImage('add_code_icon')), + ), + ) + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.sp), + child: Row( + children: [ + SizedBox(width: 20.sp,), + Text( + logic.homeData!.inviteCode! ?? '', style: TextStyle( fontSize: 30.sp, fontWeight: FontWeight.w600, - color: Colors.white, - shadows: [ - Shadow( - color: Color(0xffF657FF), - offset: Offset(0.0, -1)) - ]), + color: Color(0xffF657FF) + ), ), - )), - SizedBox( - width: 4.sp, + SizedBox( + width: 4.sp, + ), + GestureDetector( + onTap: () { + Clipboard.setData( + ClipboardData(text: logic.homeData!.inviteCode! ?? '')); + showOKToast('复制成功'); + }, + child: Text( + '复制', + style: TextStyle( + color: Color(0xff0DF5F7), + fontSize: 14.sp), + )), + Expanded(child: Container()) + ], + ), ), GestureDetector( - onTap: () { - Clipboard.setData( - ClipboardData(text: '复制到剪切板')); - showOKToast('复制成功'); - }, + onTap: () { + shopSharePiker(logic.homeData!.inviteCode! ?? '',(logic.homeData!.link! ?? '') + + '?code=${logic.homeData!.inviteCode! ?? ''}'); + }, + child: Container( + width: 174.sp, + height: 42.sp, + margin: EdgeInsets.only(top: 35.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(21.sp), + gradient: const LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + )), + alignment: Alignment.center, child: Text( - '复制', + '立即邀请', style: TextStyle( - color: Color(0xB3FFFFFF), fontSize: 14.sp), - )), - Expanded(child: Container()) + color: Color(0xFF000000), + fontSize: 16, + fontWeight: FontWeight.w600), + ), + ), + ), ], ), ), Container( - width: 224.sp, - height: 42.sp, - margin: EdgeInsets.only(top: 15.sp), + height: 62.sp, + margin: EdgeInsets.only( + left: 20.sp, right: 20.sp, top: 15.sp), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(21.sp), - gradient: const LinearGradient( - colors: [ - Color(0xFF06F9FA), - Color(0xFFDC5BFD), - ], - )), - alignment: Alignment.center, - child: Text( - '立即邀请', - style: TextStyle( - color: Colors.white, - fontSize: 16, - fontWeight: FontWeight.w600), + image: DecorationImage( + image: AssetImage(getMineImage("invite_sys_bg")), + fit: BoxFit.fill, + ), + ), + child: Swiper( + physics: NeverScrollableScrollPhysics(), + autoplay: true, + // controller: 5, + index: 0, + itemBuilder: (BuildContext context, int index) { + Map data = logic.sysData[index]; + return Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + data['inviter_name'], + style: TextStyle( + color: Color(0xff0DF5F7), + fontSize: 14.sp, + fontWeight: FontWeight.w500), + ), + Container( + margin: EdgeInsets.only( + left: 5.sp, right: 5.sp), + child: Text( + '邀请', + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: FontWeight.w500), + )), + Text( + data['invitee_name'], + style: TextStyle( + color: Color(0xff0DF5F7), + fontSize: 14.sp, + fontWeight: FontWeight.w500), + ), + Container( + margin: EdgeInsets.only(left: 5.sp), + child: Text( + '加入微乐园', + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: FontWeight.w500), + )), + ], + ), + ); + }, + itemCount: logic.sysData.length, ), ), - ], - ), - ), - Container( - height: 40.sp, - margin: EdgeInsets.only(left: 20.sp, right: 20.sp, top: 30.sp), - decoration: BoxDecoration( - color: Color(0x1AFFFFFF), - borderRadius: BorderRadius.circular(10.sp)), - child: Swiper( - physics: NeverScrollableScrollPhysics(), - autoplay: true, - // controller: 5, - index: 0, - itemBuilder: (BuildContext context, int index) { - return Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - '哟刚说A', - style: TextStyle( - color: Color(0xFFDC5BFD), - fontSize: 14.sp, - fontWeight: FontWeight.w500), + Container( + height: 220.sp, + width: Get.width-30.sp, + margin: + EdgeInsets.only(top: 15.sp), + padding: EdgeInsets.only(top: 10.sp,bottom: 10.sp,left: 10.sp,right: 10.sp), + decoration: BoxDecoration( + image:DecorationImage( + image: AssetImage(getMineImage("invite_count_bg")), + fit: BoxFit.fill, ), - Container( - margin: EdgeInsets.only(left: 5.sp, right: 5.sp), - child: Text( - '邀请', - style: TextStyle( - color: Colors.white, - fontSize: 14.sp, - fontWeight: FontWeight.w500), - )), - Text( - '扥扥', - style: TextStyle( - color: Color(0xFFDC5BFD), - fontSize: 14.sp, - fontWeight: FontWeight.w500), - ), - Container( - margin: EdgeInsets.only(left: 5.sp), - child: Text( - '加入微乐园', - style: TextStyle( - color: Colors.white, - fontSize: 14.sp, - fontWeight: FontWeight.w500), - )), - ], + ), + child: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 15.sp), + alignment: Alignment.center, + child: Image.asset(getMineImage('invite_title'),height: 22.sp,), + ), + Container( + margin: EdgeInsets.only(top: 15.sp), + alignment: Alignment.center, + child: Image.asset(getMineImage('invite_line'),height: 1.2.sp,), + ), + Container( + height: 70.sp, + margin: EdgeInsets.only( + left: 15.sp, right: 15.sp), + child: Row( + children: [ + Text( + '邀请人数', + style: TextStyle( + color: Color(0xFF0DF5F7), + fontSize: 14.sp, + fontWeight: FontWeight.w500), + ), + Expanded( + child: Stack( + // fit: StackFit.expand, + alignment: Alignment.center, + children: [ + Container( + margin: EdgeInsets.only( + left: 61.sp, right: 46.sp), + height: 2.sp, + color: Color(0xFF0DF5F7), + ), + Container( + margin: EdgeInsets.only( + left: 15.sp), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children:peopleCountList, + ), + ) + ], + )) + ], + )), + Container( + height: 20.sp, + margin: EdgeInsets.only( + left: 15.sp, right: 15.sp), + child: Row( + children: [ + Text( + '会员时长', + style: TextStyle( + color: Color(0xFF0DF5F7), + fontSize: 14.sp, + fontWeight: FontWeight.w500), + ), + Expanded( + child: Stack( + // fit: StackFit.expand, + alignment: Alignment.center, + children: [ + Container( + margin: EdgeInsets.only( + left: 25.sp, right: 15.sp), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: dayCountList + ), + ) + ], + )), + ], + )), + Expanded(child: Container()), + Container( + margin: EdgeInsets.only( + left: 15.sp, right: 15.sp,bottom: 15.sp), + child: RichText( + text: TextSpan( + children: allSpan + ))) + ], + )), + SafeArea( + child: Container( + margin: EdgeInsets.only(top: 15.sp), + alignment: Alignment.center, + child: Image.asset(getMineImage('invite_vip_desc'),width: Get.width-30.sp,), ), - ); - }, - itemCount: 5, - ), - ), - Container( - height: 203.sp, - margin: - EdgeInsets.only(left: 20.sp, right: 20.sp, top: 20.sp), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.sp), - color: Color(0x1AFFFFFF), - ), - child: Column( - children: [ - Container( - height: 80.sp, - margin: EdgeInsets.only(left: 15.sp, right: 15.sp), - child: Row( - children: [ - Text( - '邀请人数', - style: TextStyle( - color: Color(0xFFDC5BFD), - fontSize: 14.sp, - fontWeight: FontWeight.w500), - ), - Expanded( - child: Stack( - // fit: StackFit.expand, - alignment: Alignment.center, - children: [ - Container( - margin: EdgeInsets.only( - left: 61.sp, right: 46.sp), - height: 2.sp, - color: Color(0xFFDC5BFD).withOpacity(0.4), - ), - Container( - margin: EdgeInsets.only(left: 15.sp), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - peopleCountWidget('20', true), - peopleCountWidget('50', true), - peopleCountWidget('100', true), - peopleCountWidget('500', true), - ], - ), - ) - ], - )) - ], - )), - Container( - height: 80.sp, - margin: EdgeInsets.only(left: 15.sp, right: 15.sp), - child: Row( - children: [ - Text( - '会员时长', - style: TextStyle( - color: Color(0xFFDC5BFD), - fontSize: 14.sp, - fontWeight: FontWeight.w500), - ), - Expanded( - child: Stack( - // fit: StackFit.expand, - alignment: Alignment.center, - children: [ - Container( - margin: EdgeInsets.only( - left: 20.sp, right: 10.sp), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - timeWidget( - '+30天', - ), - timeWidget( - '+100天', - ), - timeWidget( - '+365天', - ), - timeWidget( - '+3年', - ), - ], - ), - ) - ], - )), - ], - )), - Container( - margin: EdgeInsets.only(left: 15.sp, right: 15.sp), - child: RichText( - text: TextSpan( - children: getTextSpanList( - 'Tip:您已成功邀请 19位同好,免费获得会员120天, 再邀请1位同友可领取更多奖励~', - Color(0xFFDC5BFD), - 14.sp, - searchContent: 'Tip:'), - ))) - ], - )), - // Container( - // height: 203.sp, - // margin: - // EdgeInsets.only(left: 20.sp, right: 20.sp, top: 20.sp), - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(10.sp), - // color: Color(0x1AFFFFFF), - // ), - // child: Column(children: [ - // Expanded( - // child: ListView.builder( - // itemBuilder: (BuildContext context, int index) { - // return Container( - // margin: EdgeInsets.only(top: 10.sp), - // padding: EdgeInsets.only(left: 15.sp, right: 15.sp), - // child: Row( - // children: [ - // ClipOval( - // child: Image.network( - // 'https://p26-passport.byteacctimg.com/img/user-avatar/b0541a2a377dd239a22eea2934709967~100x100.awebp', - // width: 40.sp, - // height: 40.sp, - // ), - // ), - // SizedBox( - // width: 4.sp, - // ), - // Column( - // children: [ - // Text( - // '2222', - // style: TextStyle( - // color: Colors.white, fontSize: 14.sp), - // ), - // ], - // ) - // ], - // ), - // ); - // }, - // itemCount: 5, - // )) - // ])), - ])))); + ), + // Container( + // height: 203.sp, + // margin: + // EdgeInsets.only(left: 20.sp, right: 20.sp, top: 20.sp), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(10.sp), + // color: Color(0x1AFFFFFF), + // ), + // child: Column(children: [ + // Expanded( + // child: ListView.builder( + // itemBuilder: (BuildContext context, int index) { + // return Container( + // margin: EdgeInsets.only(top: 10.sp), + // padding: EdgeInsets.only(left: 15.sp, right: 15.sp), + // child: Row( + // children: [ + // ClipOval( + // child: Image.network( + // 'https://p26-passport.byteacctimg.com/img/user-avatar/b0541a2a377dd239a22eea2934709967~100x100.awebp', + // width: 40.sp, + // height: 40.sp, + // ), + // ), + // SizedBox( + // width: 4.sp, + // ), + // Column( + // children: [ + // Text( + // '2222', + // style: TextStyle( + // color: Colors.white, fontSize: 14.sp), + // ), + // ], + // ) + // ], + // ), + // ); + // }, + // itemCount: 5, + // )) + // ])), + ])); + }))); } peopleCountWidget(String count, bool isCheck) { @@ -378,10 +420,10 @@ class InvitePage extends StatelessWidget { height: 46.sp, alignment: Alignment.center, decoration: - BoxDecoration(color: Color(0xFFDC5BFD), shape: BoxShape.circle), + BoxDecoration(color: isCheck ? Color(0xFF0DF5F7) : Color(0xFF504261), shape: BoxShape.circle), child: Text( '$count人', - style: TextStyle(color: Colors.white, fontSize: 12.sp), + style: TextStyle(color:isCheck ? Color(0xFF000000) : Colors.white, fontSize: 12.sp), ), ); } @@ -392,6 +434,13 @@ class InvitePage extends StatelessWidget { style: TextStyle(color: Colors.white, fontSize: 12.sp), ); } + + void shopSharePiker(String code,String link) { + Get.bottomSheet( + Share(code,link), isScrollControlled: true, + enableDrag: false + ); + } } void showCodePicker(InviteLogic logic) { @@ -420,7 +469,7 @@ void showCodePicker(InviteLogic logic) { ), ), Container( - margin: EdgeInsets.only(left: 20, right: 20.sp,top: 30.sp), + margin: EdgeInsets.only(left: 20, right: 20.sp, top: 30.sp), decoration: BoxDecoration( color: Color(0x1AFFFFFF), borderRadius: BorderRadius.circular(6.sp)), @@ -434,7 +483,7 @@ void showCodePicker(InviteLogic logic) { decoration: InputDecoration( hintText: '请输入邀请码', hintStyle: - TextStyle(color: Colors.white70, fontSize: 16.sp), + TextStyle(color: Colors.white70, fontSize: 16.sp), border: InputBorder.none, counterText: '', contentPadding: EdgeInsets.only(left: 16.sp)), @@ -450,7 +499,8 @@ void showCodePicker(InviteLogic logic) { ), Expanded(child: Container()), Container( - margin: EdgeInsets.only(left: 40.sp,right: 40.sp,bottom: 20.sp), + margin: EdgeInsets.only( + left: 40.sp, right: 40.sp, bottom: 20.sp), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -467,12 +517,20 @@ void showCodePicker(InviteLogic logic) { color: Color(0x1AFFFFFF)), child: const Text( '放弃对接', - style: TextStyle(color: Colors.white, fontSize: 16), + style: TextStyle( + color: Colors.white, fontSize: 16), ), ), ), GestureDetector( - onTap: () {}, + onTap: () { + if (logic.codeEditingController.text.isEmpty) { + showOKToast('请输入邀请码'); + return; + } + Get.back(); + logic.addCode(logic.codeEditingController.text); + }, child: Container( alignment: Alignment.center, width: 114.sp, @@ -488,7 +546,7 @@ void showCodePicker(InviteLogic logic) { child: const Text( '确认对接', style: TextStyle( - color: Colors.white, fontSize: 16), + color: Colors.black, fontSize: 16), ), ), ) diff --git a/circle_app/lib/app/login/login/view.dart b/circle_app/lib/app/login/login/view.dart index 957d74f..23e29b6 100644 --- a/circle_app/lib/app/login/login/view.dart +++ b/circle_app/lib/app/login/login/view.dart @@ -6,7 +6,10 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'logic.dart'; - +const loginBgWidget = Image( + image: AssetImage('assets/images/base/bg.png'), + fit: BoxFit.fill, +); class LoginPage extends StatelessWidget { LoginPage({Key? key}) : super(key: key); @@ -19,13 +22,9 @@ class LoginPage extends StatelessWidget { @override Widget build(BuildContext context) { return Stack( + fit: StackFit.expand, children: [ - Image.asset( - getBaseImage('bg'), - fit: BoxFit.fill, - width: Get.width, - height: Get.height, - ), + loginBgWidget, GestureDetector( onTap: () { FocusManager.instance.primaryFocus?.unfocus(); @@ -61,10 +60,10 @@ class LoginPage extends StatelessWidget { child: Container( width: 280.sp, - height: 50.sp, + height: 60.sp, decoration: BoxDecoration( // color: Colors.white60, - borderRadius: BorderRadius.circular(25.sp), + borderRadius: BorderRadius.circular(30.sp), border: Border.all(color: Colors.white60,width: 0.5.sp) ),)), Row( @@ -118,7 +117,7 @@ class LoginPage extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only(top: 20.sp), + margin: EdgeInsets.only(top: 25.sp), child: Stack( alignment: Alignment.center, children: [ @@ -127,10 +126,10 @@ class LoginPage extends StatelessWidget { child: Container( width: 280.sp, - height: 50.sp, + height: 60.sp, decoration: BoxDecoration( // color: Colors.white60, - borderRadius: BorderRadius.circular(25.sp), + borderRadius: BorderRadius.circular(30.sp), border: Border.all(color: Colors.white60,width: 0.5.sp) ),)), Row( @@ -205,18 +204,18 @@ class LoginPage extends StatelessWidget { logic.login(); }, child: Container( - width: 168.sp, - height: 42.sp, + width: 200.sp, + height: 50.sp, alignment: Alignment.center, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(21.sp), + borderRadius: BorderRadius.circular(25.sp), gradient: const LinearGradient( begin: Alignment.centerLeft, end: Alignment.centerRight, colors: [Color(0xff0AFCFF), Color(0xffD739EA)])), child: Text( '登录', - style: TextStyle(color: Colors.white, fontSize: 16.sp), + style: TextStyle(color: Colors.white, fontSize: 16.sp,fontWeight: FontWeight.w500), ), ), ), @@ -232,13 +231,13 @@ class LoginPage extends StatelessWidget { child: Container( child: Row( children: [ - !logic.check ? Container(width: 14.sp,height: 14.sp,decoration: BoxDecoration(border: Border.all(color: Colors.white70,width: 1.sp),borderRadius: BorderRadius.circular(10)),): Icon(Icons.check_circle_rounded,size: 15.sp,color: Color(0xff00FFF4),), + !logic.check ? Container(width: 18.sp,height: 18.sp,decoration: BoxDecoration(border: Border.all(color: Colors.white70,width: 1.sp),borderRadius: BorderRadius.circular(10)),): Icon(Icons.check_circle_rounded,size: 19.sp,color: Color(0xff00FFF4),), SizedBox(width: 4.sp,), Text( '同意', style: TextStyle( color: Colors.white, - fontSize: 11.sp, + fontSize: 14.sp, fontWeight: FontWeight.w600), ), SizedBox( @@ -252,7 +251,7 @@ class LoginPage extends StatelessWidget { '《用户协议》', style: TextStyle( color: Color(0xff00FFF4), - fontSize: 11.sp, + fontSize: 14.sp, fontWeight: FontWeight.w400, ), ), @@ -261,7 +260,7 @@ class LoginPage extends StatelessWidget { '和', style: TextStyle( color: Colors.white, - fontSize: 11.sp, + fontSize: 14.sp, fontWeight: FontWeight.w600), ), SizedBox( @@ -275,7 +274,7 @@ class LoginPage extends StatelessWidget { '《隐私协议》', style: TextStyle( color: Color(0xff00FFF4), - fontSize: 11.sp, + fontSize: 14.sp, fontWeight: FontWeight.w400, ), ), diff --git a/circle_app/lib/app/minefragment/view.dart b/circle_app/lib/app/minefragment/view.dart index 53ce097..4b1ec7c 100644 --- a/circle_app/lib/app/minefragment/view.dart +++ b/circle_app/lib/app/minefragment/view.dart @@ -2,8 +2,10 @@ import 'dart:io'; import 'package:cached_network_image/cached_network_image.dart'; +import 'package:circle_app/app/circle/view.dart'; import 'package:circle_app/router/app_routers.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_cache_manager/flutter_cache_manager.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -12,11 +14,18 @@ import '../../util/SharedPreferencesHelper.dart'; import '../../util/util.dart'; import 'logic.dart'; +const vipIcon = 'assets/images/home/icon_vip.png'; + +const MyImageWidget = const Image( + image: AssetImage(vipIcon), + fit: BoxFit.fill, +); class MinefragmentPage extends StatelessWidget { MinefragmentPage({Key? key}) : super(key: key); final logic = Get.lazyPut(() => MinefragmentLogic()); + final state = Get .find() .state; @@ -34,13 +43,10 @@ class MinefragmentPage extends StatelessWidget { body: Container( width: Get.width, height: Get.height, - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage(getBaseImage("home_back")), - fit: BoxFit.cover, - ), + decoration: const BoxDecoration( + image: bgWidget ), - child: Padding( + child: Padding( padding: EdgeInsets.only( top: 20.0 + statusBarHeight.sp, left: 11.sp, @@ -55,17 +61,14 @@ class MinefragmentPage extends StatelessWidget { showRechargeDialog(logic); }, child: Stack(children: [ - Image( - image: AssetImage(getHomeImage("icon_vip")), - fit: BoxFit.fill, - ), + MyImageWidget, Positioned( - top: 54.sp, - left: 71.3.sp, + top: 58.sp, + left: 90.sp, child: Text(logic.vipMsg,style: TextStyle(color: const Color(0x99FFFFFF),fontSize: 12.sp),)), Positioned( - top: 24.sp, - left: 71.3.sp, + top: 32.sp, + left: 90.sp, child: Text("会员-微乐园贵宾",style: TextStyle(color: const Color(0xFFFFFFFF),fontSize: 16.sp),)) ],), ), @@ -80,7 +83,7 @@ class MinefragmentPage extends StatelessWidget { Widget _circleLiveView(MinefragmentLogic logic) { return Column( - children: [_circleItemView(logic), _helpItemView(), _invienItemView(), _setUpItemView()], + children: [_circleItemView(logic), _invienItemView(), _helpItemView(),_setUpItemView()], ); } @@ -188,7 +191,7 @@ class MinefragmentPage extends StatelessWidget { Row( children: [ Image( - image: AssetImage(getHomeImage("mine_help")), + image: AssetImage(getMineImage("invite_icon")), width: 24.sp, height: 24.sp, ), @@ -203,7 +206,7 @@ class MinefragmentPage extends StatelessWidget { Row( children: [ const Text( - "免费领领会员", + "免费领取会员", style: TextStyle(color: Colors.white60), ), Image( diff --git a/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart b/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart index 7598849..6898ef4 100644 --- a/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart +++ b/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart @@ -455,11 +455,13 @@ class _TIMConversationState extends TIMUIKitState { Map myInfo = jsonDecode(myuserFullInfo! .customInfo!['Label'] .toString()); - if (myInfo.containsKey('city')) { - if (myInfo['city'] - .toString() - .contains(otherInfo['city'].toString())) { - isSameCity = true; + if (myInfo != null) { + if (myInfo.containsKey('city')) { + if (myInfo['city'] + .toString() + .contains(otherInfo['city'].toString())) { + isSameCity = true; + } } } } diff --git a/circle_app/lib/app/msg/sys_notify_list/view.dart b/circle_app/lib/app/msg/sys_notify_list/view.dart index ce614f4..30774ad 100644 --- a/circle_app/lib/app/msg/sys_notify_list/view.dart +++ b/circle_app/lib/app/msg/sys_notify_list/view.dart @@ -68,7 +68,7 @@ class Sys_notify_listPage extends StatelessWidget { if (data.image != null) { widgets.add(Image.network( data.image!, - width: 267, + width: 0.712 * Get.width, height: 114.sp, fit: BoxFit.fill, )); @@ -171,7 +171,7 @@ class Sys_notify_listPage extends StatelessWidget { Column( children: [ Container( - width: 267.sp, + width: 0.712 * Get.width, margin: EdgeInsets.only(left: 10.sp), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10.sp), diff --git a/circle_app/lib/app/msg/view.dart b/circle_app/lib/app/msg/view.dart index 8c4567e..569199e 100644 --- a/circle_app/lib/app/msg/view.dart +++ b/circle_app/lib/app/msg/view.dart @@ -1,6 +1,7 @@ import 'dart:math'; import 'package:circle_app/app/circle/logic.dart'; +import 'package:circle_app/app/circle/view.dart'; import 'package:circle_app/common/Widgets/open_vip_tip/view.dart'; import 'package:circle_app/main.dart'; import 'package:circle_app/network/api.dart'; @@ -63,10 +64,8 @@ class MsgPage extends StatelessWidget { Container( width: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.height, - decoration: BoxDecoration( - image: DecorationImage( - fit: BoxFit.fill, - image: AssetImage(getBaseImage('home_back')))), + decoration: const BoxDecoration( + image: bgWidget), ), SafeArea( child: GetBuilder(builder: (MsgLogic controller) { diff --git a/circle_app/lib/main.dart b/circle_app/lib/main.dart index 0033a88..ef9567e 100644 --- a/circle_app/lib/main.dart +++ b/circle_app/lib/main.dart @@ -67,9 +67,9 @@ void uploadBuzIDAndToken() async { return; } - if (Platform.isAndroid) { + // if (Platform.isAndroid) { initWxApi(); - } + // } await ChannelPush.init((msg) {}); int? businessID = await TimUiKitPushPlugin.getBuzId(PushConfig.appInfo); diff --git a/circle_app/lib/network/api.dart b/circle_app/lib/network/api.dart index 7075463..8087eb6 100644 --- a/circle_app/lib/network/api.dart +++ b/circle_app/lib/network/api.dart @@ -246,4 +246,15 @@ class Api { //苹果支付 static const applePayCallBack = 'mall-service/payment/apple/notify'; + //邀请好友主页 + static const inviteMainPage = 'user-service/invite/mainPage'; + + //系统随机的邀请记录 + static const inviteSysRecord = 'user-service/invite/record/rand'; + + //填写邀请码 + static const inviteFillIn = 'user-service/invite/fillin'; + + + } \ No newline at end of file diff --git a/circle_app/lib/network/dio_manager.dart b/circle_app/lib/network/dio_manager.dart index e9e0227..2889694 100644 --- a/circle_app/lib/network/dio_manager.dart +++ b/circle_app/lib/network/dio_manager.dart @@ -247,6 +247,10 @@ class DioManager { // } return responseMap; } on DioException catch (e) { + SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance(); + if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') { + return {'code': 500, 'msg': ''}; + } // // DioError是指返回值不为200的情况 // logger.shout('DioError报错${e.type}:${e.error.toString()}'); // // 对错误进行判断 @@ -255,8 +259,12 @@ class DioManager { // String? errorMsg = isNetworkConnected // ? e.requestOptions.extra["errorMsg"] // : "网络连接断开,请检查网络设置"; - return {'code': 500, 'msg': '请求失败'}; + return {'code': 500, 'msg': '服务器开小差了,请重试'}; } catch (e) { + SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance(); + if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') { + return {'code': 500, 'msg': ''}; + } // 其他一些意外的报错 return {'code': 500, 'msg': '请求异常'}; } diff --git a/circle_app/pubspec.yaml b/circle_app/pubspec.yaml index ae0d5a9..6f9368c 100644 --- a/circle_app/pubspec.yaml +++ b/circle_app/pubspec.yaml @@ -100,8 +100,14 @@ dependencies: tencent_chat_push_for_china: ^2.6.2+1 #苹果内购 in_app_purchase: ^3.0.8 + #图片保存到相册 + image_gallery_saver: ^1.7.1 + #二维码生成 + qr_flutter: ^4.0.0 + #本地目录 + path_provider: ^2.1.0 #第三方分享平台 - sharesdk_plugin: ^1.3.6 +# sharesdk_plugin: 1.3.6 dev_dependencies: flutter_test: