2.1.8代码提交
This commit is contained in:
parent
d29f19c63b
commit
c4c0b8d155
@ -71,8 +71,8 @@ android {
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdkVersion 21
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode 67
|
||||
versionName "2.1.7"
|
||||
versionCode 68
|
||||
versionName "2.1.8"
|
||||
manifestPlaceholders = [
|
||||
vivo_APPID: "105669716",
|
||||
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
||||
@ -98,6 +98,15 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
def versionName = variant.versionName
|
||||
def newName = "wly_${versionName}.apk"
|
||||
if (output instanceof com.android.build.gradle.internal.api.BaseVariantOutputImpl) {
|
||||
output.outputFileName = newName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
BIN
circle_app/data/img/circle/lock_icon.png
Normal file
BIN
circle_app/data/img/circle/lock_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 796 B |
@ -160,8 +160,6 @@ PODS:
|
||||
- TXIMSDK_Plus_iOS (7.5.4864)
|
||||
- url_launcher_ios (0.0.1):
|
||||
- Flutter
|
||||
- video_compress (0.3.0):
|
||||
- Flutter
|
||||
- video_player_avfoundation (0.0.1):
|
||||
- Flutter
|
||||
- video_thumbnail (0.0.1):
|
||||
@ -210,7 +208,6 @@ DEPENDENCIES:
|
||||
- tencent_cloud_uikit_core (from `.symlinks/plugins/tencent_cloud_uikit_core/ios`)
|
||||
- tencent_open_file (from `.symlinks/plugins/tencent_open_file/ios`)
|
||||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||
- video_compress (from `.symlinks/plugins/video_compress/ios`)
|
||||
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`)
|
||||
- video_thumbnail (from `.symlinks/plugins/video_thumbnail/ios`)
|
||||
- wakelock (from `.symlinks/plugins/wakelock/ios`)
|
||||
@ -308,8 +305,6 @@ EXTERNAL SOURCES:
|
||||
:path: ".symlinks/plugins/tencent_open_file/ios"
|
||||
url_launcher_ios:
|
||||
:path: ".symlinks/plugins/url_launcher_ios/ios"
|
||||
video_compress:
|
||||
:path: ".symlinks/plugins/video_compress/ios"
|
||||
video_player_avfoundation:
|
||||
:path: ".symlinks/plugins/video_player_avfoundation/ios"
|
||||
video_thumbnail:
|
||||
@ -371,7 +366,6 @@ SPEC CHECKSUMS:
|
||||
TUICore: 524dc9e15b71b9bb646db7d2a3813fc69cb35c7b
|
||||
TXIMSDK_Plus_iOS: 51108658d2e277d85682d9e51d668632a1913591
|
||||
url_launcher_ios: 68d46cc9766d0c41dbdc884310529557e3cd7a86
|
||||
video_compress: fce97e4fb1dfd88175aa07d2ffc8a2f297f87fbe
|
||||
video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126
|
||||
video_thumbnail: c4e2a3c539e247d4de13cd545344fd2d26ffafd1
|
||||
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>aps-environment</key>
|
||||
<string>development</string>
|
||||
</dict>
|
||||
<dict/>
|
||||
</plist>
|
||||
|
||||
@ -2,6 +2,7 @@ import 'dart:convert';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/circle_app/chat/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_message_tooltip.dart';
|
||||
import 'package:circle_app/circle_app/chat/TIMUIKitChat/TIMUIKitMessageItem/tim_uikit_chat_text_elem.dart';
|
||||
import 'package:circle_app/circle_app/chat/TIMUIKitChat/TIMUIKitMessageItem/tim_uikit_merger_message_elem.dart';
|
||||
import 'package:circle_app/circle_app/chat/widget/chat_msg_card_item.dart';
|
||||
@ -19,7 +20,7 @@ import 'package:loading_animation_widget/loading_animation_widget.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/data_services/core/tim_uikit_wide_modal_operation_key.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/ui/utils/screen_utils.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_message_tooltip.dart';
|
||||
// import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_chat_message_tooltip.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitMessageItem/TIMUIKitMessageReaction/tim_uikit_message_reaction_select_emoji.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitMessageItem/tim_uikit_chat_text_translate_elem.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/ui/widgets/forward_message_screen.dart';
|
||||
|
||||
@ -2,6 +2,7 @@ import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:math';
|
||||
import 'package:circle_app/circle_app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart';
|
||||
import 'package:circle_app/circle_app/home/logic.dart';
|
||||
import 'package:circle_app/main.dart';
|
||||
import 'package:circle_app/net/api.dart';
|
||||
import 'package:circle_app/net/dio_manager.dart';
|
||||
@ -34,6 +35,7 @@ import '../../../../commons/Widgets/base_tip_widget.dart';
|
||||
import '../../../../commons/Widgets/open_vip_tip/view.dart';
|
||||
import '../../../../utils/eventBus.dart';
|
||||
import '../../../userinfo/logic.dart';
|
||||
import '../../view.dart';
|
||||
import '../../widget/send_gift_dialog.dart';
|
||||
|
||||
enum MuteStatus { none, me, all }
|
||||
@ -225,32 +227,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
|
||||
// 和onSubmitted一样,只是保持焦点的不同
|
||||
onEmojiSubmitted() {
|
||||
lastText = "";
|
||||
final text = textEditingController.text.trim();
|
||||
final convType = widget.conversationType;
|
||||
if (text.isNotEmpty && text != zeroWidthSpace) {
|
||||
if (widget.model.repliedMessage != null) {
|
||||
MessageUtils.handleMessageError(
|
||||
widget.model.sendReplyMessage(
|
||||
text: text,
|
||||
convID: widget.conversationID,
|
||||
convType: convType,
|
||||
atUserIDList: getUserIdFromMemberInfoMap(),
|
||||
),
|
||||
context);
|
||||
} else {
|
||||
MessageUtils.handleMessageError(
|
||||
widget.model.sendTextMessage(
|
||||
text: text,
|
||||
convID: widget.conversationID,
|
||||
convType: convType,
|
||||
),
|
||||
context);
|
||||
}
|
||||
textEditingController.clear();
|
||||
goDownBottom();
|
||||
}
|
||||
currentCursor = null;
|
||||
onSubmitted();
|
||||
}
|
||||
|
||||
// index为emoji的index,data为baseurl+name
|
||||
@ -604,8 +581,9 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
|
||||
List words = [];
|
||||
|
||||
HomeLogic logic = Get.find<HomeLogic>();
|
||||
|
||||
if (!isContain) {
|
||||
if (!isContain && !(widget.conversationID.contains('qpqz_prod_10_') || (logic.model?.id ?? 0) < 1000)) {
|
||||
var data = await DioManager.instance
|
||||
.post(url: Api.shieldWordCheck, params: {'text': text, 'type': 2});
|
||||
if (data['data']['code'] == 10000) {
|
||||
@ -646,6 +624,9 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
isSending = false;
|
||||
goDownBottom();
|
||||
_handleSendEditStatus("", false);
|
||||
|
||||
EventBusManager.fire(MsgSendSuccess());
|
||||
|
||||
} else {
|
||||
showOKToast('请输入消息内容');
|
||||
isSending = false;
|
||||
@ -1358,3 +1339,4 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ import 'dart:typed_data';
|
||||
|
||||
import 'package:circle_app/circle_app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_send_sound_message.dart';
|
||||
import 'package:circle_app/circle_app/chat/widget/send_gift_dialog.dart';
|
||||
import 'package:circle_app/circle_app/chat/widget/send_vip_tip_dialog.dart';
|
||||
import 'package:circle_app/circle_app/chat/widget/wish_dialog.dart';
|
||||
import 'package:circle_app/circle_app/minefragment/logic.dart';
|
||||
import 'package:circle_app/commons/Widgets/open_vip_tip/view.dart';
|
||||
@ -431,6 +432,16 @@ class _TIMTextFieldLayoutNarrowState
|
||||
);
|
||||
}
|
||||
|
||||
showSendVipDialog() {
|
||||
Get.bottomSheet(
|
||||
SendVipDialog(
|
||||
widget.conversationID,
|
||||
),
|
||||
isScrollControlled: true,
|
||||
enableDrag: false,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget tuiBuild(BuildContext context, TUIKitBuildValue value) {
|
||||
final theme = value.theme;
|
||||
@ -1117,6 +1128,10 @@ class _TIMTextFieldLayoutNarrowState
|
||||
}
|
||||
|
||||
Future checkVipStatus(int plate) async {
|
||||
// qpqz_prod_10_102
|
||||
if (widget.userId?.contains('qpqz_prod_10_') ?? false) {
|
||||
return true;
|
||||
}
|
||||
var data =
|
||||
await DioManager.instance.get(url: Api.getIsVips + plate.toString());
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/circle_app/chat/TIMUIKitChat/tim_uikit_chat.dart';
|
||||
import 'package:circle_app/circle_app/chat/widget/more_dialog.dart';
|
||||
import 'package:circle_app/circle_app/chat/widget/send_gift_dialog.dart';
|
||||
import 'package:circle_app/circle_app/chat/widget/send_vip_tip_dialog.dart';
|
||||
import 'package:circle_app/net/api.dart';
|
||||
import 'package:circle_app/net/dio_manager.dart';
|
||||
import 'package:circle_app/router/routers.dart';
|
||||
@ -37,15 +38,11 @@ class _ChatPageState extends State<ChatPage> {
|
||||
// final state = Get.find<ChatLogic>().state;
|
||||
|
||||
bool isShowTip = false;
|
||||
String tip = 'TA上传了形象照,您上传后更方便了解哦,点击前往';
|
||||
String tip = 'TA上传了形象照,您上传后更方便了解哦,';
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
sub.cancel();
|
||||
sub1.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
List tipSendVipIdlList = [];
|
||||
|
||||
int isNeedVip = 0;
|
||||
|
||||
final TIMUIKitChatController _timuiKitChatController =
|
||||
TIMUIKitChatController();
|
||||
@ -56,6 +53,17 @@ class _ChatPageState extends State<ChatPage> {
|
||||
bool isBlack = false;
|
||||
var sub;
|
||||
var sub1;
|
||||
var addSub;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
sub.cancel();
|
||||
sub1.cancel();
|
||||
addSub.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
@ -90,12 +98,16 @@ class _ChatPageState extends State<ChatPage> {
|
||||
|
||||
if (bean.isSuccess()) {
|
||||
otherUserBean = bean.data.user;
|
||||
|
||||
// 2"chatNeedVip" -> 1
|
||||
isNeedVip = data['data']['chatNeedVip'];
|
||||
if (!isShowTip) {
|
||||
|
||||
fetchMyAlbum(Api.getMyAlbum);
|
||||
}
|
||||
setState(() {});
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
loadIsShowSendGiftDialogData();
|
||||
@ -116,7 +128,7 @@ class _ChatPageState extends State<ChatPage> {
|
||||
bool isOtherHave = await loadCallOutListData(otherUserBean!.id!.toString());
|
||||
if (isOtherHave && !isMyHave) {
|
||||
isShowTip = true;
|
||||
tip = 'TA发布了喊话,您发布后形象会更完善,点击前往';
|
||||
tip = 'TA发布了喊话,您发布后形象会更完善,';
|
||||
} else if (otherUserBean!.userType == 1 && userInfoBean!.userType != 1) {
|
||||
isShowTip = true;
|
||||
tip = 'TA完成了good号认证,您认证后可获得多种特权,联系客服';
|
||||
@ -151,9 +163,11 @@ class _ChatPageState extends State<ChatPage> {
|
||||
}
|
||||
}
|
||||
|
||||
setState(() {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -189,6 +203,15 @@ class _ChatPageState extends State<ChatPage> {
|
||||
sub1 = EventBusManager.on<ChatRefreshMsg>().listen((event) async {
|
||||
_timuiKitChatController.refreshCurrentHistoryList();
|
||||
});
|
||||
|
||||
addSub = EventBusManager.on<MsgSendSuccess>().listen((event) {
|
||||
if (isNeedVip == 1) {
|
||||
if (!tipSendVipIdlList.contains(otherUserBean!.id!.toString())) {
|
||||
tipSendVipIdlList.add(otherUserBean!.id!.toString());
|
||||
Get.bottomSheet(SendVipDialog(otherUserBean!.account_id!),isScrollControlled:true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Widget renderCustomStickerPanel(
|
||||
@ -370,7 +393,7 @@ class _ChatPageState extends State<ChatPage> {
|
||||
} else {
|
||||
var result = await DioManager.instance.post(url: Api.goodAuth);
|
||||
if (result['code'] == 200) {
|
||||
showOKToast('发送成功');
|
||||
showOKToast('客服回复您了,前往消息列表查看~');
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -386,14 +409,19 @@ class _ChatPageState extends State<ChatPage> {
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
tip,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
tip,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Text('点击前往',style: TextStyle(color: AppColor.mainColor,fontSize: 12.sp),)
|
||||
],
|
||||
)),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
@ -564,3 +592,7 @@ class _ChatPageState extends State<ChatPage> {
|
||||
}
|
||||
|
||||
class ChatLoadUserInfoData {}
|
||||
|
||||
class MsgSendSuccess {
|
||||
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/commons/colors/app_color.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -62,9 +63,16 @@ class _ChatCircleShareDialogState extends State<ChatCircleShareDialog> {
|
||||
var bean = BaseResponse<InterestsBean>.fromJson(
|
||||
data, (data) => InterestsBean.fromJson(data));
|
||||
|
||||
circle = bean.data!;
|
||||
if (circle.lists.length < 20) {
|
||||
InterestsBean tempCircle = bean.data!;
|
||||
|
||||
if (tempCircle.lists.isEmpty) {
|
||||
isMore = false;
|
||||
} else {
|
||||
if (page == 1) {
|
||||
circle = tempCircle;
|
||||
} else {
|
||||
circle.lists.addAll(tempCircle.lists);
|
||||
}
|
||||
}
|
||||
setState(() {
|
||||
|
||||
@ -87,7 +95,13 @@ class _ChatCircleShareDialogState extends State<ChatCircleShareDialog> {
|
||||
|
||||
Container(
|
||||
height:Get.height * 0.5,
|
||||
color: Color(0xFF423055),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(10.sp),
|
||||
topLeft: Radius.circular(10.sp)),
|
||||
gradient: AppColor.bgHorLinearGradient,
|
||||
|
||||
),
|
||||
child: circle.lists.isEmpty
|
||||
? !isMore
|
||||
? noResultWidget()
|
||||
|
||||
@ -66,7 +66,7 @@ class _ChatGiftPannelState extends State<ChatGiftPannel>
|
||||
children: [
|
||||
Expanded(child: Container()),
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 10.sp,right: 15.sp),
|
||||
margin: EdgeInsets.only(bottom: 10.sp,left: 15.sp),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
showRechargeScreenDialog().then((value) {
|
||||
@ -75,7 +75,7 @@ class _ChatGiftPannelState extends State<ChatGiftPannel>
|
||||
},
|
||||
child: Container(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Image.asset(getMineImage('bi_icon4'),width: 30.sp,),
|
||||
Text('首充大礼包',style: TextStyle(color: AppColor.mainColor,fontSize: 16.sp,fontWeight: FontWeight.bold),)
|
||||
|
||||
@ -73,7 +73,7 @@ class _GiftState extends State<Gift> {
|
||||
AssetsDataDataPriceConfs info =
|
||||
AssetsDataDataPriceConfs.fromJson(response.last);
|
||||
balanceTipStr = info.remark!.isNotEmpty
|
||||
? '首冲最高赠送' + info.remark!.split('送').last + '>'
|
||||
? '首充最高赠送' + info.remark!.split('送').last + '>'
|
||||
: '充值>';
|
||||
}
|
||||
}
|
||||
@ -139,7 +139,7 @@ class _GiftState extends State<Gift> {
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
SizedBox(
|
||||
width: 16.sp,
|
||||
width: 8.sp,
|
||||
),
|
||||
Text(
|
||||
balanceTipStr,
|
||||
|
||||
138
circle_app/lib/circle_app/chat/widget/send_vip_tip_dialog.dart
Normal file
138
circle_app/lib/circle_app/chat/widget/send_vip_tip_dialog.dart
Normal file
@ -0,0 +1,138 @@
|
||||
|
||||
import 'package:circle_app/commons/colors/app_color.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'chat_gift_pannel.dart';
|
||||
|
||||
|
||||
|
||||
class SendVipDialog extends StatefulWidget {
|
||||
|
||||
String conversationID;
|
||||
SendVipDialog(this.conversationID);
|
||||
@override
|
||||
_SendVipDialogState createState() => new _SendVipDialogState();
|
||||
|
||||
}
|
||||
|
||||
class _SendVipDialogState extends State<SendVipDialog> {
|
||||
// TODO: add state variables and methods
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// TODO: add widget build method
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Center(
|
||||
child: Container(
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: 170.sp
|
||||
),
|
||||
margin: EdgeInsets.only(left: 15.sp,right: 15.sp),
|
||||
padding: EdgeInsets.only(left: 15.sp,right: 15.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.sp),
|
||||
gradient: AppColor.bgHorLinearGradient
|
||||
// gradient: LinearGradient(colors: [Color(0xFF4C3E5F),Color(0xFF324140)]),
|
||||
// border: Gra0ientBoxBorder(
|
||||
// gradient:
|
||||
// AppColor.mainVerLinearGradient,
|
||||
// width: 1.sp,
|
||||
// ),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(height: 20.sp,),
|
||||
Container(
|
||||
child: Text(
|
||||
'温馨提示',
|
||||
style: TextStyle(color: Colors.white.withOpacity(0.75), fontSize: 17.sp,),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 12.sp),
|
||||
child: Text(
|
||||
'因对方未开会员可能回不了您的消息,可以帮他解锁会员【成为会员】,畅聊更多话题~',
|
||||
style: TextStyle(color: Colors.white, fontSize: 15.sp),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20.sp,),
|
||||
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
|
||||
},
|
||||
child: Container(
|
||||
height: 42.sp,
|
||||
width: 126.sp,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(21.sp),
|
||||
color: Color(0x26FFFFFF)
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'放弃',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
Get.back();
|
||||
Get.bottomSheet(
|
||||
ChatGiftPannel(
|
||||
accid: widget.conversationID,
|
||||
selectedIndex: 1,
|
||||
),
|
||||
isScrollControlled: false,
|
||||
enableDrag: false,
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
height: 42.sp,
|
||||
width: 126.sp,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(21.sp),
|
||||
gradient: AppColor.mainVerLinearGradient
|
||||
),
|
||||
child: Text(
|
||||
'解锁',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -33,12 +33,16 @@ class _SvgDialogState extends State<SvgDialog>
|
||||
void loadAnimation() async {
|
||||
final videoItem = await SVGAParser.shared.decodeFromURL(
|
||||
widget.url);
|
||||
animationController.videoItem = videoItem;
|
||||
animationController
|
||||
.forward() // Try to use .forward() .reverse()
|
||||
.whenComplete(() {
|
||||
Get.back();
|
||||
});
|
||||
try {
|
||||
animationController.videoItem = videoItem;
|
||||
animationController
|
||||
.forward() // Try to use .forward() .reverse()
|
||||
.whenComplete(() {
|
||||
Get.back();
|
||||
});
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -144,168 +144,166 @@ class _WishDialogState extends State<WishDialog> {
|
||||
Get.back();
|
||||
},
|
||||
child: Container())),
|
||||
SafeArea(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(10.sp),
|
||||
bottomRight: Radius.circular(10.sp)),
|
||||
color: Color(0xFF423055),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 8.sp, bottom: 15.sp),
|
||||
width: 30.sp,
|
||||
height: 3.sp,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0x33FFFFFF),
|
||||
borderRadius: BorderRadius.circular(1.5.sp)),
|
||||
),
|
||||
Text(
|
||||
'对方满足你的愿望后要尽快兑现承诺哈,感恩是你们建立稳定关系的保障哦~',
|
||||
style: TextStyle(color: Colors.white, fontSize: 15.sp),
|
||||
),
|
||||
Container(
|
||||
height: tipStr.isNotEmpty ? 145.sp : 122.sp,
|
||||
margin: EdgeInsets.only(top: 12.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.sp),
|
||||
gradient: LinearGradient(
|
||||
colors: [Color(0xFF132B40), Color(0xFF251240)])),
|
||||
child: Column(
|
||||
children: [
|
||||
if (tipStr.isNotEmpty)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 6.sp),
|
||||
child: Text(
|
||||
'礼物送出后,获得$tipStr小时的消息置顶',
|
||||
style: TextStyle(
|
||||
color: AppColor.mainColor,
|
||||
fontSize: 12.sp,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
giftGridWidget(),
|
||||
],
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
showOptionPiker(withStr);
|
||||
},
|
||||
// behavior: HitTestBehavior.opaque,
|
||||
child: Container(
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 10.sp, right: 10.sp),
|
||||
margin: EdgeInsets.only(top: 12.sp),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0x1AFFFFFF),
|
||||
borderRadius: BorderRadius.circular(15.sp)),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'选择感恩方式',
|
||||
style: TextStyle(
|
||||
color: Color(0xB3FFFFFF), fontSize: 15.sp),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
withStr.isNotEmpty ? withStr : '请选择',
|
||||
style: TextStyle(
|
||||
color: withStr.isNotEmpty
|
||||
? AppColor.mainColor
|
||||
: Colors.white,
|
||||
fontSize: 15.sp),
|
||||
),
|
||||
Image.asset(
|
||||
getHomeImage('icon_in'),
|
||||
width: 24.sp,
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 12.sp, bottom: 15.sp),
|
||||
padding: EdgeInsets.only(left: 30.sp, right: 30.sp),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (selectedIndex < 0) {
|
||||
showOKToast('请选择一个礼物');
|
||||
return;
|
||||
}
|
||||
var info = giftList[selectedIndex];
|
||||
sendInventWishCustomMsg(
|
||||
widget.accId, jsonEncode(info), '邀请你许个愿');
|
||||
},
|
||||
child: Container(
|
||||
height: 42.sp,
|
||||
width: 136.sp,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(21.sp),
|
||||
gradient: AppColor.mainVerLinearGradient,
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'邀请对方许愿',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 15.sp, right: 15.sp,bottom: MediaQuery.of(context).padding.bottom),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(10.sp),
|
||||
topLeft: Radius.circular(10.sp)),
|
||||
gradient: AppColor.bgHorLinearGradient,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 8.sp, bottom: 15.sp),
|
||||
width: 30.sp,
|
||||
height: 3.sp,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0x33FFFFFF),
|
||||
borderRadius: BorderRadius.circular(1.5.sp)),
|
||||
),
|
||||
Text(
|
||||
'对方满足你的愿望后要尽快兑现承诺哈,感恩是你们建立稳定关系的保障哦~',
|
||||
style: TextStyle(color: Colors.white, fontSize: 15.sp),
|
||||
),
|
||||
Container(
|
||||
height: tipStr.isNotEmpty ? 145.sp : 122.sp,
|
||||
margin: EdgeInsets.only(top: 12.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.sp),
|
||||
gradient: LinearGradient(
|
||||
colors: [Color(0xFF132B40), Color(0xFF251240)])),
|
||||
child: Column(
|
||||
children: [
|
||||
if (tipStr.isNotEmpty)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 6.sp),
|
||||
child: Text(
|
||||
'礼物送出后,获得$tipStr小时的消息置顶',
|
||||
style: TextStyle(
|
||||
color: AppColor.mainColor,
|
||||
fontSize: 12.sp,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (selectedIndex < 0) {
|
||||
showOKToast('请选择一个礼物');
|
||||
return;
|
||||
} else if (withStr.isEmpty) {
|
||||
showOKToast('请选择感恩方式');
|
||||
return;
|
||||
}
|
||||
var info = giftList[selectedIndex];
|
||||
info['option'] = withStr;
|
||||
sendGetWishCustomMsg(widget.accId, jsonEncode(info),
|
||||
'许愿:想要${info['name']}');
|
||||
},
|
||||
child: Container(
|
||||
height: 42.sp,
|
||||
width: 136.sp,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(21.sp),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFF7660FF),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
giftGridWidget(),
|
||||
],
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
showOptionPiker(withStr);
|
||||
},
|
||||
// behavior: HitTestBehavior.opaque,
|
||||
child: Container(
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 10.sp, right: 10.sp),
|
||||
margin: EdgeInsets.only(top: 12.sp),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0x1AFFFFFF),
|
||||
borderRadius: BorderRadius.circular(15.sp)),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'选择感恩方式',
|
||||
style: TextStyle(
|
||||
color: Color(0xB3FFFFFF), fontSize: 15.sp),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
withStr.isNotEmpty ? withStr : '请选择',
|
||||
style: TextStyle(
|
||||
color: withStr.isNotEmpty
|
||||
? AppColor.mainColor
|
||||
: Colors.white,
|
||||
fontSize: 15.sp),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
'立即许愿',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
Image.asset(
|
||||
getHomeImage('icon_in'),
|
||||
width: 24.sp,
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 12.sp, bottom: 15.sp),
|
||||
padding: EdgeInsets.only(left: 30.sp, right: 30.sp),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (selectedIndex < 0) {
|
||||
showOKToast('请选择一个礼物');
|
||||
return;
|
||||
}
|
||||
var info = giftList[selectedIndex];
|
||||
sendInventWishCustomMsg(
|
||||
widget.accId, jsonEncode(info), '邀请你许个愿');
|
||||
},
|
||||
child: Container(
|
||||
height: 42.sp,
|
||||
width: 136.sp,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(21.sp),
|
||||
gradient: AppColor.mainVerLinearGradient,
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'邀请对方许愿',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (selectedIndex < 0) {
|
||||
showOKToast('请选择一个礼物');
|
||||
return;
|
||||
} else if (withStr.isEmpty) {
|
||||
showOKToast('请选择感恩方式');
|
||||
return;
|
||||
}
|
||||
var info = giftList[selectedIndex];
|
||||
info['option'] = withStr;
|
||||
sendGetWishCustomMsg(widget.accId, jsonEncode(info),
|
||||
'许愿:想要${info['name']}');
|
||||
},
|
||||
child: Container(
|
||||
height: 42.sp,
|
||||
width: 136.sp,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(21.sp),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFF7660FF),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
'立即许愿',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
|
||||
@ -39,6 +39,7 @@ class CircleLogic extends GetxController {
|
||||
final RefreshController refreshController = RefreshController();
|
||||
final RefreshController peopleRefreshController = RefreshController();
|
||||
|
||||
List visibleItems = [];
|
||||
|
||||
bool isShowLocationDialog = false;
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ import 'package:circle_app/circle_app/dialog/ScreenBottomSheetDialog.dart';
|
||||
import 'package:circle_app/circle_app/circle/view.dart';
|
||||
import 'package:circle_app/circle_app/home/logic.dart';
|
||||
import 'package:circle_app/commons/Widgets/base_tip_widget.dart';
|
||||
import 'package:circle_app/commons/colors/app_color.dart';
|
||||
import 'package:circle_app/router/routers.dart';
|
||||
import 'package:circle_app/utils/eventBus.dart';
|
||||
import 'package:circle_app/utils/util.dart';
|
||||
@ -19,16 +20,13 @@ import 'package:flutter_pickers/style/picker_style.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_swiper/flutter_swiper.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:gradient_borders/gradient_borders.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
|
||||
import '../../commons/Widgets/today_people_dialog.dart';
|
||||
import '../../commons/colors/app_color.dart';
|
||||
import '../../net/api.dart';
|
||||
import '../../net/dio_manager.dart';
|
||||
import '../../utils/cache_img.dart';
|
||||
import '../minefragment/logic.dart';
|
||||
import '../select_circle/logic.dart';
|
||||
import '../userinfo/logic.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
@ -104,14 +102,16 @@ class _CirclePageState extends State<CirclePage>
|
||||
super.build(context);
|
||||
|
||||
return GetBuilder<CircleLogic>(builder: (controller) {
|
||||
if (currentIndex == 0) {
|
||||
logic.isNewPeopleRed = false;
|
||||
}
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: SafeArea(
|
||||
child: Stack(
|
||||
children: [
|
||||
Column(children: [
|
||||
navigatorItem(controller.statistics.value)
|
||||
,
|
||||
navigatorItem(controller.statistics.value),
|
||||
// Text(controller.state.msg),
|
||||
//组件使用
|
||||
]),
|
||||
@ -529,7 +529,6 @@ class _CirclePageState extends State<CirclePage>
|
||||
return Swiper(
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var bean = logic.circle.lists[index];
|
||||
// final GlobalKey<InfoListViewState> infoListViewKey = GlobalKey<InfoListViewState>();
|
||||
return InfoListView(index, bean, logic);
|
||||
},
|
||||
onIndexChanged: (index) async {
|
||||
@ -628,7 +627,9 @@ class _CirclePageState extends State<CirclePage>
|
||||
getMsgImage('gift'),
|
||||
width: 14.sp,
|
||||
),
|
||||
SizedBox(width: 2.sp,),
|
||||
SizedBox(
|
||||
width: 2.sp,
|
||||
),
|
||||
Text(
|
||||
homelogic.inventStr,
|
||||
style: TextStyle(
|
||||
@ -668,14 +669,37 @@ class _CirclePageState extends State<CirclePage>
|
||||
: Positioned(
|
||||
left: 0,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.DisCover);
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('clocked_icon'),
|
||||
width: 65.sp,
|
||||
),
|
||||
)),
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.DisCover);
|
||||
},
|
||||
child: Container(
|
||||
// width: 70.sp,
|
||||
padding: EdgeInsets.only(
|
||||
left: 6.sp, right: 6.sp, top: 4.sp, bottom: 4.sp),
|
||||
// height: 26.sp,
|
||||
decoration: BoxDecoration(
|
||||
gradient: AppColor.mainVerLinearGradient,
|
||||
borderRadius: BorderRadius.circular(13.sp)),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('lock_icon'),
|
||||
height: 18.sp,
|
||||
),
|
||||
SizedBox(
|
||||
width: 2.sp,
|
||||
),
|
||||
Text(
|
||||
'已解锁',
|
||||
style: TextStyle(
|
||||
color: Color(0xFFF7FAFA),
|
||||
fontSize: 13.sp,
|
||||
fontWeight: FontWeight.w500),
|
||||
)
|
||||
],
|
||||
),
|
||||
))),
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
//padding: EdgeInsets.symmetric(horizontal: 10.sp),
|
||||
@ -792,7 +816,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
logic.snedHelloMoreData();
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 2.sp,right: 2.sp),
|
||||
padding: EdgeInsets.only(left: 2.sp, right: 2.sp),
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
@ -802,7 +826,6 @@ class _CirclePageState extends State<CirclePage>
|
||||
// SizedBox(width: 2.sp,),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4.sp),
|
||||
|
||||
child: Text(
|
||||
'30',
|
||||
style: TextStyle(
|
||||
@ -830,11 +853,15 @@ class _CirclePageState extends State<CirclePage>
|
||||
: Row(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: ()async {
|
||||
onTap: () async {
|
||||
if (_tabController.index == 2) {
|
||||
var data = await DioManager.instance.get(url: Api.getUserMine);
|
||||
var bean = BaseResponse<MineResponseBean>.fromJson(
|
||||
data, (data) => MineResponseBean.fromJson(data));
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.getUserMine);
|
||||
var bean =
|
||||
BaseResponse<MineResponseBean>.fromJson(
|
||||
data,
|
||||
(data) =>
|
||||
MineResponseBean.fromJson(data));
|
||||
User userInfoBean = bean.data.user;
|
||||
|
||||
if (userInfoBean.vip > 0) {
|
||||
@ -843,8 +870,6 @@ class _CirclePageState extends State<CirclePage>
|
||||
showOKToast('领取特权之后更容易上精选');
|
||||
showOepnVipDialog();
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
Get.bottomSheet(
|
||||
TodayPeopleDialog(isShow: true),
|
||||
@ -887,20 +912,22 @@ class _CirclePageState extends State<CirclePage>
|
||||
return ScreenBottomSheetDialog(
|
||||
genderList: _tabController.index == 1
|
||||
? logic.genderList
|
||||
: _tabController.index == 0
|
||||
? logic.new_genderList
|
||||
: logic.dis_genderList,
|
||||
: _tabController.index == 0
|
||||
? logic.new_genderList
|
||||
: logic.dis_genderList,
|
||||
orientationList: _tabController.index == 1
|
||||
? logic.orientationList
|
||||
: _tabController.index == 0
|
||||
? logic.new_orientationList
|
||||
:logic.dis_orientationList,
|
||||
roleList:
|
||||
_tabController.index == 1 ? logic.roleList : _tabController.index == 0 ? logic.new_roleList : logic.dis_roleList,
|
||||
? logic.new_orientationList
|
||||
: logic.dis_orientationList,
|
||||
roleList: _tabController.index == 1
|
||||
? logic.roleList
|
||||
: _tabController.index == 0
|
||||
? logic.new_roleList
|
||||
: logic.dis_roleList,
|
||||
isHaveCity: _tabController.index == 1,
|
||||
callback: (genderList, orientationList, roleList) {
|
||||
if (_tabController.index == 1) {
|
||||
|
||||
EventBusManager.fire(NearScrollTap());
|
||||
_onRefresh();
|
||||
} else if (_tabController.index == 0) {
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
@ -31,6 +32,8 @@ import 'dart:ui' as ui show PlaceholderAlignment;
|
||||
|
||||
const String todayAddWxStatus = 'todayAddWxStatus';
|
||||
|
||||
const String firstContactTip = 'firstContactTip';
|
||||
|
||||
class Discover extends StatefulWidget {
|
||||
int unlockWxNum;
|
||||
Discover(this.unlockWxNum, {super.key});
|
||||
@ -76,12 +79,21 @@ class _DiscoverState extends State<Discover>
|
||||
|
||||
final GlobalKey _key = GlobalKey();
|
||||
|
||||
Timer? _timer;
|
||||
|
||||
int _start = 2;
|
||||
|
||||
void animateToOffset(ScrollController controller, double offset,
|
||||
void Function() onScrollCompleted) {
|
||||
controller
|
||||
.animateTo(offset,
|
||||
duration: const Duration(milliseconds: 200), curve: Curves.easeIn)
|
||||
.then((value) {
|
||||
if (widget.unlockWxNum == 0) {
|
||||
stopTimer();
|
||||
startTimer();
|
||||
}
|
||||
|
||||
if (onScrollCompleted != null) {
|
||||
onScrollCompleted();
|
||||
}
|
||||
@ -141,12 +153,39 @@ class _DiscoverState extends State<Discover>
|
||||
};
|
||||
}
|
||||
|
||||
void startTimer() {
|
||||
stopTimer(); // 确保定时器每次启动前都已停止
|
||||
_start = 2;
|
||||
_timer = Timer.periodic(Duration(seconds: 1), (timer) {
|
||||
if (_start == 0) {
|
||||
sendRequest();
|
||||
stopTimer();
|
||||
} else {
|
||||
_start--;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void stopTimer() {
|
||||
if (_timer != null) {
|
||||
_timer!.cancel();
|
||||
_timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sendRequest() async {
|
||||
var data =
|
||||
await DioManager.getInstance().postBody(url: Api.visitUserById,params: {'id': list[lastPage]['id']});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
super.dispose();
|
||||
if (widget.unlockWxNum == 0) {
|
||||
subscripition.cancel();
|
||||
stopTimer();
|
||||
}
|
||||
sub.cancel();
|
||||
sub1.cancel();
|
||||
@ -477,22 +516,46 @@ class _DiscoverState extends State<Discover>
|
||||
}
|
||||
|
||||
void checkIsPopWxTip() async {
|
||||
SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance();
|
||||
var date = DateTime.now();
|
||||
final dateFormat = DateFormat("yyyy-MM-dd");
|
||||
final date2 = dateFormat.format(date);
|
||||
if (sp.preferences!.containsKey(todayAddWxStatus)) {
|
||||
var lastDate = sp.preferences!.getString(todayAddWxStatus);
|
||||
if (lastDate != date2) {
|
||||
loadWxNumData();
|
||||
sp.preferences!.setString(todayAddWxStatus, date2);
|
||||
}
|
||||
} else {
|
||||
sp.preferences!.setString(todayAddWxStatus, date2);
|
||||
bool isShow = await isFirstContactTip();
|
||||
if (isShow) {
|
||||
loadWxNumData();
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> isFirstContactTip() async {
|
||||
SharedPreferencesHelper preferences = await SharedPreferencesHelper.getInstance();
|
||||
String time = await preferences!.getString(firstContactTip) ?? '';
|
||||
if (time.isNotEmpty) {
|
||||
DateTime dateTime = DateTime.parse(time);
|
||||
bool isShow = !isWithinOneMonth(dateTime,DateTime.now());
|
||||
if (isShow) {
|
||||
preferences!.setString(firstContactTip, DateTime.now().toString());
|
||||
}
|
||||
return isShow;
|
||||
} else {
|
||||
preferences!.setString(firstContactTip, DateTime.now().toString());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isWithinOneMonth(DateTime time1, DateTime time2) {
|
||||
// 加上一个月
|
||||
DateTime time1PlusOneMonth = DateTime(
|
||||
time1.year,
|
||||
time1.month + 1,
|
||||
time1.day,
|
||||
time1.hour,
|
||||
time1.minute,
|
||||
time1.second,
|
||||
time1.millisecond,
|
||||
time1.microsecond,
|
||||
);
|
||||
|
||||
// 检查 time2 是否在 time1 和 time1PlusOneMonth 之间
|
||||
return time2.isAfter(time1) && time2.isBefore(time1PlusOneMonth);
|
||||
}
|
||||
|
||||
|
||||
loadWxNumData() async {
|
||||
var data = await DioManager.instance.get(
|
||||
url: Api.checkWxNumState,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/circle_app/circle/logic.dart';
|
||||
import 'package:circle_app/circle_app/circle/view.dart';
|
||||
@ -14,6 +16,7 @@ import 'package:get/get_core/src/get_main.dart';
|
||||
import 'package:gradient_borders/box_borders/gradient_box_border.dart';
|
||||
import 'package:keframe/keframe.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import 'package:visibility_detector/visibility_detector.dart';
|
||||
|
||||
import '../../../commons/Widgets/tag_widget.dart';
|
||||
import 'package:flutter_bmflocation/flutter_bmflocation.dart';
|
||||
@ -21,6 +24,8 @@ import 'package:flutter_bmflocation/flutter_bmflocation.dart';
|
||||
import '../../../commons/colors/app_color.dart';
|
||||
import 'dart:ui' as ui show PlaceholderAlignment;
|
||||
|
||||
import '../../../net/api.dart';
|
||||
import '../../../net/dio_manager.dart';
|
||||
import '../../../utils/cache_img.dart';
|
||||
|
||||
class Vicinity extends StatefulWidget {
|
||||
@ -38,6 +43,11 @@ class _VicinityState extends State<Vicinity>
|
||||
ScrollController _scrollController = ScrollController();
|
||||
|
||||
double maxOff = 0;
|
||||
|
||||
|
||||
bool isScrolling = false;
|
||||
Timer? _timer;
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
@override
|
||||
@ -59,7 +69,12 @@ class _VicinityState extends State<Vicinity>
|
||||
// TODO: implement dispose
|
||||
super.dispose();
|
||||
_scrollController.dispose();
|
||||
try {
|
||||
_scrollController.position.isScrollingNotifier.removeListener(isScrollingListener);
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
_timer?.cancel();
|
||||
sub.cancel();
|
||||
}
|
||||
|
||||
@ -82,14 +97,24 @@ class _VicinityState extends State<Vicinity>
|
||||
padding: EdgeInsets.all(10.sp),
|
||||
itemCount: widget.logic.vicinityList.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
_scrollController.position.isScrollingNotifier
|
||||
.addListener(isScrollingListener);
|
||||
if (index == 0) {
|
||||
return bannerView(widget.logic);
|
||||
} else {
|
||||
return FrameSeparateWidget(
|
||||
index: index,
|
||||
child: ListItem(
|
||||
child: VisibilityDetector(
|
||||
key: Key(index.toString()),
|
||||
onVisibilityChanged: (visibilityInfo) {
|
||||
_onVisibilityChanged(
|
||||
index - 1,
|
||||
visibilityInfo.visibleFraction > 0.0,
|
||||
);
|
||||
},
|
||||
child: ListItem(
|
||||
widget.logic.vicinityList[index - 1],
|
||||
index - 1));
|
||||
index - 1)));
|
||||
}
|
||||
},
|
||||
),
|
||||
@ -121,6 +146,59 @@ class _VicinityState extends State<Vicinity>
|
||||
});
|
||||
}
|
||||
|
||||
void _onVisibilityChanged(int index, bool visible) async {
|
||||
int id = widget.logic.vicinityList[index].id;
|
||||
if (visible) {
|
||||
if (!widget.logic.visibleItems.contains(id)) {
|
||||
widget.logic.visibleItems.add(id);
|
||||
}
|
||||
} else {
|
||||
widget.logic.visibleItems.remove(id);
|
||||
}
|
||||
}
|
||||
|
||||
void isScrollingListener() {
|
||||
if (_scrollController.hasClients && _scrollController.position.isScrollingNotifier.hasListeners) {
|
||||
isScrolling = _scrollController.position.isScrollingNotifier.value;
|
||||
if (isScrolling) {
|
||||
isScrolling = true;
|
||||
_stopTimer();
|
||||
} else {
|
||||
|
||||
_startTimer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void _startTimer() {
|
||||
// isScrolling = true;
|
||||
_timer?.cancel(); // 取消现有的定时器
|
||||
_timer = Timer(Duration(seconds: 1), _executeTask);
|
||||
}
|
||||
|
||||
void _stopTimer() {
|
||||
_timer?.cancel();
|
||||
}
|
||||
|
||||
void _executeTask() {
|
||||
if (!isScrolling) {
|
||||
// 在这里执行你的任务
|
||||
print("执行任务");
|
||||
isScrolling = false;
|
||||
sendReadPeopleData();
|
||||
_stopTimer();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sendReadPeopleData() async {
|
||||
var data =
|
||||
await DioManager.getInstance().post(
|
||||
url: Api.visitUserByIds, params: {'ids': widget.logic.visibleItems});
|
||||
}
|
||||
|
||||
|
||||
Widget bannerView(CircleLogic controller) {
|
||||
return SizedBox(
|
||||
height: 160.sp,
|
||||
|
||||
@ -110,76 +110,87 @@ class _CircleListPageState extends State<CircleListPage>
|
||||
logic.update();
|
||||
}
|
||||
|
||||
return logic.isLoadFial ? noResultWidget(tip:'',callBack: () {
|
||||
logic.isLoadFial = false;
|
||||
logic.isLoad = true;
|
||||
logic.update();
|
||||
logic.loadMyInfo();
|
||||
logic.loadData();
|
||||
}) : logic.isLoad
|
||||
? loaddingWidget(true)
|
||||
: Container(
|
||||
width: Get.width,
|
||||
height: Get.height,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 65.sp,
|
||||
child: Column(
|
||||
children: [
|
||||
leftItem('', logic.currentIndex == -1, false, -1),
|
||||
leftItem('', logic.currentIndex == -2, false, -2),
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
height: 20,
|
||||
child: Container(
|
||||
width: 33.sp,
|
||||
height: 1.sp,
|
||||
color: Color(0x4DFFFFFF),
|
||||
)),
|
||||
Expanded(
|
||||
child: MediaQuery.removePadding(
|
||||
removeTop: true,
|
||||
context: context,
|
||||
child: ListView.builder(
|
||||
controller: logic.myCircleCtr,
|
||||
itemBuilder: (context, index) {
|
||||
return leftItem(
|
||||
logic.mycircle.lists[index].title,
|
||||
logic.currentIndex == index,
|
||||
logic.hasNewList.length > index
|
||||
? logic.hasNewList[index]
|
||||
: false,
|
||||
index);
|
||||
},
|
||||
itemCount: logic.mycircle.lists.length,
|
||||
)))
|
||||
],
|
||||
)),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: logic.currentIndex == -1
|
||||
? circleRecommandWidget()
|
||||
: logic.currentIndex == -2
|
||||
? LikeView(
|
||||
changeCallback: () {
|
||||
logic.currentIndex = -1;
|
||||
logic.update();
|
||||
},
|
||||
)
|
||||
: RightCircleIten( logic.currentIndex,
|
||||
logic.mycircle
|
||||
.lists[logic.currentIndex],
|
||||
logic,key: ValueKey(
|
||||
'${logic.mycircle.lists[logic.currentIndex].id.toString() + logic.currentIndex.toString()}'),)))
|
||||
return logic.isLoadFial
|
||||
? noResultWidget(
|
||||
tip: '',
|
||||
callBack: () {
|
||||
logic.isLoadFial = false;
|
||||
logic.isLoad = true;
|
||||
logic.update();
|
||||
logic.loadMyInfo();
|
||||
logic.loadData();
|
||||
})
|
||||
: logic.isLoad
|
||||
? loaddingWidget(true)
|
||||
: Container(
|
||||
width: Get.width,
|
||||
height: Get.height,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 65.sp,
|
||||
child: Column(
|
||||
children: [
|
||||
leftItem(
|
||||
'', logic.currentIndex == -1, false, -1),
|
||||
leftItem(
|
||||
'', logic.currentIndex == -2, false, -2),
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
height: 20,
|
||||
child: Container(
|
||||
width: 33.sp,
|
||||
height: 1.sp,
|
||||
color: Color(0x4DFFFFFF),
|
||||
)),
|
||||
Expanded(
|
||||
child: MediaQuery.removePadding(
|
||||
removeTop: true,
|
||||
context: context,
|
||||
child: ListView.builder(
|
||||
controller: logic.myCircleCtr,
|
||||
itemBuilder: (context, index) {
|
||||
return leftItem(
|
||||
logic.mycircle.lists[index]
|
||||
.title,
|
||||
logic.currentIndex == index,
|
||||
logic.hasNewList.length >
|
||||
index
|
||||
? logic.hasNewList[index]
|
||||
: false,
|
||||
index);
|
||||
},
|
||||
itemCount:
|
||||
logic.mycircle.lists.length,
|
||||
)))
|
||||
],
|
||||
)),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: logic.currentIndex == -1
|
||||
? circleRecommandWidget()
|
||||
: logic.currentIndex == -2
|
||||
? LikeView(
|
||||
changeCallback: () {
|
||||
logic.currentIndex = -1;
|
||||
logic.update();
|
||||
},
|
||||
)
|
||||
: RightCircleIten(
|
||||
logic.currentIndex,
|
||||
logic.mycircle
|
||||
.lists[logic.currentIndex],
|
||||
logic,
|
||||
key: ValueKey(
|
||||
'${logic.mycircle.lists[logic.currentIndex].id.toString() + logic.currentIndex.toString()}'),
|
||||
)))
|
||||
|
||||
// InfoListView(
|
||||
// InfoListView(
|
||||
|
||||
|
||||
// )))
|
||||
],
|
||||
),
|
||||
);
|
||||
// )))
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
@ -638,7 +649,7 @@ class _CircleListPageState extends State<CircleListPage>
|
||||
));
|
||||
}
|
||||
|
||||
leftItem(String text, bool isSelcted, bool isUnread, int index) {
|
||||
leftItem(String text, bool isSelcted, bool isUnread, int index) {
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () async {
|
||||
@ -687,9 +698,11 @@ class _CircleListPageState extends State<CircleListPage>
|
||||
maxWidth: double.infinity,
|
||||
minHeight: 0.0,
|
||||
maxHeight: double.infinity,
|
||||
child: Image.asset(getCircleImage('circle_selected_bg'),width: 65.sp,),
|
||||
child: Image.asset(
|
||||
getCircleImage('circle_selected_bg'),
|
||||
width: 65.sp,
|
||||
),
|
||||
),
|
||||
|
||||
if (text.isEmpty && index == -1)
|
||||
topCicleStatusItem(
|
||||
isSelcted,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
// import 'package:flutter_install_app/flutter_install_app.dart';
|
||||
import 'package:flutter_install_app/flutter_install_app.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
@ -302,7 +302,7 @@ class _CustomDialogState extends State<UpdateDialog> {
|
||||
|
||||
installApk() async {
|
||||
//flutter_install_app
|
||||
// await AppInstaller.installApk(filePath, actionRequired: false);
|
||||
await AppInstaller.installApk(filePath, actionRequired: false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,132 @@
|
||||
import 'package:circle_app/circle_app/home/logic.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:circle_app/commons/colors/app_color.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../circle_list/logic.dart';
|
||||
|
||||
class LikePeoleSendedCallOutDialog extends StatelessWidget {
|
||||
String desc;
|
||||
// TODO: add state variables, methods and constructor params
|
||||
LikePeoleSendedCallOutDialog(this.desc);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// TODO: add widget build method
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Center(
|
||||
child: Container(
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: 170.sp
|
||||
),
|
||||
margin: EdgeInsets.only(left: 15.sp,right: 15.sp),
|
||||
padding: EdgeInsets.only(left: 15.sp,right: 15.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.sp),
|
||||
gradient: AppColor.bgHorLinearGradient
|
||||
// gradient: LinearGradient(colors: [Color(0xFF4C3E5F),Color(0xFF324140)]),
|
||||
// border: Gra0ientBoxBorder(
|
||||
// gradient:
|
||||
// AppColor.mainVerLinearGradient,
|
||||
// width: 1.sp,
|
||||
// ),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(height: 20.sp,),
|
||||
Container(
|
||||
child: Text(
|
||||
'温馨提示',
|
||||
style: TextStyle(color: Colors.white.withOpacity(0.75), fontSize: 17.sp,),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 12.sp),
|
||||
child: Text(
|
||||
desc,
|
||||
style: TextStyle(color: Colors.white, fontSize: 15.sp),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20.sp,),
|
||||
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
height: 42.sp,
|
||||
width: 126.sp,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(21.sp),
|
||||
color: Color(0x26FFFFFF)
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'放弃',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
Get.back();
|
||||
HomeLogic logic = Get.find<HomeLogic>();
|
||||
logic.updateIndex(1);
|
||||
Future.delayed(Duration(milliseconds: 500),() {
|
||||
final likeLogic = Get.find<LikeLogic>();
|
||||
likeLogic.currentIndex == -2;
|
||||
likeLogic.update();
|
||||
});
|
||||
|
||||
},
|
||||
child: Container(
|
||||
height: 42.sp,
|
||||
width: 126.sp,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(21.sp),
|
||||
gradient: AppColor.mainVerLinearGradient
|
||||
),
|
||||
child: Text(
|
||||
'前往查看',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -37,6 +37,7 @@ import '../dialog/UpdateDialog.dart';
|
||||
import '../invite/logic.dart';
|
||||
import '../minefragment/view.dart';
|
||||
import '../msg/view.dart';
|
||||
import 'like_peole_sended_call_out_dialog.dart';
|
||||
import 'state.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
@ -195,7 +196,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
});
|
||||
|
||||
TencentImSDKPlugin.v2TIMManager.v2TIMMessageManager.addAdvancedMsgListener(
|
||||
listener: V2TimAdvancedMsgListener(onRecvNewMessage: (message) {
|
||||
listener: V2TimAdvancedMsgListener(onRecvNewMessage: (message) async {
|
||||
getUnreadSize();
|
||||
print(message);
|
||||
if (message.elemType == MessageElemType.V2TIM_ELEM_TYPE_CUSTOM) {
|
||||
@ -234,8 +235,12 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
});
|
||||
} else if (int.parse(event) == 3) {
|
||||
//喜欢列表刷新
|
||||
showOKToast(message.customElem!.desc!.toString());
|
||||
EventBusManager.fire(LikeRefresh());
|
||||
SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance();
|
||||
if (await sp.isFirstPeopleSendCallOut()) {
|
||||
Future.delayed(Duration(seconds: 20),() {
|
||||
showSendedCallOutDialog(message.customElem!.desc!.toString());
|
||||
});
|
||||
}
|
||||
} else if (int.parse(event) == 5) {
|
||||
//有人送礼会话置顶
|
||||
// print(jsonData.toString());
|
||||
@ -251,13 +256,19 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
logic.update();
|
||||
} else if (int.parse(event) == 8) {
|
||||
//有新的喊话
|
||||
World_call_outLogic logic = Get.find<World_call_outLogic>();
|
||||
logic.isNewMsg = true;
|
||||
logic.update();
|
||||
if (Get.isRegistered<World_call_outLogic>()) {
|
||||
World_call_outLogic logic = Get.find<World_call_outLogic>();
|
||||
logic.isNewMsg = true;
|
||||
logic.update();
|
||||
}
|
||||
} else if (int.parse(event) == 10) {
|
||||
//有新访客
|
||||
MsgLogic logic = Get.find<MsgLogic>();
|
||||
logic.getMode();
|
||||
} else if (int.parse(event) == 11) {
|
||||
var info = jsonDecode(jsonData['content']);
|
||||
EventBusManager.fire(ShowGiftNotifi(info));
|
||||
|
||||
}
|
||||
} else if (jsonData.containsKey('type')) {
|
||||
int type = jsonData['type'];
|
||||
@ -296,6 +307,17 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
}
|
||||
}
|
||||
|
||||
showSendedCallOutDialog(String desc) {
|
||||
|
||||
Get.bottomSheet(
|
||||
LikePeoleSendedCallOutDialog(
|
||||
desc
|
||||
),
|
||||
isScrollControlled: true,
|
||||
enableDrag: false,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> checkVersion() async {
|
||||
var data = await DioManager.instance.get(url: Api.APP_VERSION);
|
||||
var bean = BaseResponse<UpdateInfo>.fromJson(
|
||||
@ -366,6 +388,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
FlutterNativeSplash.remove();
|
||||
final logic = Get.find<CircleLogic>();
|
||||
logic.loadCirclePeopleData();
|
||||
|
||||
}
|
||||
|
||||
addBadge() {
|
||||
@ -603,3 +626,8 @@ class conTop {
|
||||
}
|
||||
|
||||
class MsgRecommendCardRefresh {}
|
||||
|
||||
class ShowGiftNotifi {
|
||||
Map info;
|
||||
ShowGiftNotifi(this.info);
|
||||
}
|
||||
@ -3,6 +3,7 @@ import 'package:circle_app/circle_app/minefragment/view.dart';
|
||||
import 'package:circle_app/circle_app/msg/view.dart';
|
||||
import 'package:circle_app/circle_app/world_call_out/view.dart';
|
||||
import 'package:circle_app/commons/colors/app_color.dart';
|
||||
import 'package:circle_app/utils/eventBus.dart';
|
||||
import 'package:circle_app/utils/util.dart';
|
||||
import 'package:circle_app/view/ExitAppConfirmation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -10,7 +11,10 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../main.dart';
|
||||
import '../../router/routers.dart';
|
||||
import '../../view/notice.dart';
|
||||
import '../circle_list/view.dart';
|
||||
import '../world_call_out/logic.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
class HomePage extends StatefulWidget {
|
||||
@ -29,6 +33,7 @@ class _HomePageState extends State<HomePage>
|
||||
bool get wantKeepAlive => true;
|
||||
|
||||
HomeLogic logic = Get.find<HomeLogic>();
|
||||
var sub;
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
@ -38,6 +43,17 @@ class _HomePageState extends State<HomePage>
|
||||
vsync: this,
|
||||
initialIndex: 0,
|
||||
animationDuration: Duration.zero);
|
||||
sub = EventBusManager.on<ShowGiftNotifi>().listen((event) {
|
||||
var info = event.info;
|
||||
showGiftButtonOverlay(context!, info['msg'], info['fromUser'], info['toUser'], () {
|
||||
Get.until((route) => route.settings.name == Routes.Home);
|
||||
logic.updateIndex(2);
|
||||
World_call_outLogic worldLogic = Get.find<World_call_outLogic>();
|
||||
worldLogic.index = 1;
|
||||
worldLogic.loadData();
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
@ -58,6 +74,7 @@ class _HomePageState extends State<HomePage>
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
super.dispose();
|
||||
sub.cancel();
|
||||
routeObserver.unsubscribe(this);
|
||||
}
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ class Complete_materialLogic extends GetxController {
|
||||
userInfoBean = bean.data.user;
|
||||
state.wxEditingController.text = userInfoBean!.wx_num ;
|
||||
state.nickName = userInfoBean!.nickname;
|
||||
state.sex = getGenderImg(userInfoBean!.gender);
|
||||
state.sex = getGenderStr(userInfoBean!.gender);
|
||||
state.genderId = userInfoBean!.gender.toString();
|
||||
state.age = userInfoBean!.age.toString();
|
||||
state.brithday = userInfoBean!.birthday.toString();
|
||||
|
||||
@ -803,28 +803,14 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
|
||||
|
||||
|
||||
return ClipOval(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
if(logic.userInfoBean!=null){
|
||||
var imgList = <String>[];
|
||||
imgList.add(logic.userInfoBean!.avatar);
|
||||
// Get.toNamed(AppRoutes.Swiper,arguments:imgList);
|
||||
Get.toNamed(Routes.SwiperPage, arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': 0
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
child:logic.userInfoBean==null ? SizedBox(
|
||||
width: 63.sp,
|
||||
height: 63.sp,
|
||||
): CachedImg(
|
||||
fit: BoxFit.cover,
|
||||
imageUrl: logic.avatar,
|
||||
width: 63.sp,
|
||||
height: 63.sp,
|
||||
),
|
||||
child: logic.userInfoBean==null ? SizedBox(
|
||||
width: 63.sp,
|
||||
height: 63.sp,
|
||||
): CachedImg(
|
||||
fit: BoxFit.cover,
|
||||
imageUrl: logic.avatar,
|
||||
width: 63.sp,
|
||||
height: 63.sp,
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
@ -644,8 +644,8 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
||||
const Color(0x0F4B3E5E),
|
||||
const Color(0xaF334141)
|
||||
])),
|
||||
padding: const EdgeInsets.only(
|
||||
top: 6, bottom: 6, left: 16, right: 16),
|
||||
padding: EdgeInsets.only(
|
||||
top: 6, bottom: 6, left: 10.sp, right: 10.sp),
|
||||
child: Row(
|
||||
children: [
|
||||
ClipOval(child: Image.network(
|
||||
|
||||
@ -83,8 +83,10 @@ class TIMConversationItem extends TIMUIKitStatelessWidget {
|
||||
lastMessageBuilder!(lastMsg, groupAtInfoList) != null) {
|
||||
return lastMessageBuilder!(lastMsg, groupAtInfoList)!;
|
||||
}
|
||||
return Row(
|
||||
|
||||
|
||||
|
||||
return Row(
|
||||
children: [
|
||||
isSameCity
|
||||
? const Text('[同城]',
|
||||
@ -157,7 +159,7 @@ class TIMConversationItem extends TIMUIKitStatelessWidget {
|
||||
final isDesktopScreen =
|
||||
TUIKitScreenUtils.getFormFactor(context) == DeviceType.Desktop;
|
||||
return Container(
|
||||
padding: const EdgeInsets.only(top: 6, bottom: 6, left: 16, right: 16),
|
||||
padding: EdgeInsets.only(top: 6, bottom: 6, left: 10.sp, right: 10.sp),
|
||||
decoration: BoxDecoration(
|
||||
// color: Colors.transparent,
|
||||
// gl.startPoint = CGPointMake(0.48, 0.48);
|
||||
|
||||
@ -51,7 +51,7 @@ class _TIMLastMsgState extends TIMUIKitState<TIMLastMsg> {
|
||||
final isSelf = widget.lastMsg!.isSelf ?? true;
|
||||
final option1 = isSelf
|
||||
? TIM_t("您")
|
||||
: widget.lastMsg!.nickName ?? widget.lastMsg?.sender;
|
||||
: 'Ta';
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
groupTipsAbstractText = TIM_t_para(
|
||||
@ -82,7 +82,7 @@ class _TIMLastMsgState extends TIMUIKitState<TIMLastMsg> {
|
||||
case MessageElemType.V2TIM_ELEM_TYPE_SOUND:
|
||||
return "[语音]";
|
||||
case MessageElemType.V2TIM_ELEM_TYPE_TEXT:
|
||||
return (widget.lastMsg?.textElem?.text)?.trim() ?? "";
|
||||
return (widget.lastMsg?.textElem?.text)?.trim() ?? "";
|
||||
case MessageElemType.V2TIM_ELEM_TYPE_FACE:
|
||||
return "[表情]";
|
||||
case MessageElemType.V2TIM_ELEM_TYPE_FILE:
|
||||
@ -133,6 +133,16 @@ class _TIMLastMsgState extends TIMUIKitState<TIMLastMsg> {
|
||||
Widget tuiBuild(BuildContext context, TUIKitBuildValue value) {
|
||||
final TUITheme theme = value.theme;
|
||||
final icon = _getIconByMsgStatus(context);
|
||||
final isRevokedMessage = widget.lastMsg!.status == 6;
|
||||
if (isRevokedMessage) {
|
||||
final isSelf = widget.lastMsg!.isSelf ?? true;
|
||||
final option1 = isSelf
|
||||
? TIM_t("您")
|
||||
: 'Ta';
|
||||
groupTipsAbstractText = TIM_t_para(
|
||||
"{{option1}}撤回了一条消息", "$option1撤回了一条消息")(option1: option1);
|
||||
}
|
||||
|
||||
return Row(children: [
|
||||
if (icon != null)
|
||||
Container(
|
||||
|
||||
@ -30,7 +30,7 @@ class MsgPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MsgPageState extends State<MsgPage> with AutomaticKeepAliveClientMixin {
|
||||
final ctr = Get.put(MsgLogic());
|
||||
final ctr = Get.lazyPut(() =>MsgLogic());
|
||||
// final controller = Get.find<MsgLogic>();
|
||||
var logic = Get.find<CircleLogic>();
|
||||
void getPipeiData() async {
|
||||
@ -93,7 +93,8 @@ class _MsgPageState extends State<MsgPage> with AutomaticKeepAliveClientMixin {
|
||||
Get.toNamed(Routes.SysNotifyListPage, arguments: selectedConv);
|
||||
return;
|
||||
}
|
||||
Get.toNamed(Routes.Chat, arguments: selectedConv);
|
||||
await Get.toNamed(Routes.Chat, arguments: selectedConv);
|
||||
|
||||
},
|
||||
))
|
||||
],
|
||||
@ -177,7 +178,7 @@ class _MsgPageState extends State<MsgPage> with AutomaticKeepAliveClientMixin {
|
||||
|
||||
return Container(
|
||||
width: Get.width,
|
||||
padding: EdgeInsets.only(left: 18.sp, right: 18.sp),
|
||||
padding: EdgeInsets.only(left: 10.sp, right: 10.sp),
|
||||
height: 44.sp,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
@ -272,7 +273,7 @@ class _MsgPageState extends State<MsgPage> with AutomaticKeepAliveClientMixin {
|
||||
tipWidget(MsgLogic controller) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 10.sp, bottom: 15.sp),
|
||||
padding: EdgeInsets.only(left: 16.sp, right: 12.sp),
|
||||
padding: EdgeInsets.only(left: 10.sp, right: 4.sp),
|
||||
width: Get.width,
|
||||
height: 20.sp,
|
||||
child: Row(
|
||||
@ -322,7 +323,7 @@ class _MsgPageState extends State<MsgPage> with AutomaticKeepAliveClientMixin {
|
||||
|
||||
reconmandWidget(MsgLogic controller) {
|
||||
return Container(
|
||||
padding: EdgeInsets.only(left: 16.sp, right: 18.sp),
|
||||
padding: EdgeInsets.only(left: 10.sp, right: 12.sp),
|
||||
width: Get.width,
|
||||
height: 80.sp,
|
||||
child: Row(
|
||||
|
||||
@ -417,10 +417,11 @@ class UserinfoLogic extends GetxController {
|
||||
class UserBean {
|
||||
int id;
|
||||
String nickname;
|
||||
String account_id;
|
||||
String avatar;
|
||||
String birthday;
|
||||
String wx_num;
|
||||
|
||||
int chat_need_vip;
|
||||
int age;
|
||||
String contact;
|
||||
int contactType;
|
||||
@ -446,6 +447,7 @@ class UserBean {
|
||||
required this.id,
|
||||
required this.nickname,
|
||||
required this.avatar,
|
||||
required this.account_id,
|
||||
required this.wx_num,
|
||||
required this.birthday,
|
||||
required this.age,
|
||||
@ -466,6 +468,7 @@ class UserBean {
|
||||
required this.lat,
|
||||
required this.onlineFlag,
|
||||
this.city,
|
||||
required this.chat_need_vip,
|
||||
required this.isOnline,
|
||||
this.offlineTime,
|
||||
required this.avatarThumb,
|
||||
@ -478,6 +481,8 @@ class UserBean {
|
||||
currentCity: json['currentCity'] ?? '',
|
||||
hide_wx_num: json['hide_wx_num'] ?? 0,
|
||||
orientations: json['orientations'] ?? [],
|
||||
account_id: json['account_id'] ?? '',
|
||||
chat_need_vip: json['chatNeedVip'],
|
||||
wx_num: json['wx_num'] ?? '',
|
||||
mark: json['mark'] ?? 0,
|
||||
nickname: json['nickname'],
|
||||
|
||||
@ -21,6 +21,7 @@ import '../../utils/cache_img.dart';
|
||||
import '../../utils/eventBus.dart';
|
||||
import '../../utils/util.dart';
|
||||
import '../../view/notice.dart';
|
||||
import '../circle_list/widgets/right_circle_iten.dart';
|
||||
import '../home/logic.dart';
|
||||
import '../select_circle/logic.dart';
|
||||
import 'logic.dart';
|
||||
@ -294,16 +295,23 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
width: Get.width,
|
||||
// color: Colors.red,
|
||||
child: NestedScrollView(
|
||||
controller: scrollController,
|
||||
// controller: scrollController,
|
||||
headerSliverBuilder: (context, isScrolled) {
|
||||
return [
|
||||
SliverToBoxAdapter(
|
||||
child: buildContent(logic),
|
||||
),
|
||||
SliverOverlapAbsorber(
|
||||
handle:
|
||||
NestedScrollView.sliverOverlapAbsorberHandleFor(
|
||||
context),
|
||||
sliver: SliverToBoxAdapter(
|
||||
child: buildContent(logic),
|
||||
))
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
sliver:SliverPersistentHeader(
|
||||
pinned: true,
|
||||
|
||||
delegate: MySliverAppBarDelegate(
|
||||
minHeight: 35,
|
||||
maxHeight: 35,
|
||||
child: titleTab(logic),
|
||||
),
|
||||
)),
|
||||
];
|
||||
},
|
||||
body: contentWidget(logic),
|
||||
@ -752,7 +760,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
contentWidget(UserinfoLogic controller) {
|
||||
return Column(
|
||||
children: [
|
||||
titleTab(controller),
|
||||
SizedBox(height: 35.sp,),
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
controller: _tabController,
|
||||
@ -1027,6 +1035,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
)
|
||||
: Expanded(
|
||||
child: GridView.builder(
|
||||
physics: ClampingScrollPhysics(),
|
||||
padding: const EdgeInsets.only(bottom: 58.0),
|
||||
shrinkWrap: true,
|
||||
gridDelegate:
|
||||
|
||||
@ -12,6 +12,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_core/src/get_main.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
|
||||
import '../../../commons/Widgets/text_more.dart';
|
||||
import '../../../net/api.dart';
|
||||
@ -36,7 +37,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
HomeCallOutLogic? listsLg;
|
||||
|
||||
final RefreshController refreshController = RefreshController();
|
||||
ScrollController scrollController = ScrollController();
|
||||
UserinfoLogic logic = Get.find<UserinfoLogic>();
|
||||
|
||||
@ -86,65 +87,75 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<HomeCallOutLogic>(
|
||||
assignId: true,
|
||||
builder: (listLogic) {
|
||||
return listLogic.lists.isEmpty
|
||||
? Center(
|
||||
child: Image.asset(
|
||||
getBaseImage('no_result'),
|
||||
width: 200,
|
||||
// height: 11,
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
width: Get.width,
|
||||
// margin: EdgeInsets.only(top: isEnd ? 40.sp : 0.sp),
|
||||
child: listLogic.lists.isEmpty
|
||||
? loaddingWidget(true)
|
||||
: ListView.builder(
|
||||
// physics: const AlwaysScrollableScrollPhysics(),
|
||||
physics: isEnd
|
||||
? BouncingScrollPhysics()
|
||||
: NeverScrollableScrollPhysics(),
|
||||
// shrinkWrap:true,
|
||||
padding: EdgeInsets.only(
|
||||
bottom:
|
||||
MediaQuery.of(context).padding.bottom + 56.sp),
|
||||
scrollDirection: Axis.vertical,
|
||||
controller: listLogic.scrollController,
|
||||
itemCount: listLogic.lists.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
if (listLogic.lists.length > index) {
|
||||
Lists lists = listLogic.lists[index];
|
||||
if (lists.isQueen!) {
|
||||
return vipDynamicItem(lists);
|
||||
assignId: true,
|
||||
builder: (listLogic) {
|
||||
return listLogic.lists.isEmpty
|
||||
? Center(
|
||||
child: Image.asset(
|
||||
getBaseImage('no_result'),
|
||||
width: 200,
|
||||
// height: 11,
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
width: Get.width,
|
||||
padding: EdgeInsets.only(
|
||||
bottom:
|
||||
MediaQuery.of(context).padding.bottom + 56.sp),
|
||||
child: listLogic.lists.isEmpty
|
||||
? loaddingWidget(true)
|
||||
: SmartRefresher(
|
||||
controller: refreshController,
|
||||
enablePullDown: false,
|
||||
onLoading: () async {
|
||||
await listLogic.loadCallOutListData(widget.userId);
|
||||
if (listLogic.callOutMore) {
|
||||
refreshController.loadNoData();
|
||||
} else {
|
||||
return normalDynamicItem(lists);
|
||||
refreshController.loadComplete();
|
||||
}
|
||||
} else {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: listLogic.callOutMore ? 0 : 10.sp),
|
||||
child: loaddingWidget(listLogic.callOutMore),
|
||||
);
|
||||
}
|
||||
}));
|
||||
},
|
||||
);
|
||||
},
|
||||
enablePullUp: true,
|
||||
child: ListView.builder(
|
||||
|
||||
scrollDirection: Axis.vertical,
|
||||
itemCount: listLogic.lists.length,
|
||||
itemBuilder: (context, index) {
|
||||
if (listLogic.lists.length > index) {
|
||||
Lists lists = listLogic.lists[index];
|
||||
if (lists.isQueen!) {
|
||||
return vipDynamicItem(lists);
|
||||
} else {
|
||||
return normalDynamicItem(lists);
|
||||
}
|
||||
}
|
||||
})
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
///至尊喊话
|
||||
vipDynamicItem(Lists lists) {
|
||||
Widget descText = logic.openCallOutIdList.contains(lists.id) ? Text(
|
||||
lists.content!,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
) : HideText(text: lists.content!,maxWidth: Get.currentRoute == Routes.Home ? Get.width - 90.sp : Get.width - 20.sp,additionText: '查看更多',maxLines: 15,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
|
||||
logic.openCallOutIdList.add(lists.id);
|
||||
setState(() {
|
||||
|
||||
});
|
||||
},
|
||||
);
|
||||
Widget descText = logic.openCallOutIdList.contains(lists.id)
|
||||
? Text(
|
||||
lists.content!,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
)
|
||||
: HideText(
|
||||
text: lists.content!,
|
||||
maxWidth: Get.currentRoute == Routes.Home
|
||||
? Get.width - 90.sp
|
||||
: Get.width - 20.sp,
|
||||
additionText: '查看更多',
|
||||
maxLines: 15,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
additionStyle:
|
||||
TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),
|
||||
onTap: () {
|
||||
logic.openCallOutIdList.add(lists.id);
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
|
||||
double picHeight = 0.0;
|
||||
|
||||
@ -184,7 +195,6 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
),
|
||||
),
|
||||
Container(
|
||||
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
width: Get.width,
|
||||
// height: widgetHeight,
|
||||
@ -223,7 +233,11 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
Container(
|
||||
// height: widgetHeight,
|
||||
width: Get.width,
|
||||
padding: EdgeInsets.only(top: 12.sp, left: 12.sp, right: 12.sp,),
|
||||
padding: EdgeInsets.only(
|
||||
top: 12.sp,
|
||||
left: 12.sp,
|
||||
right: 12.sp,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@ -374,32 +388,34 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
}),
|
||||
),
|
||||
if (widget.userId.isEmpty)
|
||||
Container(
|
||||
width: Get.width,
|
||||
margin: EdgeInsets.only(top: 4.sp,bottom: 5.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 1.sp),
|
||||
),
|
||||
widget.userId.isNotEmpty
|
||||
? Container()
|
||||
: GestureDetector(
|
||||
onTap: () {
|
||||
showCallOutTipPop(lists.id!.toString(),
|
||||
listsLg!.lists.indexOf(lists),lists!.userTop! == 1);
|
||||
},
|
||||
child: Icon(
|
||||
Icons.more_vert,
|
||||
color: AppColor.mainColor,
|
||||
size: 20,
|
||||
))
|
||||
],
|
||||
))
|
||||
Container(
|
||||
width: Get.width,
|
||||
margin: EdgeInsets.only(top: 4.sp, bottom: 5.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 1.sp),
|
||||
),
|
||||
widget.userId.isNotEmpty
|
||||
? Container()
|
||||
: GestureDetector(
|
||||
onTap: () {
|
||||
showCallOutTipPop(
|
||||
lists.id!.toString(),
|
||||
listsLg!.lists.indexOf(lists),
|
||||
lists!.userTop! == 1);
|
||||
},
|
||||
child: Icon(
|
||||
Icons.more_vert,
|
||||
color: AppColor.mainColor,
|
||||
size: 20,
|
||||
))
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
)
|
||||
@ -410,16 +426,26 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
|
||||
///普通图文喊话
|
||||
normalDynamicItem(Lists lists) {
|
||||
Widget descText = logic.openCallOutIdList.contains(lists.id) ? Text(
|
||||
lists.content!,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
) : HideText(text: lists.content!,maxWidth: Get.currentRoute == Routes.Home ? Get.width - 90.sp : Get.width - 20.sp,additionText: '查看更多',maxLines: 15,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
|
||||
logic.openCallOutIdList.add(lists.id);
|
||||
setState(() {
|
||||
|
||||
});
|
||||
},
|
||||
);
|
||||
Widget descText = logic.openCallOutIdList.contains(lists.id)
|
||||
? Text(
|
||||
lists.content!,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
)
|
||||
: HideText(
|
||||
text: lists.content!,
|
||||
maxWidth: Get.currentRoute == Routes.Home
|
||||
? Get.width - 90.sp
|
||||
: Get.width - 20.sp,
|
||||
additionText: '查看更多',
|
||||
maxLines: 15,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
additionStyle:
|
||||
TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),
|
||||
onTap: () {
|
||||
logic.openCallOutIdList.add(lists.id);
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
|
||||
double picHeight = 0.0;
|
||||
|
||||
@ -597,7 +623,9 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
// margin: EdgeInsets.only(top: 4.sp),
|
||||
child: descText,
|
||||
),
|
||||
SizedBox(height: picHeight > 0 ? 5.sp : 10.sp,),
|
||||
SizedBox(
|
||||
height: picHeight > 0 ? 5.sp : 10.sp,
|
||||
),
|
||||
picHeight > 0
|
||||
? Container(
|
||||
height: picHeight,
|
||||
@ -648,33 +676,34 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
}))
|
||||
: Container(),
|
||||
if (widget.userId.isEmpty)
|
||||
Container(
|
||||
width: Get.width,
|
||||
margin: EdgeInsets.only(top: 4.sp,bottom: 5.sp),
|
||||
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
widget.userId.isNotEmpty
|
||||
? Container()
|
||||
: GestureDetector(
|
||||
onTap: () {
|
||||
showCallOutTipPop(lists.id!.toString(),
|
||||
listsLg!.lists.indexOf(lists),lists.userTop == 1);
|
||||
},
|
||||
child: Icon(
|
||||
Icons.more_vert,
|
||||
color: AppColor.mainColor,
|
||||
size: 20,
|
||||
))
|
||||
],
|
||||
))
|
||||
Container(
|
||||
width: Get.width,
|
||||
margin: EdgeInsets.only(top: 4.sp, bottom: 5.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
widget.userId.isNotEmpty
|
||||
? Container()
|
||||
: GestureDetector(
|
||||
onTap: () {
|
||||
showCallOutTipPop(
|
||||
lists.id!.toString(),
|
||||
listsLg!.lists.indexOf(lists),
|
||||
lists.userTop == 1);
|
||||
},
|
||||
child: Icon(
|
||||
Icons.more_vert,
|
||||
color: AppColor.mainColor,
|
||||
size: 20,
|
||||
))
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
)
|
||||
@ -729,7 +758,11 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
return painter.width;
|
||||
}
|
||||
|
||||
showCallOutTipPop(String calloutId, int index, bool isTop,) {
|
||||
showCallOutTipPop(
|
||||
String calloutId,
|
||||
int index,
|
||||
bool isTop,
|
||||
) {
|
||||
Get.bottomSheet(
|
||||
CupertinoActionSheet(
|
||||
title: Text(
|
||||
@ -748,8 +781,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
CupertinoActionSheetAction(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
showTipPiker(calloutId,
|
||||
index);
|
||||
showTipPiker(calloutId, index);
|
||||
// toast('举报成功,等待反馈!');
|
||||
},
|
||||
child: Text('删除'),
|
||||
|
||||
@ -34,7 +34,7 @@ class HomeCallOutLogic extends GetxController {
|
||||
}
|
||||
callOutPage++;
|
||||
}
|
||||
callOutMore = dataList.length == 20;
|
||||
callOutMore = dataList.isEmpty;
|
||||
update();
|
||||
} else {
|
||||
showOKToast(data["msg"]);
|
||||
|
||||
@ -46,7 +46,7 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
|
||||
logic.isNewMsg = false;
|
||||
/// 初始化
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
}
|
||||
@ -57,70 +57,70 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: MyAppBar(
|
||||
centerTitle: logic.total > 0
|
||||
? '全球喊话' + '(${convertToTenThousand(logic.total)})'
|
||||
: '全球喊话',
|
||||
isBack: false,
|
||||
isDiyBack: true,
|
||||
backWdiget: Positioned(
|
||||
left: 15.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.InvitePage);
|
||||
},
|
||||
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),
|
||||
padding: EdgeInsets.only(
|
||||
left: 6.sp, right: 6.sp, top: 4.sp, bottom: 4.sp),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
color: const Color(0xFF392D53),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
getMsgImage('gift'),
|
||||
width: 14.sp,
|
||||
),
|
||||
SizedBox(
|
||||
width: 2.sp,
|
||||
),
|
||||
Text(
|
||||
homelogic.inventStr,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
actionWdiget: GestureDetector(
|
||||
onTap: () {
|
||||
logic.showBottomSheet(context);
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('icon_screen'),
|
||||
width: 30.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
// appBar: MyAppBar(
|
||||
// centerTitle: logic.total > 0
|
||||
// ? '全球喊话' + '(${convertToTenThousand(logic.total)})'
|
||||
// : '全球喊话',
|
||||
// isBack: false,
|
||||
// isDiyBack: true,
|
||||
// backWdiget: Positioned(
|
||||
// left: 15.sp,
|
||||
// child: GestureDetector(
|
||||
// onTap: () {
|
||||
// Get.toNamed(Routes.InvitePage);
|
||||
// },
|
||||
// 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),
|
||||
// padding: EdgeInsets.only(
|
||||
// left: 6.sp, right: 6.sp, top: 4.sp, bottom: 4.sp),
|
||||
// alignment: Alignment.center,
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(17.0),
|
||||
// color: const Color(0xFF392D53),
|
||||
// ),
|
||||
// child: Row(
|
||||
// children: [
|
||||
// Image.asset(
|
||||
// getMsgImage('gift'),
|
||||
// width: 14.sp,
|
||||
// ),
|
||||
// SizedBox(
|
||||
// width: 2.sp,
|
||||
// ),
|
||||
// Text(
|
||||
// homelogic.inventStr,
|
||||
// style: TextStyle(
|
||||
// fontSize: 12.sp,
|
||||
// color: Colors.white,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// actionWdiget: GestureDetector(
|
||||
// onTap: () {
|
||||
// logic.showBottomSheet(context);
|
||||
// },
|
||||
// child: Image.asset(
|
||||
// getCircleImage('icon_screen'),
|
||||
// width: 30.sp,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
body: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
@ -133,49 +133,56 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
|
||||
// logic.sendTextMessage();
|
||||
},
|
||||
child:
|
||||
SmartRefresher(
|
||||
controller: logic.refreshController,
|
||||
onLoading: () {
|
||||
logic.loadMore();
|
||||
},
|
||||
onRefresh: () {
|
||||
logic.isNewMsg = false;
|
||||
logic.index = 1;
|
||||
logic.isMore = true;
|
||||
logic.refreshController.resetNoData();
|
||||
// logic.lists.clear();
|
||||
// logic.update();
|
||||
logic.loadData();
|
||||
},
|
||||
enablePullUp: true,
|
||||
enablePullDown: true,
|
||||
child:logic.loadFail ? noResultWidget(tip: '',callBack: () {
|
||||
logic.loadFail = false;
|
||||
logic.isMore = true;
|
||||
logic.update();
|
||||
logic.initGerder();
|
||||
logic.loadData();
|
||||
}) : logic.lists.isEmpty
|
||||
? !logic.isMore
|
||||
? noResultWidget()
|
||||
: loaddingWidget(true)
|
||||
: ListView.builder(
|
||||
reverse: true,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
WorldLists data = logic.lists[index];
|
||||
if (data.content!.contains('赚钱')) {
|
||||
print('111');
|
||||
}
|
||||
if (data.showType == 2) {
|
||||
return SigalItemWidget(index, data);
|
||||
}
|
||||
return SysItemWidget(index, logic.lists[index],logic);
|
||||
},
|
||||
itemCount: logic.lists.length,
|
||||
controller: logic.scrollController,
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
)),
|
||||
Column(
|
||||
children: [
|
||||
titleWidget(),
|
||||
Expanded(
|
||||
child: SmartRefresher(
|
||||
controller: logic.refreshController,
|
||||
onLoading: () {
|
||||
logic.loadMore();
|
||||
},
|
||||
onRefresh: () {
|
||||
logic.isNewMsg = false;
|
||||
logic.index = 1;
|
||||
logic.isMore = true;
|
||||
logic.refreshController.resetNoData();
|
||||
// logic.lists.clear();
|
||||
// logic.update();
|
||||
logic.loadData();
|
||||
},
|
||||
enablePullUp: true,
|
||||
enablePullDown: true,
|
||||
child:logic.loadFail ? noResultWidget(tip: '',callBack: () {
|
||||
logic.loadFail = false;
|
||||
logic.isMore = true;
|
||||
logic.update();
|
||||
logic.initGerder();
|
||||
logic.loadData();
|
||||
}) : logic.lists.isEmpty
|
||||
? !logic.isMore
|
||||
? noResultWidget()
|
||||
: loaddingWidget(true)
|
||||
: ListView.builder(
|
||||
reverse: true,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
WorldLists data = logic.lists[index];
|
||||
if (data.content!.contains('赚钱')) {
|
||||
print('111');
|
||||
}
|
||||
if (data.showType == 2) {
|
||||
return SigalItemWidget(index, data);
|
||||
}
|
||||
return SysItemWidget(index, logic.lists[index],logic);
|
||||
},
|
||||
itemCount: logic.lists.length,
|
||||
controller: logic.scrollController,
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 36.sp,
|
||||
@ -226,6 +233,100 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
|
||||
});
|
||||
}
|
||||
|
||||
titleWidget() {
|
||||
return SafeArea(
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
height: 44.sp,
|
||||
child:Stack(
|
||||
fit: StackFit.expand,
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Semantics(
|
||||
namesRoute: true,
|
||||
header: true,
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: double.infinity,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 48.0),
|
||||
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(
|
||||
logic.total > 0
|
||||
? '全球喊话' + '(${convertToTenThousand(logic.total)})'
|
||||
: '全球喊话',
|
||||
style: TextStyle(fontSize: 18.sp,fontWeight: FontWeight.w600,color: Colors.white,shadows: [Shadow(color: Color(0xffF657FF), offset: Offset(0.0, -1))]),
|
||||
),
|
||||
),
|
||||
)),
|
||||
Positioned(
|
||||
left: 10.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.InvitePage);
|
||||
},
|
||||
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),
|
||||
padding: EdgeInsets.only(
|
||||
left: 6.sp, right: 6.sp, top: 4.sp, bottom: 4.sp),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
color: const Color(0xFF392D53),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
getMsgImage('gift'),
|
||||
width: 14.sp,
|
||||
),
|
||||
SizedBox(
|
||||
width: 2.sp,
|
||||
),
|
||||
Text(
|
||||
homelogic.inventStr,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(right: 10.sp,child: GestureDetector(
|
||||
onTap: () {
|
||||
logic.showBottomSheet(context);
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('icon_screen'),
|
||||
width: 30.sp,
|
||||
),
|
||||
),)
|
||||
],
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
double getBottomHeight(context) {
|
||||
if (logic.showKeyboard) {
|
||||
final currentKeyboardHeight = MediaQuery.of(context).viewInsets.bottom;
|
||||
@ -751,7 +852,7 @@ class _SysItemWidgetState extends State<SysItemWidget> {
|
||||
margin: EdgeInsets.only(left: 10.sp, right: 10.sp,bottom: 5.sp),
|
||||
child: picHeight == 200.sp
|
||||
? VideoItemWidget(list.album![0].url!)
|
||||
: GridView.builder(
|
||||
: MediaQuery.removePadding(removeTop: true,context: context, child:GridView.builder(
|
||||
itemCount: list.album!.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
@ -781,7 +882,7 @@ class _SysItemWidgetState extends State<SysItemWidget> {
|
||||
),
|
||||
),
|
||||
);
|
||||
}))
|
||||
})))
|
||||
: Container();
|
||||
}
|
||||
|
||||
@ -1033,37 +1134,38 @@ class _SigalItemWidgetState extends State<SigalItemWidget> {
|
||||
margin: EdgeInsets.only(left: 10.sp, right: 10.sp,bottom: 5.sp),
|
||||
child: picHeight == 200.sp
|
||||
? VideoItemWidget(list.album![0].url!)
|
||||
: GridView.builder(
|
||||
itemCount: list.album!.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3, //横轴三个子widget
|
||||
crossAxisSpacing: 4.sp,
|
||||
mainAxisSpacing: 4.sp,
|
||||
childAspectRatio: 0.7 //宽高比为1时,子widget
|
||||
),
|
||||
itemBuilder: (contentxt, currentIndex) {
|
||||
Album album = list.album![currentIndex];
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
var imgList = <String>[];
|
||||
for (var element in list.album!) {
|
||||
imgList.add(element.url!);
|
||||
}
|
||||
Get.toNamed(Routes.SwiperPage, arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': currentIndex
|
||||
});
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: CachedImg(
|
||||
imageUrl: album.url!,
|
||||
fit: BoxFit.cover,
|
||||
: MediaQuery.removePadding(removeTop: true,context: context, child:GridView.builder(
|
||||
itemCount: list.album!.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3, //横轴三个子widget
|
||||
crossAxisSpacing: 4.sp,
|
||||
mainAxisSpacing: 4.sp,
|
||||
childAspectRatio: 0.7 //宽高比为1时,子widget
|
||||
),
|
||||
itemBuilder: (contentxt, currentIndex) {
|
||||
Album album = list.album![currentIndex];
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
var imgList = <String>[];
|
||||
for (var element in list.album!) {
|
||||
imgList.add(element.url!);
|
||||
}
|
||||
Get.toNamed(Routes.SwiperPage, arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': currentIndex
|
||||
});
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: CachedImg(
|
||||
imageUrl: album.url!,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}))
|
||||
);
|
||||
}),
|
||||
))
|
||||
: Container();
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,6 +61,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
|
||||
|
||||
} else {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
Navigator.pop(superContext!);
|
||||
}
|
||||
|
||||
|
||||
@ -335,7 +335,7 @@ class _WxEditDialogState extends State<WxEditDialog> {
|
||||
showOKToast('请设置联系方式解锁金额大于零');
|
||||
return;
|
||||
} else if (int.parse(moneyEditingController.text) > 300 || int.parse(moneyEditingController.text) < 10) {
|
||||
showOKToast('请设置联系方式解锁金额在10元~200元之间');
|
||||
showOKToast('请设置联系方式解锁金额在10元~300元之间');
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -354,16 +354,12 @@ class _WxEditDialogState extends State<WxEditDialog> {
|
||||
"price": (wxInfo['price'] != null ? wxInfo['price'].toString() : '').isNotEmpty ? moneyEditingController.text.isEmpty ? 0 : moneyEditingController.text : '',
|
||||
'contactType':type,
|
||||
"contact": wxEditingController.text});
|
||||
if (result['code'] ==200) {
|
||||
if (result['code'] == 200) {
|
||||
showOKToast('设置成功');
|
||||
Get.back();
|
||||
} else if (result['code'] == 10081) {
|
||||
showRechargeScreenDialog();
|
||||
}
|
||||
|
||||
|
||||
// Get.back();
|
||||
// showRechargeDialog();
|
||||
},
|
||||
child: Container(
|
||||
height: 30.sp,
|
||||
|
||||
@ -452,5 +452,12 @@ class Api {
|
||||
//每日在线圈友推荐
|
||||
static const dayOnline = '/msg-service/im/chat/recommend/dayOnline';
|
||||
|
||||
//查看单个用户
|
||||
static const visitUserById = '/user-service/visitUserById';
|
||||
|
||||
//批量查看多个用户
|
||||
static const visitUserByIds = '/user-service/visitUserByIds';
|
||||
|
||||
//批量查看多个喊话
|
||||
static const readCalloutByIds = '/up-service/readCalloutByIds';
|
||||
}
|
||||
@ -25,6 +25,8 @@ class SharedPreferencesHelper {
|
||||
|
||||
static const FirstAutoMatch = 'FirstAutoMatch';
|
||||
|
||||
static const FirstPeopleSendCallOut = 'FirstPeopleSendCallOut';
|
||||
|
||||
static SharedPreferencesHelper? _instance;
|
||||
static SharedPreferences? _preferences;
|
||||
|
||||
@ -117,6 +119,22 @@ class SharedPreferencesHelper {
|
||||
return true;
|
||||
}
|
||||
|
||||
Future<bool> isFirstPeopleSendCallOut() async {
|
||||
String time = preferences!.getString(FirstPeopleSendCallOut) ?? '';
|
||||
if (time.isNotEmpty) {
|
||||
DateTime dateTime = DateTime.parse(time);
|
||||
bool isShow = !isSameDay(dateTime,DateTime.now());
|
||||
if (isShow) {
|
||||
preferences!.setString(FirstPeopleSendCallOut, DateTime.now().toString());
|
||||
}
|
||||
return isShow;
|
||||
} else {
|
||||
preferences!.setString(FirstPeopleSendCallOut, DateTime.now().toString());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool isSameDay(DateTime time1, DateTime time2) {
|
||||
return time1.year == time2.year &&
|
||||
time1.month == time2.month &&
|
||||
|
||||
@ -27,7 +27,7 @@ import 'package:tencent_cloud_chat_uikit/business_logic/view_models/tui_conversa
|
||||
import 'package:tencent_cloud_chat_uikit/data_services/services_locatar.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:video_compress/video_compress.dart';
|
||||
// import 'package:video_compress/video_compress.dart';
|
||||
|
||||
import '../circle_app/circle/logic.dart';
|
||||
import '../circle_app/circle_list/logic.dart';
|
||||
@ -349,21 +349,21 @@ String getRoleContent(int number) {
|
||||
|
||||
typedef void MyCallback(String path);
|
||||
|
||||
Future<void> compressVideo(
|
||||
String inputPath, String outputPath, MyCallback myCallback) async {
|
||||
final info = await VideoCompress.compressVideo(
|
||||
inputPath,
|
||||
quality: VideoQuality.MediumQuality,
|
||||
deleteOrigin: false,
|
||||
);
|
||||
|
||||
if (info != null && null != info.path) {
|
||||
print(info.path);
|
||||
myCallback(info.path!);
|
||||
} else {
|
||||
print('视频压缩失败');
|
||||
}
|
||||
}
|
||||
// Future<void> compressVideo(
|
||||
// String inputPath, String outputPath, MyCallback myCallback) async {
|
||||
// final info = await VideoCompress.compressVideo(
|
||||
// inputPath,
|
||||
// quality: VideoQuality.MediumQuality,
|
||||
// deleteOrigin: false,
|
||||
// );
|
||||
//
|
||||
// if (info != null && null != info.path) {
|
||||
// print(info.path);
|
||||
// myCallback(info.path!);
|
||||
// } else {
|
||||
// print('视频压缩失败');
|
||||
// }
|
||||
// }
|
||||
|
||||
class CustomRefreshHeader extends StatelessWidget {
|
||||
@override
|
||||
|
||||
@ -32,7 +32,7 @@ class _ExitAppConfirmationState extends State<ExitAppConfirmation> {
|
||||
// ScaffoldMessenger.of(context).showSnackBar(
|
||||
// const SnackBar(content: Text('再按一次返回键退出应用')),
|
||||
// );
|
||||
showOKToast("再按一次返回键退出应用");
|
||||
showOKToast("再次滑动可退出APP");
|
||||
return Future.value(false);
|
||||
}
|
||||
return Future.value(true);
|
||||
|
||||
@ -229,6 +229,227 @@ void showFloatingButtonOverlay(BuildContext context, String nickname,
|
||||
overlayState?.insert(overlayEntry!);
|
||||
}
|
||||
|
||||
void showGiftButtonOverlay(BuildContext context,String content,
|
||||
Map sendUser, Map recevierUser, NoticeCallback noticeCallback) {
|
||||
OverlayState? overlayState = Overlay.of(context);
|
||||
late OverlayEntry overlayEntry;
|
||||
bool showMessage = false;
|
||||
|
||||
int countdownSeconds = 5; // 倒计时秒数
|
||||
|
||||
// 创建 Timer
|
||||
late Timer countdownTimer;
|
||||
|
||||
// 创建 OverlayEntry
|
||||
overlayEntry = OverlayEntry(
|
||||
builder: (BuildContext context) {
|
||||
return Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Positioned(
|
||||
top: MediaQuery.of(context).padding.top,
|
||||
// right: 16,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 500),
|
||||
curve: Curves.easeInOut,
|
||||
height: showMessage ? 55 : 0,
|
||||
child: Container(
|
||||
width: Get.width - 8,
|
||||
// margin: EdgeInsets.only(top:10.sp),
|
||||
padding: EdgeInsets.fromLTRB(8.sp, 8.sp, 8.sp, 8.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: const Color(0xFF353443),
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
|
||||
// const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// direction: Axis.vertical,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
countdownTimer.cancel();
|
||||
try {
|
||||
overlayEntry!.remove();
|
||||
} catch (e) {}
|
||||
mainOverlayEntry = null;
|
||||
Get.toNamed(Routes.UserInfoPage,arguments:sendUser['id'].toString());
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
ClipOval(
|
||||
child: CachedImg(
|
||||
fit: BoxFit.cover,
|
||||
imageUrl: sendUser['avatar'],
|
||||
width: 30.sp,
|
||||
height: 30.sp,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
// width: 70.sp,
|
||||
child: Text(
|
||||
sendUser['nickname'],
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: AppColor.mainColor,
|
||||
fontSize: 15.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
// width: 70.sp,
|
||||
child: Text(
|
||||
'送',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: Color.fromRGBO(247, 250, 250, 1.0),
|
||||
fontSize: 15.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
countdownTimer.cancel();
|
||||
try {
|
||||
overlayEntry!.remove();
|
||||
} catch (e) {}
|
||||
mainOverlayEntry = null;
|
||||
Get.toNamed(Routes.UserInfoPage,arguments:recevierUser['id'].toString());
|
||||
},
|
||||
child: Container(
|
||||
// width: 70.sp,
|
||||
child: Text(
|
||||
recevierUser['nickname'],
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: AppColor.mainColor,
|
||||
fontSize: 15.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
// width: 70.sp,
|
||||
child: Text(
|
||||
'礼物' + content.split(recevierUser['nickname']).last,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: Color.fromRGBO(247, 250, 250, 1.0),
|
||||
fontSize: 15.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
countdownTimer.cancel();
|
||||
try {
|
||||
overlayEntry!.remove();
|
||||
} catch (e) {}
|
||||
mainOverlayEntry = null;
|
||||
noticeCallback();
|
||||
|
||||
// logic.setLike();
|
||||
// logic.showMessage = false;
|
||||
// logic.update();
|
||||
},
|
||||
child: Container(
|
||||
// margin: EdgeInsets.only(top: 6.sp),
|
||||
height: 24,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFFDC5BFD),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 8.sp, vertical: 0.sp),
|
||||
child: Text(
|
||||
'围观',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: MediaQuery.of(context).padding.top,
|
||||
right: 5.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
countdownTimer.cancel();
|
||||
// 取消计时器
|
||||
try {
|
||||
overlayEntry!.remove();
|
||||
} catch (e) {}
|
||||
mainOverlayEntry = null;
|
||||
},
|
||||
child: Container(
|
||||
height: 15,
|
||||
width: 20,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(10),
|
||||
bottomLeft: Radius.circular(10)),
|
||||
gradient: AppColor.tagVerLinearGradient),
|
||||
alignment: Alignment.center,
|
||||
child: Icon(
|
||||
Icons.close,
|
||||
size: 15,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
))
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
// setState(() {});
|
||||
showMessage = true;
|
||||
mainOverlayEntry = overlayEntry;
|
||||
countdownTimer = Timer.periodic(Duration(seconds: 1), (timer) {
|
||||
if (countdownSeconds > 0) {
|
||||
countdownSeconds--;
|
||||
// overlayEntry.markNeedsBuild(); // 刷新 OverlayEntry
|
||||
} else {
|
||||
// 取消计时器
|
||||
timer.cancel();
|
||||
|
||||
try {
|
||||
overlayEntry!.remove();
|
||||
} catch (e) {}
|
||||
mainOverlayEntry = null;
|
||||
}
|
||||
});
|
||||
// 将 OverlayEntry 添加到 Overlay 中
|
||||
overlayState?.insert(overlayEntry!);
|
||||
}
|
||||
|
||||
|
||||
void showTipFloatingButtonOverlay(BuildContext context, String tip) {
|
||||
OverlayState? overlayState = Overlay.of(context);
|
||||
late OverlayEntry overlayEntry;
|
||||
|
||||
@ -21,7 +21,6 @@ import photo_manager
|
||||
import shared_preferences_foundation
|
||||
import sqflite
|
||||
import url_launcher_macos
|
||||
import video_compress
|
||||
import wakelock_macos
|
||||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
@ -41,6 +40,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
||||
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||
VideoCompressPlugin.register(with: registry.registrar(forPlugin: "VideoCompressPlugin"))
|
||||
WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin"))
|
||||
}
|
||||
|
||||
@ -45,10 +45,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: app_settings
|
||||
sha256: "2ec421f375d747916c4c0193933567074ea60c4f01c4a68642f07fef1002524e"
|
||||
sha256: e6a34735d4ddb24ca9c5fd7e965ec65c8b611cbd3a329152c294f9e9f4bacb33
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "4.0.4"
|
||||
version: "4.3.1"
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -630,6 +630,14 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.1.3"
|
||||
flutter_install_app:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_install_app
|
||||
sha256: "9b117006d17c900e671c26bcbc9b15c7b8efd15d6f9b4442ad5d576de20fab53"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
flutter_intl:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -1906,14 +1914,6 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
video_compress:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: video_compress
|
||||
sha256: "407693726e674a1e1958801deb2d9daf5a5297707ba6d03375007012dae7389a"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "3.1.2"
|
||||
video_player:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -1962,6 +1962,14 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.5.3"
|
||||
visibility_detector:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: visibility_detector
|
||||
sha256: ec932527913f32f65aa01d3a393504240b9e9021ecc77123f017755605e48832
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.2.2"
|
||||
wakelock:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@ -79,7 +79,7 @@ dependencies:
|
||||
#时间戳
|
||||
flutter_intl: ^0.0.1
|
||||
#视频压缩
|
||||
video_compress: ^3.1.2
|
||||
# video_compress: ^3.1.2
|
||||
#图片缓存
|
||||
cached_network_image: ^3.2.3
|
||||
#网络拦截
|
||||
@ -90,7 +90,7 @@ dependencies:
|
||||
fluwx: ^3.8.1+1
|
||||
event_bus: ^2.0.0
|
||||
#安装apk
|
||||
# flutter_install_app: 1.3.0
|
||||
flutter_install_app: 1.3.0
|
||||
#闪屏页
|
||||
flutter_native_splash: 2.2.16
|
||||
#腾讯离线推送
|
||||
@ -112,13 +112,15 @@ dependencies:
|
||||
#边框渐变
|
||||
gradient_borders: ^1.0.0
|
||||
#系统设置 安卓4.3.1 苹果4.0.4
|
||||
app_settings: 4.0.4
|
||||
app_settings: 4.3.1
|
||||
#百度定位插件
|
||||
flutter_bmflocation: ^3.6.0
|
||||
#通知权限
|
||||
notification_permissions: ^0.6.1
|
||||
#分帧
|
||||
keframe: ^2.0.6
|
||||
#判断item是否可见
|
||||
visibility_detector: ^0.2.2
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user