bug修改
This commit is contained in:
parent
4818b67f64
commit
8ce0f58a77
@ -71,8 +71,8 @@ android {
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdkVersion 21
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode 21
|
||||
versionName "1.2.7"
|
||||
versionCode 24
|
||||
versionName "1.3.2"
|
||||
manifestPlaceholders = [
|
||||
vivo_APPID: "105669716",
|
||||
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
||||
|
||||
BIN
circle_app/assets/images/circle/callout_icon.png
Normal file
BIN
circle_app/assets/images/circle/callout_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
BIN
circle_app/assets/images/circle/circile_all_icon.png
Normal file
BIN
circle_app/assets/images/circle/circile_all_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
BIN
circle_app/assets/images/tabbar/like_normal.png
Normal file
BIN
circle_app/assets/images/tabbar/like_normal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.0 KiB |
BIN
circle_app/assets/images/tabbar/like_selected.png
Normal file
BIN
circle_app/assets/images/tabbar/like_selected.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@ -381,7 +381,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.2.5;
|
||||
MARKETING_VERSION = 1.2.6;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
@ -530,7 +530,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.2.5;
|
||||
MARKETING_VERSION = 1.2.6;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
@ -573,7 +573,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.2.5;
|
||||
MARKETING_VERSION = 1.2.6;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
|
||||
@ -10,9 +10,11 @@
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>CFBundleURLName</key>
|
||||
<string></string>
|
||||
<string>weixin</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array/>
|
||||
<array>
|
||||
<string>wxab2387c2198f01e1</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>LSApplicationQueriesSchemes</key>
|
||||
|
||||
@ -1,10 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.developer.associated-domains</key>
|
||||
<array>
|
||||
<string>applinks:https://www.leyuan666.com/</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict/>
|
||||
</plist>
|
||||
|
||||
@ -37,7 +37,7 @@ class Call_outLogic extends GetxController {
|
||||
var quToken = '';
|
||||
VideoPlayerController? videoPlayerController;
|
||||
List<MyConfigData> numbers = [];
|
||||
List<MyConfigData> myConfigData = Get.arguments['numbers'];
|
||||
List<MyConfigData>? myConfigData;
|
||||
int vip = 0;
|
||||
|
||||
bool isZfbPrice = true;
|
||||
@ -51,24 +51,7 @@ class Call_outLogic extends GetxController {
|
||||
@override
|
||||
void onInit() async {
|
||||
super.onInit();
|
||||
if (myConfigData != null) {
|
||||
// print(myConfigData.name);
|
||||
numbers.addAll(myConfigData);
|
||||
if(numbers.length>0){
|
||||
circleName = numbers[0].name;
|
||||
}
|
||||
|
||||
SharedPreferencesHelper.getInstance().then((sharedPreferences) {
|
||||
vip = sharedPreferences.getInt(SharedPreferencesHelper.VIP);
|
||||
print(vip);
|
||||
if (vip == 2) {
|
||||
isCheck = true;
|
||||
}
|
||||
update();
|
||||
});
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
var data =
|
||||
await DioManager.instance.get(url: Api.getCircleList, params: {});
|
||||
@ -80,11 +63,51 @@ class Call_outLogic extends GetxController {
|
||||
showOKToast(bean.msg);
|
||||
}
|
||||
|
||||
var quniuData =
|
||||
await DioManager.instance.get(url: Api.getqiniuToken, params: {});
|
||||
var qiniuBean = BaseResponse<QnTokenData>.fromJson(
|
||||
quniuData, (quniuData) => QnTokenData.fromJson(quniuData));
|
||||
quToken = qiniuBean.data!.token.toString();
|
||||
Map arg = Get.arguments;
|
||||
|
||||
if (arg != null) {
|
||||
// print(myConfigData.name);
|
||||
List<MyConfigData> myConfigData = Get.arguments['numbers'];
|
||||
numbers.addAll(myConfigData);
|
||||
if(numbers.length>0) {
|
||||
circleName = numbers[0].name;
|
||||
}
|
||||
update();
|
||||
} else {
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.getMyCircleInterests, params: {"page": 1,'page_size':20});
|
||||
|
||||
var bean = BaseResponse<InterestsBean>.fromJson(
|
||||
data, (data) => InterestsBean.fromJson(data));
|
||||
|
||||
InterestsBean info = bean.data;
|
||||
|
||||
if (info.lists.isNotEmpty) {
|
||||
Circle circle = info.lists.first;
|
||||
MyConfigData configData = MyConfigData(circle.id.toString(),circle.title,true);
|
||||
numbers.add(configData);
|
||||
if(numbers.length>0){
|
||||
circleName = numbers[0].name;
|
||||
}
|
||||
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
SharedPreferencesHelper.getInstance().then((sharedPreferences) {
|
||||
vip = sharedPreferences.getInt(SharedPreferencesHelper.VIP);
|
||||
print(vip);
|
||||
if (vip == 2) {
|
||||
isCheck = true;
|
||||
}
|
||||
update();
|
||||
});
|
||||
|
||||
|
||||
loadQiniuToken();
|
||||
|
||||
StreamSubscription subscription =
|
||||
EventBusManager.on<CommentVipEvent>().listen((event) {
|
||||
@ -92,6 +115,14 @@ class Call_outLogic extends GetxController {
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> loadQiniuToken() async {
|
||||
var quniuData =
|
||||
await DioManager.instance.get(url: Api.getqiniuToken, params: {});
|
||||
var qiniuBean = BaseResponse<QnTokenData>.fromJson(
|
||||
quniuData, (quniuData) => QnTokenData.fromJson(quniuData));
|
||||
quToken = qiniuBean.data!.token.toString();
|
||||
}
|
||||
|
||||
showRechargeDialog() {
|
||||
Get.bottomSheet(
|
||||
Scaffold(
|
||||
|
||||
@ -198,7 +198,7 @@ class CircleLogic extends GetxController {
|
||||
|
||||
if (data['code'] == 200) {
|
||||
statistics.value = myAlbumBean.data;
|
||||
// update();
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
@ -305,6 +305,7 @@ class CircleLogic extends GetxController {
|
||||
vicinityList.addAll(bean.data.users);
|
||||
vicinityPage = vicinityPage + 1;
|
||||
} on Exception {}
|
||||
update();
|
||||
} else if (bean.code == 21201) {
|
||||
myVip = 0;
|
||||
refreshController.loadComplete();
|
||||
@ -478,7 +479,7 @@ class InterestsBean {
|
||||
InterestsBean({required this.lists});
|
||||
|
||||
factory InterestsBean.fromJson(Map<String, dynamic> json) {
|
||||
List<dynamic> listsJson = json['lists'];
|
||||
List<dynamic> listsJson = json.containsKey('lists') ? json['lists'] : json;
|
||||
List<Circle> lists = listsJson.map((e) => Circle.fromJson(e)).toList();
|
||||
return InterestsBean(lists: lists);
|
||||
}
|
||||
@ -518,24 +519,28 @@ class Circle {
|
||||
});
|
||||
|
||||
factory Circle.fromJson(Map<String, dynamic> json) {
|
||||
List<dynamic> lastJoinUsersJson = json['last_join_users'];
|
||||
List<JoinUser> lastJoinUsers =
|
||||
lastJoinUsersJson.map((e) => JoinUser.fromJson(e)).toList();
|
||||
List<JoinUser> lastJoinUsers = [];
|
||||
if (json.containsKey('last_join_users')) {
|
||||
List<dynamic> lastJoinUsersJson = json['last_join_users'];
|
||||
lastJoinUsers =
|
||||
lastJoinUsersJson.map((e) => JoinUser.fromJson(e)).toList();
|
||||
}
|
||||
|
||||
|
||||
return Circle(
|
||||
id: json['id'],
|
||||
is_limit: json['is_limit'] ?? false,
|
||||
image: json['image'],
|
||||
image: json['image'] ?? '',
|
||||
ios_item: json['ios_item'] ?? '',
|
||||
title: json['title'],
|
||||
intro: json['intro'],
|
||||
amount: json['amount'].toDouble(),
|
||||
oldAmount: json['old_amount'].toDouble(),
|
||||
lastCalloutTime: json['last_callout_time'],
|
||||
isJoin: json['is_join'],
|
||||
isLike: json['is_like'],
|
||||
viewTotal: json['view_total'],
|
||||
joinTotal: json['join_total'],
|
||||
title: json['title'] ?? '',
|
||||
intro: json['intro'] ?? '',
|
||||
amount: json.containsKey('amount') ? json['amount'].toDouble() ?? 0 : 0,
|
||||
oldAmount: json.containsKey('amount') ? json['old_amount'].toDouble() ?? 0 : 0,
|
||||
lastCalloutTime: json['last_callout_time'] ?? '',
|
||||
isJoin: json['is_join'] ?? false,
|
||||
isLike: json['is_like'] ?? false,
|
||||
viewTotal: json['view_total'] ?? 0,
|
||||
joinTotal: json['join_total'] ?? 0,
|
||||
lastJoinUsers: lastJoinUsers,
|
||||
);
|
||||
}
|
||||
|
||||
@ -3,8 +3,10 @@ import 'dart:math';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/app/circle/widgets/discover.dart';
|
||||
import 'package:circle_app/app/circle/widgets/info_list_view.dart';
|
||||
import 'package:circle_app/app/circle/widgets/like_view.dart';
|
||||
import 'package:circle_app/app/circle/widgets/vicinity.dart';
|
||||
import 'package:circle_app/app/dialog/ScreenBottomSheetDialog.dart';
|
||||
import 'package:circle_app/app/like/view.dart';
|
||||
import 'package:circle_app/router/app_routers.dart';
|
||||
import 'package:circle_app/util/eventBus.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
@ -24,7 +26,7 @@ const bgWidget = DecorationImage(
|
||||
fit: BoxFit.fill, image: AssetImage('assets/images/base/home_back.png'));
|
||||
|
||||
class CirclePage extends StatefulWidget {
|
||||
CirclePage({Key? key}) : super(key: key);
|
||||
const CirclePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<CirclePage> createState() => _CirclePageState();
|
||||
@ -37,6 +39,14 @@ class _CirclePageState extends State<CirclePage>
|
||||
|
||||
int currentIndex = 0;
|
||||
|
||||
|
||||
final logic = Get.find<CircleLogic>();
|
||||
|
||||
final state = Get.find<CircleLogic>().state;
|
||||
|
||||
var getContext;
|
||||
|
||||
// 是否需要缓存
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
|
||||
@ -45,10 +55,12 @@ class _CirclePageState extends State<CirclePage>
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
currentIndex = Random().nextInt(3);
|
||||
_pageController = PageController(initialPage: currentIndex);
|
||||
_tabController = TabController(length: 3, vsync: this, initialIndex: currentIndex);
|
||||
_tabController.addListener(_handleTabChange);
|
||||
getContext = context;
|
||||
}
|
||||
|
||||
void _handleTabChange() {
|
||||
@ -59,12 +71,6 @@ class _CirclePageState extends State<CirclePage>
|
||||
logic.update();
|
||||
}
|
||||
|
||||
// 是否需要缓存
|
||||
final logic = Get.put(CircleLogic());
|
||||
|
||||
final state = Get.find<CircleLogic>().state;
|
||||
|
||||
var getContext;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
@ -76,13 +82,13 @@ class _CirclePageState extends State<CirclePage>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
getContext = context;
|
||||
return GetBuilder<CircleLogic>(builder: (logic) {
|
||||
super.build(context);
|
||||
|
||||
return GetBuilder<CircleLogic>(builder: (controller) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: SafeArea(
|
||||
child: GetBuilder(builder: (CircleLogic controller) {
|
||||
return Stack(
|
||||
child:Stack(
|
||||
children: [
|
||||
Column(children: [
|
||||
Obx(() {
|
||||
@ -93,42 +99,44 @@ class _CirclePageState extends State<CirclePage>
|
||||
]),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 45.sp),
|
||||
child: PageView(
|
||||
controller: _pageController,
|
||||
onPageChanged: (index) {
|
||||
_tabController.animateTo(index);
|
||||
print("index=" + index.toString());
|
||||
},
|
||||
child: TabBarView(
|
||||
controller: _tabController,
|
||||
// controller: _pageController,
|
||||
// onPageChanged: (index) {
|
||||
// _tabController.animateTo(index);
|
||||
// print("index=" + index.toString());
|
||||
// },
|
||||
children: [
|
||||
circleList(controller),
|
||||
LikeView(),
|
||||
// circleList(controller),
|
||||
Vicinity(controller),
|
||||
Discover(0)
|
||||
],
|
||||
),
|
||||
),
|
||||
_tabController.index == 0
|
||||
? Positioned(
|
||||
bottom: 36.sp,
|
||||
right: 10.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
List<MyConfigData> numbers = [];
|
||||
numbers.add(MyConfigData(
|
||||
logic.getCircleIndex().id.toString(),
|
||||
logic.getCircleIndex().title!,
|
||||
false));
|
||||
var data = await Get.toNamed(AppRoutes.Call_out,
|
||||
arguments: {'numbers': numbers});
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('send_msg'),
|
||||
width: 60.sp,
|
||||
)))
|
||||
: Center()
|
||||
// _tabController.index == 0
|
||||
// ? Positioned(
|
||||
// bottom: 36.sp,
|
||||
// right: 10.sp,
|
||||
// child: GestureDetector(
|
||||
// onTap: () async {
|
||||
// List<MyConfigData> numbers = [];
|
||||
// numbers.add(MyConfigData(
|
||||
// logic.getCircleIndex().id.toString(),
|
||||
// logic.getCircleIndex().title!,
|
||||
// false));
|
||||
// var data = await Get.toNamed(AppRoutes.Call_out,
|
||||
// arguments: {'numbers': numbers});
|
||||
// },
|
||||
// child: Image.asset(
|
||||
// getCircleImage('send_msg'),
|
||||
// width: 60.sp,
|
||||
// )))
|
||||
// : Center()
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
)
|
||||
),
|
||||
|
||||
);
|
||||
});
|
||||
}
|
||||
@ -691,7 +699,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
tabs: [
|
||||
Tab(
|
||||
child: Text(
|
||||
'圈子',
|
||||
'喜欢',
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp,
|
||||
),
|
||||
@ -750,11 +758,11 @@ class _CirclePageState extends State<CirclePage>
|
||||
return;
|
||||
}
|
||||
currentIndex = index;
|
||||
_pageController.animateToPage(
|
||||
index, // 目标页面索引
|
||||
duration: const Duration(milliseconds: 300), // 动画时长
|
||||
curve: Curves.ease, // 动画曲线
|
||||
);
|
||||
// _pageController.animateToPage(
|
||||
// index, // 目标页面索引
|
||||
// duration: const Duration(milliseconds: 300), // 动画时长
|
||||
// curve: Curves.ease, // 动画曲线
|
||||
// );
|
||||
|
||||
},
|
||||
),
|
||||
@ -766,11 +774,11 @@ class _CirclePageState extends State<CirclePage>
|
||||
child: _tabController.index == 0
|
||||
? GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.MyCircle, arguments: '');
|
||||
Get.toNamed(AppRoutes.Call_out);
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('my_circle'),
|
||||
width: 64.sp,
|
||||
getCircleImage('callout_icon'),
|
||||
width: 75.sp,
|
||||
),
|
||||
)
|
||||
: GestureDetector(
|
||||
|
||||
@ -507,7 +507,7 @@ class _DiscoverState extends State<Discover>
|
||||
user.userId.toString());
|
||||
}),
|
||||
SizedBox(
|
||||
height: 10.sp,
|
||||
height: 15.sp,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
@ -562,13 +562,13 @@ class _DiscoverState extends State<Discover>
|
||||
),
|
||||
Container(
|
||||
width: Get.width - 120.sp,
|
||||
margin: EdgeInsets.only(top: 5.sp),
|
||||
margin: EdgeInsets.only(top: 10.sp,bottom: 10.sp),
|
||||
child: Text(
|
||||
user.signature! ?? '',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 2,
|
||||
style: TextStyle(
|
||||
fontSize: 15.sp,
|
||||
fontSize: 16.sp,
|
||||
color: const Color(0XFFF7FAFA)),
|
||||
),
|
||||
),
|
||||
|
||||
@ -6,7 +6,10 @@ import 'package:circle_app/app/circle/logic.dart';
|
||||
import 'package:circle_app/app/circle/state.dart';
|
||||
import 'package:circle_app/app/circle/widgets/list_logic.dart';
|
||||
import 'package:circle_app/app/circle/widgets/video_item.dart';
|
||||
import 'package:circle_app/app/like/logic.dart';
|
||||
import 'package:circle_app/app/select_circle/logic.dart';
|
||||
import 'package:circle_app/common/Widgets/base_tip_widget.dart';
|
||||
import 'package:circle_app/common/Widgets/circle_share.dart';
|
||||
import 'package:circle_app/common/Widgets/text_more.dart';
|
||||
import 'package:circle_app/main.dart';
|
||||
import 'package:circle_app/network/dio_manager.dart';
|
||||
@ -53,6 +56,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
List<Lists> lists = [];
|
||||
|
||||
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
@ -92,29 +96,42 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
|
||||
|
||||
|
||||
|
||||
callRefreshCicle = EventBusManager.on<CallRefreshCircle>().listen((event) {
|
||||
if(widget.bean.id.toString() == event.circleId){
|
||||
loadCallOutListData();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
scroToTop = EventBusManager.on<ScrollToTop>().listen((event) {
|
||||
if (widget.logic.state.index == widget.index) {
|
||||
scrollController.animateTo(
|
||||
0.0,
|
||||
duration: Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
}
|
||||
|
||||
});
|
||||
//
|
||||
// scroToTop = EventBusManager.on<ScrollToTop>().listen((event) {
|
||||
// if (widget.logic.state.index == widget.index) {
|
||||
// scrollController.animateTo(
|
||||
// 0.0,
|
||||
// duration: Duration(milliseconds: 300),
|
||||
// curve: Curves.easeInOut,
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// });
|
||||
|
||||
// widget.back(widget.createState());
|
||||
}
|
||||
|
||||
|
||||
loadCircleInfo() async{
|
||||
var data = await DioManager.instance.get(
|
||||
url: "/up-service/interest/$circleId",);
|
||||
if (data["code"] == 200) {
|
||||
widget.bean = Circle.fromJson(data['data']);
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
loadCallOutListData() async {
|
||||
var data = await DioManager.instance.get(
|
||||
@ -143,6 +160,8 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
setCircleId(String id) {
|
||||
circleId = id;
|
||||
loadCallOutListData();
|
||||
@ -245,6 +264,9 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (widget.bean.image.isEmpty) {
|
||||
loadCircleInfo();
|
||||
}
|
||||
List<JoinUser> urlList = widget.bean.lastJoinUsers;
|
||||
List<Widget> widgets = [];
|
||||
int i = 0;
|
||||
@ -267,17 +289,18 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
borderRadius: BorderRadius.circular(10.sp),
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
margin:
|
||||
EdgeInsets.only(left: widget.index > 0 ? 4.sp : 0, right: 4.sp),
|
||||
// margin:
|
||||
|
||||
child: Stack(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(10.sp),
|
||||
child: SizedBox(
|
||||
width: Get.width,
|
||||
height: Get.height,
|
||||
child: Image.asset(
|
||||
getCircleImage('circle_bg'),
|
||||
fit: BoxFit.fill,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
)),
|
||||
Container(
|
||||
@ -321,7 +344,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
margin: EdgeInsets.only(bottom: 7.sp),
|
||||
width: Get.width,
|
||||
// height: 50.sp,
|
||||
child: HideText(text: widget.bean.intro,additionText: '查看更多',maxLines: 3,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
|
||||
child: HideText(text: widget.bean.intro,maxWidth: Get.currentRoute == AppRoutes.Home ? Get.width - 90.sp : Get.width - 60.sp,additionText: '查看更多',maxLines: 3,style: TextStyle(color: Colors.white, fontSize: 17.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 17.sp),onTap: () {
|
||||
_showTextContentDialog(
|
||||
context, widget.bean.intro,widget.bean.title);
|
||||
},
|
||||
@ -333,39 +356,51 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
// showToast("点个鸡毛,星哥还没做");
|
||||
// Get.toNamed(AppRoutes.FriendsActivity,arguments: '3');
|
||||
},
|
||||
child:urlList.length==0?Container(): Row(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30.sp,
|
||||
width: 30.0.sp +
|
||||
15.sp *
|
||||
(widgets.length -
|
||||
1.sp),
|
||||
child: Stack(
|
||||
children: widgets,
|
||||
),
|
||||
child:urlList.length==0?Container(): Container(
|
||||
height: 30.sp,
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30.sp,
|
||||
width: 30.0.sp +
|
||||
15.sp *
|
||||
(widgets.length -
|
||||
1.sp),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: widgets,
|
||||
),
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
Text(
|
||||
'${convertToTenThousand(widget.bean.joinTotal)}圈友加入',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.sp),
|
||||
),
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
// Image.asset(
|
||||
// getCircleImage('play'),
|
||||
// width: 20.sp,
|
||||
// )
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 4.sp,
|
||||
),
|
||||
Text(
|
||||
'${convertToTenThousand(widget.bean.joinTotal)}圈友加入',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.sp),
|
||||
),
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
// GestureDetector(
|
||||
// onTap: () {
|
||||
// Get.bottomSheet(
|
||||
// CircleShare('','',widget.bean), isScrollControlled: true,
|
||||
// enableDrag: false
|
||||
// );
|
||||
// },
|
||||
// child: Container(
|
||||
// height: 30.sp,
|
||||
// alignment: Alignment.center,
|
||||
// child: Image.asset(
|
||||
// getCircleImage('play'),
|
||||
// width: 20.sp,
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -403,32 +438,39 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
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:widget.bean.image,
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
memCacheHeight: 40,
|
||||
memCacheWidth: 40,
|
||||
fit:BoxFit.cover
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (widget.bean.isJoin) {
|
||||
_showOutCircleDialog(Get.context!, widget.logic, widget.bean);
|
||||
}
|
||||
},
|
||||
child: 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: widget.bean.image.isNotEmpty ? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl:widget.bean.image,
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
memCacheHeight: 40,
|
||||
memCacheWidth: 40,
|
||||
fit:BoxFit.cover
|
||||
) ,
|
||||
) : Container(),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
@ -473,8 +515,10 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
GestureDetector(//加入圈子
|
||||
onTap: () async {
|
||||
if (widget.bean.isJoin) {
|
||||
_showOutCircleDialog(
|
||||
context, widget.logic, widget.bean);
|
||||
Get.bottomSheet(
|
||||
CircleShare('','',widget.bean), isScrollControlled: true,
|
||||
enableDrag: false
|
||||
);
|
||||
} else {
|
||||
await widget.logic.outCircle(
|
||||
widget.bean.id.toString(),
|
||||
@ -490,7 +534,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
width: 77.sp,
|
||||
),
|
||||
Text(
|
||||
!widget.bean.isJoin ? '申请加入' : '已加入',
|
||||
!widget.bean.isJoin ? '申请加入' : '分享有奖',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
)
|
||||
@ -505,6 +549,26 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
getCircleImage('circle_line'),
|
||||
width: Get.width,
|
||||
)),
|
||||
if (Get.currentRoute == AppRoutes.Home)
|
||||
Positioned(
|
||||
bottom: 36.sp,
|
||||
right: 10.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
List<MyConfigData> numbers = [];
|
||||
numbers.add(MyConfigData(
|
||||
widget.bean.id.toString(),
|
||||
widget.bean.title,
|
||||
false));
|
||||
var data = await Get.toNamed(
|
||||
AppRoutes.Call_out,
|
||||
arguments: {'numbers': numbers}
|
||||
);
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('send_msg'),
|
||||
width: 70.sp,
|
||||
)))
|
||||
],
|
||||
)));
|
||||
}
|
||||
@ -588,7 +652,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
vipDynamicItem(Lists lists) {
|
||||
Text descText = Text(
|
||||
lists.content!,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
style: TextStyle(color: Colors.white, fontSize: 17.sp),
|
||||
maxLines: 2,
|
||||
);
|
||||
|
||||
@ -624,10 +688,11 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
Album info = lists.album!.first;
|
||||
|
||||
if (info.type == 1) {
|
||||
double picWidth = (Get.width - (widget.logic.runtimeType == LikeLogic ? 100.sp : 60.sp))/3;
|
||||
if (lists.album!.length > 3) {
|
||||
picHeight = 218.sp;
|
||||
picHeight = picWidth * 2;
|
||||
} else {
|
||||
picHeight = 109.sp;
|
||||
picHeight = picWidth;
|
||||
}
|
||||
} else {
|
||||
picHeight = 140.sp;
|
||||
@ -635,7 +700,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
}
|
||||
}
|
||||
|
||||
double widgetHeight = 140.sp + contentHeight(lists.content!) + picHeight;
|
||||
double widgetHeight = 130.sp + contentHeight(lists.content!) + picHeight;
|
||||
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
@ -657,17 +722,17 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
Positioned(
|
||||
right: 2.sp,
|
||||
top: 2.sp,
|
||||
height: 18.sp,
|
||||
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('location'),
|
||||
height: 20.sp,
|
||||
height: 30.sp,
|
||||
),
|
||||
Text(
|
||||
lists.user!.city ?? '外星',
|
||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
style: TextStyle(color: Colors.white, fontSize: 15.sp),
|
||||
)
|
||||
],
|
||||
),
|
||||
@ -849,20 +914,18 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
}),
|
||||
),
|
||||
Container(
|
||||
height: 34.sp,
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp),
|
||||
margin: EdgeInsets.only(top: 5.sp),
|
||||
margin: EdgeInsets.only(top: picHeight > 0 ? 5.sp : 5.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.sp),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment(0.25, 0.5),
|
||||
end: Alignment(0.75, 0.5),
|
||||
colors: [Color(0xff261240), Color(0xff122D40)])),
|
||||
borderRadius: BorderRadius.circular(15.sp),
|
||||
color: Color(0x33000000)
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
widgets.isNotEmpty
|
||||
? SizedBox(
|
||||
width: 24 + 12.sp * widgets.length - 12.sp,
|
||||
width: 24 + 12.sp * widgets.length - 8.sp,
|
||||
height: 24.sp,
|
||||
child: Stack(children: widgets),
|
||||
)
|
||||
@ -875,13 +938,13 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
child: Text(
|
||||
'${lists.chat!.count!}位圈友已私聊',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
color: Colors.white, fontSize: 14.sp),
|
||||
))
|
||||
: Expanded(
|
||||
child: Text(
|
||||
'赶紧成为第一位私聊ta的圈友吧',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
color: Colors.white, fontSize: 14.sp),
|
||||
)),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
@ -907,7 +970,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
normalDynamicItem(Lists lists) {
|
||||
Text descText = Text(
|
||||
lists.content!,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
style: TextStyle(color: Colors.white, fontSize: 17.sp),
|
||||
// maxLines: 2,
|
||||
);
|
||||
|
||||
@ -917,10 +980,11 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
Album info = lists.album!.first;
|
||||
|
||||
if (info.type == 1) {
|
||||
double picWidth = (Get.width - (widget.logic.runtimeType == LikeLogic ? 100.sp : 60.sp))/3;
|
||||
if (lists.album!.length > 3) {
|
||||
picHeight = 218.sp;
|
||||
picHeight = picWidth * 2;
|
||||
} else {
|
||||
picHeight = 109.sp;
|
||||
picHeight = picWidth;
|
||||
}
|
||||
} else {
|
||||
picHeight = 140.sp;
|
||||
@ -952,7 +1016,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
width: Get.width,
|
||||
height: 130.sp + contentHeight(lists.content!) + picHeight,
|
||||
height: 120.sp + contentHeight(lists.content!) + picHeight,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
@ -969,19 +1033,19 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('location'),
|
||||
height: 20.sp,
|
||||
height: 30.sp,
|
||||
),
|
||||
Text(
|
||||
lists.user!.city ?? '外星',
|
||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
style: TextStyle(color: Colors.white, fontSize: 15.sp),
|
||||
)
|
||||
],
|
||||
),
|
||||
// height: 18.sp,
|
||||
),
|
||||
Container(
|
||||
height: 130.sp + contentHeight(lists.content!) + picHeight,
|
||||
width: Get.width,
|
||||
|
||||
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
@ -1167,20 +1231,17 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
}))
|
||||
: Container(),
|
||||
Container(
|
||||
height: 34.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp),
|
||||
margin: EdgeInsets.only(top: 5.sp),
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp,),
|
||||
margin: EdgeInsets.only(top: picHeight > 0 ? 5.sp : 10.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.sp),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment(0.25, 0.5),
|
||||
end: Alignment(0.75, 0.5),
|
||||
colors: [Color(0xff261240), Color(0xff122D40)])),
|
||||
borderRadius: BorderRadius.circular(15.sp),
|
||||
color: Color(0x33000000)),
|
||||
child: Row(
|
||||
children: [
|
||||
widgets.isNotEmpty
|
||||
? SizedBox(
|
||||
width: 24 + 12.sp * widgets.length - 12.sp,
|
||||
width: 24 + 12.sp * widgets.length - 8.sp,
|
||||
height: 24.sp,
|
||||
child: Stack(children: widgets),
|
||||
)
|
||||
@ -1193,13 +1254,13 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
child: Text(
|
||||
'${lists.chat!.count!}位圈友已私聊',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
color: Colors.white, fontSize: 14.sp),
|
||||
))
|
||||
: Expanded(
|
||||
child: Text(
|
||||
'赶紧成为第一位私聊ta的圈友吧',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
color: Colors.white, fontSize: 14.sp),
|
||||
)),
|
||||
GestureDetector(
|
||||
onTap: () async{
|
||||
@ -1213,15 +1274,137 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
))
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
// Positioned(
|
||||
// bottom: 0,
|
||||
// child: Container(
|
||||
// width: Get.width - 26.sp,
|
||||
// child: circleInfoItem(),
|
||||
// ))
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
circleWidget(String url, String userId,{double width = 30}) {
|
||||
circleInfoItem() {
|
||||
return ClipRRect(
|
||||
borderRadius: BorderRadius.circular(
|
||||
10.sp),
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
||||
height: 72.sp,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image:
|
||||
AssetImage(getCircleImage('top_circle_bg')))),
|
||||
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:widget.bean.image,
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
memCacheHeight: 40,
|
||||
memCacheWidth: 40,
|
||||
fit:BoxFit.cover
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: (){
|
||||
scrollController.animateTo(
|
||||
0.0, // Scroll to the top
|
||||
duration: Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 8.sp, top: 12.sp),
|
||||
// alignment: Alignment.,
|
||||
height: 72.sp,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
widget.bean.title,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(
|
||||
height: 4.sp,
|
||||
),
|
||||
Text(
|
||||
'${convertToTenThousand(widget.bean.viewTotal)}人看过',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: const Color(0xff03FEFB),
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
GestureDetector(//加入圈子
|
||||
onTap: () async {
|
||||
if (widget.bean.isJoin) {
|
||||
Get.bottomSheet(
|
||||
CircleShare('','',widget.bean), isScrollControlled: true,
|
||||
enableDrag: false
|
||||
);
|
||||
} else {
|
||||
await widget.logic.outCircle(
|
||||
widget.bean.id.toString(),
|
||||
widget.bean.isJoin);
|
||||
widget.logic.update();
|
||||
}
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('add'),
|
||||
width: 77.sp,
|
||||
),
|
||||
Text(
|
||||
!widget.bean.isJoin ? '申请加入' : '分享有奖',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
)
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
circleWidget(String url, String userId,{double width = 24}) {
|
||||
return GestureDetector(
|
||||
onTap: (){
|
||||
Get.toNamed(AppRoutes.UserInfoActivity, arguments: userId);
|
||||
@ -1345,7 +1528,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
Navigator.pop(context);
|
||||
await widget.logic
|
||||
.outCircle(bean.id.toString(), bean.isJoin);
|
||||
widget.logic.update();
|
||||
// widget.logic.update();
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 24.sp),
|
||||
@ -1389,7 +1572,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
|
||||
double contentHeight(String content) {
|
||||
return calculateTextHeight(
|
||||
content, 14.sp, FontWeight.w300, Get.width - 64.sp, 100);
|
||||
content, 17.sp, FontWeight.w300, Get.currentRoute == AppRoutes.Home ? Get.width - 90.sp : Get.width - 64.sp, 100);
|
||||
}
|
||||
|
||||
void refreshCircleData() async {
|
||||
@ -1400,10 +1583,10 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
.get(url: 'up-service/interest/${widget.bean.id}');
|
||||
if (data['code'] == 200) {
|
||||
widget.bean = Circle.fromJson(data['data']);
|
||||
widget.logic.updateCircleInfo(widget.bean);
|
||||
setState(() {
|
||||
|
||||
});
|
||||
// widget.logic.updateCircleInfo(widget.bean);
|
||||
// setState(() {
|
||||
//
|
||||
// });
|
||||
// final logic = Get.put(CircleLogic());
|
||||
// logic.update();
|
||||
|
||||
|
||||
1409
circle_app/lib/app/circle/widgets/like_view.dart
Normal file
1409
circle_app/lib/app/circle/widgets/like_view.dart
Normal file
File diff suppressed because it is too large
Load Diff
@ -248,7 +248,7 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
// padding: EdgeInsets.only( left: 8.sp, right: 8.sp),
|
||||
width: Get.width,
|
||||
height: 200.sp,
|
||||
height: 210.sp,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
@ -264,14 +264,12 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
|
||||
topLeft: Radius.circular(10.sp),
|
||||
topRight: Radius.circular(10.sp),
|
||||
),
|
||||
child: item.images.length == 0
|
||||
? Image(
|
||||
child: Image(
|
||||
image: AssetImage(getCircleImage("icon_list_null")),
|
||||
width: Get.width,
|
||||
fit: BoxFit.fill,
|
||||
height: 92.sp,
|
||||
)
|
||||
: Container(),
|
||||
),
|
||||
),
|
||||
Column(children: [
|
||||
@ -355,7 +353,7 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 38.sp, // 设置固定高度
|
||||
height: 55.sp, // 设置固定高度
|
||||
width: Get.width,
|
||||
margin: EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Align(
|
||||
@ -363,7 +361,7 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
|
||||
child: Text(
|
||||
item.signature,
|
||||
maxLines: 2,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
style: TextStyle(color: Colors.white, fontSize: 18.sp),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
|
||||
@ -203,7 +203,7 @@ class UnlockCallDialog extends GetxController {
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'¥$amount',
|
||||
'¥${int.parse(amount)}',
|
||||
style: TextStyle(
|
||||
color: Color(0xffE845FF),
|
||||
fontSize: 16.sp,
|
||||
@ -213,7 +213,7 @@ class UnlockCallDialog extends GetxController {
|
||||
width: 2.sp,
|
||||
),
|
||||
Text(
|
||||
'(原价$oldAmount)',
|
||||
'(原价${int.parse(oldAmount)})',
|
||||
style: TextStyle(
|
||||
color: Colors.white70,
|
||||
fontSize: 16.sp,
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -260,7 +260,7 @@ class _CustomDialogState extends State<UpdateDialog> {
|
||||
// SmartDialog.dismiss();
|
||||
print(error);
|
||||
});
|
||||
await AppInstaller.installApk(filePath, actionRequired: false);
|
||||
// await AppInstaller.installApk(filePath, actionRequired: false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import 'package:circle_app/app/circle/logic.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
@ -6,5 +7,6 @@ class HomeBinding extends Bindings {
|
||||
@override
|
||||
void dependencies() {
|
||||
Get.lazyPut(() => HomeLogic());
|
||||
Get.lazyPut(() => CircleLogic());
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import 'dart:io';
|
||||
|
||||
|
||||
import 'package:circle_app/app/circle/logic.dart';
|
||||
import 'package:circle_app/app/like/view.dart';
|
||||
import 'package:circle_app/app/minefragment/logic.dart';
|
||||
import 'package:circle_app/main.dart';
|
||||
import 'package:circle_app/network/api.dart';
|
||||
@ -26,25 +27,32 @@ import '../msg/view.dart';
|
||||
import 'state.dart';
|
||||
|
||||
class HomeLogic extends GetxController {
|
||||
PageController pageController = PageController(initialPage: 1);
|
||||
int currentIndex = 1;
|
||||
late TabController tabController;
|
||||
|
||||
int currentIndex = 0;
|
||||
Widget currentPage = Container();
|
||||
|
||||
final HomeState state = HomeState();
|
||||
|
||||
final List<Widget> tabs = [];
|
||||
var circlePage = CirclePage();
|
||||
List<Widget> tabs = [];
|
||||
static final MessageService _messageService =
|
||||
serviceLocator<MessageService>();
|
||||
final RxString unreadSIze = "0".obs;
|
||||
|
||||
final RxBool showcirlceUnred = false.obs;
|
||||
|
||||
|
||||
@override
|
||||
void onInit() async {
|
||||
super.onInit();
|
||||
|
||||
getIMData();
|
||||
|
||||
tabs.add(MsgPage());
|
||||
|
||||
|
||||
tabs.add(CirclePage());
|
||||
tabs.add(LikePage());
|
||||
tabs.add(MsgPage());
|
||||
tabs.add(MinefragmentPage());
|
||||
|
||||
EventBusManager.on<RefreshUnread>().listen((event) {
|
||||
@ -110,6 +118,12 @@ class HomeLogic extends GetxController {
|
||||
|
||||
_messageService.addSimpleMsgListener(listener: msgListener);
|
||||
|
||||
checkVersion();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Future<void> checkVersion() async {
|
||||
var data = await DioManager.instance.get(url: Api.APP_VERSION);
|
||||
var bean = BaseResponse<UpdateInfo>.fromJson(
|
||||
data, (data) => UpdateInfo.fromJson(data));
|
||||
@ -174,6 +188,10 @@ class HomeLogic extends GetxController {
|
||||
super.onReady();
|
||||
|
||||
FlutterNativeSplash.remove();
|
||||
final logic = Get.find<CircleLogic>();
|
||||
logic.loadCirclePeopleData();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void showReportDialog(
|
||||
@ -206,13 +224,13 @@ class HomeLogic extends GetxController {
|
||||
|
||||
updateIndex(int index) {
|
||||
currentIndex = index;
|
||||
if (index == 1) {
|
||||
if (index == 0) {
|
||||
final logic = Get.put(CircleLogic());
|
||||
logic.loadCirclePeopleData();
|
||||
} else if (index == 2) {
|
||||
} else if (index == 3) {
|
||||
final logic = Get.put(MinefragmentLogic());
|
||||
logic.getMode();
|
||||
} else {
|
||||
} else if (index == 2) {
|
||||
getUnreadSize();
|
||||
}
|
||||
update();
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
|
||||
import 'package:circle_app/app/circle/view.dart';
|
||||
import 'package:circle_app/app/like/view.dart';
|
||||
import 'package:circle_app/app/minefragment/view.dart';
|
||||
import 'package:circle_app/app/msg/view.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:circle_app/view/ExitAppConfirmation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -16,62 +18,71 @@ class HomePage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _HomePageState extends State<HomePage>
|
||||
with AutomaticKeepAliveClientMixin {
|
||||
with AutomaticKeepAliveClientMixin,SingleTickerProviderStateMixin {
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
final logic = Get.lazyPut(() => HomeLogic());
|
||||
|
||||
final state = Get.find<HomeLogic>().state;
|
||||
HomeLogic logic = Get.find<HomeLogic>();
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
logic.tabController = TabController(length: 4, vsync: this, initialIndex: 0,animationDuration: Duration.zero);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
|
||||
return GetBuilder(builder: (HomeLogic controller) {
|
||||
return ExitAppConfirmation(child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: const Color.fromRGBO(15, 10, 31, 1.0),
|
||||
bottomNavigationBar: Container(
|
||||
height: 49.sp + MediaQuery.of(context).padding.bottom,
|
||||
width: Get.width,
|
||||
// color: Colors.red,
|
||||
padding: EdgeInsets.only(left: 40.sp, right: 40.sp),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF423055),
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(
|
||||
getTabbarImage('tabbar_bg'),
|
||||
))),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
return ExitAppConfirmation(
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: const Color.fromRGBO(15, 10, 31, 1.0),
|
||||
bottomNavigationBar: Container(
|
||||
height: 49.sp + MediaQuery.of(context).padding.bottom,
|
||||
width: Get.width,
|
||||
// color: Colors.red,
|
||||
padding: EdgeInsets.only(left: 20.sp, right: 20.sp),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF423055),
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(
|
||||
getTabbarImage('tabbar_bg'),
|
||||
))),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
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),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
funcItem(0, 'msg', 0 == controller.currentIndex, controller),
|
||||
funcItem(1, 'circle', 1 == controller.currentIndex, controller),
|
||||
funcItem(2, 'mine', 2 == controller.currentIndex, controller),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
// height:
|
||||
// Get.height - 49.sp + MediaQuery.of(context).padding.bottom,
|
||||
decoration: const BoxDecoration(image: bgWidget),
|
||||
),
|
||||
TabBarView(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
controller: logic.tabController,
|
||||
children: [
|
||||
const CirclePage(),
|
||||
LikePage(),
|
||||
MsgPage(),
|
||||
MinefragmentPage()
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: Get.height - 49.sp + MediaQuery.of(context).padding.bottom,
|
||||
decoration: const BoxDecoration(
|
||||
image: bgWidget),),
|
||||
PageView(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
controller: controller.pageController,
|
||||
onPageChanged: (int index) {
|
||||
// controller.updateIndex(index);
|
||||
},
|
||||
children: controller.tabs,
|
||||
|
||||
)
|
||||
],
|
||||
),
|
||||
),);
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@ -83,30 +94,46 @@ class _HomePageState extends State<HomePage>
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
if (!isSelected) {
|
||||
controller.pageController.jumpToPage(index);
|
||||
logic.tabController.animateTo(index, duration: Duration(milliseconds: 0), curve: Curves.ease);
|
||||
controller.updateIndex(index);
|
||||
}
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children:[
|
||||
Container(
|
||||
|
||||
child: Stack(alignment: Alignment.center, children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 8.sp),
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
isSelected
|
||||
? getTabbarImage('${image}_selected')
|
||||
: getTabbarImage('${image}_normal'),
|
||||
width: 38.sp,
|
||||
height: 38.sp,
|
||||
fit: BoxFit.fill,
|
||||
excludeFromSemantics: true,
|
||||
gaplessPlayback: true,
|
||||
))),
|
||||
child: Image.asset(
|
||||
isSelected
|
||||
? getTabbarImage('${image}_selected')
|
||||
: getTabbarImage('${image}_normal'),
|
||||
width: 38.sp,
|
||||
height: 38.sp,
|
||||
fit: BoxFit.fill,
|
||||
excludeFromSemantics: true,
|
||||
gaplessPlayback: true,
|
||||
))),
|
||||
// if (logic.showcirlceUnred.value && index == 1)
|
||||
Obx(() => Visibility(
|
||||
visible: index == 1 && controller.showcirlceUnred.value,
|
||||
child: Positioned(
|
||||
// right: 4.sp,
|
||||
top: 10.sp,
|
||||
child: Container(
|
||||
|
||||
width: 14.sp,
|
||||
height: 14.sp,
|
||||
margin: EdgeInsets.only(
|
||||
left:24.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(7.sp),
|
||||
gradient: LinearGradient(
|
||||
colors: controller.showcirlceUnred.value ? [Color(0xFFC343F9), Color(0xFFFB34B2)] : [Color(0xFFC343F9), Color(0xFFFB34B2)]),
|
||||
border:
|
||||
Border.all(color: Color(0xFF170730), width: 1.sp))),
|
||||
))),
|
||||
// Obx(() => null)
|
||||
Obx(() => Visibility(
|
||||
visible: index == 0 && controller.unreadSIze != "0",
|
||||
visible: index == 2 && controller.unreadSIze != "0",
|
||||
child: Positioned(
|
||||
// right: 4.sp,
|
||||
top: 6.sp,
|
||||
|
||||
@ -487,7 +487,6 @@ void showCodePicker(InviteLogic logic) {
|
||||
alignment: Alignment.center,
|
||||
child: TextField(
|
||||
controller: logic.codeEditingController,
|
||||
keyboardType: TextInputType.phone,
|
||||
maxLength: 8,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||
|
||||
10
circle_app/lib/app/like/binding.dart
Normal file
10
circle_app/lib/app/like/binding.dart
Normal file
@ -0,0 +1,10 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class LikeBinding extends Bindings {
|
||||
@override
|
||||
void dependencies() {
|
||||
Get.lazyPut(() => LikeLogic());
|
||||
}
|
||||
}
|
||||
188
circle_app/lib/app/like/logic.dart
Normal file
188
circle_app/lib/app/like/logic.dart
Normal file
@ -0,0 +1,188 @@
|
||||
import 'package:circle_app/app/circle/logic.dart';
|
||||
import 'package:circle_app/app/home/logic.dart';
|
||||
import 'package:circle_app/app/invite/logic.dart';
|
||||
import 'package:circle_app/network/api.dart';
|
||||
import 'package:circle_app/network/dio_manager.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class LikeLogic extends GetxController {
|
||||
int currentIndex = -1;
|
||||
|
||||
int page = 1;
|
||||
int myPage = 1;
|
||||
|
||||
InterestsBean circle = InterestsBean(lists: []);
|
||||
InterestsBean mycircle = InterestsBean(lists: []);
|
||||
|
||||
ScrollController leftCtr = ScrollController();
|
||||
ScrollController rightCtr = ScrollController();
|
||||
ScrollController myCircleCtr = ScrollController();
|
||||
|
||||
bool isMore = true;
|
||||
bool isMyMore = true;
|
||||
bool isLoad = true;
|
||||
|
||||
List<bool> hasNewList = [];
|
||||
|
||||
Data? homeData;
|
||||
@override
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
// leftCtr.addListener(() {
|
||||
// if (leftCtr.position.pixels ==
|
||||
// leftCtr.position.maxScrollExtent) {
|
||||
// loadMore();
|
||||
// }
|
||||
// });
|
||||
rightCtr.addListener(() {
|
||||
if (rightCtr.position.pixels ==
|
||||
rightCtr.position.maxScrollExtent) {
|
||||
loadMore();
|
||||
}
|
||||
});
|
||||
//
|
||||
// myCircleCtr.addListener(() {
|
||||
// if (myCircleCtr.position.pixels ==
|
||||
// myCircleCtr.position.maxScrollExtent) {
|
||||
// loadMyMore();
|
||||
// }
|
||||
// });
|
||||
loadInviteData();
|
||||
loadCircleListData();
|
||||
loadMyCircleData();
|
||||
}
|
||||
|
||||
loadInviteData() async {
|
||||
|
||||
var data = await DioManager.instance.get(url: Api.inviteMainPage);
|
||||
if (data['code'] == 200) {
|
||||
Autogenerated result = Autogenerated.fromJson(data);
|
||||
|
||||
homeData = result.data;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
loadCircleListData() async {
|
||||
var data = await DioManager.instance.get(
|
||||
url: Api.getCircleInterests, params: {"page": page, 'page_size': 20});
|
||||
var bean = BaseResponse<InterestsBean>.fromJson(
|
||||
data, (data) => InterestsBean.fromJson(data));
|
||||
if (bean.data is InterestsBean && bean.isSuccess()) {
|
||||
if (page == 1) {
|
||||
circle = bean.data!;
|
||||
} else {
|
||||
circle.lists.addAll(bean.data!.lists);
|
||||
}
|
||||
|
||||
isLoad = false;
|
||||
if (circle.lists.length < 20) {
|
||||
isMore = false;
|
||||
}
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
loadMyCircleData() async {
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.getMyCircleAll);
|
||||
|
||||
// var bean = BaseResponse<InterestsBean>.fromJson(
|
||||
// data, (data) => InterestsBean.fromJson(data));
|
||||
|
||||
if (data['code'] == 200) {
|
||||
List circleList = data['data'];
|
||||
if (circleList.isNotEmpty) {
|
||||
List<Circle> infoList = [];
|
||||
circleList.forEach((element) {
|
||||
var info = Circle.fromJson(element);
|
||||
infoList.add(info);
|
||||
});
|
||||
mycircle.lists = infoList;
|
||||
if (currentIndex >= mycircle.lists.length - 1) {
|
||||
currentIndex = mycircle.lists.length -1;
|
||||
}
|
||||
|
||||
loadCalloutsNew();
|
||||
}
|
||||
}
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
loadMore() {
|
||||
if (isMore) {
|
||||
page = page + 1;
|
||||
loadCircleListData();
|
||||
}
|
||||
}
|
||||
|
||||
void relaodData() {
|
||||
page = 1;
|
||||
loadCircleListData();
|
||||
}
|
||||
|
||||
loadMyMore() {
|
||||
if (isMyMore) {
|
||||
myPage = myPage + 1;
|
||||
loadMyCircleData();
|
||||
}
|
||||
}
|
||||
|
||||
void relaodMyData() {
|
||||
myPage = 1;
|
||||
loadMyCircleData();
|
||||
}
|
||||
|
||||
outCircle(String interest_id, bool isStatus) async {
|
||||
var data = await DioManager.instance.post(
|
||||
url: "${Api.outCrrcle}$interest_id/join",
|
||||
params: {"status": isStatus ? "0" : "1"});
|
||||
var bean = BaseResponse<String>.fromJson(data, (data) => data);
|
||||
if (bean.code == 200) {
|
||||
circle.lists.forEach((element) {
|
||||
if (element.id.toString() == interest_id.toString()) {
|
||||
element.isJoin = !isStatus;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
relaodMyData();
|
||||
}
|
||||
showOKToast(bean.msg);
|
||||
}
|
||||
|
||||
|
||||
loadCalloutsNew() async {
|
||||
List<String> idList = [];
|
||||
mycircle.lists.forEach((element) {
|
||||
idList.add(element.id.toString());
|
||||
});
|
||||
var data = await DioManager.instance.post(
|
||||
url:Api.calloutsNew,
|
||||
params: {"interestIds":idList});
|
||||
|
||||
if (data['code'] == 200) {
|
||||
hasNewList.clear();
|
||||
List infoList = data['data'];
|
||||
bool isHasNew = false;
|
||||
if (infoList.isNotEmpty) {
|
||||
infoList.forEach((element) {
|
||||
// "hasNew" -> false
|
||||
hasNewList.add(element['hasNew']);
|
||||
if (element['hasNew']) {
|
||||
isHasNew = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
HomeLogic logic = Get.find<HomeLogic>();
|
||||
logic.showcirlceUnred.value = isHasNew;
|
||||
// logic.update();
|
||||
// update();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
501
circle_app/lib/app/like/view.dart
Normal file
501
circle_app/lib/app/like/view.dart
Normal file
@ -0,0 +1,501 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/app/circle/logic.dart';
|
||||
import 'package:circle_app/app/circle/widgets/info_list_view.dart';
|
||||
import 'package:circle_app/app/select_circle/logic.dart';
|
||||
import 'package:circle_app/common/Widgets/circle_share.dart';
|
||||
import 'package:circle_app/common/Widgets/text_more.dart';
|
||||
import 'package:circle_app/router/app_routers.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class LikePage extends StatelessWidget {
|
||||
LikePage({Key? key}) : super(key: key);
|
||||
final ctr = Get.lazyPut(() => LikeLogic());
|
||||
final logic = Get.find<LikeLogic>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: SafeArea(
|
||||
child: GetBuilder<LikeLogic>(builder: (logic) {
|
||||
return logic.isLoad
|
||||
? loaddingWidget(true)
|
||||
: Container(
|
||||
width: Get.width,
|
||||
height: Get.height,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 65.sp,
|
||||
child: Column(
|
||||
children: [
|
||||
leftItem('', logic.currentIndex == -1, false, -1),
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
height: 20,
|
||||
child: Container(
|
||||
width: 33.sp,
|
||||
height: 1.sp,
|
||||
color: Color(0x4DFFFFFF),
|
||||
)),
|
||||
Expanded(
|
||||
child: MediaQuery.removePadding(
|
||||
removeTop: true,
|
||||
context: context,
|
||||
child: ListView.builder(
|
||||
controller: logic.myCircleCtr,
|
||||
itemBuilder: (context, index) {
|
||||
return leftItem(
|
||||
logic.mycircle.lists[index].title,
|
||||
logic.currentIndex == index,
|
||||
logic.hasNewList.length > index
|
||||
? logic.hasNewList[index]
|
||||
: false,
|
||||
index);
|
||||
},
|
||||
itemCount: logic.mycircle.lists.length,
|
||||
)))
|
||||
],
|
||||
)),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: logic.currentIndex == -1
|
||||
? circleInfoListView()
|
||||
: InfoListView(
|
||||
logic.currentIndex,
|
||||
logic.mycircle.lists[logic.currentIndex],
|
||||
logic,
|
||||
key: ValueKey('${logic.mycircle.lists[logic.currentIndex].id.toString() + logic.currentIndex.toString()}'),
|
||||
)))
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
circleInfoListView() {
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
logic.relaodData();
|
||||
},
|
||||
child: ListView.builder(
|
||||
controller: logic.rightCtr,
|
||||
itemBuilder: (context, index) {
|
||||
return circleInfoItem(logic.circle.lists[index]);
|
||||
},
|
||||
itemCount: logic.circle.lists.length,
|
||||
)),
|
||||
Positioned(
|
||||
bottom: 36.sp,
|
||||
right: 10.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
var data = await Get.toNamed(
|
||||
AppRoutes.Call_out,
|
||||
);
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('send_msg'),
|
||||
width: 60.sp,
|
||||
)))
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
circleInfoItem(Circle bean) {
|
||||
List<JoinUser> urlList = bean.lastJoinUsers;
|
||||
List<Widget> widgets = [];
|
||||
int i = 0;
|
||||
// print(urlList);
|
||||
if (null != urlList) {
|
||||
urlList.forEach((element) {
|
||||
if (widgets.length > 2) {
|
||||
return;
|
||||
}
|
||||
widgets.add(Positioned(
|
||||
left: 15.sp * i,
|
||||
child: circleWidget(
|
||||
element.avatar! ??
|
||||
"https://qiniuyun.leyuan666.com/quanzi/avatar/default.png",
|
||||
element.id.toString()),
|
||||
));
|
||||
i++;
|
||||
});
|
||||
}
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
// if (bean.isJoin) {
|
||||
Get.toNamed(AppRoutes.Signal_circle_list, arguments: bean.id);
|
||||
// }
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(bottom: 10.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10.sp),
|
||||
topRight: Radius.circular(10.sp)),
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
||||
height: 72.sp,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(getCircleImage('top_circle_bg')))),
|
||||
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, top: 12.sp),
|
||||
// alignment: Alignment.,
|
||||
height: 72.sp,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
bean.title,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(
|
||||
height: 4.sp,
|
||||
),
|
||||
Text(
|
||||
'${convertToTenThousand(bean.viewTotal)}人看过',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: const Color(0xff03FEFB),
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
GestureDetector(
|
||||
//加入圈子
|
||||
onTap: () async {
|
||||
if (bean.isJoin) {
|
||||
Get.bottomSheet(CircleShare('', '', bean),
|
||||
isScrollControlled: true, enableDrag: false);
|
||||
} else {
|
||||
await logic.outCircle(
|
||||
bean.id.toString(), bean.isJoin);
|
||||
}
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('add'),
|
||||
width: 77.sp,
|
||||
),
|
||||
Text(
|
||||
!bean.isJoin ? '申请加入' : '分享有奖',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
)
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
)),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
||||
// height:urlList.length==0?47.sp: 118.sp,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(getCircleImage('circle_desc')))),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 7.sp),
|
||||
width: Get.width - 80.sp,
|
||||
// height: 50.sp,
|
||||
child: HideText(
|
||||
text: bean.intro,
|
||||
maxWidth: Get.width - 89.sp,
|
||||
additionText: '查看更多',
|
||||
maxLines: 3,
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
additionStyle: TextStyle(
|
||||
color: const Color(0xFFFF4DF6), fontSize: 14.sp),
|
||||
onTap: () {
|
||||
_showTextContentDialog(
|
||||
Get.context!, bean.intro, bean.title);
|
||||
},
|
||||
)),
|
||||
urlList.length == 0
|
||||
? Container()
|
||||
: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30.sp,
|
||||
width:
|
||||
30.0.sp + 14.sp * (widgets.length - 1.sp),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: widgets,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 4.sp,
|
||||
),
|
||||
Text(
|
||||
'${convertToTenThousand(bean.joinTotal)}圈友加入',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
SizedBox(
|
||||
width: 4.sp,
|
||||
),
|
||||
// GestureDetector(
|
||||
// onTap: () {
|
||||
// // Get.bottomSheet(
|
||||
// // CircleShare(logic.homeData!.inviteCode!,logic.homeData!.link!,bean), isScrollControlled: true,
|
||||
// // enableDrag: false
|
||||
// // );
|
||||
// },
|
||||
// behavior: HitTestBehavior.opaque,
|
||||
// child: Container(
|
||||
// height: 30.sp,
|
||||
// alignment: Alignment.center,
|
||||
// child: Image.asset(
|
||||
// getCircleImage('play'),
|
||||
// width: 20.sp,
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
circleWidget(String url, String userId, {double width = 24}) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.UserInfoActivity, arguments: userId);
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('avatar_bg'),
|
||||
width: width.sp,
|
||||
),
|
||||
ClipOval(
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: url ??
|
||||
"https://qiniuyun.leyuan666.com/quanzi/avatar/default.png",
|
||||
width: (width - 1).sp,
|
||||
height: (width - 1).sp,
|
||||
fit: BoxFit.cover,
|
||||
memCacheHeight: width.toInt() - 1,
|
||||
memCacheWidth: width.toInt() - 1,
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
leftItem(String text, bool isSelcted, bool isUnread, int index) {
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () async {
|
||||
logic.currentIndex = index;
|
||||
|
||||
if (index >= 0) {
|
||||
logic.hasNewList[index] = false;
|
||||
logic.update();
|
||||
Future.delayed(Duration(seconds: 1), () {
|
||||
logic.loadCalloutsNew();
|
||||
});
|
||||
} else {
|
||||
logic.update();
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: 65.sp,
|
||||
height: 65.sp,
|
||||
color: isSelcted ? Colors.white.withOpacity(0.3) : Colors.transparent,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
if (text.isEmpty)
|
||||
Image.asset(
|
||||
getCircleImage('circile_all_icon'),
|
||||
width: 55.sp,
|
||||
),
|
||||
if (text.isNotEmpty)
|
||||
Container(
|
||||
margin: EdgeInsets.all(6.sp),
|
||||
// padding: EdgeInsets.only(left: 4.sp),
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.all(6.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(7.sp),
|
||||
gradient: LinearGradient(
|
||||
colors: [Color(0xFF3F6967), Color(0xFF5C3769)])),
|
||||
child: Text(
|
||||
text,
|
||||
maxLines: 2,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 13.sp,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontWeight: FontWeight.w600),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
if (isUnread)
|
||||
Positioned(
|
||||
right: 6.sp,
|
||||
top: 6.sp,
|
||||
child: Container(
|
||||
width: 15.sp,
|
||||
height: 15.sp,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
gradient: LinearGradient(
|
||||
colors: [Color(0xFFC343F9), Color(0xFFFB34B2)]),
|
||||
border:
|
||||
Border.all(color: Color(0xFF170730), width: 1.sp)),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _showTextContentDialog(BuildContext context, String msg, String title) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
child: Container(
|
||||
height: 300.sp,
|
||||
padding: const EdgeInsets.all(1.0),
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(1.sp),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFF4C3E5F), Color(0xFF324140)],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 15,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Center(
|
||||
child: Text(title,
|
||||
style: TextStyle(
|
||||
color: const Color(0xFFF7FAFA), fontSize: 16.sp)),
|
||||
)),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 24.sp, bottom: 24.sp),
|
||||
child: Container(
|
||||
margin:
|
||||
EdgeInsets.only(top: 12.sp, left: 14.sp, right: 14.sp),
|
||||
alignment: Alignment.center,
|
||||
child: SingleChildScrollView(
|
||||
child: Text(
|
||||
msg,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: const Color(0xCCF7FAFA), fontSize: 16.sp),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 8.sp,
|
||||
right: 10.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Icon(
|
||||
Icons.close,
|
||||
color: Colors.white,
|
||||
size: 20.sp,
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@ -247,7 +247,7 @@ class Complete_materialLogic extends GetxController {
|
||||
}
|
||||
|
||||
if (state.wxEditingController.text.isNotEmpty && !isPass) {
|
||||
RegExp wxReg = RegExp(r'^[a-zA-Z][-_a-zA-Z0-9]{5,19}$');
|
||||
RegExp wxReg = RegExp(r'^[-_a-zA-Z][-_a-zA-Z0-9]{5,19}$');
|
||||
if (!wxReg.hasMatch(state.wxEditingController.text)) {
|
||||
showOKToast('请输入正确的微信号');
|
||||
return;
|
||||
|
||||
@ -119,8 +119,8 @@ class Sys_notify_listPage extends StatelessWidget {
|
||||
break;
|
||||
case "my_main":
|
||||
final homeLogic = Get.put(HomeLogic());
|
||||
homeLogic.pageController.jumpToPage(2);
|
||||
homeLogic.updateIndex(2);
|
||||
homeLogic.tabController.animateTo(3);
|
||||
homeLogic.updateIndex(3);
|
||||
|
||||
Get.back();
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ import 'package:tencent_cloud_chat_uikit/ui/controller/tim_uikit_conversation_co
|
||||
import '../../util/eventBus.dart';
|
||||
import 'TIMUIKitConversation/tim_uikit_conversation.dart';
|
||||
import 'logic.dart';
|
||||
const bgWidget = DecorationImage(
|
||||
const msgBgWidget = DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage('assets/images/base/home_back.png'));
|
||||
class MsgPage extends StatelessWidget {
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/app/circle/logic.dart';
|
||||
import 'package:circle_app/app/circle/widgets/info_list_view.dart';
|
||||
import 'package:circle_app/app/my_circle/logic.dart';
|
||||
import 'package:circle_app/app/select_circle/logic.dart';
|
||||
import 'package:circle_app/common/Widgets/circle_share.dart';
|
||||
import 'package:circle_app/common/Widgets/text_more.dart';
|
||||
import 'package:circle_app/components/my_app_bar.dart';
|
||||
import 'package:circle_app/router/app_routers.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
@ -12,7 +15,6 @@ import 'package:get/get.dart';
|
||||
|
||||
import '../../util/eventBus.dart';
|
||||
|
||||
|
||||
class My_circlePage extends StatefulWidget {
|
||||
My_circlePage({Key? key}) : super(key: key);
|
||||
@override
|
||||
@ -29,92 +31,324 @@ class _My_circlePageState extends State<My_circlePage>
|
||||
|
||||
final state = Get.find<MyCircleLogic>().state;
|
||||
|
||||
|
||||
var getContext;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
getContext = context;
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFF423055),
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(getBaseImage('home_back')))),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: SafeArea(
|
||||
child: GetBuilder(builder: (MyCircleLogic controller) {
|
||||
return Stack(
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFF423055),
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(getBaseImage('home_back')))),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: SafeArea(
|
||||
child: GetBuilder(builder: (MyCircleLogic controller) {
|
||||
return Stack(
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
child: Container(
|
||||
child: Column(children: [
|
||||
backNavigatorItem(),
|
||||
// Text(controller.state.msg),
|
||||
//组件使用
|
||||
Expanded(
|
||||
child: logic.circle.lists.isEmpty
|
||||
? !logic.isMore
|
||||
? noResultWidget()
|
||||
: loaddingWidget(logic.isMore)
|
||||
: ListView.builder(
|
||||
// controller: logic.rightCtr,
|
||||
itemBuilder: (context, index) {
|
||||
var bean = logic.circle.lists[index];
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
|
||||
Get.toNamed(AppRoutes.Signal_circle_list, arguments: bean.id);
|
||||
|
||||
},
|
||||
child: circleInfoItemWidget(
|
||||
logic.circle.lists[index]));
|
||||
},
|
||||
itemCount: logic.circle.lists.length,
|
||||
))
|
||||
// Swiper(
|
||||
// itemBuilder: (BuildContext context, int index) {
|
||||
// var bean = logic.circle.lists[index];
|
||||
// // final GlobalKey<InfoListViewState> infoListViewKey = GlobalKey<InfoListViewState>();
|
||||
// // MyinfoListViewKey = infoListViewKey;
|
||||
// return InfoListView(
|
||||
// index,
|
||||
// bean,
|
||||
// controller
|
||||
// );
|
||||
// },
|
||||
// index: controller.state.index,
|
||||
// itemCount: logic.circle.lists.length,
|
||||
// viewportFraction: 0.93,
|
||||
// // scale: 0.9,
|
||||
// loop: false,
|
||||
// onIndexChanged: (index) {
|
||||
// controller.state.index = index;
|
||||
// if (index == logic.circle.lists.length - 1 && controller.isMore) {
|
||||
//
|
||||
// logic.loadMore();
|
||||
// }
|
||||
//
|
||||
// },
|
||||
// // pagination: new SwiperPagination(),//如果不填则不显示指示点
|
||||
// // control: new SwiperControl(),//如果不填则不显示左右按钮
|
||||
// )
|
||||
]),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
var MyinfoListViewKey;
|
||||
|
||||
circleInfoItemWidget(Circle bean) {
|
||||
List<JoinUser> urlList = bean.lastJoinUsers;
|
||||
List<Widget> widgets = [];
|
||||
int i = 0;
|
||||
// print(urlList);
|
||||
if (null != urlList) {
|
||||
urlList.forEach((element) {
|
||||
if (widgets.length > 2) {
|
||||
return;
|
||||
}
|
||||
widgets.add(Positioned(
|
||||
left: 15.sp * i,
|
||||
child: circleWidget(
|
||||
element.avatar! ??
|
||||
"https://qiniuyun.leyuan666.com/quanzi/avatar/default.png",
|
||||
),
|
||||
));
|
||||
i++;
|
||||
});
|
||||
}
|
||||
return Container(
|
||||
margin: EdgeInsets.only(bottom: 10.sp, left: 10.sp, right: 10.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10.sp),
|
||||
topRight: Radius.circular(10.sp)),
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
||||
height: 72.sp,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(getCircleImage('top_circle_bg')))),
|
||||
child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
child: Container(
|
||||
child: Column(children: [
|
||||
backNavigatorItem(),
|
||||
// Text(controller.state.msg),
|
||||
//组件使用
|
||||
Expanded(
|
||||
child: logic.circle.lists.isEmpty ? !logic.isMore ? noResultWidget() : loaddingWidget(logic.isMore) : Swiper(
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var bean = logic.circle.lists[index];
|
||||
// final GlobalKey<InfoListViewState> infoListViewKey = GlobalKey<InfoListViewState>();
|
||||
// MyinfoListViewKey = infoListViewKey;
|
||||
return InfoListView(
|
||||
index,
|
||||
bean,
|
||||
controller
|
||||
);
|
||||
},
|
||||
index: controller.state.index,
|
||||
itemCount: logic.circle.lists.length,
|
||||
viewportFraction: 0.93,
|
||||
// scale: 0.9,
|
||||
loop: false,
|
||||
onIndexChanged: (index) {
|
||||
controller.state.index = index;
|
||||
if (index == logic.circle.lists.length - 1 && controller.isMore) {
|
||||
|
||||
logic.loadMore();
|
||||
}
|
||||
|
||||
},
|
||||
// pagination: new SwiperPagination(),//如果不填则不显示指示点
|
||||
// control: new SwiperControl(),//如果不填则不显示左右按钮
|
||||
))
|
||||
]),
|
||||
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, top: 12.sp),
|
||||
// alignment: Alignment.,
|
||||
height: 72.sp,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
bean.title,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(
|
||||
height: 4.sp,
|
||||
),
|
||||
Text(
|
||||
'${convertToTenThousand(bean.viewTotal)}人看过',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: const Color(0xff03FEFB),
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
GestureDetector(
|
||||
//加入圈子
|
||||
onTap: () async {
|
||||
if (bean.isJoin) {
|
||||
Get.bottomSheet(
|
||||
CircleShare('','',bean), isScrollControlled: true,
|
||||
enableDrag: false
|
||||
);
|
||||
} else {
|
||||
await logic.outCircle(
|
||||
bean.id.toString(), bean.isJoin);
|
||||
}
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('add'),
|
||||
width: 77.sp,
|
||||
),
|
||||
Text(
|
||||
!bean.isJoin ? '申请加入' : '分享有奖',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
)
|
||||
],
|
||||
))
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
)),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
||||
// height:urlList.length==0?47.sp: 118.sp,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(getCircleImage('circle_desc')))),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 7.sp),
|
||||
width: Get.width - 20.sp,
|
||||
// height: 50.sp,
|
||||
child: HideText(
|
||||
text: bean.intro,
|
||||
maxWidth: Get.width - 50.sp,
|
||||
additionText: '查看更多',
|
||||
maxLines: 3,
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 17.sp),
|
||||
additionStyle: TextStyle(
|
||||
color: const Color(0xFFFF4DF6), fontSize: 17.sp),
|
||||
onTap: () {
|
||||
_showTextContentDialog(
|
||||
Get.context!,
|
||||
bean.intro,
|
||||
);
|
||||
},
|
||||
)),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
// showToast("点个鸡毛,星哥还没做");
|
||||
// Get.toNamed(AppRoutes.FriendsActivity,arguments: '3');
|
||||
},
|
||||
child: urlList.length == 0
|
||||
? Container()
|
||||
: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30.sp,
|
||||
width:
|
||||
30.0.sp + 14.sp * (widgets.length - 1.sp),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: widgets,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 4.sp,
|
||||
),
|
||||
Text(
|
||||
'${convertToTenThousand(bean.joinTotal)}圈友加入',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
SizedBox(
|
||||
width: 4.sp,
|
||||
),
|
||||
// GestureDetector(
|
||||
// onTap: () {
|
||||
// // Get.bottomSheet(
|
||||
// // CircleShare(logic.homeData!.inviteCode!,logic.homeData!.link!,bean), isScrollControlled: true,
|
||||
// // enableDrag: false
|
||||
// // );
|
||||
// },
|
||||
// behavior: HitTestBehavior.opaque,
|
||||
// child: Container(
|
||||
// height: 30.sp,
|
||||
// alignment: Alignment.center,
|
||||
// child: Image.asset(
|
||||
// getCircleImage('play'),
|
||||
// width: 20.sp,
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
var MyinfoListViewKey;
|
||||
|
||||
backNavigatorItem() {
|
||||
return MyAppBar(
|
||||
centerTitle: '我的圈子',
|
||||
onCenterTitlePressed: (){
|
||||
onCenterTitlePressed: () {
|
||||
EventBusManager.fire(ScrollToTop());
|
||||
},
|
||||
actionWdiget: const Text(
|
||||
"发布喊话",
|
||||
style: TextStyle(color: Colors.white),
|
||||
actionWdiget: Image.asset(
|
||||
getCircleImage('callout_icon'),
|
||||
width: 75.sp,
|
||||
),
|
||||
onPressed: () async{
|
||||
onPressed: () async {
|
||||
List<MyConfigData> numbers = [];
|
||||
numbers.add(MyConfigData(
|
||||
logic.getCircleIndex().id.toString(),
|
||||
logic.getCircleIndex().title!,
|
||||
false));
|
||||
var data = await Get.toNamed(AppRoutes.Call_out, arguments: {'numbers': numbers});
|
||||
// MyinfoListViewKey.currentState?.loadCallOutListData();
|
||||
numbers.add(MyConfigData(logic.getCircleIndex().id.toString(),
|
||||
logic.getCircleIndex().title!, false));
|
||||
var data = await Get.toNamed(AppRoutes.Call_out,
|
||||
arguments: {'numbers': numbers});
|
||||
// MyinfoListViewKey.currentState?.loadCallOutListData();
|
||||
// logic.refresh();
|
||||
// logic.update();
|
||||
},
|
||||
@ -146,7 +380,6 @@ class _My_circlePageState extends State<My_circlePage>
|
||||
Positioned(
|
||||
left: 0,
|
||||
child: Container(
|
||||
|
||||
width: 30.sp * widgets.length,
|
||||
height: 44.sp,
|
||||
child: Stack(
|
||||
@ -177,7 +410,8 @@ class _My_circlePageState extends State<My_circlePage>
|
||||
right: 0,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.MyCircle,arguments: '',preventDuplicates:false);
|
||||
Get.toNamed(AppRoutes.MyCircle,
|
||||
arguments: '', preventDuplicates: false);
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('my_circle'),
|
||||
@ -192,26 +426,24 @@ class _My_circlePageState extends State<My_circlePage>
|
||||
circleWidget(String url, {double width = 30}) {
|
||||
return GestureDetector(
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('avatar_bg'),
|
||||
width: width.sp,
|
||||
),
|
||||
ClipOval(
|
||||
child: Image.network(
|
||||
url,
|
||||
width: (width - 1).sp,
|
||||
height: (width - 1).sp,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('avatar_bg'),
|
||||
width: width.sp,
|
||||
),
|
||||
ClipOval(
|
||||
child: Image.network(
|
||||
url,
|
||||
width: (width - 1).sp,
|
||||
height: (width - 1).sp,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
|
||||
void _showTextContentDialog(BuildContext context, String msg) {
|
||||
showDialog(
|
||||
context: context,
|
||||
@ -272,8 +504,7 @@ class _My_circlePageState extends State<My_circlePage>
|
||||
);
|
||||
}
|
||||
|
||||
void _showOutCircleDialog(
|
||||
BuildContext context, CircleLogic controller, Circle bean) {
|
||||
void _showOutCircleDialog(BuildContext context, var controller, Circle bean) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
@ -315,7 +546,7 @@ class _My_circlePageState extends State<My_circlePage>
|
||||
child: Text(
|
||||
"提示",
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||
TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
@ -410,4 +641,3 @@ class _My_circlePageState extends State<My_circlePage>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -7,41 +7,41 @@ import 'state.dart';
|
||||
class Select_circleLogic extends GetxController {
|
||||
late Map<String, dynamic> interestMap = Get.arguments['interestMap'];
|
||||
bool isRodio = Get.arguments['isRodio'];
|
||||
List<MyConfigData> selectCircle = Get.arguments['selectCircle'];
|
||||
List<MyConfigData> selectCircle = Get.arguments['selectCircle'];
|
||||
var selectIndex = -1;
|
||||
|
||||
@override
|
||||
void onInit() async {
|
||||
if(isRodio){
|
||||
if (isRodio) {
|
||||
List<MapEntry<String, dynamic>> entries = interestMap.entries.toList();
|
||||
|
||||
for (var entry in entries.asMap().entries) {
|
||||
MyConfigData bean = MyConfigData(entry.value.key, entry.value.value, false);
|
||||
if(selectCircle.isEmpty){
|
||||
MyConfigData bean =
|
||||
MyConfigData(entry.value.key, entry.value.value, false);
|
||||
if (selectCircle.isEmpty) {
|
||||
arrList.add(bean);
|
||||
}else{
|
||||
} else {
|
||||
selectCircle.forEach((element) {
|
||||
if(entry.value.key==element.id){
|
||||
if (entry.value.key == element.id) {
|
||||
bean.isSelect = true;
|
||||
selectIndex = entry.key;
|
||||
}
|
||||
arrList.add(bean);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
interestMap.forEach((key, value) {
|
||||
MyConfigData bean = MyConfigData(key, value, false);
|
||||
MyConfigData bean = MyConfigData(key, value, false);
|
||||
selectCircle.forEach((element) {
|
||||
if(key==element.id){
|
||||
if (key == element.id) {
|
||||
bean.isSelect = true;
|
||||
}
|
||||
});
|
||||
arrList.add(bean);
|
||||
});
|
||||
}
|
||||
print(arrList.length.toString());
|
||||
print(arrList.length.toString());
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
import 'package:circle_app/app/circle/logic.dart';
|
||||
import 'package:circle_app/app/circle/widgets/info_list_view.dart';
|
||||
import 'package:circle_app/app/select_circle/logic.dart';
|
||||
import 'package:circle_app/components/my_app_bar.dart';
|
||||
import 'package:circle_app/router/app_routers.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@ -28,7 +30,21 @@ class Signal_circle_listPage extends StatelessWidget {
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: MyAppBar(
|
||||
centerTitle: logic.circle?.title ?? '',
|
||||
|
||||
actionWdiget: Image.asset(
|
||||
getCircleImage('callout_icon'),
|
||||
width: 75.sp,
|
||||
),
|
||||
onPressed: () async{
|
||||
List<MyConfigData> numbers = [];
|
||||
numbers.add(MyConfigData(
|
||||
controller.circle!.id.toString(),
|
||||
controller.circle!.title,
|
||||
false));
|
||||
var data = await Get.toNamed(AppRoutes.Call_out, arguments: {'numbers': numbers});
|
||||
// MyinfoListViewKey.currentState?.loadCallOutListData();
|
||||
// logic.refresh();
|
||||
// logic.update();
|
||||
},
|
||||
),
|
||||
body: Container(
|
||||
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
|
||||
|
||||
@ -262,9 +262,11 @@ typedef void MyCallback(bool payResult);
|
||||
showJoinCiclePiker(String cicleId, String pirce, String oldPrice, int type,
|
||||
MyCallback payResult,String iosItem) {
|
||||
String title = ['解锁圈子才能发布喊话', '解锁圈子才能查看主页', '解锁圈子才能主动私聊'][type];
|
||||
int intP = double.parse(pirce).toInt();
|
||||
int intoldPrice = double.parse(oldPrice).toInt();
|
||||
return Get.bottomSheet(
|
||||
joiinCircileTipWdiget(cicleId, pirce, oldPrice, title, payResult,iosItem: iosItem),
|
||||
isScrollControlled: true,
|
||||
joiinCircileTipWdiget(cicleId,intP.toString(), intoldPrice.toString(), title, payResult,iosItem: iosItem),
|
||||
isScrollControlled: true,
|
||||
enableDrag: false);
|
||||
}
|
||||
|
||||
|
||||
735
circle_app/lib/common/Widgets/circle_share.dart
Normal file
735
circle_app/lib/common/Widgets/circle_share.dart
Normal file
@ -0,0 +1,735 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/app/circle/logic.dart';
|
||||
import 'package:circle_app/app/invite/logic.dart';
|
||||
import 'package:circle_app/app/minefragment/logic.dart';
|
||||
import 'package:circle_app/common/Widgets/text_more.dart';
|
||||
import 'package:circle_app/network/api.dart';
|
||||
import 'package:circle_app/network/dio_manager.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_core/src/get_main.dart';
|
||||
import 'package:image_gallery_saver/image_gallery_saver.dart';
|
||||
import 'dart:ui' as ui;
|
||||
import 'package:fluwx/fluwx.dart' as fluwx;
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:qr_flutter/qr_flutter.dart';
|
||||
|
||||
|
||||
class CircleShare extends StatefulWidget {
|
||||
Circle bean;
|
||||
String code;
|
||||
String link;
|
||||
CircleShare(this.code, this.link,this.bean);
|
||||
@override
|
||||
_CircleShareState createState() => new _CircleShareState();
|
||||
|
||||
}
|
||||
|
||||
class _CircleShareState extends State<CircleShare> {
|
||||
// TODO: add state variables and methods
|
||||
GlobalKey _globalKey = GlobalKey();
|
||||
|
||||
MinefragmentLogic logic = Get.find<MinefragmentLogic>();
|
||||
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
loadInviteData();
|
||||
}
|
||||
|
||||
loadInviteData() async {
|
||||
|
||||
var data = await DioManager.instance.get(url: Api.inviteMainPage);
|
||||
if (data['code'] == 200) {
|
||||
Autogenerated result = Autogenerated.fromJson(data);
|
||||
|
||||
Data homeData = result.data!;
|
||||
widget.code = homeData.inviteCode!;
|
||||
|
||||
widget.link = homeData.link!;
|
||||
setState(() {
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@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,
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Color(0xFFDD3DF4),
|
||||
Color(0xFF30FFD9)
|
||||
],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 46.sp,
|
||||
height: 46.sp,
|
||||
child: _buildAvatar1(logic),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 10.sp),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildNameRow(logic),
|
||||
SizedBox(height: 10.sp),
|
||||
_buildInfoRow(logic),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Image.asset(
|
||||
getBaseImage("ic_launcher"),
|
||||
width: 65.sp,
|
||||
height: 65.sp,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
// Expanded(
|
||||
// child:
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 10.sp,right: 10.sp),
|
||||
// color: Colors.red,
|
||||
// height: 310.sp,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 5.sp,
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 15.sp,right: 15.sp),
|
||||
child: Image.asset(
|
||||
getMineImage('share_title'),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.sp,
|
||||
),
|
||||
circleInfoItem(widget.bean)
|
||||
],
|
||||
),
|
||||
),
|
||||
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(0xFF0DF5F7),
|
||||
Color(0xFFD263FB)
|
||||
],
|
||||
begin:
|
||||
Alignment.centerLeft,
|
||||
end:
|
||||
Alignment.centerRight,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12.5.sp)),
|
||||
child: Text(
|
||||
widget.code,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 12.sp),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
width: Get.width - 200.sp,
|
||||
child: Text(
|
||||
'扫码或长按识别下载APP,认识更多小众圈子里的人,给生活带来更多乐趣~',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 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: widget.link,
|
||||
padding: EdgeInsets.zero,
|
||||
version: QrVersions.auto,
|
||||
size: 80.sp,
|
||||
gapless: false,
|
||||
// backgroundColor: Colors.black,
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
))
|
||||
),
|
||||
),
|
||||
SafeArea(
|
||||
top: false,
|
||||
child: Container(
|
||||
height: 164.sp,
|
||||
width: Get.width,
|
||||
color: Color(0xFF292247),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(
|
||||
top: 15.sp, left: 15.sp, right: 15.sp),
|
||||
alignment: Alignment.center,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
shareAction('wx', '微信', () {
|
||||
shareWxData(1);
|
||||
}),
|
||||
shareAction('wxq', '朋友圈', () {
|
||||
shareWxData(2);
|
||||
}),
|
||||
shareAction('qq', 'QQ', () {
|
||||
copyInviteText(logic.name);
|
||||
}),
|
||||
shareAction('wb', '微博', () {
|
||||
copyInviteText(logic.name);
|
||||
}),
|
||||
shareAction('hb', '保存海报', () {
|
||||
_saveLocalImage();
|
||||
}),
|
||||
],
|
||||
),
|
||||
)),
|
||||
Container(
|
||||
height: 1.sp,
|
||||
color: Color(0x33FFFFFF),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
height: 67.sp,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'取消',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 14.sp),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAvatar1(MinefragmentLogic logic) {
|
||||
return ClipOval(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
if (logic.userInfoBean != null) {
|
||||
var imgList = <String>[];
|
||||
imgList.add(logic.userInfoBean!.avatar);
|
||||
// Get.toNamed(AppRoutes.Swiper,arguments:imgList);
|
||||
// Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
// 'imaglist': imgList,
|
||||
// 'index': 0
|
||||
// });
|
||||
}
|
||||
},
|
||||
child: logic.userInfoBean == null
|
||||
? SizedBox(
|
||||
width: 63.sp,
|
||||
height: 63.sp,
|
||||
)
|
||||
: CachedNetworkImage(
|
||||
fit: BoxFit.cover,
|
||||
placeholder: null,
|
||||
imageUrl: logic.avatar,
|
||||
width: 63.sp,
|
||||
height: 63.sp,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNameRow(MinefragmentLogic logic) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 6.sp),
|
||||
child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
logic.name,
|
||||
style: TextStyle(
|
||||
color: const Color.fromRGBO(247, 250, 250, 1.0),
|
||||
fontSize: 16.sp,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 4.sp,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color.fromRGBO(141, 255, 248, 1.0),
|
||||
Color.fromRGBO(181, 211, 255, 1.0),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.only(
|
||||
top: 2.sp, bottom: 2.sp, left: 10.sp, right: 10.sp),
|
||||
child: Text(
|
||||
logic.ageMsg,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 10.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInfoRow(MinefragmentLogic logic) {
|
||||
return Row(
|
||||
children: [
|
||||
Text('邀请您加入',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.sp,
|
||||
)),
|
||||
Text('【微乐园APP】',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF0DF5F7),
|
||||
fontSize: 12.sp,
|
||||
)),
|
||||
],
|
||||
);
|
||||
}
|
||||
circleWidget(String url, String userId, {double width = 24}) {
|
||||
return Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('avatar_bg'),
|
||||
width: width.sp,
|
||||
),
|
||||
ClipOval(
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: url ??
|
||||
"https://qiniuyun.leyuan666.com/quanzi/avatar/default.png",
|
||||
width: (width - 1).sp,
|
||||
height: (width - 1).sp,
|
||||
fit: BoxFit.cover,
|
||||
memCacheHeight: width.toInt() - 1,
|
||||
memCacheWidth: width.toInt() - 1,
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
circleInfoItem(Circle bean) {
|
||||
List<JoinUser> urlList = bean.lastJoinUsers;
|
||||
List<Widget> widgets = [];
|
||||
int i = 0;
|
||||
// print(urlList);
|
||||
if (null != urlList) {
|
||||
urlList.forEach((element) {
|
||||
if (widgets.length > 2) {
|
||||
return;
|
||||
}
|
||||
widgets.add(Positioned(
|
||||
left: 15.sp * i,
|
||||
child: circleWidget(
|
||||
element.avatar! ??
|
||||
"https://qiniuyun.leyuan666.com/quanzi/avatar/default.png",
|
||||
element.id.toString()),
|
||||
));
|
||||
i++;
|
||||
});
|
||||
}
|
||||
return Container(
|
||||
margin: EdgeInsets.only(bottom: 10.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.sp),
|
||||
gradient: LinearGradient(colors: [Color(0xFF261240),Color(0xFF132C40),])
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10.sp),
|
||||
topRight: Radius.circular(10.sp)),
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
||||
height: 72.sp,
|
||||
decoration: BoxDecoration(
|
||||
|
||||
gradient: LinearGradient(colors: [Color(0xFF261240),Color(0xFF132C40),]),
|
||||
|
||||
),
|
||||
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, top: 12.sp),
|
||||
// alignment: Alignment.,
|
||||
height: 72.sp,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
bean.title,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(
|
||||
height: 4.sp,
|
||||
),
|
||||
Text(
|
||||
'${convertToTenThousand(bean.viewTotal)}人看过',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: const Color(0xff03FEFB),
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('add'),
|
||||
width: 77.sp,
|
||||
),
|
||||
Text(
|
||||
!bean.isJoin ? '申请加入' : '分享有奖',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
||||
// height:urlList.length==0?47.sp: 118.sp,
|
||||
decoration: BoxDecoration(
|
||||
|
||||
),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 7.sp),
|
||||
width: Get.width - 80.sp,
|
||||
// height: 50.sp,
|
||||
child: HideText(
|
||||
text: bean.intro,
|
||||
maxWidth: Get.width - 84.sp,
|
||||
additionText: '查看更多',
|
||||
maxLines: 3,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
additionStyle: TextStyle(
|
||||
color: const Color(0xFFFF4DF6), fontSize: 14.sp),
|
||||
onTap: () {
|
||||
|
||||
},
|
||||
)),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
// showToast("点个鸡毛,星哥还没做");
|
||||
// Get.toNamed(AppRoutes.FriendsActivity,arguments: '3');
|
||||
},
|
||||
child: urlList.length == 0
|
||||
? Container()
|
||||
: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30.sp,
|
||||
width:
|
||||
30.0.sp + 14.sp * (widgets.length - 1.sp),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: widgets,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 4.sp,
|
||||
),
|
||||
Text(
|
||||
'${convertToTenThousand(bean.joinTotal)}圈友加入',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
SizedBox(
|
||||
width: 4.sp,
|
||||
),
|
||||
// GestureDetector(
|
||||
// onTap: () {
|
||||
// Get.bottomSheet(
|
||||
// CircleShare('code','link,',bean), isScrollControlled: true,
|
||||
// enableDrag: false
|
||||
// );
|
||||
// },
|
||||
// behavior: HitTestBehavior.opaque,
|
||||
// child: Container(
|
||||
// height: 30.sp,
|
||||
// alignment: Alignment.center,
|
||||
// child: Image.asset(
|
||||
// getCircleImage('play'),
|
||||
// width: 20.sp,
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
shareAction(String img, String name, GestureTapCallback onTap) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
getMineImage(img),
|
||||
width: 40.sp,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.sp,
|
||||
),
|
||||
Text(
|
||||
name,
|
||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_saveLocalImage() async {
|
||||
RenderRepaintBoundary boundary =
|
||||
_globalKey.currentContext!.findRenderObject() as RenderRepaintBoundary;
|
||||
ui.Image image = await boundary.toImage(pixelRatio: ui.window.devicePixelRatio);
|
||||
ByteData? byteData =
|
||||
await (image.toByteData(format: ui.ImageByteFormat.png));
|
||||
if (byteData != null) {
|
||||
final result =
|
||||
await ImageGallerySaver.saveImage(byteData.buffer.asUint8List());
|
||||
print(result);
|
||||
// isSuccess
|
||||
if (result['isSuccess']) {
|
||||
showOKToast('保存成功');
|
||||
} else {
|
||||
showOKToast('保存失败,请检查相册权限是否开启');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
copyInviteText(
|
||||
String username,
|
||||
) {
|
||||
Clipboard.setData(ClipboardData(
|
||||
text: '【${username}】邀请你加入“微乐园”,邀请码为${widget.code},点击进入${(widget.link!) +
|
||||
'?code=${widget.code}'}'));
|
||||
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!);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -321,14 +321,14 @@ class Open_vip_tipPage extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
controller.priceBean[index].amount.toString(),
|
||||
'${controller.priceBean[index].amount.toInt()}',
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
),
|
||||
SizedBox(
|
||||
width: 4.sp,
|
||||
),
|
||||
Text(
|
||||
"${controller.priceBean[index].oldAmount}元",
|
||||
"${controller.priceBean[index].oldAmount.toInt()}元",
|
||||
style: TextStyle(
|
||||
color: Colors.white70,
|
||||
fontSize: 10.sp,
|
||||
|
||||
@ -11,7 +11,8 @@ class HideText extends StatefulWidget {
|
||||
required this.style, //正常字样式
|
||||
required this.additionText, //附加字,如点击查看更多
|
||||
this.additionStyle, //附加字的样式
|
||||
this.maxLines = 3, //行数,不传 默认为3
|
||||
this.maxLines = 3, //行数,不传 默认为3
|
||||
required this.maxWidth,
|
||||
this.additionUrl, //点击附加字跳转URL
|
||||
this.additionParams,
|
||||
this.onTap,//点击附加字跳转时携带的参数
|
||||
@ -22,6 +23,7 @@ class HideText extends StatefulWidget {
|
||||
final String? additionText;
|
||||
final TextStyle? additionStyle;
|
||||
final int? maxLines;
|
||||
final double maxWidth;
|
||||
final String? additionUrl;
|
||||
GestureTapCallback? onTap;
|
||||
final Map<String, dynamic>? additionParams;
|
||||
@ -72,7 +74,7 @@ class _HideTextState extends State<HideText> {
|
||||
children: children
|
||||
),
|
||||
textDirection: TextDirection.ltr)
|
||||
..layout(maxWidth: Get.width - 60.sp); //若新功能宽度不一致,可尝试修改,
|
||||
..layout(maxWidth: widget.maxWidth); //若新功能宽度不一致,可尝试修改,
|
||||
//UIUtils.screenWidth(context)是自定义的获取屏幕宽度的方法
|
||||
}
|
||||
|
||||
|
||||
@ -248,7 +248,10 @@ class Api {
|
||||
|
||||
|
||||
// /up-service/my/interests /up-service/interest/statistics
|
||||
|
||||
static const getMyCircleInterests = 'up-service/my/interests';
|
||||
//我的所有圈子
|
||||
static const getMyCircleAll = '/up-service/my/interests/all';
|
||||
//缘分匹配
|
||||
static const getMatch = 'msg-service/im/chat/match';
|
||||
//系统通知
|
||||
@ -297,6 +300,9 @@ class Api {
|
||||
//重置密码
|
||||
static const resetPassword = '/user-service/register/user/password/reset';
|
||||
|
||||
//获取多个圈子是否有新喊话
|
||||
static const calloutsNew = '/up-service/interests/callouts/new';
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -57,7 +57,7 @@ void showFloatingButtonOverlay(
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 70.sp,
|
||||
// width: 70.sp,
|
||||
child: Text(
|
||||
nickname,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user