Compare commits

...

8 Commits

36 changed files with 603 additions and 301 deletions

View File

@ -65,8 +65,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21 minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode 6 versionCode 14
versionName "1.0.5" versionName "1.1.4"
manifestPlaceholders = [ manifestPlaceholders = [
vivo_APPID: "105669716", vivo_APPID: "105669716",
vivo_APPKEY:"84f750207787376b310ca5b0d5969122", vivo_APPKEY:"84f750207787376b310ca5b0d5969122",

View File

@ -24,6 +24,9 @@
android:name="android.permission.READ_MEDIA_IMAGES"/> android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission <uses-permission
android:name="android.permission.READ_MEDIA_VIDEO"/> android:name="android.permission.READ_MEDIA_VIDEO"/>
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 这个权限用于访问GPS定位 --> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 这个权限用于访问GPS定位 -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name = "com.huawei.android.launcher.permission.CHANGE_BADGE "/> <uses-permission android:name = "com.huawei.android.launcher.permission.CHANGE_BADGE "/>
@ -71,7 +74,6 @@
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:showWhenLocked="true"
android:turnScreenOn="true" android:turnScreenOn="true"
android:networkSecurityConfig="@xml/network_security_config" android:networkSecurityConfig="@xml/network_security_config"
android:windowSoftInputMode="adjustResize"> android:windowSoftInputMode="adjustResize">

View File

@ -7,7 +7,7 @@
<item> <item>
<bitmap <bitmap
android:gravity="center" android:gravity="center"
android:src="@mipmap/launch_image" /> android:src="@mipmap/launch_back" />
</item> </item>
<item> <item>
<bitmap <bitmap

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View File

@ -12,7 +12,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.2.0' classpath 'com.android.tools.build:gradle:7.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.huawei.agconnect:agcp:1.6.0.300' classpath 'com.huawei.agconnect:agcp:1.6.0.300'
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 587 KiB

After

Width:  |  Height:  |  Size: 401 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@ -381,7 +381,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.1.0; MARKETING_VERSION = 1.1.3;
PRODUCT_BUNDLE_IDENTIFIER = com.exampe.circleApp; PRODUCT_BUNDLE_IDENTIFIER = com.exampe.circleApp;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@ -530,7 +530,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.1.0; MARKETING_VERSION = 1.1.3;
PRODUCT_BUNDLE_IDENTIFIER = com.exampe.circleApp; PRODUCT_BUNDLE_IDENTIFIER = com.exampe.circleApp;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@ -573,7 +573,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.1.0; MARKETING_VERSION = 1.1.3;
PRODUCT_BUNDLE_IDENTIFIER = com.exampe.circleApp; PRODUCT_BUNDLE_IDENTIFIER = com.exampe.circleApp;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

View File

@ -40,7 +40,7 @@
</Testables> </Testables>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Debug" buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0" launchStyle = "0"

View File

@ -50,6 +50,8 @@ class AboutappLogic extends GetxController {
getUpVersion() async { getUpVersion() async {
if(isUpdate){ if(isUpdate){
showReportDialog(Get.context!, _updateInfo!.constraint == 0, _updateInfo!); showReportDialog(Get.context!, _updateInfo!.constraint == 0, _updateInfo!);
}else {
showOKToast("暂无新版本");
} }
} }

View File

@ -177,7 +177,7 @@ class AboutappPage extends StatelessWidget {
), ),
):Container(), ):Container(),
Text( Text(
logic.version, "",
style: TextStyle( style: TextStyle(
color: const Color(0xFFB7BECC), color: const Color(0xFFB7BECC),
fontSize: 12.sp, fontSize: 12.sp,

View File

@ -54,7 +54,10 @@ class Call_outLogic extends GetxController {
if (myConfigData != null) { if (myConfigData != null) {
// print(myConfigData.name); // print(myConfigData.name);
numbers.addAll(myConfigData); numbers.addAll(myConfigData);
if(numbers.length>0){
circleName = numbers[0].name; circleName = numbers[0].name;
}
SharedPreferencesHelper.getInstance().then((sharedPreferences) { SharedPreferencesHelper.getInstance().then((sharedPreferences) {
vip = sharedPreferences.getInt(SharedPreferencesHelper.VIP); vip = sharedPreferences.getInt(SharedPreferencesHelper.VIP);
print(vip); print(vip);

View File

@ -1,5 +1,8 @@
import 'dart:async'; import 'dart:async';
import 'dart:ffi';
import 'dart:io';
import 'dart:math'; import 'dart:math';
import 'dart:typed_data';
import 'package:circle_app/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_send_sound_message.dart'; import 'package:circle_app/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_send_sound_message.dart';
import 'package:circle_app/app/minefragment/logic.dart'; import 'package:circle_app/app/minefragment/logic.dart';
@ -31,8 +34,11 @@ import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitTextField
import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_send_sound_message.dart'; import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_send_sound_message.dart';
import 'package:tencent_extended_text_field/extended_text_field.dart'; import 'package:tencent_extended_text_field/extended_text_field.dart';
import 'package:tencent_keyboard_visibility/tencent_keyboard_visibility.dart'; import 'package:tencent_keyboard_visibility/tencent_keyboard_visibility.dart';
import 'package:video_player/video_player.dart';
import 'package:video_thumbnail/video_thumbnail.dart';
import '../../../../../util/eventBus.dart'; import '../../../../../util/eventBus.dart';
import '../../../../call_out/logic.dart';
GlobalKey<_TIMTextFieldLayoutNarrowState> TIMnarrowTextFieldKey = GlobalKey(); GlobalKey<_TIMTextFieldLayoutNarrowState> TIMnarrowTextFieldKey = GlobalKey();
@ -152,6 +158,7 @@ class TIMTextFieldLayoutNarrow extends StatefulWidget {
class _TIMTextFieldLayoutNarrowState class _TIMTextFieldLayoutNarrowState
extends TIMUIKitState<TIMTextFieldLayoutNarrow> { extends TIMUIKitState<TIMTextFieldLayoutNarrow> {
final TUISettingModel settingModel = serviceLocator<TUISettingModel>(); final TUISettingModel settingModel = serviceLocator<TUISettingModel>();
final ImagePicker _picker = ImagePicker(); final ImagePicker _picker = ImagePicker();
@ -176,7 +183,8 @@ class _TIMTextFieldLayoutNarrowState
}); });
} }
if (null == commentBlackEvent) { if (null == commentBlackEvent) {
commentBlackEvent = EventBusManager.on<CommentBlackEvent>().listen((event) { commentBlackEvent =
EventBusManager.on<CommentBlackEvent>().listen((event) {
if (event.userId == widget.userId) { if (event.userId == widget.userId) {
isBlack = event.isBlack; isBlack = event.isBlack;
} }
@ -185,7 +193,9 @@ class _TIMTextFieldLayoutNarrowState
getBlack(); getBlack();
} }
StreamSubscription? commentBlackEvent = null; StreamSubscription? commentBlackEvent = null;
@override @override
void dispose() { void dispose() {
print("TIMTextFieldLayoutNarrow解绑"); print("TIMTextFieldLayoutNarrow解绑");
@ -193,7 +203,6 @@ class _TIMTextFieldLayoutNarrowState
EventBusManager.cancelSubscription(commentBlackEvent!); EventBusManager.cancelSubscription(commentBlackEvent!);
} }
super.dispose(); super.dispose();
} }
@ -214,7 +223,6 @@ class _TIMTextFieldLayoutNarrowState
} }
} }
void setSendButton() { void setSendButton() {
final value = widget.textEditingController.text; final value = widget.textEditingController.text;
if (isWebDevice() || isAndroidDevice()) { if (isWebDevice() || isAndroidDevice()) {
@ -668,7 +676,7 @@ class _TIMTextFieldLayoutNarrowState
), ),
), ),
Container( Container(
height: 40.sp, height: 64.sp,
width: Get.width, width: Get.width,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
@ -692,7 +700,8 @@ class _TIMTextFieldLayoutNarrowState
showSendSoundText = !showSendSoundText; showSendSoundText = !showSendSoundText;
}); });
} else { } else {
var data = await Permission.microphone.request(); var data =
await Permission.microphone.request();
if (data.isGranted) { if (data.isGranted) {
setState(() { setState(() {
showEmojiPanel = false; showEmojiPanel = false;
@ -700,7 +709,8 @@ class _TIMTextFieldLayoutNarrowState
showSendSoundText = !showSendSoundText; showSendSoundText = !showSendSoundText;
}); });
} else { } else {
Permissions.showPermissionConfirmDialog(context, Permission.microphone.value); Permissions.showPermissionConfirmDialog(
context, Permission.microphone.value);
} }
} }
} catch (e) { } catch (e) {
@ -713,27 +723,50 @@ class _TIMTextFieldLayoutNarrowState
), ),
), ),
GestureDetector( GestureDetector(
onTap: () {
onTap: () async {
if (isBlack) { if (isBlack) {
showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~");
return; return;
} }
getImageFile(); await getImageFile();
}, },
child: child:
Image.asset(getMsgImage('photo'), width: 40.sp), Image.asset(getMsgImage('photo'), width: 40.sp),
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () async {
if (isBlack) { if (isBlack) {
showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~");
return; return;
} }
getTakeImageFile(); await getTakeImageFile();
}, },
child: Image.asset(getMsgImage('take_photo'), child: Image.asset(getMsgImage('take_photo'),
width: 40.sp), width: 40.sp),
), ),
GestureDetector(
onTap: () async {
if (isBlack) {
showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~");
return;
}
await getVideoFile(ImageSource.gallery);
},
child: Image.asset(getMsgImage('icon_video'),
width: 40.sp),
),
GestureDetector(
onTap: () async {
if (isBlack) {
showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~");
return;
}
await getVideoFile(ImageSource.camera);
},
child: Image.asset(getMsgImage('icon_video_camera'),
width: 40.sp),
),
], ],
), ),
), ),
@ -775,22 +808,29 @@ class _TIMTextFieldLayoutNarrowState
); );
} }
Future checkVipStatus() async { Future checkVipStatus(int plate) async {
if (!isVip) { if (!isVip) {
SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance(); SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance();
if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') { if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') {
isVip = true; isVip = true;
return true; return true;
} else { } else {
var data = await DioManager.instance.get(url: Api.getUserMine); var data =
var bean = BaseResponse<MineResponseBean>.fromJson( await DioManager.instance.get(url: Api.getIsVips + plate.toString());
data, (data) => MineResponseBean.fromJson(data));
if (bean.isSuccess()) { if (data['code'] == 200) {
User userInfoBean = bean.data.user!; isVip = !data['data'];
isVip = userInfoBean.vip > 0; }
} // var data = await DioManager.instance.get(url: Api.getUserMine);
// var bean = BaseResponse<MineResponseBean>.fromJson(
// data, (data) => MineResponseBean.fromJson(data));
// if (bean.isSuccess()) {
// User userInfoBean = bean.data.user!;
// isVip = userInfoBean.vip > 0;
// }
} }
} }
if (!isVip) { if (!isVip) {
showOKToast('开通会员之后才能发送图片'); showOKToast('开通会员之后才能发送图片');
Get.bottomSheet( Get.bottomSheet(
@ -807,8 +847,91 @@ class _TIMTextFieldLayoutNarrowState
return isVip; return isVip;
} }
VideoPlayerController? videoPlayerController;
Future getVideoFile(ImageSource imageSource) async {
bool isOK = await checkVipStatus(imageSource == ImageSource.camera ? 2 : 4);
if (!isOK) {
return;
}
await requestStoragePermission();
XFile? pickedFile;
String? thumbnailPath; // thumbnailPath
try {
pickedFile = await _picker.pickVideo(
source: imageSource, maxDuration: const Duration(seconds: 30)
);
if (pickedFile == null) {
return;
}
videoPlayerController = VideoPlayerController.file(
File(pickedFile.path),
videoPlayerOptions: VideoPlayerOptions(mixWithOthers: true),
);
await videoPlayerController?.initialize().then((_) async {
thumbnailPath = await VideoThumbnail.thumbnailFile(
video: pickedFile!.path,
imageFormat: ImageFormat.JPEG,
maxWidth: 100,
quality: 50,
);
});
final Duration videoDuration = videoPlayerController!.value.duration;
final double durationInSeconds = videoDuration.inSeconds.toDouble();
await widget.model.sendVideoMessage(
videoPath: pickedFile.path,
snapshotPath: thumbnailPath,
//
convID: widget.conversationID,
convType: widget.conversationType,
duration: durationInSeconds.toInt(),
inputElement: context,
);
if (imageSource == ImageSource.camera) {
DioManager.instance.get(url: Api.getAddTrialCount + "2");
} else {
DioManager.instance.get(url: Api.getAddTrialCount + "4");
}
} catch (e) {
print(e);
// setState(() {
// _pickImageError = e;
// });
}
}
Future<ThumbnailResult> getFirstPic(url) async {
Uint8List? bytes = await VideoThumbnail.thumbnailData(video: url);
final Completer<ThumbnailResult> completer = Completer();
if (bytes != null) {
int _imageDataSize = bytes.length;
print("image size: $_imageDataSize");
final _image = Image.memory(bytes);
_image.image
.resolve(ImageConfiguration())
.addListener(ImageStreamListener((ImageInfo info, bool _) {
completer.complete(ThumbnailResult(
image: _image,
dataSize: _imageDataSize,
height: info.image.height,
width: info.image.width,
));
}));
}
return completer.future;
}
Future getImageFile() async { Future getImageFile() async {
bool isOK = await checkVipStatus(); bool isOK = await checkVipStatus(3);
if (!isOK) { if (!isOK) {
return; return;
} }
@ -821,6 +944,7 @@ class _TIMTextFieldLayoutNarrowState
convID: widget.conversationID, convID: widget.conversationID,
convType: widget.conversationType, convType: widget.conversationType,
inputElement: context); inputElement: context);
var data = await DioManager.instance.get(url: Api.getAddTrialCount + "3");
} catch (e) { } catch (e) {
print(e); print(e);
// setState(() { // setState(() {
@ -830,24 +954,43 @@ class _TIMTextFieldLayoutNarrowState
} }
Future getTakeImageFile() async { Future getTakeImageFile() async {
bool isOK = await checkVipStatus(); bool isOK = await checkVipStatus(1);
if (!isOK) { if (!isOK) {
return; return;
} }
await requestStoragePermission();
try { try {
final XFile? pickedFile = await _picker.pickImage( final XFile? pickedFile = await _picker.pickImage(
source: ImageSource.camera, source: ImageSource.camera,
); );
if(null==pickedFile){
return;
}
widget.model.sendImageMessage( widget.model.sendImageMessage(
imagePath: pickedFile!.path, imagePath: pickedFile.path,
convID: widget.conversationID, convID: widget.conversationID,
convType: widget.conversationType, convType: widget.conversationType,
inputElement: context); inputElement: context);
DioManager.instance.get(url: Api.getAddTrialCount + "1");
} catch (e) {} } catch (e) {}
} }
//
Future<void> requestStoragePermission() async {
final status = await Permission.storage.request();
if (status.isGranted) {
//
} else if (status.isDenied) {
showOKToast("请打开存储权限。将为你带来更好的服务");
//
} else if (status.isPermanentlyDenied) {
showOKToast("请打开存储权限。将为你带来更优的服务");
//
//
}
}
_handleCameraAndMic() async { _handleCameraAndMic() async {
// // // //
// Map<PermissionGroup, PermissionStatus> permissions = await PermissionHandler().requestPermissions( // Map<PermissionGroup, PermissionStatus> permissions = await PermissionHandler().requestPermissions(

View File

@ -14,7 +14,6 @@ import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
import 'package:tencent_cloud_chat_uikit/ui/controller/tim_uikit_chat_controller.dart'; import 'package:tencent_cloud_chat_uikit/ui/controller/tim_uikit_chat_controller.dart';
import '../../util/eventBus.dart'; import '../../util/eventBus.dart';
import 'logic.dart';
class ChatPage extends StatefulWidget { class ChatPage extends StatefulWidget {
@ -111,6 +110,7 @@ class _ChatPageState extends State<ChatPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
V2TimConversation con = Get.arguments; V2TimConversation con = Get.arguments;
return TIMChat( return TIMChat(
conversation: Get.arguments, conversation: Get.arguments,
customStickerPanel: renderCustomStickerPanel, customStickerPanel: renderCustomStickerPanel,
onTapAvatar :(String userId,TapDownDetails tapDownDetails)async{ onTapAvatar :(String userId,TapDownDetails tapDownDetails)async{
@ -121,6 +121,7 @@ class _ChatPageState extends State<ChatPage> {
}, },
controller : _timuiKitChatController, controller : _timuiKitChatController,
config: TIMUIKitChatConfig( config: TIMUIKitChatConfig(
// 使 // 使
isAllowClickAvatar: true, isAllowClickAvatar: true,
isUseDefaultEmoji: true, isUseDefaultEmoji: true,

View File

@ -1,3 +1,7 @@
import 'package:get/get_rx/src/rx_types/rx_types.dart';
import 'logic.dart';
class CircleState { class CircleState {
String msg = ''; String msg = '';
int index = 0; int index = 0;
@ -79,6 +83,7 @@ class Chat {
int? count; int? count;
List<Users>? users; List<Users>? users;
Chat({this.accountId, this.count, this.users}); Chat({this.accountId, this.count, this.users});
Chat.fromJson(Map<String, dynamic> json) { Chat.fromJson(Map<String, dynamic> json) {

View File

@ -43,7 +43,7 @@ class _CirclePageState extends State<CirclePage>
void initState() { void initState() {
super.initState(); super.initState();
_pageController = PageController(); _pageController = PageController();
_tabController = TabController(length: 2, vsync: this); _tabController = TabController(length: 1, vsync: this);
_tabController.addListener(_handleTabChange); _tabController.addListener(_handleTabChange);
} }
@ -77,7 +77,9 @@ class _CirclePageState extends State<CirclePage>
{ {
return Scaffold( return Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
body: SafeArea( body:
SafeArea(
child: GetBuilder(builder: (CircleLogic controller) { child: GetBuilder(builder: (CircleLogic controller) {
return Stack( return Stack(
children: [ children: [
@ -98,7 +100,7 @@ class _CirclePageState extends State<CirclePage>
}, },
children: [ children: [
circleList(controller), circleList(controller),
vicinityList(controller), // vicinityList(controller),
], ],
), ),
), ),
@ -592,87 +594,71 @@ class _CirclePageState extends State<CirclePage>
child: Stack( child: Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
logic.isShowCircle // logic.isShowCircle
? Positioned( // ? Positioned(
left: 0,
child: GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.Invite);
},
child: Container(
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.6.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0),
color: const Color(0xFF392D53),
),
child: Padding(
padding: EdgeInsets.only(
top: 5.sp,
bottom: 4.sp,
left: 8.sp,
right: 8.sp,
),
child: const Center(
child: Text(
"邀请得会员",
style: TextStyle(
fontSize: 11,
color: Colors.white,
),
),
),
),
),
),
))
// Positioned(
// left: 0, // left: 0,
// child: GestureDetector( // child: GestureDetector(
// onTap: () { // onTap: () {
// Get.toNamed(AppRoutes.VisitorListActivity); // Get.toNamed(AppRoutes.Invite);
// }, // },
// child: SizedBox( // child: Container(
// width: 30.sp * widgets.length, // decoration: BoxDecoration(
// height: 44.sp, // borderRadius: BorderRadius.circular(17.0),
// child: Stack( // gradient: const LinearGradient(
// alignment: Alignment.centerLeft, // colors: [
// children: widgets, // Color(0xFF06F9FA),
// Color(0xFFDC5BFD),
// ],
// ),
// color: const Color(0xFF392D53),
// ),
// child: Container(
// margin: EdgeInsets.all(0.6.sp),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(17.0),
// color: const Color(0xFF392D53),
// ),
// child: Padding(
// padding: EdgeInsets.only(
// top: 5.sp,
// bottom: 4.sp,
// left: 8.sp,
// right: 8.sp,
// ),
// child: const Center(
// child: Text(
// "邀请得会员",
// style: TextStyle(
// fontSize: 11,
// color: Colors.white,
// ), // ),
// ), // ),
// ), // ),
// ) // ),
: GestureDetector( // ),
onTap: () { // ),
showCityPiker(context); // ))
}, //
child: Row( // : GestureDetector(
children: [ // onTap: () {
Image.asset( // showCityPiker(context);
getCircleImage('icon_city'), // },
width: 24.sp, // child: Row(
), // children: [
Container( // Image.asset(
margin: EdgeInsets.only(left: 4.sp, top: 4.sp), // getCircleImage('icon_city'),
child: Text( // width: 24.sp,
modifyCityName(logic.cityName), // ),
style: // Container(
TextStyle(color: Colors.white, fontSize: 16.sp), // margin: EdgeInsets.only(left: 4.sp, top: 4.sp),
)) // child: Text(
], // modifyCityName(logic.cityName),
), // style:
), // TextStyle(color: Colors.white, fontSize: 16.sp),
// ))
// ],
// ),
// ),
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
//padding: EdgeInsets.symmetric(horizontal: 10.sp), //padding: EdgeInsets.symmetric(horizontal: 10.sp),
@ -707,14 +693,14 @@ class _CirclePageState extends State<CirclePage>
), ),
), ),
), ),
Tab( // Tab(
child: Text( // child: Text(
'附近', // '附近',
style: TextStyle( // style: TextStyle(
fontSize: 18.sp, // fontSize: 18.sp,
), // ),
), // ),
), // ),
], ],
labelStyle: TextStyle( labelStyle: TextStyle(
color: const Color(0xFF00FFF4), color: const Color(0xFF00FFF4),

View File

@ -1,14 +1,19 @@
import 'dart:ffi';
import 'dart:io'; import 'dart:io';
import 'package:connectivity/connectivity.dart';
import 'package:device_info/device_info.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:tencent_chat_push_for_china/tencent_chat_push_for_china.dart'; import 'package:tencent_chat_push_for_china/tencent_chat_push_for_china.dart';
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart'; import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
import '../../common/values/pushconfig.dart'; import '../../common/values/pushconfig.dart';
import '../../main.dart';
import '../../util/PaymentUtils.dart'; import '../../util/PaymentUtils.dart';
import '../../util/SharedPreferencesHelper.dart'; import '../../util/SharedPreferencesHelper.dart';
import '../../util/device.dart'; import '../../util/device.dart';
@ -36,7 +41,6 @@ class _CustomDialogState extends State<YesAgreementDialog> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return WillPopScope(
onWillPop: () async { onWillPop: () async {
print(getAgreemement()); print(getAgreemement());
return false; return false;
}, },
@ -78,7 +82,7 @@ class _CustomDialogState extends State<YesAgreementDialog> {
margin: EdgeInsets.only(left: 10.sp, right: 10.sp), margin: EdgeInsets.only(left: 10.sp, right: 10.sp),
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: "感谢您信任并使用跨友APP在你使用跨友的服务之前,请认真阅读", text: "感谢您信任并使用微乐园APP在你使用微乐园的服务之前,请认真阅读",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 14.sp, fontSize: 14.sp,
@ -86,7 +90,7 @@ class _CustomDialogState extends State<YesAgreementDialog> {
children: [ children: [
TextSpan( TextSpan(
text: "《用户协议》", text: "《用户协议》",
style: TextStyle( style: const TextStyle(
color: Color(0xFF21BEAB), color: Color(0xFF21BEAB),
), ),
recognizer: TapGestureRecognizer() recognizer: TapGestureRecognizer()
@ -94,7 +98,7 @@ class _CustomDialogState extends State<YesAgreementDialog> {
navigateToUserAgreement(); navigateToUserAgreement();
}, },
), ),
TextSpan( const TextSpan(
text: "", text: "",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
@ -102,7 +106,7 @@ class _CustomDialogState extends State<YesAgreementDialog> {
), ),
TextSpan( TextSpan(
text: "《隐私政策》", text: "《隐私政策》",
style: TextStyle( style: const TextStyle(
color: Color(0xFF21BEAB), color: Color(0xFF21BEAB),
), ),
recognizer: TapGestureRecognizer() recognizer: TapGestureRecognizer()
@ -112,7 +116,7 @@ class _CustomDialogState extends State<YesAgreementDialog> {
), ),
TextSpan( TextSpan(
text: text:
"的全部内容,以了解用户权力义务和个人信息处理规则。跨友仅会将您的信息用于提供服务和改善体验,我们将权力保障您的信息安全,请同意后使用,若您不同意本隐私政策,很遗憾,我们将无法为您提供完整的产品和服务。", "的全部内容,以了解用户权力义务和个人信息处理规则。微乐园仅会将您的信息用于提供服务和改善体验,我们将权力保障您的信息安全,请同意后使用,若您不同意本隐私政策,很遗憾,我们将无法为您提供完整的产品和服务。",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 14.sp, fontSize: 14.sp,
@ -126,19 +130,32 @@ class _CustomDialogState extends State<YesAgreementDialog> {
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
// //
SmartDialog.showLoading();
var connectivityResult =
await Connectivity().checkConnectivity();
if (connectivityResult == ConnectivityResult.none) {
showOKToast("请检查网络连接是否正常");
print('没网');
return;
}
try {
var sp = await SharedPreferencesHelper.getInstance(); var sp = await SharedPreferencesHelper.getInstance();
sp.setBool(SharedPreferencesHelper.AGREEMENT, true); sp.setBool(SharedPreferencesHelper.AGREEMENT, true);
pushLoginPage(); } catch (e) {}
uploadBuzIDAndToken(); uploadBuzIDAndToken();
SmartDialog.dismiss();
pushLoginPage();
}, },
child: Container( child: Container(
width: 240.sp, width: 240.sp,
padding: EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
vertical: 10, vertical: 10,
horizontal: 44, horizontal: 44,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( gradient: const LinearGradient(
colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)], colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)],
begin: Alignment.centerLeft, begin: Alignment.centerLeft,
end: Alignment.centerRight, end: Alignment.centerRight,
@ -159,7 +176,8 @@ class _CustomDialogState extends State<YesAgreementDialog> {
TextButton( TextButton(
onPressed: () { onPressed: () {
// //
exit(1); // exit(1);
SystemNavigator.pop();
}, },
child: Text( child: Text(
"不同意并退出应用", "不同意并退出应用",
@ -178,25 +196,29 @@ class _CustomDialogState extends State<YesAgreementDialog> {
); );
} }
// Future<bool> uploadBuzIDAndToken() async {
void uploadBuzIDAndToken() async { // if (Platform.isAndroid) {
if (Platform.isAndroid) { // initWxApi();
initWxApi(); // }
} //
final CoreServicesImpl coreInstance = TIMUIKitCore.getInstance(); //
await ChannelPush.init((msg) {}); // final CoreServicesImpl coreInstance = TIMUIKitCore.getInstance();
// await ChannelPush.init((msg) {});
int? businessID = await TimUiKitPushPlugin.getBuzId(PushConfig.appInfo); //
// int? businessID = await TimUiKitPushPlugin.getBuzId(PushConfig.appInfo);
String token = await ChannelPush.getDeviceToken(); //
ChannelPush.uploadToken(); // String token = await ChannelPush.getDeviceToken();
// ChannelPush.uploadToken();
print("token=" + token); //
if (token != "") { // print("token=" + token);
V2TimCallback res = await coreInstance.setOfflinePushConfig( // if (token != "") {
token: token, businessID: businessID); // V2TimCallback res = await coreInstance.setOfflinePushConfig(
// token: token, businessID: businessID);
print("token=" + res.code.toString()); //
} // print("token=" + res.code.toString());
} // }
//
//
// return true;
// }
} }

View File

@ -2,7 +2,6 @@ import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'dart:ffi';
import 'package:circle_app/app/circle/logic.dart'; import 'package:circle_app/app/circle/logic.dart';
import 'package:circle_app/app/minefragment/logic.dart'; import 'package:circle_app/app/minefragment/logic.dart';

View File

@ -67,7 +67,7 @@ class LoginLogic extends GetxController {
if (bean.code == 200) { if (bean.code == 200) {
showOKToast('发送成功!'); showOKToast('发送成功!');
if (kDebugMode) { if (kDebugMode) {
print("验证码:${bean.data!.code}"); //print("验证码:${bean.data!.code}");
// codeEditingController.text = bean.data!.code.toString(); // codeEditingController.text = bean.data!.code.toString();
// update(); // update();
} }

View File

@ -12,6 +12,7 @@ import 'package:shared_preferences/shared_preferences.dart';
class MinefragmentLogic extends GetxController { class MinefragmentLogic extends GetxController {
final MinefragmentState state = MinefragmentState(); final MinefragmentState state = MinefragmentState();
User? userInfoBean; User? userInfoBean;
bool isProxy = false;
String ageMsg = ""; String ageMsg = "";
var isVip = 0.obs; var isVip = 0.obs;
var likeCount = 0; var likeCount = 0;
@ -34,6 +35,12 @@ class MinefragmentLogic extends GetxController {
@override @override
void onInit() async { void onInit() async {
super.onInit(); super.onInit();
SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance();
if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') {
isProxy = true;
} else {
isProxy = false;
}
getMode(); getMode();
EventBusManager.on<CommentVipEvent>().listen((event) { EventBusManager.on<CommentVipEvent>().listen((event) {
isVip.value = event.vip; isVip.value = event.vip;

View File

@ -19,10 +19,18 @@ import 'logic.dart';
const vipIcon = 'assets/images/home/icon_vip.png'; const vipIcon = 'assets/images/home/icon_vip.png';
const MyImageWidget = const Image( const MyImageWidget = Image(
image: AssetImage(vipIcon), image: AssetImage(vipIcon),
fit: BoxFit.fill, fit: BoxFit.fill,
); );
const vipIcon1 = 'assets/images/home/icon_one_vip.png';
const MyImageWidget1 = Image(
image: AssetImage(vipIcon1),
fit: BoxFit.fill,
);
class MinefragmentPage extends StatelessWidget { class MinefragmentPage extends StatelessWidget {
MinefragmentPage({Key? key}) : super(key: key); MinefragmentPage({Key? key}) : super(key: key);
@ -60,7 +68,7 @@ class MinefragmentPage extends StatelessWidget {
showRechargeDialog(logic); showRechargeDialog(logic);
}, },
child: Stack(children: [ child: Stack(children: [
MyImageWidget, logic.isProxy ? MyImageWidget1 : MyImageWidget,
Positioned( Positioned(
top: 54.sp, top: 54.sp,
left: 72.sp, left: 72.sp,
@ -82,7 +90,7 @@ class MinefragmentPage extends StatelessWidget {
Widget _circleLiveView(MinefragmentLogic logic) { Widget _circleLiveView(MinefragmentLogic logic) {
return Column( return Column(
children: [_circleItemView(logic), _invienItemView(), _helpItemView(),_setUpItemView()], children: [_circleItemView(logic), _helpItemView(),_setUpItemView()],
); );
} }

View File

@ -22,6 +22,7 @@ import 'package:tencent_cloud_chat_uikit/ui/widgets/customize_ball_pulse_header.
import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_base.dart'; import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_base.dart';
import 'package:tencent_cloud_chat_uikit/ui/widgets/wide_popup.dart'; import 'package:tencent_cloud_chat_uikit/ui/widgets/wide_popup.dart';
import '../../../util/eventBus.dart';
import 'tim_uikit_conversation_item.dart'; import 'tim_uikit_conversation_item.dart';
typedef TIMConversationItemBuilder = Widget Function( typedef TIMConversationItemBuilder = Widget Function(
@ -190,9 +191,11 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
model.setSelectedConversation(conversation); model.setSelectedConversation(conversation);
} }
_clearHistory(V2TimConversation conversationItem) { _clearHistory(V2TimConversation conversationItem) async{
_timuiKitConversationController.clearHistoryMessage( await _timuiKitConversationController.clearHistoryMessage(
conversation: conversationItem); conversation: conversationItem);
await Future.delayed(Duration(seconds: 1));
EventBusManager.fire(RefreshUnread());
} }
_pinConversation(V2TimConversation conversation) { _pinConversation(V2TimConversation conversation) {
@ -201,9 +204,11 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
isPinned: !conversation.isPinned!); isPinned: !conversation.isPinned!);
} }
_deleteConversation(V2TimConversation conversation) { _deleteConversation(V2TimConversation conversation) async{
_timuiKitConversationController.deleteConversation( await _timuiKitConversationController.deleteConversation(
conversationID: conversation.conversationID); conversationID: conversation.conversationID);
await Future.delayed(Duration(seconds: 1));
EventBusManager.fire(RefreshUnread());
} }
List<V2TimConversation?> getFilteredConversation() { List<V2TimConversation?> getFilteredConversation() {

View File

@ -17,6 +17,9 @@ class Select_circleLogic extends GetxController {
for (var entry in entries.asMap().entries) { for (var entry in entries.asMap().entries) {
MyConfigData bean = MyConfigData(entry.value.key, entry.value.value, false); MyConfigData bean = MyConfigData(entry.value.key, entry.value.value, false);
if(selectCircle.isEmpty){
arrList.add(bean);
}else{
selectCircle.forEach((element) { selectCircle.forEach((element) {
if(entry.value.key==element.id){ if(entry.value.key==element.id){
bean.isSelect = true; bean.isSelect = true;
@ -25,6 +28,8 @@ class Select_circleLogic extends GetxController {
arrList.add(bean); arrList.add(bean);
}); });
} }
}
}else{ }else{
interestMap.forEach((key, value) { interestMap.forEach((key, value) {
MyConfigData bean = MyConfigData(key, value, false); MyConfigData bean = MyConfigData(key, value, false);
@ -36,7 +41,7 @@ class Select_circleLogic extends GetxController {
arrList.add(bean); arrList.add(bean);
}); });
} }
print(arrList.length.toString());
update(); update();
} }

View File

@ -1,5 +1,6 @@
import 'dart:io'; import 'dart:io';
import 'package:connectivity/connectivity.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart'; import 'package:flutter_native_splash/flutter_native_splash.dart';
@ -8,6 +9,7 @@ import 'package:get/get.dart';
import '../../router/app_routers.dart'; import '../../router/app_routers.dart';
import '../../util/SharedPreferencesHelper.dart'; import '../../util/SharedPreferencesHelper.dart';
import '../dialog/YesAgreementDialog.dart'; import '../dialog/YesAgreementDialog.dart';
import '../select_circle/logic.dart';
import 'state.dart'; import 'state.dart';
import '../../network/api.dart'; import '../../network/api.dart';
@ -25,10 +27,31 @@ class SplashLogic extends GetxController {
super.onReady(); super.onReady();
} }
@override @override
void onInit() async { void onInit() async {
super.onInit(); super.onInit();
// await Future.delayed(Duration(seconds: 30)); // await Future.delayed(Duration(seconds: 30));
var data1 =
await DioManager.instance.get(url: Api.getCircleList, params: {});
var bean1 = BaseResponse<ConfigBean>.fromJson(
data1, (data1) => ConfigBean.fromJson(data1));
if (bean1.code == 200) {
configBean = bean1.data!;
configBean.genderMap.forEach((key, value) {
genderList.add(value);
});
configBean.orientationMap.forEach((key, value) {
orientationList.add(value);
});
configBean.roleMap.forEach((key, value) {
roleList.add(value);
});
}
if ((await getAuthorization()).isEmpty) { if ((await getAuthorization()).isEmpty) {
if (Platform.isIOS) { if (Platform.isIOS) {
pushLoginPage(); pushLoginPage();

View File

@ -15,7 +15,7 @@ class SplashPage extends StatelessWidget {
return Container( return Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage('assets/images/base/launch_image.webp'), image: AssetImage('assets/images/base/launch_back.webp'),
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),

View File

@ -133,7 +133,11 @@ class UserinfoLogic extends GetxController {
} }
onLineCity = isOnline ? "在线" : "离线"; onLineCity = isOnline ? "在线" : "离线";
if (userInfoBean?.city != null) { if (userInfoBean?.city != null) {
if (isOnline) {
onLineCity = "$onLineCity·${userInfoBean!.city}"; onLineCity = "$onLineCity·${userInfoBean!.city}";
} else {
onLineCity = userInfoBean!.city! ?? '';
}
} else { } else {
onLineCity = "$onLineCity·外星"; onLineCity = "$onLineCity·外星";
} }

View File

@ -302,7 +302,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
shape: BoxShape.circle, shape: BoxShape.circle,
color: logic.isOnline color: logic.isOnline
? const Color(0xFF00FFF4) ? const Color(0xFF00FFF4)
: const Color(0xFF787575), : const Color(0x00000000),
), ),
), ),
logic.isBlack || logic.isDestroy || logic.isBlackBeen logic.isBlack || logic.isDestroy || logic.isBlackBeen
@ -404,6 +404,17 @@ class MyTabbedScreenState extends State<UserinfoPage>
} }
Widget titleTab(UserinfoLogic controller) { Widget titleTab(UserinfoLogic controller) {
String buttonText = "";
if (controller.isMe) {
if (logic.isShowAlbum) {
buttonText = controller.isEdit ? "完成" : "管理";
} else {
buttonText = "发布喊话";
}
} else {
buttonText = controller.isUrgeStatus ? "已催更" : "催更";
}
return Container( return Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
padding: EdgeInsets.symmetric(horizontal: 10.sp), padding: EdgeInsets.symmetric(horizontal: 10.sp),
@ -441,10 +452,13 @@ class MyTabbedScreenState extends State<UserinfoPage>
); );
}, },
), ),
logic.isBlack || logic.isDestroy || logic.isBlackBeen logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): GestureDetector(
? Container()
: GestureDetector(
onTap: () { onTap: () {
if(!logic.isShowAlbum&&controller.isMe){
List<MyConfigData> numbers = [];
var data = Get.toNamed(AppRoutes.Call_out, arguments: {'numbers': numbers});
return ;
}
if (controller.isMe) { if (controller.isMe) {
controller.isEdit = !controller.isEdit; controller.isEdit = !controller.isEdit;
controller.update(); controller.update();
@ -453,7 +467,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
} }
}, },
child: Visibility( child: Visibility(
visible: logic.isShowAlbum, // visible: logic.isShowAlbum,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17), borderRadius: BorderRadius.circular(17),
@ -471,13 +485,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
horizontal: 12.sp, horizontal: 12.sp,
), ),
child: Text( child: Text(
controller.isMe buttonText,
? controller.isEdit
? "完成"
: "管理"
: controller.isUrgeStatus
? "已催更"
: "催更",
style: const TextStyle( style: const TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 12, fontSize: 12,
@ -509,7 +517,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
style: const TextStyle(color: Colors.white30), style: const TextStyle(color: Colors.white30),
), ),
), ),
controller.state.imaglist.isEmpty && !controller.isEdit controller.state.imaglist.isEmpty && !controller.isMe
? Center( ? Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -542,19 +550,21 @@ class MyTabbedScreenState extends State<UserinfoPage>
crossAxisCount: 3, crossAxisCount: 3,
), ),
itemCount: controller.isMe itemCount: controller.isMe
? controller.isEdit // ? controller.isEdit
? controller.state.imaglist.length < 15 // ? controller.state.imaglist.length < 15
// ? controller.state.imaglist.length
? controller.state.imaglist.length+1 ? controller.state.imaglist.length+1
: controller.state.imaglist.length
: controller.state.imaglist.length
: controller.state.imaglist.length , : controller.state.imaglist.length ,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
if (controller.isMe && // print("123123123123");
controller.isEdit && if (controller.isMe ) {
controller.state.imaglist.length < 15) {
if (index == 0) { if (index == 0) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
if(controller.state.imaglist.length >= 15){
showOKToast("最大只可上传15张图片哦~");
return ;
}
controller.getImageFile(); controller.getImageFile();
}, },
child: Container( child: Container(

View File

@ -1,4 +1,5 @@
import 'package:device_info/device_info.dart';
import 'package:tencent_chat_push_for_china/model/appInfo.dart'; import 'package:tencent_chat_push_for_china/model/appInfo.dart';
import 'package:tencent_chat_push_for_china/tencent_chat_push_for_china.dart'; import 'package:tencent_chat_push_for_china/tencent_chat_push_for_china.dart';
@ -12,6 +13,7 @@ class PushConfig{
// Business ID for XiaoMi // Business ID for XiaoMi
static const XMPushBuzID = 30672; static const XMPushBuzID = 30672;
static const String XMChannelID = "111363";
// APP Info of XiaoMi // APP Info of XiaoMi
static const String XMPushAPPID = "2882303761520264048"; static const String XMPushAPPID = "2882303761520264048";
@ -72,14 +74,32 @@ class ChannelPush{
appInfo: PushConfig.appInfo, appInfo: PushConfig.appInfo,
); );
print("token=初始化"+isInit.toString()); print("token=初始化"+isInit.toString());
AndroidDeviceInfo androidInfo;
// create new notification channel try {
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
androidInfo = await deviceInfo.androidInfo;
} catch (e) {
//
return true;
}
if (androidInfo.brand == 'Xiaomi'||androidInfo.brand == 'Redmi') {
cPush.createNotificationChannel(
channelId: PushConfig.XMChannelID,
channelName: "消息推送",
channelDescription:
"The notification for chat message from Tencent Cloud IM"
);
}else{
cPush.createNotificationChannel( cPush.createNotificationChannel(
channelId: PushConfig.OPPOChannelID, channelId: PushConfig.OPPOChannelID,
channelName: "消息推送", channelName: "消息推送",
channelDescription: channelDescription:
"The notification for chat message from Tencent Cloud IM" "The notification for chat message from Tencent Cloud IM"
); );
}
// create new notification channel
// require the permission for notification // require the permission for notification
cPush.requireNotificationPermission(); cPush.requireNotificationPermission();

View File

@ -13,10 +13,12 @@ import 'package:circle_app/util/SharedPreferencesHelper.dart';
import 'package:circle_app/util/device.dart'; import 'package:circle_app/util/device.dart';
import 'package:circle_app/util/util.dart'; import 'package:circle_app/util/util.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart'; import 'package:flutter_native_splash/flutter_native_splash.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:image_picker/image_picker.dart';
import 'package:oktoast/oktoast.dart'; import 'package:oktoast/oktoast.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:tencent_cloud_chat_uikit/business_logic/separate_models/tui_chat_separate_view_model.dart'; import 'package:tencent_cloud_chat_uikit/business_logic/separate_models/tui_chat_separate_view_model.dart';
@ -37,8 +39,32 @@ void main() {
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized(); WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding); FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
runApp(const MyApp()); runApp(const MyApp());
if (Platform.isAndroid) {
getLostData();
} }
}
Future<void> getLostData() async {
final ImagePicker picker = ImagePicker();
final LostDataResponse response = await picker.retrieveLostData();
if (response.isEmpty) {
return;
}
final List<XFile>? files = response.files;
if (files != null) {
_handleLostFiles(files);
} else {
_handleError(response.exception);
}
}
void _handleLostFiles(List<XFile> file) {}
Future<void> _handleError(dynamic error) async {
//
print('Error occurred: $error');
//
showToast('内存异常,请重新上传');
}
int IM_SDK_APP_ID = 1400799631; int IM_SDK_APP_ID = 1400799631;
String IOS_APP_ID = ""; String IOS_APP_ID = "";

View File

@ -1,9 +1,10 @@
class Api { class Api {
// static const baseUrl = 'https://leyuan666.com/zuul-service/'; static const baseUrl = 'https://leyuan666.com/zuul-service/';
static const baseUrl = 'http://192.168.3.55:2000/' ;
// static const baseUrl = 'http://192.168.3.55:2000/' ;
// //
@ -80,6 +81,15 @@ class Api {
static const getUserMine = 'user-service/my/main'; static const getUserMine = 'user-service/my/main';
//vip弹窗
static const getIsVips = 'mall-service/vips/show/';
//
static const getAddTrialCount = 'mall-service/vips/trialCount/';
// //
static const getUserInfo = 'user-service/my/home'; static const getUserInfo = 'user-service/my/home';

View File

@ -183,7 +183,19 @@ String getAgeCOntent(int gender, int age, int role, int orientation) {
return "${getGenderContent(gender)}·${age}·${getRoleContent(role)}·${getOrientationContent(orientation)}"; return "${getGenderContent(gender)}·${age}·${getRoleContent(role)}·${getOrientationContent(orientation)}";
} }
late ConfigBean configBean;
List<MyConfigData> numbers = [];
List<String> genderList = [];
List<String> orientationList = [];
List<String> roleList = [];
String getGenderContent(int number) { String getGenderContent(int number) {
if(genderList.length!=0){
return genderList[number-1];
}else {
switch (number) { switch (number) {
case 1: case 1:
return ""; return "";
@ -201,8 +213,12 @@ String getGenderContent(int number) {
return ""; return "";
} }
} }
}
String getOrientationContent(int number) { String getOrientationContent(int number) {
if(orientationList.length!=0){
return orientationList[number-1];
}else {
switch (number) { switch (number) {
case 1: case 1:
return "异性恋"; return "异性恋";
@ -222,8 +238,12 @@ String getOrientationContent(int number) {
return ""; return "";
} }
} }
}
String getRoleContent(int number) { String getRoleContent(int number) {
if(roleList.length!=0){
return roleList[number-1];
}else {
switch (number) { switch (number) {
case 1: case 1:
return "Sado"; return "Sado";
@ -239,6 +259,7 @@ String getRoleContent(int number) {
return ""; return "";
} }
} }
}
typedef void MyCallback(String path); typedef void MyCallback(String path);