新增用户标识,发现页修改为精选,消息页面UI调整,主页增加分享,图片增加底部邀请信息
@ -63,7 +63,6 @@
|
||||
|
||||
<application
|
||||
android:label="微乐园"
|
||||
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
|
||||
@ -10,4 +10,6 @@ class MainActivity: FlutterActivity() {
|
||||
super.onCreate(savedInstanceState, persistentState)
|
||||
Log.e("tag","11111111111")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
extra-front-end-options=--no-sound-null-safety
|
||||
BIN
circle_app/assets/images/circle/QA_icon.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
circle_app/assets/images/mine/im_first.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
circle_app/assets/images/mine/im_neglect.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
circle_app/assets/images/mine/im_right_look.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
circle_app/assets/images/mine/im_visit.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
circle_app/assets/images/msg/msg_add_black.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
circle_app/assets/images/msg/msg_more.png
Normal file
|
After Width: | Height: | Size: 653 B |
BIN
circle_app/assets/images/msg/msg_report.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
circle_app/assets/images/msg/msg_share.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
circle_app/assets/images/tabbar/call_normal.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
circle_app/assets/images/tabbar/call_selected.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
@ -381,7 +381,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.4.4;
|
||||
MARKETING_VERSION = 1.4.5;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
@ -530,7 +530,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.4.4;
|
||||
MARKETING_VERSION = 1.4.5;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
@ -573,7 +573,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.4.4;
|
||||
MARKETING_VERSION = 1.4.5;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
|
||||
@ -30,8 +30,10 @@ import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitTextField
|
||||
import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_base.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/wide.dart';
|
||||
|
||||
import '../../../../common/Widgets/base_tip_widget.dart';
|
||||
import '../../../../common/Widgets/open_vip_tip/view.dart';
|
||||
import '../../../../util/eventBus.dart';
|
||||
import '../../../userinfo/logic.dart';
|
||||
import '../../widget/send_gift_dialog.dart';
|
||||
|
||||
enum MuteStatus { none, me, all }
|
||||
@ -145,6 +147,8 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
|
||||
int latestSendEditStatusTime = DateTime.now().millisecondsSinceEpoch;
|
||||
|
||||
UserBean? userInfoBean;
|
||||
|
||||
setCurrentCursor(int? value) {
|
||||
currentCursor = value;
|
||||
}
|
||||
@ -267,6 +271,33 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
}
|
||||
|
||||
Future checkImStatus() async {
|
||||
|
||||
List<
|
||||
String> pressionStr = '微信、QQ、加Q、+V、地球号、绿泡泡、公众号、网站、app、视频、手机号、id、企鹅、门槛、收费、加群'
|
||||
.split('、');
|
||||
|
||||
if (textEditingController.text.isNotEmpty && (userInfoBean?.wx_num?.isEmpty ?? true)) {
|
||||
bool isContain = false;
|
||||
String sendText = textEditingController.text.toUpperCase();
|
||||
for (String text in pressionStr) {
|
||||
if (sendText.contains(text)) {
|
||||
isContain = true;
|
||||
}
|
||||
}
|
||||
if (isContain) {
|
||||
await showAddWxPicker(
|
||||
userInfoBean!.wx_num!.isNotEmpty ?? false,
|
||||
isHidden:
|
||||
userInfoBean!.wx_num!.isNotEmpty ?? false,
|
||||
isWxHidden: userInfoBean!.hide_wx_num == 1,
|
||||
);
|
||||
imStatusOK = false;
|
||||
return imStatusOK;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
var data =
|
||||
await DioManager.instance.get(url: Api.imstate);
|
||||
|
||||
@ -880,7 +911,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
loadMyInfoData();
|
||||
checkHintText();
|
||||
if (PlatformUtils().isWeb || PlatformUtils().isDesktop) {
|
||||
focusNode = FocusNode(
|
||||
@ -1277,4 +1308,14 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void loadMyInfoData() async {
|
||||
var data = await DioManager.instance.get(url: Api.getUserInfo);
|
||||
var bean = BaseResponse<ResponseBean>.fromJson(
|
||||
data, (data) => ResponseBean.fromJson(data));
|
||||
|
||||
if (bean.isSuccess()) {
|
||||
userInfoBean = bean.data.user;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
// ignore_for_file: must_be_immutable, avoid_print
|
||||
|
||||
import 'package:circle_app/app/chat/widget/more_dialog.dart';
|
||||
import 'package:circle_app/components/func_widget.dart';
|
||||
import 'package:circle_app/util/eventBus.dart';
|
||||
import 'package:desktop_drop/desktop_drop.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:provider/single_child_widget.dart';
|
||||
import 'package:scroll_to_index/scroll_to_index.dart';
|
||||
@ -23,6 +26,11 @@ import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKItMessageLi
|
||||
import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitTextField/at_member_panel.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/tim_uikit_multi_select_panel.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/tim_uikit_send_file.dart';
|
||||
import '../../../common/colors/app_color.dart';
|
||||
import '../../../network/api.dart';
|
||||
import '../../../network/dio_manager.dart';
|
||||
import '../../../router/app_routers.dart';
|
||||
import '../../userinfo/logic.dart';
|
||||
import 'TIMUIKItMessageList/TIMUIKitTongue/tim_uikit_chat_history_message_list_tongue.dart';
|
||||
import 'TIMUIKItMessageList/tim_uikit_chat_history_message_list_config.dart';
|
||||
import 'TIMUIKItMessageList/tim_uikit_history_message_list_container.dart';
|
||||
@ -193,7 +201,8 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
|
||||
final TUIChatGlobalModel chatGlobalModel =
|
||||
serviceLocator<TUIChatGlobalModel>();
|
||||
bool _dragging = false;
|
||||
|
||||
bool isLike = false;
|
||||
UserBean? otherUserBean;
|
||||
final GlobalKey alignKey = GlobalKey();
|
||||
final GlobalKey listContainerKey = GlobalKey();
|
||||
|
||||
@ -209,9 +218,14 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
|
||||
axis: Axis.vertical,
|
||||
);
|
||||
|
||||
var sub;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
sub = EventBusManager.on<ClearMsg>().listen((event) {
|
||||
model.clearHistory();
|
||||
});
|
||||
if (kProfileMode) {
|
||||
Frame.init();
|
||||
}
|
||||
@ -224,18 +238,19 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
|
||||
print("Page render time:$timeSpend ms");
|
||||
}
|
||||
});
|
||||
// loadUserData();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
sub.cancel();
|
||||
if (kProfileMode) {
|
||||
Frame.destroy();
|
||||
}
|
||||
try {
|
||||
model.dispose();
|
||||
} catch (e) {}
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
@ -314,13 +329,15 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
|
||||
return widget.conversation.type == 1 ? ConvType.c2c : ConvType.group;
|
||||
}
|
||||
|
||||
|
||||
String _getTotalUnReadCount(int unreadCount) {
|
||||
return unreadCount < 99 ? unreadCount.toString() : "99+";
|
||||
}
|
||||
|
||||
@override
|
||||
Widget tuiBuild(BuildContext context, TUIKitBuildValue value) {
|
||||
if (otherUserBean == null) {
|
||||
loadUserData();
|
||||
}
|
||||
final TUITheme theme = value.theme;
|
||||
final closePanel =
|
||||
OptimizeUtils.throttle((_) => textFieldController.hideAllPanel(), 60);
|
||||
@ -373,7 +390,8 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
|
||||
}
|
||||
}
|
||||
|
||||
return BgWidget(widget:GestureDetector(
|
||||
return BgWidget(
|
||||
widget: GestureDetector(
|
||||
onTap: () {
|
||||
textFieldController.hideAllPanel();
|
||||
},
|
||||
@ -386,7 +404,11 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
|
||||
alignment: Alignment.centerLeft,
|
||||
children: [
|
||||
widget.customAppBar!,
|
||||
chatGlobalModel.totalUnReadCount > 0 ? Positioned(left: 40.sp,bottom: 12.sp,child: Container(
|
||||
chatGlobalModel.totalUnReadCount > 0
|
||||
? Positioned(
|
||||
left: 40.sp,
|
||||
bottom: 12.sp,
|
||||
child: Container(
|
||||
// width: 22,
|
||||
height: 22,
|
||||
alignment: Alignment.center,
|
||||
@ -398,13 +420,21 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
|
||||
maxWidth: 30,
|
||||
minWidth: 22,
|
||||
),
|
||||
child:
|
||||
Text(_getTotalUnReadCount(chatGlobalModel.totalUnReadCount),style: TextStyle(color: Colors.white,fontSize: 12.sp),),
|
||||
)) : Container()
|
||||
child: Text(
|
||||
_getTotalUnReadCount(
|
||||
chatGlobalModel.totalUnReadCount),
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
))
|
||||
: Container(),
|
||||
if (otherUserBean != null)
|
||||
Positioned(
|
||||
left: 40.sp,
|
||||
bottom: 4.sp,
|
||||
child: titleWidget(chatGlobalModel.totalUnReadCount)),
|
||||
],
|
||||
),
|
||||
|
||||
|
||||
),
|
||||
body: DropTarget(
|
||||
onDragDone: (detail) {
|
||||
@ -547,6 +577,110 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
loadUserData() async {
|
||||
String url =
|
||||
"${Api.getUserInfoTA + widget.conversation.userID!.split('_').last}/home";
|
||||
var data = await DioManager.instance.get(url: url);
|
||||
var bean = BaseResponse<ResponseBean>.fromJson(
|
||||
data, (data) => ResponseBean.fromJson(data));
|
||||
|
||||
if (bean.isSuccess()) {
|
||||
isLike = bean.data.isFollow;
|
||||
otherUserBean = bean.data.user;
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
Widget titleWidget(int msgCount) {
|
||||
return otherUserBean == null
|
||||
? Container()
|
||||
: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.UserInfoActivity,
|
||||
arguments: otherUserBean!.id!.toString());
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: msgCount > 0 ? 40.sp : 0),
|
||||
child: Row(
|
||||
children: [
|
||||
ClipOval(
|
||||
child: Image.network(
|
||||
otherUserBean!.avatar!,
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
fit: BoxFit.cover,
|
||||
)),
|
||||
SizedBox(
|
||||
width: 4.sp,
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(otherUserBean!.nickname ?? '昵称待审核',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
// fontSize:
|
||||
// ((otherUserBean!.onlineFlag ?? '').isNotEmpty)
|
||||
// ? 14.sp
|
||||
// : 16.sp),
|
||||
)),
|
||||
// if ((otherUserBean!.onlineFlag ?? '').isNotEmpty)
|
||||
// Text(
|
||||
// otherUserBean!.onlineFlag ?? '',
|
||||
// style: TextStyle(
|
||||
// color: Colors.white.withOpacity(0.75),
|
||||
// fontSize: 12.sp),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
|
||||
]),
|
||||
if (!isLike)
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
if (!isLike) {
|
||||
var data = await DioManager.instance.post(
|
||||
url: "${Api.setLike + otherUserBean!.id!.toString()}/follow",
|
||||
params: {'status': isLike ? "0" : "1"});
|
||||
var bean = BaseResponse<dynamic>.fromJson(
|
||||
data,
|
||||
(jsonData) => jsonData,
|
||||
);
|
||||
if (bean.isSuccess()) {
|
||||
|
||||
isLike = !isLike;
|
||||
setState(() {
|
||||
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// addFollowHeader();
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 5.sp,
|
||||
),
|
||||
padding: EdgeInsets.only(left: 4.sp, right: 4.sp),
|
||||
height: 22.sp,
|
||||
decoration: BoxDecoration(
|
||||
gradient: AppColor.mainHorLinearGradient,
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'喜欢',
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp, color: Colors.white)),
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class TIMUIKitChatProviderScope extends StatelessWidget {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/app/chat/TIMUIKitChat/tim_uikit_chat.dart';
|
||||
import 'package:circle_app/app/chat/widget/more_dialog.dart';
|
||||
import 'package:circle_app/app/chat/widget/send_gift_dialog.dart';
|
||||
import 'package:circle_app/app/minefragment/logic.dart';
|
||||
import 'package:circle_app/components/my_app_bar.dart';
|
||||
@ -16,6 +17,7 @@ import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/ui/controller/tim_uikit_chat_controller.dart';
|
||||
|
||||
import '../../util/eventBus.dart';
|
||||
import '../userinfo/logic.dart';
|
||||
|
||||
class ChatPage extends StatefulWidget {
|
||||
|
||||
@ -41,6 +43,8 @@ class _ChatPageState extends State<ChatPage> {
|
||||
TIMUIKitChatController();
|
||||
|
||||
User? userInfoBean;
|
||||
UserBean? otherUserBean;
|
||||
String conversationID = '';
|
||||
var sub;
|
||||
var sub1;
|
||||
@override
|
||||
@ -49,23 +53,41 @@ class _ChatPageState extends State<ChatPage> {
|
||||
super.initState();
|
||||
initEventBus();
|
||||
loadMyInfo();
|
||||
loadIsShowSendGiftDialogData();
|
||||
loadUserData();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void loadIsShowSendGiftDialogData() async {
|
||||
V2TimConversation con = Get.arguments;
|
||||
var data = await DioManager.instance.get(url: Api.isShow_give_gift + con!.conversationID!.split('_').last);
|
||||
var data = await DioManager.instance.get(url: Api.isShow_give_gift + conversationID.split('_').last);
|
||||
|
||||
if (data['code'] == 200) {
|
||||
if (data['data']) {
|
||||
Get.bottomSheet(SendGiftDialog(accid: con!.conversationID!,title: data['msg'],), isScrollControlled: true,
|
||||
Get.bottomSheet(SendGiftDialog(accid: conversationID,title: data['msg'],), isScrollControlled: true,
|
||||
enableDrag: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
loadUserData() async {
|
||||
V2TimConversation con = Get.arguments;
|
||||
conversationID = con!.conversationID!;
|
||||
String url = "${Api.getUserInfoTA + conversationID.split('_').last}/home";
|
||||
var data = await DioManager.instance.get(url: url);
|
||||
var bean = BaseResponse<ResponseBean>.fromJson(
|
||||
data, (data) => ResponseBean.fromJson(data));
|
||||
|
||||
if (bean.isSuccess()) {
|
||||
otherUserBean = bean.data.user;
|
||||
setState(() {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
loadIsShowSendGiftDialogData();
|
||||
}
|
||||
|
||||
|
||||
initEventBus()async{
|
||||
sub = EventBusManager.on<SendCoustomMessage>().listen((event) async{
|
||||
@ -190,14 +212,26 @@ class _ChatPageState extends State<ChatPage> {
|
||||
],
|
||||
),
|
||||
customAppBar:MyAppBar(
|
||||
centerTitle: con != null ? con.showName! : '',
|
||||
centerTitle: '',
|
||||
actionWdiget: GestureDetector(
|
||||
onTap: () async{
|
||||
var data = await Get.toNamed(AppRoutes.UserInfoActivity,arguments: con.userID.toString().split('_').last,preventDuplicates: false);
|
||||
|
||||
onTap: () {
|
||||
Get.bottomSheet(
|
||||
MoreDialog(
|
||||
sessionId: conversationID,
|
||||
userId: (otherUserBean?.id ?? 0) > 0 ? otherUserBean!.id!.toString() : '',
|
||||
deleteMsgCallBack: () {
|
||||
// context.read<ChatViewModel>().clearMsg();
|
||||
// ChatViewModel viewModel = context.read<ChatViewModel>();
|
||||
// viewModel.messageList.clear();
|
||||
// viewModel.notifyListeners();
|
||||
}),
|
||||
isScrollControlled: true);
|
||||
// defaultAvatarTap(widget.sessionId, isSelf:false);
|
||||
},
|
||||
child: Text('查看主页',style: TextStyle(color: const Color(0xFF00FFF4),fontSize:12.sp,fontWeight: FontWeight.w500),),
|
||||
),
|
||||
child: Image.asset(
|
||||
getMsgImage('msg_more'),
|
||||
width: 24.sp,
|
||||
)),
|
||||
onPressed: () {},
|
||||
),
|
||||
|
||||
@ -246,6 +280,84 @@ class _ChatPageState extends State<ChatPage> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Widget titleWidget() {
|
||||
return userInfoBean == null
|
||||
? Container()
|
||||
: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.UserInfoActivity,
|
||||
arguments: userInfoBean!.id!.toString());
|
||||
},
|
||||
child: Container(
|
||||
margin:
|
||||
EdgeInsets.only(left: 0 > 99 ? 80.sp : 65.sp),
|
||||
child: Row(
|
||||
children: [
|
||||
ClipOval(
|
||||
child: Image.network(
|
||||
otherUserBean!.avatar!,
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
fit: BoxFit.cover,
|
||||
)),
|
||||
SizedBox(
|
||||
width: 4.sp,
|
||||
),
|
||||
// Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// Text(
|
||||
// userInfoBean!.nickname ?? '昵称待审核',
|
||||
// style: TextStyle(
|
||||
// color: Colors.white,
|
||||
// fontSize:
|
||||
// ((otherUserBean!.onlineFlag ?? '').isNotEmpty)
|
||||
// ? 14.sp
|
||||
// : 16.sp),
|
||||
// ),
|
||||
// if ((otherUserBean!.onlineFlag ?? '').isNotEmpty)
|
||||
// Text(
|
||||
// otherUserBean!.onlineFlag ?? '',
|
||||
// style: TextStyle(
|
||||
// color: Colors.white.withOpacity(0.75),
|
||||
// fontSize: 12.sp),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// if (otherUserBean!.! <= 1 ))
|
||||
// GestureDetector(
|
||||
// onTap: () {
|
||||
// if (userInfoBean!.followStatus! <= 1) {
|
||||
// setFollow();
|
||||
// } else {
|
||||
// addFollowHeader();
|
||||
// }
|
||||
// },
|
||||
// child: Container(
|
||||
// margin: EdgeInsets.only(
|
||||
// left: 5.sp,
|
||||
// ),
|
||||
// padding: EdgeInsets.only(left: 4.sp, right: 4.sp),
|
||||
// height: 22.sp,
|
||||
// decoration: BoxDecoration(
|
||||
// gradient: AppColor.newMainVerLinearGradient,
|
||||
// borderRadius: BorderRadius.circular(14),
|
||||
// ),
|
||||
// child: Center(
|
||||
// child: Text(
|
||||
// userInfoBean!.followStatus! <= 1 ? '关注' : '+特别关心',
|
||||
// style: TextStyle(
|
||||
// fontSize: 12.sp, color: Colors.white)),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
475
circle_app/lib/app/chat/widget/more_dialog.dart
Normal file
@ -0,0 +1,475 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/data_services/friendShip/friendship_services.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/data_services/services_locatar.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/ui/controller/tim_uikit_chat_controller.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/ui/controller/tim_uikit_conversation_controller.dart';
|
||||
import '../../../network/api.dart';
|
||||
import '../../../network/dio_manager.dart';
|
||||
import '../../../router/app_routers.dart';
|
||||
import '../../../util/eventBus.dart';
|
||||
import '../../../util/util.dart';
|
||||
import '../../userinfo/logic.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class MoreDialog extends StatefulWidget {
|
||||
String userId;
|
||||
String sessionId;
|
||||
Function deleteMsgCallBack;
|
||||
MoreDialog(
|
||||
{super.key,
|
||||
required this.sessionId,
|
||||
required this.userId,
|
||||
required this.deleteMsgCallBack});
|
||||
|
||||
@override
|
||||
_MoreDialogState createState() => new _MoreDialogState();
|
||||
}
|
||||
|
||||
class _MoreDialogState extends State<MoreDialog> {
|
||||
// TODO: add state variables and methods
|
||||
// late ChatViewModel _viewModel;
|
||||
bool isTop = false;
|
||||
bool isBlack = false;
|
||||
UserBean? userBean;
|
||||
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
|
||||
loadIsTop();
|
||||
getUserData();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// TODO: add widget build method
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: userBean != null
|
||||
? Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Container())),
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(16.0),
|
||||
topRight: Radius.circular(16.0),
|
||||
),
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF4A3E5D),
|
||||
Color(0xFF344143),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
height: 118.0,
|
||||
width: double.infinity,
|
||||
child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
Get.back();
|
||||
Get.toNamed(AppRoutes.UserInfoActivity,
|
||||
arguments: widget.userId);
|
||||
},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image(
|
||||
image:
|
||||
AssetImage(getMineImage("im_right_look")),
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 2.sp),
|
||||
child: Text(
|
||||
"查看主页",
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
Get.toNamed(AppRoutes.ReportActivity,
|
||||
arguments: {"userId": widget.userId});
|
||||
},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image(
|
||||
image: AssetImage(getMsgImage("msg_report")),
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 2.sp),
|
||||
child: const Text(
|
||||
"举报",
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
if (!isBlack) {
|
||||
_showReportDialog(Get.context!);
|
||||
} else {
|
||||
cancelBlack();
|
||||
}
|
||||
// Navigator.pop(context);
|
||||
},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image(
|
||||
image: AssetImage(getMsgImage("msg_add_black")),
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 2.sp),
|
||||
child: Text(
|
||||
(isBlack) ? '取消拉黑' : " 拉黑 ",
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
// Navigator.pop(context);
|
||||
addTop(isTop, widget.sessionId);
|
||||
},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image(
|
||||
image: AssetImage(getMineImage("im_first")),
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 2.sp),
|
||||
child: Text(
|
||||
isTop ? '取消置顶' : "聊天置顶",
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
clearMsg(widget.sessionId);
|
||||
},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image(
|
||||
image: AssetImage(getMineImage("im_visit")),
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 2.sp),
|
||||
child: Text(
|
||||
"清空记录",
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
: loaddingWidget(true),
|
||||
);
|
||||
}
|
||||
|
||||
void _showReportDialog(BuildContext context) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
child: Container(
|
||||
height: 277.sp,
|
||||
padding: const EdgeInsets.all(1.0),
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.circular(22.0.sp),
|
||||
// gradient: const LinearGradient(
|
||||
// colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)],
|
||||
// begin: Alignment.topCenter,
|
||||
// end: Alignment.bottomCenter,
|
||||
// ),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(1.sp),
|
||||
child: Image.asset(getMineImage("im_neglect")),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 12.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
Center(
|
||||
child: Text(
|
||||
"是否拉黑",
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 14.sp),
|
||||
alignment: Alignment.center,
|
||||
child: Image(
|
||||
image: AssetImage(getMineImage("icon_dialog_black")),
|
||||
width: 70.sp,
|
||||
height: 70.sp,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 12.sp, left: 14.sp, right: 14.sp),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
"拉黑后,你将屏蔽对方的任何信息若您关注了对方,将自动取消关注。",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: const Color(0xCCF7FAFA), fontSize: 16.sp),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0x26FFFFFF),
|
||||
Color(0x26FFFFFF),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.only(
|
||||
top: 10.sp,
|
||||
bottom: 10.sp,
|
||||
left: 52.sp,
|
||||
right: 52.sp),
|
||||
child: const Text(
|
||||
"否",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 24.sp),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
setBlock();
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0x26FFFFFF),
|
||||
Color(0x26FFFFFF),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.only(
|
||||
top: 10.sp,
|
||||
bottom: 10.sp,
|
||||
left: 52.sp,
|
||||
right: 52.sp),
|
||||
child: const Text(
|
||||
"是",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
//聊天置顶
|
||||
addTop(bool status, String sessionId) async {
|
||||
//会话置顶
|
||||
V2TimCallback pinConversationRes = await TencentImSDKPlugin.v2TIMManager
|
||||
.getConversationManager()
|
||||
.pinConversation(
|
||||
conversationID: widget.sessionId,//需要修改置顶属性的会话id
|
||||
isPinned: !status);//是否置顶
|
||||
if (pinConversationRes.code == 0) {
|
||||
//设置置顶成功
|
||||
if (!status) {
|
||||
isTop = true;
|
||||
showOKToast('置顶成功');
|
||||
} else {
|
||||
showOKToast('取消置顶成功');
|
||||
isTop = false;
|
||||
}
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//清空聊天记录
|
||||
clearMsg(String sessionId) async {
|
||||
String userId = widget.sessionId.replaceAll("c2c_", '');
|
||||
//清空单聊本地及云端的消息(不删除会话)
|
||||
V2TimCallback clearC2CHistoryMessageRes = await TencentImSDKPlugin
|
||||
.v2TIMManager
|
||||
.getMessageManager()
|
||||
.clearC2CHistoryMessage(userID:userId); // 需要清空记录的用户id
|
||||
if (clearC2CHistoryMessageRes.code == 0) {
|
||||
EventBusManager.fire(ClearMsg());
|
||||
//清除成功
|
||||
showOKToast('记录清空成功');
|
||||
Get.back();
|
||||
}
|
||||
}
|
||||
|
||||
void loadIsTop() async {
|
||||
V2TimValueCallback<V2TimConversation> getConversationtRes =
|
||||
await TencentImSDKPlugin.v2TIMManager
|
||||
.getConversationManager()
|
||||
.getConversation(conversationID: widget.sessionId);//会话唯一 ID,如果是 C2C 单聊,组成方式为 c2c_userID,如果是群聊,组成方式为 group_groupID
|
||||
if (getConversationtRes.code == 0) {
|
||||
isTop = getConversationtRes.data?.isPinned ?? false;
|
||||
setState(() {
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void getUserData() async {
|
||||
var data = await DioManager.instance.get(
|
||||
url: Api.getUserInfoTA + widget.userId + '/home',
|
||||
);
|
||||
|
||||
var bean = BaseResponse<ResponseBean>.fromJson(
|
||||
data, (data) => ResponseBean.fromJson(data));
|
||||
|
||||
if (bean.isSuccess()) {
|
||||
userBean = bean.data.user;
|
||||
var result = await DioManager.instance
|
||||
.get(url: '${Api.setBlock + widget.userId}/block');
|
||||
isBlack = result["data"]["status"] == 1;
|
||||
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
setBlock() async {
|
||||
setBlack("1");
|
||||
}
|
||||
|
||||
cancelBlack() async {
|
||||
setBlack("0");
|
||||
}
|
||||
|
||||
void setBlack(String status) async {
|
||||
List<String> parts = widget.sessionId.split('_');
|
||||
if (parts[2] == "10") {
|
||||
showOKToast("不可拉黑客服号哦~");
|
||||
return;
|
||||
}
|
||||
var data = await DioManager.instance.post(
|
||||
url: "${Api.setBlock + widget.userId}/block",
|
||||
params: {'status': status});
|
||||
var bean = BaseResponse<dynamic>.fromJson(
|
||||
data,
|
||||
(jsonData) => jsonData,
|
||||
);
|
||||
if (bean.isSuccess()) {
|
||||
final FriendshipServices _friendshipServices =
|
||||
serviceLocator<FriendshipServices>();
|
||||
|
||||
isBlack = status == "1";
|
||||
try {
|
||||
if (isBlack) {
|
||||
// Navigator.pop(Get.context!);
|
||||
var result = await _friendshipServices
|
||||
.addToBlackList(userIDList: [widget.sessionId]);
|
||||
showOKToast("拉黑成功");
|
||||
} else {
|
||||
var result = await _friendshipServices
|
||||
.deleteFromBlackList(userIDList: [widget.sessionId]);
|
||||
showOKToast("取消拉黑成功");
|
||||
}
|
||||
// await Future.delayed(Duration(milliseconds: 500));
|
||||
// Future.delayed(Duration(seconds: 3),() {
|
||||
EventBusManager.fire(
|
||||
CommentBlackEvent(userId: widget.userId, isBlack: isBlack));
|
||||
// });
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ClearMsg {
|
||||
}
|
||||
@ -67,7 +67,7 @@ class CircleLogic extends GetxController {
|
||||
getCityList();
|
||||
|
||||
// getBanner();
|
||||
// getNearByList();
|
||||
getNearByList();
|
||||
|
||||
|
||||
EventBusManager.on<CommentVipEvent>().listen((event) {
|
||||
@ -395,6 +395,7 @@ class VicinityItemBean {
|
||||
final String birthday;
|
||||
final int age;
|
||||
final int vip;
|
||||
final int mark;
|
||||
final int gender;
|
||||
final int role;
|
||||
final int orientation;
|
||||
@ -418,6 +419,7 @@ class VicinityItemBean {
|
||||
required this.avatar,
|
||||
required this.signature,
|
||||
required this.birthday,
|
||||
required this.mark,
|
||||
required this.age,
|
||||
required this.vip,
|
||||
required this.gender,
|
||||
@ -446,6 +448,7 @@ class VicinityItemBean {
|
||||
id: json['id'],
|
||||
nickname: json['nickname'],
|
||||
avatar: json['avatar'],
|
||||
mark: json['mark'] ?? 0,
|
||||
signature: json['signature'],
|
||||
birthday: json['birthday'],
|
||||
age: json['age'],
|
||||
|
||||
@ -136,6 +136,7 @@ class User {
|
||||
int? gender;
|
||||
int? age;
|
||||
int? id;
|
||||
int? mark;
|
||||
double? lat;
|
||||
double? lng;
|
||||
String? nickname;
|
||||
@ -150,6 +151,7 @@ class User {
|
||||
this.gender,
|
||||
this.id,
|
||||
this.lat,
|
||||
this.mark,
|
||||
this.lng,
|
||||
this.age,
|
||||
this.nickname,
|
||||
@ -162,6 +164,7 @@ class User {
|
||||
avatar = json['avatar'];
|
||||
city = json['city'];
|
||||
gender = json['gender'];
|
||||
mark = json['mark'] ?? 0;
|
||||
id = json['id'];
|
||||
age = json['age'] ?? 0;
|
||||
lat = json['lat'] ?? 0.0;
|
||||
|
||||
@ -725,7 +725,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
),
|
||||
Tab(
|
||||
child: Text(
|
||||
'发现',
|
||||
'精选',
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
),
|
||||
@ -793,14 +793,19 @@ class _CirclePageState extends State<CirclePage>
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (_tabController.index == 1 ) {
|
||||
navigateToQueen();
|
||||
} else {
|
||||
Get.bottomSheet(
|
||||
TodayPeopleDialog(isShow:true),
|
||||
isScrollControlled: true,
|
||||
enableDrag: false,
|
||||
);
|
||||
}
|
||||
|
||||
},
|
||||
child: Image.asset(
|
||||
getMsgImage('heart_icon'),
|
||||
_tabController.index == 1 ? getCircleImage('QA_icon') : getMsgImage('heart_icon'),
|
||||
width: 24.sp,
|
||||
),
|
||||
),
|
||||
|
||||
@ -392,7 +392,7 @@ class _DiscoverState extends State<Discover>
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: user.images![index],
|
||||
fit: BoxFit.cover,
|
||||
width: Get.width,
|
||||
// width: Get.width,
|
||||
height: screenHeight,
|
||||
));
|
||||
},itemCount: user.images!.length,)
|
||||
|
||||
@ -21,6 +21,7 @@ import 'package:get/get.dart';
|
||||
import 'package:get/get_core/src/get_main.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../../../common/Widgets/tag_widget.dart';
|
||||
import '../../../util/SharedPreferencesHelper.dart';
|
||||
import '../../../util/eventBus.dart';
|
||||
import '../../circle_list/logic.dart';
|
||||
@ -847,12 +848,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
lists.user?.vip != null && lists.user!.vip == 0
|
||||
? Container()
|
||||
: Image.asset(
|
||||
getCircleImage(lists.user!.vip == 1 ? 'vip' : 'year_vip'),
|
||||
width: 36.sp,
|
||||
)
|
||||
UserTagWidget(lists.user!.mark!),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
@ -1158,12 +1154,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
lists.user?.vip != null && lists.user!.vip == 0
|
||||
? Container()
|
||||
: Image.asset(
|
||||
getCircleImage(lists.user!.vip == 1 ? 'vip' : 'year_vip'),
|
||||
width: 36.sp,
|
||||
)
|
||||
UserTagWidget(lists.user!.mark!),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
|
||||
@ -21,6 +21,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../../../common/Widgets/base_tip_widget.dart';
|
||||
import '../../../common/Widgets/tag_widget.dart';
|
||||
|
||||
class LikeView extends StatefulWidget {
|
||||
@override
|
||||
@ -627,15 +628,16 @@ class _LikeViewState extends State<LikeView>
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
lists.user?.vip != null &&
|
||||
lists.user!.vip == 0
|
||||
? Container()
|
||||
: Image.asset(
|
||||
getCircleImage(lists.user!.vip == 1
|
||||
? 'vip'
|
||||
: 'year_vip'),
|
||||
width: 36.sp,
|
||||
)
|
||||
UserTagWidget(lists.user!.mark!),
|
||||
// lists.user?.vip != null &&
|
||||
// lists.user!.vip == 0
|
||||
// ? Container()
|
||||
// : Image.asset(
|
||||
// getCircleImage(lists.user!.vip == 1
|
||||
// ? 'vip'
|
||||
// : 'year_vip'),
|
||||
// width: 36.sp,
|
||||
// )
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
@ -933,15 +935,7 @@ class _LikeViewState extends State<LikeView>
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
lists.user?.vip != null &&
|
||||
lists.user!.vip == 0
|
||||
? Container()
|
||||
: Image.asset(
|
||||
getCircleImage(lists.user!.vip == 1
|
||||
? 'vip'
|
||||
: 'year_vip'),
|
||||
width: 36.sp,
|
||||
)
|
||||
UserTagWidget(lists.user!.mark!),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
|
||||
@ -13,6 +13,8 @@ import 'package:get/get.dart';
|
||||
import 'package:get/get_core/src/get_main.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
|
||||
import '../../../common/Widgets/tag_widget.dart';
|
||||
|
||||
class Vicinity extends StatefulWidget {
|
||||
CircleLogic logic;
|
||||
// TODO: add state variables, methods and constructor params
|
||||
@ -457,12 +459,7 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
if (item.vip > 0)
|
||||
Image(
|
||||
image: AssetImage(getBaseImage(item.vip == 1 ? "vip" : 'year_vip')),
|
||||
width: 44.sp,
|
||||
height: 18.sp,
|
||||
),
|
||||
UserTagWidget(item.mark!),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@ -128,6 +128,7 @@ class LikeLogic extends GetxController {
|
||||
|
||||
void relaodData() {
|
||||
page = 1;
|
||||
isMore = true;
|
||||
loadCircleListData();
|
||||
}
|
||||
|
||||
|
||||
@ -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:url_launcher/url_launcher.dart';
|
||||
|
||||
@ -140,7 +140,7 @@ class _CustomDialogState extends State<UpdateDialog> {
|
||||
child:isShowWeb? Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
child: Text(
|
||||
"下载太慢?试试游览器下载吧。",
|
||||
"下载太慢?试试浏览器下载吧。",
|
||||
style: TextStyle(
|
||||
color: Colors.blue, // 设置蓝色颜色
|
||||
decoration:
|
||||
@ -171,11 +171,11 @@ class _CustomDialogState extends State<UpdateDialog> {
|
||||
if (appStoreUrl.contains("apk")) {
|
||||
updataApk(appStoreUrl);
|
||||
setDownloadUi();
|
||||
await Future.delayed(Duration(seconds: 10));
|
||||
Future.delayed(Duration(seconds: 10),() {
|
||||
setState(() {
|
||||
isShowWeb = true;
|
||||
});
|
||||
|
||||
});
|
||||
} else {
|
||||
if (await canLaunch(appStoreUrl)) {
|
||||
await launch(appStoreUrl,
|
||||
@ -262,7 +262,7 @@ class _CustomDialogState extends State<UpdateDialog> {
|
||||
print(error);
|
||||
});
|
||||
DioManager.instance.setReceiveTimeout(30);
|
||||
await AppInstaller.installApk(filePath, actionRequired: false);
|
||||
// await AppInstaller.installApk(filePath, actionRequired: false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -34,6 +34,7 @@ import '../circle/view.dart';
|
||||
import '../circle_list/logic.dart';
|
||||
import '../circle_list/view.dart';
|
||||
import '../dialog/UpdateDialog.dart';
|
||||
import '../invite/logic.dart';
|
||||
import '../minefragment/view.dart';
|
||||
import '../msg/view.dart';
|
||||
import 'state.dart';
|
||||
@ -42,7 +43,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
late TabController tabController;
|
||||
var connectivitySub;
|
||||
ConnectivityResult? currentResult;
|
||||
|
||||
User? model;
|
||||
int currentIndex = 0;
|
||||
Widget currentPage = Container();
|
||||
|
||||
@ -65,6 +66,10 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
bool isProd = true;
|
||||
|
||||
String accountId = '';
|
||||
|
||||
String inviteCode = '';
|
||||
|
||||
var link = '';
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
@ -87,6 +92,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
|
||||
setFirstData();
|
||||
|
||||
loadMyInfoData();
|
||||
tabs.add(CirclePage());
|
||||
tabs.add(CircleListPage());
|
||||
tabs.add(MsgPage());
|
||||
@ -373,10 +379,10 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
if (index == 0) {
|
||||
final logic = Get.put(CircleLogic());
|
||||
logic.loadCirclePeopleData();
|
||||
} else if (index == 3) {
|
||||
} else if (index == 4) {
|
||||
final logic = Get.put(MinefragmentLogic());
|
||||
logic.getMode();
|
||||
} else if (index == 2) {
|
||||
} else if (index == 3) {
|
||||
final logic = Get.find<MsgLogic>();
|
||||
EventBusManager.fire(MsgRecommendCardRefresh());
|
||||
logic.loadChatData();
|
||||
@ -449,10 +455,10 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
} else if (currentIndex == 1) {
|
||||
var logic = Get.put(LikeLogic());
|
||||
logic.loadData();
|
||||
} else if (currentIndex == 2) {
|
||||
} else if (currentIndex == 3) {
|
||||
final logic = Get.find<MsgLogic>();
|
||||
logic.loadData();
|
||||
} else if (currentIndex == 3) {
|
||||
} else if (currentIndex == 4) {
|
||||
var logic = Get.put(MinefragmentLogic());
|
||||
logic.loadData();
|
||||
}
|
||||
@ -467,6 +473,24 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
}
|
||||
}
|
||||
|
||||
void loadMyInfoData() async {
|
||||
var data = await DioManager.instance.get(url: Api.getUserMine);
|
||||
var bean = BaseResponse<MineResponseBean>.fromJson(
|
||||
data, (data) => MineResponseBean.fromJson(data));
|
||||
if (bean.isSuccess()) {
|
||||
model = bean.data.user;
|
||||
var result = await DioManager.instance.get(url: Api.inviteMainPage);
|
||||
if (result['code'] == 200) {
|
||||
Autogenerated info = Autogenerated.fromJson(result);
|
||||
inviteCode = info.data!.inviteCode!;
|
||||
link = info.data!.link!;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import 'package:circle_app/app/circle/view.dart';
|
||||
import 'package:circle_app/app/minefragment/view.dart';
|
||||
import 'package:circle_app/app/msg/view.dart';
|
||||
import 'package:circle_app/common/colors/app_color.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:circle_app/view/ExitAppConfirmation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -19,7 +20,10 @@ class HomePage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _HomePageState extends State<HomePage>
|
||||
with AutomaticKeepAliveClientMixin, SingleTickerProviderStateMixin,RouteAware {
|
||||
with
|
||||
AutomaticKeepAliveClientMixin,
|
||||
SingleTickerProviderStateMixin,
|
||||
RouteAware {
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
|
||||
@ -29,7 +33,7 @@ class _HomePageState extends State<HomePage>
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
logic.tabController = TabController(
|
||||
length: 4,
|
||||
length: 5,
|
||||
vsync: this,
|
||||
initialIndex: 0,
|
||||
animationDuration: Duration.zero);
|
||||
@ -44,7 +48,6 @@ class _HomePageState extends State<HomePage>
|
||||
routeObserver.subscribe(this, ModalRoute.of(context) as PageRoute);
|
||||
}
|
||||
|
||||
|
||||
void didPopNext() {
|
||||
print('didPopNext');
|
||||
logic.getUnreadSize();
|
||||
@ -53,13 +56,12 @@ class _HomePageState extends State<HomePage>
|
||||
///当前页面进入时触发
|
||||
void didPush() {
|
||||
print('didPopNext');
|
||||
|
||||
}
|
||||
|
||||
void didPop() {
|
||||
print('didPop');
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
@ -67,7 +69,6 @@ class _HomePageState extends State<HomePage>
|
||||
routeObserver.unsubscribe(this);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder(builder: (HomeLogic controller) {
|
||||
@ -79,7 +80,7 @@ class _HomePageState extends State<HomePage>
|
||||
height: 49.sp + MediaQuery.of(context).padding.bottom,
|
||||
width: Get.width,
|
||||
// color: Colors.red,
|
||||
padding: EdgeInsets.only(left: 20.sp, right: 20.sp),
|
||||
padding: EdgeInsets.only(left: 10.sp, right: 10.sp),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF423055),
|
||||
image: DecorationImage(
|
||||
@ -93,8 +94,9 @@ class _HomePageState extends State<HomePage>
|
||||
children: [
|
||||
funcItem(0, 'circle', 0 == controller.currentIndex, controller),
|
||||
funcItem(1, 'like', 1 == controller.currentIndex, controller),
|
||||
funcItem(2, 'msg', 2 == controller.currentIndex, controller),
|
||||
funcItem(3, 'mine', 3 == controller.currentIndex, controller),
|
||||
centerItem(2, 'call', 2 == controller.currentIndex, controller),
|
||||
funcItem(3, 'msg', 3 == controller.currentIndex, controller),
|
||||
funcItem(4, 'mine', 4 == controller.currentIndex, controller),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -113,6 +115,7 @@ class _HomePageState extends State<HomePage>
|
||||
children: [
|
||||
const CirclePage(),
|
||||
CircleListPage(),
|
||||
Container(),
|
||||
MsgPage(),
|
||||
MinefragmentPage()
|
||||
],
|
||||
@ -124,9 +127,57 @@ class _HomePageState extends State<HomePage>
|
||||
});
|
||||
}
|
||||
|
||||
centerItem(int index, String image, bool isSelected, HomeLogic controller) {
|
||||
return SizedBox(
|
||||
width: 50.sp,
|
||||
height: 50.sp,
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
if (!isSelected) {
|
||||
logic.tabController.animateTo(index,
|
||||
duration: Duration(milliseconds: 0), curve: Curves.ease);
|
||||
controller.updateIndex(index);
|
||||
}
|
||||
},
|
||||
child: OverflowBox(
|
||||
minWidth: 0.0,
|
||||
maxWidth: double.infinity,
|
||||
minHeight: 0.0,
|
||||
maxHeight: double.infinity,
|
||||
child: Container(
|
||||
width: 60.sp,
|
||||
height: 60.sp,
|
||||
margin: EdgeInsets.only(bottom: 4.sp),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF460358),
|
||||
Color(0xFF400350),
|
||||
],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(30.sp)
|
||||
),
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
isSelected
|
||||
? getTabbarImage('${image}_selected')
|
||||
: getTabbarImage('${image}_normal'),
|
||||
width: 50.sp,
|
||||
height: 50.sp,
|
||||
fit: BoxFit.fill,
|
||||
excludeFromSemantics: true,
|
||||
gaplessPlayback: true,
|
||||
))),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
funcItem(int index, String image, bool isSelected, HomeLogic controller) {
|
||||
return SizedBox(
|
||||
width: 80.sp,
|
||||
width: 50.sp,
|
||||
height: 50.sp,
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
@ -139,7 +190,7 @@ class _HomePageState extends State<HomePage>
|
||||
},
|
||||
child: Stack(alignment: Alignment.center, children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 8.sp),
|
||||
margin: EdgeInsets.only(top: index == 2 ? 0 : 8.sp),
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
isSelected
|
||||
@ -172,7 +223,7 @@ class _HomePageState extends State<HomePage>
|
||||
))),
|
||||
// Obx(() => null)
|
||||
Obx(() => Visibility(
|
||||
visible: index == 2 && controller.unreadSIze != "0",
|
||||
visible: index == 3 && controller.unreadSIze != "0",
|
||||
child: Positioned(
|
||||
// right: 4.sp,
|
||||
top: 6.sp,
|
||||
|
||||
@ -42,15 +42,20 @@ class LoginLogic extends GetxController {
|
||||
String loginPhone =
|
||||
await sharedPreferences.getString(SharedPreferencesHelper.LOGINPHONE) ??
|
||||
"";
|
||||
String pwd =
|
||||
await sharedPreferences.getString(SharedPreferencesHelper.PWD) ??
|
||||
"";
|
||||
print(loginPhone);
|
||||
phoneEditingController.text = loginPhone;
|
||||
if (GetUtils.isPhoneNumber(loginPhone) && loginPhone.length == 11) {
|
||||
isPhone = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (sharedPreferences!.containsKey(SharedPreferencesHelper.firstLogin)) {
|
||||
loginType = 1;
|
||||
pwdEditingController.text = pwd;
|
||||
}
|
||||
|
||||
update();
|
||||
@ -192,6 +197,12 @@ class LoginLogic extends GetxController {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (loginType == 1) {
|
||||
SharedPreferencesHelper.getInstance().then((sharedPreferences) {
|
||||
sharedPreferences.setString(
|
||||
SharedPreferencesHelper.PWD, pwdEditingController.text);
|
||||
});
|
||||
}
|
||||
var data =
|
||||
await DioManager.instance.put(url: Api.refreshToken, params: {});
|
||||
var bean = BaseResponse<LoginData>.fromJson(
|
||||
|
||||
@ -30,6 +30,7 @@ import '../../../router/app_routers.dart';
|
||||
import '../../../util/eventBus.dart';
|
||||
import '../../../util/util.dart';
|
||||
import '../../circle/widgets/discover.dart';
|
||||
import '../recommend_circle_friend_item.dart';
|
||||
import 'tim_uikit_conversation_item.dart';
|
||||
|
||||
typedef TIMConversationItemBuilder = Widget Function(
|
||||
@ -169,6 +170,8 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
||||
// final TUIFriendShipViewModel friendShipViewModel =
|
||||
// serviceLocator<TUIFriendShipViewModel>();
|
||||
bool hasMore = true;
|
||||
var sub;
|
||||
|
||||
List<String> chatImIdList = [];
|
||||
Map recommendCircleFriendData = {};
|
||||
@override
|
||||
@ -485,7 +488,9 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
||||
itemBuilder: (context, index) {
|
||||
if (index == filteredConversationList.length) {
|
||||
return recommendCircleFriendData.isNotEmpty
|
||||
? recommendCircleFriendWidget()
|
||||
? RecommendCircleFriendItem(recommendCircleFriendData: recommendCircleFriendData,getDataCallBack: () {
|
||||
loadRecommendCircleFriendData();
|
||||
})
|
||||
: Container();
|
||||
}
|
||||
|
||||
@ -515,6 +520,7 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
||||
V2TimUserFullInfo? userFullInfo;
|
||||
bool isOfficial = false;
|
||||
bool isSameCity = false;
|
||||
int mark = 0;
|
||||
if (snapshot.connectionState ==
|
||||
ConnectionState.done) {
|
||||
if ((snapshot.data ?? []).isNotEmpty) {
|
||||
@ -534,17 +540,22 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
||||
.toList()
|
||||
.first;
|
||||
|
||||
|
||||
if (userFullInfo!.customInfo!
|
||||
.containsKey('Label')) {
|
||||
if (userFullInfo!.customInfo!['Label']
|
||||
.toString()
|
||||
.isNotEmpty) {
|
||||
var otherInfo = jsonDecode(userFullInfo!
|
||||
Map otherInfo = jsonDecode(userFullInfo!
|
||||
.customInfo!['Label']
|
||||
.toString());
|
||||
Map myInfo = jsonDecode(myuserFullInfo!
|
||||
.customInfo!['Label']
|
||||
.toString());
|
||||
|
||||
if (otherInfo.containsKey('mark')) {
|
||||
mark = otherInfo['mark'] ?? 0;
|
||||
}
|
||||
if (myInfo != null) {
|
||||
if (myInfo.containsKey('city')) {
|
||||
if (myInfo['city'].toString().contains(
|
||||
@ -575,6 +586,7 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
child: TIMConversationItem(
|
||||
mark:mark,
|
||||
isSameCity: isSameCity,
|
||||
isOfficial: isOfficial,
|
||||
isCurrent: isCurrent,
|
||||
|
||||
@ -4,6 +4,7 @@ import 'dart:convert';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/app/msg/TIMUIKitConversation/tim_uikit_conversation_last_msg.dart';
|
||||
import 'package:circle_app/common/Widgets/tag_widget.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@ -25,6 +26,7 @@ class TIMConversationItem extends TIMUIKitStatelessWidget {
|
||||
final String nickName;
|
||||
final V2TimMessage? lastMsg;
|
||||
final int unreadCount;
|
||||
final int mark;
|
||||
final bool isPined;
|
||||
final List<V2TimGroupAtInfo?> groupAtInfoList;
|
||||
final String? draftText;
|
||||
@ -47,6 +49,7 @@ class TIMConversationItem extends TIMUIKitStatelessWidget {
|
||||
Key? key,
|
||||
required this.isShowDraft,
|
||||
required this.faceUrl,
|
||||
required this.mark,
|
||||
required this.isSameCity,
|
||||
required this.nickName,
|
||||
required this.lastMsg,
|
||||
@ -242,14 +245,10 @@ class TIMConversationItem extends TIMUIKitStatelessWidget {
|
||||
)
|
||||
),
|
||||
child: Text('官方',style: TextStyle(color: Color(0xFFF7FAFA),fontSize: 10.sp,fontWeight: FontWeight.w600),),),
|
||||
if (vipType > 0)
|
||||
// if (vipType > 0)
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 5.sp,),
|
||||
child: Image(
|
||||
image: AssetImage(getBaseImage(vipType == 2 ? 'year_vip' : "vip")),
|
||||
width: 44.sp,
|
||||
height: 20.sp,
|
||||
) ,),
|
||||
child: UserTagWidget(mark)),
|
||||
|
||||
Expanded(
|
||||
child:Container()),
|
||||
|
||||
588
circle_app/lib/app/msg/recommend_circle_friend_item.dart
Normal file
@ -0,0 +1,588 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:gradient_borders/box_borders/gradient_box_border.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
|
||||
import '../../common/colors/app_color.dart';
|
||||
import '../../network/api.dart';
|
||||
import '../../network/dio_manager.dart';
|
||||
import '../../router/app_routers.dart';
|
||||
import '../../util/util.dart';
|
||||
import '../circle/widgets/discover.dart';
|
||||
|
||||
class RecommendCircleFriendItem extends StatefulWidget {
|
||||
RecommendCircleFriendItem({super.key,required this.recommendCircleFriendData,required this.getDataCallBack});
|
||||
var recommendCircleFriendData;
|
||||
Function getDataCallBack;
|
||||
@override
|
||||
_RecommendCircleFriendItemState createState() =>
|
||||
_RecommendCircleFriendItemState();
|
||||
}
|
||||
|
||||
class _RecommendCircleFriendItemState extends State<RecommendCircleFriendItem> {
|
||||
// TODO: add state variables and methods
|
||||
var recommendCircleFriendData;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
recommendCircleFriendData = widget.recommendCircleFriendData;
|
||||
// TODO: add widget build method
|
||||
ErrorWidget.builder = (FlutterErrorDetails errorDetails) => Container();
|
||||
|
||||
return recommendCircleFriendData == null ? Container() : recommendCircleFriendWidget();
|
||||
}
|
||||
|
||||
|
||||
recommendCircleFriendWidget() {
|
||||
try {
|
||||
var info = {};
|
||||
|
||||
var user = Users.fromJson(recommendCircleFriendData['user']);
|
||||
|
||||
// 对方喜欢了你100
|
||||
// ·你们有共同喜欢的圈友90
|
||||
// ·你喜欢的圈友也喜欢TA80
|
||||
// ·你们都在深圳留下过足迹70
|
||||
// ·你们有2个共同的圈子:圈子名称、圈子名称60
|
||||
// ·我刚来到这里哦55
|
||||
// ·可能是你想认识的人50
|
||||
// ·很多圈友都喜欢TA40
|
||||
// ·TA是乐园优秀圈主哦~30
|
||||
|
||||
info = checkCardReturnData(recommendCircleFriendData);
|
||||
|
||||
List circleList = recommendCircleFriendData['interests'] ?? [];
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
|
||||
child: Column(children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20.sp),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 2.sp,
|
||||
color: Colors.white.withOpacity(0.5),
|
||||
)),
|
||||
Container(
|
||||
width: 4.sp,
|
||||
height: 4.sp,
|
||||
margin: EdgeInsets.only(left: 15.sp, right: 15.sp),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.white.withOpacity(0.5)),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 2.sp,
|
||||
color: Colors.white.withOpacity(0.5),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 16.sp),
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
getMsgImage('heart_icon'),
|
||||
width: 18.sp,
|
||||
),
|
||||
SizedBox(
|
||||
width: 4.sp,
|
||||
),
|
||||
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(
|
||||
'圈友推荐',
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white,
|
||||
shadows: [
|
||||
Shadow(
|
||||
color: Color(0xffF657FF),
|
||||
offset: Offset(0.0, -1))
|
||||
]),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 4.sp,
|
||||
),
|
||||
Image.asset(
|
||||
getMsgImage('heart_icon'),
|
||||
width: 18.sp,
|
||||
),
|
||||
Expanded(child: Container()),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
widget.getDataCallBack();
|
||||
},
|
||||
child: Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.refresh_sharp,
|
||||
size: 18.sp,
|
||||
color: AppColor.mainColor,
|
||||
),
|
||||
SizedBox(
|
||||
width: 4.sp,
|
||||
),
|
||||
Text(
|
||||
'换一位',
|
||||
style: TextStyle(
|
||||
color: AppColor.mainColor, fontSize: 15.sp),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 16.sp),
|
||||
width: Get.width,
|
||||
// constraints: BoxConstraints(maxHeight: 230.sp),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Color(0xFF4C3E5F), Color(0xFF324140)]),
|
||||
borderRadius: BorderRadius.circular(8.sp),
|
||||
border: GradientBoxBorder(
|
||||
gradient: AppColor.mainVerLinearGradient,
|
||||
width: 1.sp,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.only(left: 12.sp, right: 12.sp, top: 10.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.UserInfoActivity,
|
||||
arguments: user.userId.toString());
|
||||
},
|
||||
child: Container(
|
||||
child: Row(
|
||||
children: [
|
||||
ClipOval(
|
||||
child: Image.network(
|
||||
recommendCircleFriendData['user']['avatar'],
|
||||
width: 50.sp,
|
||||
height: 50.sp,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 6.sp,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
user.nickname ?? '',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Color(0XFFF7FAFA),
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
ShaderMask(
|
||||
shaderCallback: (Rect bounds) {
|
||||
return const LinearGradient(
|
||||
begin: Alignment.centerRight,
|
||||
end: Alignment.centerLeft,
|
||||
colors: [
|
||||
Color(0xff71F3F2),
|
||||
Color(0xffF657FF)
|
||||
],
|
||||
).createShader(
|
||||
Offset.zero & bounds.size);
|
||||
},
|
||||
child: Text(
|
||||
'匹配度' +
|
||||
(recommendCircleFriendData[
|
||||
'recommend_score']
|
||||
.toString() ??
|
||||
'') +
|
||||
'%',
|
||||
style: TextStyle(
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 4.sp,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
height: 18.sp,
|
||||
padding: EdgeInsets.only(
|
||||
left: 6.sp, right: 6.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(9.sp),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment(0.25, 0.5),
|
||||
end: Alignment(0.75, 0.5),
|
||||
colors: [
|
||||
Color(0xff8DFFF8),
|
||||
Color(0xffB5D3FF)
|
||||
])),
|
||||
child: Text(
|
||||
getAgeCOntent(
|
||||
user!.gender ?? 0,
|
||||
user!.age ?? 0,
|
||||
user!.role ?? 0,
|
||||
user!.orientation ?? 0),
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (user.vip! > 0)
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 4.sp,
|
||||
),
|
||||
child: Image.asset(
|
||||
getCircleImage(
|
||||
user.vip == 1 ? 'vip' : 'year_vip'),
|
||||
width: 36.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
V2TimValueCallback<V2TimConversation>
|
||||
getConversationtRes = await TencentImSDKPlugin
|
||||
.v2TIMManager
|
||||
.getConversationManager()
|
||||
.getConversation(
|
||||
conversationID:
|
||||
'c2c-${recommendCircleFriendData['user']['imId']}'); //会话唯一 ID,如果是 C2C 单聊,组成方式为 c2c_userID,如果是群聊,组成方式为 group_groupID
|
||||
if (getConversationtRes.code == 0) {
|
||||
if (getConversationtRes.data?.lastMessage == null) {
|
||||
await createCustomMsg(user.userId.toString(),
|
||||
recommendCircleFriendData['user']['imId']);
|
||||
}
|
||||
} else {
|
||||
await createCustomMsg(user.userId.toString(),
|
||||
recommendCircleFriendData['user']['imId']);
|
||||
}
|
||||
// if (!chatImIdList.contains(user.userId.toString())) {
|
||||
// await createCustomMsg(user.userId.toString(), recommendCircleFriendData['user']['imId']);
|
||||
// }
|
||||
|
||||
pushChatPage(
|
||||
user.userId.toString(),
|
||||
recommendCircleFriendData['user']['imId'],
|
||||
user.nickname!);
|
||||
},
|
||||
child: Container(
|
||||
height: 25.sp,
|
||||
padding: EdgeInsets.only(left: 6.sp, right: 6.sp),
|
||||
decoration: BoxDecoration(
|
||||
gradient: AppColor.mainVerLinearGradient,
|
||||
borderRadius: BorderRadius.circular(12.5.sp)),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'聊一聊',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 15.sp),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (info.containsKey('desc'))
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.sp, right: 16.sp),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 5.sp),
|
||||
width: 3,
|
||||
height: 3,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(1.5),
|
||||
color: Color(0xFF00FFF4)),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: Text(
|
||||
info['desc'],
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
if (info.containsKey('city'))
|
||||
info['city'].toString().isNotEmpty
|
||||
? Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 5.sp),
|
||||
width: 3.sp,
|
||||
height: 3.sp,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(1.5.sp),
|
||||
color: Color(0xFF00FFF4)),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
info['city'],
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w500),
|
||||
))
|
||||
],
|
||||
),
|
||||
)
|
||||
: Container(),
|
||||
if (info.containsKey('both_interests'))
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.sp, right: 16.sp),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 5.sp),
|
||||
width: 3,
|
||||
height: 3,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(1.5),
|
||||
color: Color(0xFF00FFF4)),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: Text(
|
||||
info['both_interests'],
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 5.sp, top: 10.sp),
|
||||
width: 3,
|
||||
height: 3,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(1.5),
|
||||
color: Color(0xFF00FFF4)),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'交友宣言:' +
|
||||
recommendCircleFriendData['user']
|
||||
['signature'],
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w500),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
)),
|
||||
])),
|
||||
Image.asset(
|
||||
getCircleImage('line'),
|
||||
width: Get.width,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
if (circleList.isNotEmpty)
|
||||
Container(
|
||||
height: 72.sp,
|
||||
margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp),
|
||||
width: Get.width,
|
||||
child: ListView.builder(
|
||||
itemBuilder: (context, index) {
|
||||
return CircleInfoItem(
|
||||
bean: circleList[index], index: index);
|
||||
},
|
||||
itemCount: circleList.length,
|
||||
scrollDirection: Axis.horizontal,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
]));
|
||||
} catch (e) {
|
||||
// widget.getDataCallBack();
|
||||
return Container();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class CircleInfoItem extends StatefulWidget {
|
||||
var bean;
|
||||
int index;
|
||||
|
||||
CircleInfoItem({super.key, required this.bean, required this.index});
|
||||
@override
|
||||
_CircleInfoItemState createState() => _CircleInfoItemState();
|
||||
}
|
||||
|
||||
class _CircleInfoItemState extends State<CircleInfoItem> {
|
||||
// TODO: add state variables and methods
|
||||
|
||||
var bean;
|
||||
int index = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
bean = widget.bean;
|
||||
index = widget.index;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// TODO: add widget build method
|
||||
return circleInfoItem();
|
||||
}
|
||||
|
||||
circleInfoItem() {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.Signal_circle_list,
|
||||
arguments: bean['id'].toString());
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(right: 10.sp),
|
||||
padding: EdgeInsets.only(left: 12.sp, right: 5.sp),
|
||||
height: 72.sp,
|
||||
width: 145.sp,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8.sp),
|
||||
border: GradientBoxBorder(
|
||||
gradient: AppColor.mainVerLinearGradient,
|
||||
width: 1.sp,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
width: 42.sp,
|
||||
height: 42.sp,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Color(0xFF71F3F2),
|
||||
Color(0xFFF558FF),
|
||||
],
|
||||
stops: [0.0365, 0.9427],
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.all(1.sp),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: bean['image'],
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
memCacheHeight: 40,
|
||||
memCacheWidth: 40,
|
||||
fit: BoxFit.cover),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: 8.sp,
|
||||
),
|
||||
// alignment: Alignment.,
|
||||
height: 72.sp,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
bean['title'],
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(
|
||||
height: 4.sp,
|
||||
),
|
||||
Text(
|
||||
// "view_total" -> 21
|
||||
'${convertToTenThousand(bean['viewTotal'])}人看过',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: const Color(0xff03FEFB),
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -7,6 +7,7 @@ import 'package:get/get.dart';
|
||||
import 'package:gradient_borders/box_borders/gradient_box_border.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
|
||||
import '../../common/Widgets/tag_widget.dart';
|
||||
import '../../common/colors/app_color.dart';
|
||||
import '../../components/my_app_bar.dart';
|
||||
import '../../router/app_routers.dart';
|
||||
@ -302,12 +303,7 @@ class QuickPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
if (item.vip > 0)
|
||||
Image(
|
||||
image: AssetImage(getBaseImage(item.vip == 1 ? "vip" : 'year_vip')),
|
||||
width: 44.sp,
|
||||
height: 18.sp,
|
||||
),
|
||||
UserTagWidget(item.mark!),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,15 +1,19 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/common/colors/app_color.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:flutter_swiper/flutter_swiper.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_core/src/get_main.dart';
|
||||
import 'package:get/get_state_manager/src/simple/get_state.dart';
|
||||
import 'package:image_gallery_saver/image_gallery_saver.dart';
|
||||
import 'package:qr_flutter/qr_flutter.dart';
|
||||
|
||||
import '../home/logic.dart';
|
||||
import 'logic.dart';
|
||||
import 'dart:ui' as ui;
|
||||
class SwiperPage extends StatefulWidget {
|
||||
@ -23,6 +27,8 @@ class _SwiperPageState extends State<SwiperPage> {
|
||||
|
||||
GlobalKey _globalKey = GlobalKey();
|
||||
|
||||
var homeLogic = Get.find<HomeLogic>();
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -39,7 +45,20 @@ class _SwiperPageState extends State<SwiperPage> {
|
||||
|
||||
});
|
||||
|
||||
return Scaffold(
|
||||
return Stack(
|
||||
children: [
|
||||
Stack(
|
||||
children: [
|
||||
RepaintBoundary(
|
||||
key: _globalKey, child: itemWidget(logic, logic.index, true)),
|
||||
Container(
|
||||
width: Get.width,
|
||||
height: Get.height,
|
||||
color: Colors.black,
|
||||
),
|
||||
],
|
||||
),
|
||||
Scaffold(
|
||||
appBar: null,
|
||||
backgroundColor: Colors.black87,
|
||||
body: GestureDetector(
|
||||
@ -62,7 +81,7 @@ class _SwiperPageState extends State<SwiperPage> {
|
||||
// key: _globalKey,
|
||||
// child:itemWidget(logic,index));
|
||||
// }
|
||||
return itemWidget(logic,index);
|
||||
return itemWidget(logic,index,false);
|
||||
},
|
||||
|
||||
onIndexChanged: (int index) {
|
||||
@ -75,87 +94,198 @@ class _SwiperPageState extends State<SwiperPage> {
|
||||
activeColor: Color(0xFFD14CFF),
|
||||
color: Colors.white)), //下面的分页小点
|
||||
)),
|
||||
// Positioned(
|
||||
// bottom: Get.bottomBarHeight,
|
||||
// right: 15.sp,
|
||||
// child: InkWell(
|
||||
// onTap: () {
|
||||
// _saveLocalImage();
|
||||
// },
|
||||
// child: Container(
|
||||
// alignment: Alignment.center,
|
||||
// padding: EdgeInsets.all(5.sp),
|
||||
// decoration: BoxDecoration(
|
||||
// color: Colors.black.withOpacity(0.5),
|
||||
// borderRadius: BorderRadius.circular(17.5.sp)),
|
||||
// child: Icon(
|
||||
// Icons.download,
|
||||
// color: Colors.white,
|
||||
// size: 25.sp,
|
||||
// ),
|
||||
// ),
|
||||
// ))
|
||||
Positioned(
|
||||
bottom: Get.bottomBarHeight,
|
||||
right: 15.sp,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
_saveLocalImage();
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.all(5.sp),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black.withOpacity(0.5),
|
||||
borderRadius: BorderRadius.circular(17.5.sp)),
|
||||
child: Icon(
|
||||
Icons.download,
|
||||
color: Colors.white,
|
||||
size: 25.sp,
|
||||
),
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
itemWidget(SwiperLogic logic,int index) {
|
||||
return Container(
|
||||
width: Get.width,
|
||||
itemWidget(SwiperLogic logic,int index,bool isShow) {
|
||||
String link = homeLogic.link + '#code=' + homeLogic.inviteCode;
|
||||
return Stack(
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.black,
|
||||
width: double.infinity,
|
||||
height: Get.height,
|
||||
alignment: Alignment.center,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
|
||||
Container(
|
||||
// color: Colors.red,
|
||||
|
||||
child: CachedNetworkImage(
|
||||
// progressIndicatorBuilder: (context,str,progress) {
|
||||
// return Container();
|
||||
// },
|
||||
placeholder: (context,str) {
|
||||
print(str + '进度');
|
||||
if (Get.arguments['index'] == index) {
|
||||
return Container(
|
||||
// color: Colors.red,
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: logic.imgList[index].toString(),
|
||||
|
||||
fit: BoxFit.cover,
|
||||
width: Get.width,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return Container();
|
||||
}
|
||||
},
|
||||
imageUrl: logic.imgList[index].toString().contains('?') ? logic.imgList[index].toString().split('?').first : logic.imgList[index].toString(),
|
||||
fit: BoxFit.cover,
|
||||
width: Get.width,
|
||||
imageUrl: logic.imgList[index],
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 10.sp,
|
||||
right: 10.sp,
|
||||
bottom: 20.sp,
|
||||
child: Container(
|
||||
margin:
|
||||
EdgeInsets.only(top: Get.height * 0.45),
|
||||
margin: EdgeInsets.only(top: Get.height * 0.45),
|
||||
child: Text(
|
||||
'微乐园APP',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 25.sp),
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 25.sp),
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
],
|
||||
))),
|
||||
if (isShow)
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
color: Colors.black,
|
||||
height: 60.sp,
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
getBaseImage("ic_launcher"),
|
||||
width: 50.sp,
|
||||
height: 50.sp,
|
||||
),
|
||||
SizedBox(
|
||||
width: 10.sp,
|
||||
),
|
||||
// Expanded(
|
||||
// child:
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5.sp, bottom: 5.sp),
|
||||
width: Get.width - 150.sp,
|
||||
child: Text('微乐园APP-认识更多小众圈子的人',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 14.sp))),
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.only(left: 10.sp, right: 10.sp),
|
||||
height: 25.sp,
|
||||
decoration: BoxDecoration(
|
||||
// color: Color(0xFFDC5BFD),
|
||||
gradient: AppColor.mainVerLinearGradient,
|
||||
borderRadius: BorderRadius.circular(12.5.sp)),
|
||||
child: Text(
|
||||
'专属邀请码:${homeLogic.inviteCode}',
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// ),
|
||||
Expanded(child: Container()),
|
||||
// SizedBox(width: 10.sp,),
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
width: 50.sp,
|
||||
height: 50.sp,
|
||||
),
|
||||
QrImageView(
|
||||
data: link,
|
||||
padding: EdgeInsets.zero,
|
||||
version: QrVersions.auto,
|
||||
size: 45.sp,
|
||||
gapless: false,
|
||||
// backgroundColor: Colors.black,
|
||||
)
|
||||
],
|
||||
));
|
||||
),
|
||||
SizedBox(
|
||||
width: 10.sp,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
);
|
||||
// return Container(
|
||||
// width: Get.width,
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// children: [
|
||||
// Stack(
|
||||
// alignment: Alignment.center,
|
||||
// children: [
|
||||
//
|
||||
// Container(
|
||||
// // color: Colors.red,
|
||||
//
|
||||
// child: CachedNetworkImage(
|
||||
// // progressIndicatorBuilder: (context,str,progress) {
|
||||
// // return Container();
|
||||
// // },
|
||||
// placeholder: (context,str) {
|
||||
// print(str + '进度');
|
||||
// if (Get.arguments['index'] == index) {
|
||||
// return Container(
|
||||
// // color: Colors.red,
|
||||
// child: CachedNetworkImage(
|
||||
// imageUrl: logic.imgList[index].toString(),
|
||||
//
|
||||
// fit: BoxFit.cover,
|
||||
// width: Get.width,
|
||||
// ),
|
||||
// );
|
||||
// } else {
|
||||
// return Container();
|
||||
// }
|
||||
// },
|
||||
// imageUrl: logic.imgList[index].toString().contains('?') ? logic.imgList[index].toString().split('?').first : logic.imgList[index].toString(),
|
||||
// fit: BoxFit.cover,
|
||||
// width: Get.width,
|
||||
// ),
|
||||
// ),
|
||||
// Positioned(
|
||||
// left: 10.sp,
|
||||
// bottom: 20.sp,
|
||||
// child: Container(
|
||||
// margin:
|
||||
// EdgeInsets.only(top: Get.height * 0.45),
|
||||
// child: Text(
|
||||
// '微乐园APP',
|
||||
// style: TextStyle(
|
||||
// color: Colors.white, fontSize: 25.sp),
|
||||
// ),
|
||||
// ))
|
||||
// ],
|
||||
// )
|
||||
// ],
|
||||
// ));
|
||||
}
|
||||
|
||||
_saveLocalImage() async {
|
||||
@ -166,9 +296,11 @@ class _SwiperPageState extends State<SwiperPage> {
|
||||
ByteData? byteData =
|
||||
await (image.toByteData(format: ui.ImageByteFormat.png));
|
||||
if (byteData != null) {
|
||||
SmartDialog.showLoading(msg: '正在保存...');
|
||||
final result =
|
||||
await ImageGallerySaver.saveImage(byteData.buffer.asUint8List());
|
||||
print(result);
|
||||
SmartDialog.dismiss();
|
||||
// isSuccess
|
||||
if (result['isSuccess']) {
|
||||
showOKToast('保存成功');
|
||||
|
||||
@ -420,6 +420,7 @@ class UserBean {
|
||||
int vip;
|
||||
int gender;
|
||||
int role;
|
||||
int mark;
|
||||
int orientation;
|
||||
List<Interest> interests;
|
||||
List orientations;
|
||||
@ -443,6 +444,7 @@ class UserBean {
|
||||
required this.gender,
|
||||
required this.hide_wx_num,
|
||||
required this.orientations,
|
||||
required this.mark,
|
||||
required this.role,
|
||||
required this.orientation,
|
||||
required this.interests,
|
||||
@ -460,6 +462,7 @@ class UserBean {
|
||||
hide_wx_num: json['hide_wx_num'] ?? 0,
|
||||
orientations: json['orientations'] ?? [],
|
||||
wx_num: json['wx_num'] ?? '',
|
||||
mark: json['mark'] ?? 0,
|
||||
nickname: json['nickname'],
|
||||
avatar: json['avatar'],
|
||||
birthday: json['birthday'],
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/app/userinfo/widgets/home_call_out.dart';
|
||||
import 'package:circle_app/common/Widgets/base_tip_widget.dart';
|
||||
import 'package:circle_app/common/Widgets/user_share.dart';
|
||||
import 'package:circle_app/common/colors/app_color.dart';
|
||||
import 'package:circle_app/common/const.dart';
|
||||
import 'package:circle_app/main.dart';
|
||||
@ -12,6 +13,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../common/Widgets/tag_widget.dart';
|
||||
import '../../components/my_app_bar.dart';
|
||||
import '../../router/app_routers.dart';
|
||||
import '../../util/eventBus.dart';
|
||||
@ -486,9 +488,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
final interests = userInfoBean?.interests ?? [];
|
||||
|
||||
return Container(
|
||||
// color: Colors.red,
|
||||
width: Get.width,
|
||||
// height: Get.height,
|
||||
padding: EdgeInsets.symmetric(vertical: 14.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
@ -1073,13 +1073,8 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
if (controller.isVip > 0)
|
||||
Image(
|
||||
image: AssetImage(
|
||||
getBaseImage(controller.isVip == 1 ? "vip" : 'year_vip')),
|
||||
width: 44.sp,
|
||||
height: 18.sp,
|
||||
),
|
||||
if ((controller.userInfoBean?.mark ?? 0) > 0)
|
||||
UserTagWidget(controller.userInfoBean!.mark!),
|
||||
],
|
||||
);
|
||||
}
|
||||
@ -1235,6 +1230,29 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
Get.bottomSheet(UserShare(userImgUrl: logic.userInfoBean!.avatar!, userNIckName: ''),isScrollControlled:true);
|
||||
},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image(
|
||||
image: AssetImage(getMsgImage("msg_share")),
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 2.sp),
|
||||
child: const Text(
|
||||
"分享",
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
|
||||
41
circle_app/lib/common/Widgets/tag_widget.dart
Normal file
@ -0,0 +1,41 @@
|
||||
import 'package:circle_app/common/colors/app_color.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../router/app_routers.dart';
|
||||
|
||||
class UserTagWidget extends StatelessWidget {
|
||||
int type;
|
||||
// TODO: add state variables, methods and constructor params
|
||||
UserTagWidget(this.type);
|
||||
// NON(0, "null或0无标识"),
|
||||
// BACKER(1, "金主"),
|
||||
// GOOD(2, "Good"),
|
||||
// YEAR_PARTNER(3, "年合伙人"),
|
||||
// PARTNER(4, "合伙人"),
|
||||
// NEW_USER(5, "新人"),
|
||||
List tagList = '""、金主、Good、年VIP、VIP、新人'.split('、');
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// TODO: add widget build method
|
||||
if (type == 0 || type >= tagList.length + 1) {
|
||||
return Container();
|
||||
}
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
height: 14.sp,
|
||||
padding: EdgeInsets.only(left: 8.sp,right: 8.sp),
|
||||
decoration: BoxDecoration(
|
||||
gradient: AppColor.mainVerLinearGradient,
|
||||
borderRadius: BorderRadius.circular(7.sp)
|
||||
),
|
||||
child: Text(tagList[type],style: TextStyle(color: const Color.fromRGBO(19, 33, 54, 1),fontWeight: FontWeight.bold,fontSize: 11.sp),),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
481
circle_app/lib/common/Widgets/user_share.dart
Normal file
@ -0,0 +1,481 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_core/src/get_main.dart';
|
||||
import 'package:image_gallery_saver/image_gallery_saver.dart';
|
||||
import 'dart:ui' as ui;
|
||||
import 'package:fluwx/fluwx.dart' as fluwx;
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:qr_flutter/qr_flutter.dart';
|
||||
|
||||
import '../../app/home/logic.dart';
|
||||
import '../../util/util.dart';
|
||||
import '../colors/app_color.dart';
|
||||
|
||||
class UserShare extends StatefulWidget {
|
||||
String userImgUrl;
|
||||
String userNIckName;
|
||||
|
||||
UserShare({super.key,required this.userImgUrl,required this.userNIckName});
|
||||
@override
|
||||
_UserShareState createState() => new _UserShareState();
|
||||
|
||||
}
|
||||
|
||||
class _UserShareState extends State<UserShare> {
|
||||
// TODO: add state variables and methods
|
||||
HomeLogic logic = Get.find<HomeLogic>();
|
||||
|
||||
GlobalKey _globalKey = GlobalKey();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// TODO: add widget build method
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(child: Container()),
|
||||
Container(
|
||||
width: Get.width - 40.sp,
|
||||
// height: Get.height - Get.bottomBarHeight - 164.sp - 10.sp,
|
||||
child:SingleChildScrollView(
|
||||
child: RepaintBoundary(
|
||||
key: _globalKey,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(getCircleImage("open_vip_bg")),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: Get.width,
|
||||
height: 65.sp,
|
||||
margin: EdgeInsets.only(left: 15.sp, top: 20.sp,right: 15.sp),
|
||||
child: Row(
|
||||
children: [
|
||||
Center(
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 47.sp,
|
||||
height: 47.sp,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 46.sp,
|
||||
height: 46.sp,
|
||||
child: _buildAvatar1(logic),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 10.sp),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildNameRow(logic),
|
||||
SizedBox(height: 10.sp),
|
||||
_buildInfoRow(logic),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Image.asset(
|
||||
getBaseImage("ic_launcher"),
|
||||
width: 60.sp,
|
||||
height: 60.sp,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 300.sp,
|
||||
width: Get.width,
|
||||
margin: EdgeInsets.only(left: 10.sp,right: 10.sp,top: 10.sp,bottom: 5.sp),
|
||||
|
||||
child:ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: Image.network(widget.userImgUrl,fit: BoxFit.cover,)
|
||||
),
|
||||
),
|
||||
|
||||
Container(
|
||||
// height: 90.sp,
|
||||
// color: Color(0xFF334141),
|
||||
alignment: Alignment.center,
|
||||
// color: Colors.yellow,
|
||||
// width: Get.width-40.sp,
|
||||
margin: EdgeInsets.only(bottom: 15.sp,top: 10.sp),
|
||||
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
|
||||
child: Row(
|
||||
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
// color: Colors.red,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
// color: Colors.blue,
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'专属邀请码',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp),
|
||||
),
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.only(
|
||||
left: 10.sp, right: 10.sp),
|
||||
height: 25.sp,
|
||||
decoration: BoxDecoration(
|
||||
// color: Color(0xFFDC5BFD),
|
||||
gradient:
|
||||
const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFFD263FB),
|
||||
Color(0xFFD263FB)
|
||||
],
|
||||
begin:
|
||||
Alignment.centerLeft,
|
||||
end:
|
||||
Alignment.centerRight,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.5.sp)),
|
||||
child: Text(
|
||||
logic.inviteCode,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.sp),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
width: Get.width - 200.sp,
|
||||
child: Text(
|
||||
'扫码或长按识别下载APP,认识更多小众圈子里的人,给生活带来更多乐趣~',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15.sp)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
// Image.asset(getBaseImage("ic_launcher"),width: 80.sp,height: 80.sp,)
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
width: 90.sp,
|
||||
height: 90.sp,
|
||||
),
|
||||
QrImageView(
|
||||
data: logic.link + '#code=${logic.inviteCode}',
|
||||
padding: EdgeInsets.zero,
|
||||
version: QrVersions.auto,
|
||||
size: 80.sp,
|
||||
gapless: false,
|
||||
// backgroundColor: Colors.black,
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
))
|
||||
),
|
||||
),
|
||||
SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Container(
|
||||
height: 164.sp,
|
||||
width: Get.width,
|
||||
color: Color(0xFF292247),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(
|
||||
top: 15.sp, left: 15.sp, right: 15.sp),
|
||||
alignment: Alignment.center,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
shareAction('wx', '微信', () {
|
||||
shareWxData(1);
|
||||
}),
|
||||
shareAction('wxq', '朋友圈', () {
|
||||
shareWxData(2);
|
||||
}),
|
||||
shareAction('save', '复制邀请链接', () {
|
||||
copyInviteText(logic.model!.nickname!);
|
||||
}),
|
||||
// shareAction('wb', '复制链接', () {
|
||||
// copyInviteText(logic.name);
|
||||
// }),
|
||||
|
||||
shareAction('hb', '保存邀请海报', () {
|
||||
_saveLocalImage();
|
||||
}),
|
||||
],
|
||||
),
|
||||
)),
|
||||
Container(
|
||||
height: 1.sp,
|
||||
color: Color(0x33FFFFFF),
|
||||
),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
height: 67.sp,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'取消',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 14.sp),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAvatar1(HomeLogic logic) {
|
||||
return ClipOval(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
if (logic.model != null) {
|
||||
var imgList = <String>[];
|
||||
imgList.add(logic.model!.avatar!);
|
||||
// Get.toNamed(AppRoutes.Swiper,arguments:imgList);
|
||||
// Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
// 'imaglist': imgList,
|
||||
// 'index': 0
|
||||
// });
|
||||
}
|
||||
},
|
||||
child: logic.model == null
|
||||
? SizedBox(
|
||||
width: 63.sp,
|
||||
height: 63.sp,
|
||||
)
|
||||
: CachedNetworkImage(
|
||||
fit: BoxFit.cover,
|
||||
placeholder: null,
|
||||
imageUrl: logic.model!.avatar!,
|
||||
width: 63.sp,
|
||||
height: 63.sp,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNameRow(HomeLogic logic) {
|
||||
int gender = logic.model!.gender!;
|
||||
int role = logic.model!.role!;
|
||||
int age = logic.model!.age!;
|
||||
int orientation = logic.model!.orientation!;
|
||||
|
||||
String ageMsg = getAgeCOntent(gender, age, role, orientation);
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 6.sp),
|
||||
child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
logic.model!.nickname!,
|
||||
style: TextStyle(
|
||||
color: const Color.fromRGBO(247, 250, 250, 1.0),
|
||||
fontSize: 16.sp,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 4.sp,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color.fromRGBO(141, 255, 248, 1.0),
|
||||
Color.fromRGBO(181, 211, 255, 1.0),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.only(
|
||||
top: 2.sp, bottom: 2.sp, left: 10.sp, right: 10.sp),
|
||||
child: Text(
|
||||
ageMsg,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 10.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInfoRow(HomeLogic logic) {
|
||||
return Row(
|
||||
children: [
|
||||
Text('邀请您加入',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.sp,
|
||||
)),
|
||||
Text('【微乐园APP】',
|
||||
style: TextStyle(
|
||||
color: AppColor.mainColor,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.bold
|
||||
)),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
shareAction(String img, String name, GestureTapCallback onTap) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
getMineImage(img),
|
||||
width: 40.sp,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.sp,
|
||||
),
|
||||
Text(
|
||||
name,
|
||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_saveLocalImage() async {
|
||||
RenderRepaintBoundary boundary =
|
||||
_globalKey.currentContext!.findRenderObject() as RenderRepaintBoundary;
|
||||
ui.Image image = await boundary.toImage(pixelRatio: ui.window.devicePixelRatio);
|
||||
ByteData? byteData =
|
||||
await (image.toByteData(format: ui.ImageByteFormat.png));
|
||||
if (byteData != null) {
|
||||
final result =
|
||||
await ImageGallerySaver.saveImage(byteData.buffer.asUint8List());
|
||||
print(result);
|
||||
// isSuccess
|
||||
if (result['isSuccess']) {
|
||||
showOKToast('保存成功');
|
||||
} else {
|
||||
showOKToast('保存失败,请检查相册权限是否开启');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
copyInviteText(
|
||||
String username,
|
||||
) {
|
||||
String linkStr = logic.link.replaceAll('https://', '');
|
||||
|
||||
Clipboard.setData(ClipboardData(
|
||||
text: '【${username}】邀请你加入“微乐园”,邀请码为${logic.inviteCode},点击进入${logic.link}'
|
||||
'这是一款专为各种特色小众圈子爱好者打造的交友平台,资质齐全,安全正规。'
|
||||
'在这里,能看到很多没听说过的圈子,也能发现很多为数不多的真实情怀,还能见证小众亚文化在生活方式上的新体验。真实、安全、私密、走心,我和很多圈友都在玩哦~'));
|
||||
showOKToast('您已成功复制分享链接,前往对应平台粘贴发送即可~');
|
||||
}
|
||||
/**
|
||||
* 分享图片到微信,
|
||||
* file=本地路径
|
||||
* url=网络地址
|
||||
* asset=内置在app的资源图片
|
||||
* scene=分享场景,1好友会话,2朋友圈,3收藏
|
||||
*/
|
||||
void shareWxData(int scene) async {
|
||||
|
||||
SmartDialog.showLoading(msg:'正在生成分享图片...');
|
||||
RenderRepaintBoundary boundary =
|
||||
_globalKey.currentContext!.findRenderObject() as RenderRepaintBoundary;
|
||||
ui.Image image = await boundary.toImage(pixelRatio: ui.window.devicePixelRatio);
|
||||
ByteData? byteData =
|
||||
await (image.toByteData(format: ui.ImageByteFormat.png));
|
||||
String filePath = '';
|
||||
if (byteData != null) {
|
||||
Uint8List pngBytes = byteData!.buffer.asUint8List();
|
||||
Directory directory = await getApplicationDocumentsDirectory();
|
||||
filePath = '${directory.path}/widget_image.png';
|
||||
File imageFile = File(filePath);
|
||||
imageFile.writeAsBytesSync(pngBytes);
|
||||
}
|
||||
SmartDialog.dismiss();
|
||||
fluwx.WeChatScene wxScene = fluwx.WeChatScene.SESSION;
|
||||
if (scene == 2) {
|
||||
wxScene = fluwx.WeChatScene.TIMELINE;
|
||||
}
|
||||
fluwx.WeChatShareImageModel? model;
|
||||
|
||||
if (filePath.isNotEmpty) {
|
||||
model = fluwx.WeChatShareImageModel(fluwx.WeChatImage.file(File(filePath)),
|
||||
title: '', description: '', scene: wxScene);
|
||||
}
|
||||
if (model != null) {
|
||||
fluwx.shareToWeChat(model!);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -13,6 +13,7 @@ import 'package:circle_app/util/PaymentUtils.dart';
|
||||
import 'package:circle_app/util/SharedPreferencesHelper.dart';
|
||||
import 'package:circle_app/util/device.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:device_info/device_info.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bugly/flutter_bugly.dart';
|
||||
@ -44,6 +45,7 @@ final TUIChatSeparateViewModel chatSeparateViewModel =
|
||||
OverlayEntry? mainOverlayEntry;
|
||||
|
||||
void main() {
|
||||
checkAndExitIfEmulator();
|
||||
// setCustomErrorWidget();
|
||||
FlutterBugly.postCatchedException(() async {
|
||||
// 如果需要 ensureInitialized,请在这里运行。
|
||||
@ -68,6 +70,17 @@ void main() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Future<void> checkAndExitIfEmulator() async {
|
||||
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
|
||||
if (Platform.isAndroid) {
|
||||
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
|
||||
if (!androidInfo.isPhysicalDevice) {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setCustomErrorWidget() {
|
||||
ErrorWidget.builder = (FlutterErrorDetails details) {
|
||||
print(details.toString());
|
||||
|
||||
@ -4,7 +4,7 @@ class Api {
|
||||
static const baseUrl2 = 'https://wlybiz.cdtszn.net/zuul-service/';
|
||||
static const baseUrl1 = 'https://wlybiz.leyuan666.com/zuul-service/';
|
||||
|
||||
static const baseUrl = 'http://192.168.3.55:2000/';
|
||||
static const baseUrl = 'http://192.168.3.5:2000/';
|
||||
|
||||
|
||||
// 获取验证码
|
||||
|
||||
@ -42,9 +42,9 @@ class DioManager {
|
||||
// baseUrl2
|
||||
baseUrl:
|
||||
|
||||
// Api.baseUrl,
|
||||
Api.baseUrl,
|
||||
|
||||
type == 1 ? Api.baseUrl2 : Api.baseUrl1,
|
||||
// type == 1 ? Api.baseUrl2 : Api.baseUrl1,
|
||||
// 连接服务器超时时间,单位是毫秒
|
||||
connectTimeout: const Duration(seconds: 30),
|
||||
// 接收数据的最长时限
|
||||
|
||||
@ -14,7 +14,7 @@ class SharedPreferencesHelper {
|
||||
static const NAME = 'name';
|
||||
|
||||
static const LOGINPHONE = 'loginPhone';
|
||||
|
||||
static const PWD = 'pwd';
|
||||
static const AGREEMENT = 'agreement';
|
||||
|
||||
static const String firstLogin = 'firstlogin';
|
||||
|
||||
@ -87,14 +87,6 @@ showOKToast(String msg) {
|
||||
textStyle: const TextStyle(fontSize: 16.0),
|
||||
// animationBuilder: const Miui10AnimBuilder(),
|
||||
);
|
||||
// Fluttertoast.showToast(
|
||||
// msg: msg,
|
||||
// toastLength: Toast.LENGTH_SHORT,
|
||||
// gravity: ToastGravity.CENTER,
|
||||
// timeInSecForIosWeb: 1,
|
||||
// backgroundColor: Colors.black54,
|
||||
// textColor: Colors.white,
|
||||
// fontSize: 16.0);
|
||||
}
|
||||
|
||||
loaddingWidget(bool isMore) {
|
||||
@ -183,9 +175,12 @@ pushLoginPage() async {
|
||||
SharedPreferencesHelper.getInstance().then((sharedPreferences) {
|
||||
String loginPhone =
|
||||
sharedPreferences.getString(SharedPreferencesHelper.LOGINPHONE) ?? "";
|
||||
String pwd =
|
||||
sharedPreferences.getString(SharedPreferencesHelper.PWD) ?? "";
|
||||
print(loginPhone);
|
||||
sharedPreferences.clear();
|
||||
sharedPreferences.setString(SharedPreferencesHelper.LOGINPHONE, loginPhone);
|
||||
sharedPreferences.setString(SharedPreferencesHelper.PWD, pwd);
|
||||
sharedPreferences.setBool(SharedPreferencesHelper.AGREEMENT, true);
|
||||
sharedPreferences.setString(SharedPreferencesHelper.firstLogin, '1');
|
||||
});
|
||||
@ -393,6 +388,15 @@ void navigateToUserAgreement() {
|
||||
});
|
||||
}
|
||||
|
||||
//跳转到如何上精选
|
||||
void navigateToQueen() {
|
||||
Get.toNamed(AppRoutes.WebViewActivity, arguments: {
|
||||
'title': "如何上精选",
|
||||
"url": 'https://iquanpai.com/app-h5/4_184.html'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//跳转到隐私政策
|
||||
void navigateToPrivacyPolicy() {
|
||||
Get.toNamed(AppRoutes.WebViewActivity, arguments: {
|
||||
|
||||
@ -622,14 +622,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.3"
|
||||
flutter_install_app:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_install_app
|
||||
sha256: "9b117006d17c900e671c26bcbc9b15c7b8efd15d6f9b4442ad5d576de20fab53"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
flutter_intl:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
||||
@ -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
|
||||
#腾讯离线推送
|
||||
|
||||