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.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode 21
|
versionCode 24
|
||||||
versionName "1.2.7"
|
versionName "1.3.2"
|
||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
vivo_APPID: "105669716",
|
vivo_APPID: "105669716",
|
||||||
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
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)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.2.5;
|
MARKETING_VERSION = 1.2.6;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp;
|
PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
@ -530,7 +530,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.2.5;
|
MARKETING_VERSION = 1.2.6;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp;
|
PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
@ -573,7 +573,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.2.5;
|
MARKETING_VERSION = 1.2.6;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp;
|
PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
|
|||||||
@ -10,9 +10,11 @@
|
|||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
<string>Editor</string>
|
<string>Editor</string>
|
||||||
<key>CFBundleURLName</key>
|
<key>CFBundleURLName</key>
|
||||||
<string></string>
|
<string>weixin</string>
|
||||||
<key>CFBundleURLSchemes</key>
|
<key>CFBundleURLSchemes</key>
|
||||||
<array/>
|
<array>
|
||||||
|
<string>wxab2387c2198f01e1</string>
|
||||||
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>LSApplicationQueriesSchemes</key>
|
<key>LSApplicationQueriesSchemes</key>
|
||||||
|
|||||||
@ -1,10 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict/>
|
||||||
<key>com.apple.developer.associated-domains</key>
|
|
||||||
<array>
|
|
||||||
<string>applinks:https://www.leyuan666.com/</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class Call_outLogic extends GetxController {
|
|||||||
var quToken = '';
|
var quToken = '';
|
||||||
VideoPlayerController? videoPlayerController;
|
VideoPlayerController? videoPlayerController;
|
||||||
List<MyConfigData> numbers = [];
|
List<MyConfigData> numbers = [];
|
||||||
List<MyConfigData> myConfigData = Get.arguments['numbers'];
|
List<MyConfigData>? myConfigData;
|
||||||
int vip = 0;
|
int vip = 0;
|
||||||
|
|
||||||
bool isZfbPrice = true;
|
bool isZfbPrice = true;
|
||||||
@ -51,24 +51,7 @@ class Call_outLogic extends GetxController {
|
|||||||
@override
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
super.onInit();
|
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 =
|
var data =
|
||||||
await DioManager.instance.get(url: Api.getCircleList, params: {});
|
await DioManager.instance.get(url: Api.getCircleList, params: {});
|
||||||
@ -80,11 +63,51 @@ class Call_outLogic extends GetxController {
|
|||||||
showOKToast(bean.msg);
|
showOKToast(bean.msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
var quniuData =
|
Map arg = Get.arguments;
|
||||||
await DioManager.instance.get(url: Api.getqiniuToken, params: {});
|
|
||||||
var qiniuBean = BaseResponse<QnTokenData>.fromJson(
|
if (arg != null) {
|
||||||
quniuData, (quniuData) => QnTokenData.fromJson(quniuData));
|
// print(myConfigData.name);
|
||||||
quToken = qiniuBean.data!.token.toString();
|
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 =
|
StreamSubscription subscription =
|
||||||
EventBusManager.on<CommentVipEvent>().listen((event) {
|
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() {
|
showRechargeDialog() {
|
||||||
Get.bottomSheet(
|
Get.bottomSheet(
|
||||||
Scaffold(
|
Scaffold(
|
||||||
|
|||||||
@ -198,7 +198,7 @@ class CircleLogic extends GetxController {
|
|||||||
|
|
||||||
if (data['code'] == 200) {
|
if (data['code'] == 200) {
|
||||||
statistics.value = myAlbumBean.data;
|
statistics.value = myAlbumBean.data;
|
||||||
// update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,6 +305,7 @@ class CircleLogic extends GetxController {
|
|||||||
vicinityList.addAll(bean.data.users);
|
vicinityList.addAll(bean.data.users);
|
||||||
vicinityPage = vicinityPage + 1;
|
vicinityPage = vicinityPage + 1;
|
||||||
} on Exception {}
|
} on Exception {}
|
||||||
|
update();
|
||||||
} else if (bean.code == 21201) {
|
} else if (bean.code == 21201) {
|
||||||
myVip = 0;
|
myVip = 0;
|
||||||
refreshController.loadComplete();
|
refreshController.loadComplete();
|
||||||
@ -478,7 +479,7 @@ class InterestsBean {
|
|||||||
InterestsBean({required this.lists});
|
InterestsBean({required this.lists});
|
||||||
|
|
||||||
factory InterestsBean.fromJson(Map<String, dynamic> json) {
|
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();
|
List<Circle> lists = listsJson.map((e) => Circle.fromJson(e)).toList();
|
||||||
return InterestsBean(lists: lists);
|
return InterestsBean(lists: lists);
|
||||||
}
|
}
|
||||||
@ -518,24 +519,28 @@ class Circle {
|
|||||||
});
|
});
|
||||||
|
|
||||||
factory Circle.fromJson(Map<String, dynamic> json) {
|
factory Circle.fromJson(Map<String, dynamic> json) {
|
||||||
List<dynamic> lastJoinUsersJson = json['last_join_users'];
|
List<JoinUser> lastJoinUsers = [];
|
||||||
List<JoinUser> lastJoinUsers =
|
if (json.containsKey('last_join_users')) {
|
||||||
lastJoinUsersJson.map((e) => JoinUser.fromJson(e)).toList();
|
List<dynamic> lastJoinUsersJson = json['last_join_users'];
|
||||||
|
lastJoinUsers =
|
||||||
|
lastJoinUsersJson.map((e) => JoinUser.fromJson(e)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return Circle(
|
return Circle(
|
||||||
id: json['id'],
|
id: json['id'],
|
||||||
is_limit: json['is_limit'] ?? false,
|
is_limit: json['is_limit'] ?? false,
|
||||||
image: json['image'],
|
image: json['image'] ?? '',
|
||||||
ios_item: json['ios_item'] ?? '',
|
ios_item: json['ios_item'] ?? '',
|
||||||
title: json['title'],
|
title: json['title'] ?? '',
|
||||||
intro: json['intro'],
|
intro: json['intro'] ?? '',
|
||||||
amount: json['amount'].toDouble(),
|
amount: json.containsKey('amount') ? json['amount'].toDouble() ?? 0 : 0,
|
||||||
oldAmount: json['old_amount'].toDouble(),
|
oldAmount: json.containsKey('amount') ? json['old_amount'].toDouble() ?? 0 : 0,
|
||||||
lastCalloutTime: json['last_callout_time'],
|
lastCalloutTime: json['last_callout_time'] ?? '',
|
||||||
isJoin: json['is_join'],
|
isJoin: json['is_join'] ?? false,
|
||||||
isLike: json['is_like'],
|
isLike: json['is_like'] ?? false,
|
||||||
viewTotal: json['view_total'],
|
viewTotal: json['view_total'] ?? 0,
|
||||||
joinTotal: json['join_total'],
|
joinTotal: json['join_total'] ?? 0,
|
||||||
lastJoinUsers: lastJoinUsers,
|
lastJoinUsers: lastJoinUsers,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,8 +3,10 @@ import 'dart:math';
|
|||||||
import 'package:cached_network_image/cached_network_image.dart';
|
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/discover.dart';
|
||||||
import 'package:circle_app/app/circle/widgets/info_list_view.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/circle/widgets/vicinity.dart';
|
||||||
import 'package:circle_app/app/dialog/ScreenBottomSheetDialog.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/router/app_routers.dart';
|
||||||
import 'package:circle_app/util/eventBus.dart';
|
import 'package:circle_app/util/eventBus.dart';
|
||||||
import 'package:circle_app/util/util.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'));
|
fit: BoxFit.fill, image: AssetImage('assets/images/base/home_back.png'));
|
||||||
|
|
||||||
class CirclePage extends StatefulWidget {
|
class CirclePage extends StatefulWidget {
|
||||||
CirclePage({Key? key}) : super(key: key);
|
const CirclePage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<CirclePage> createState() => _CirclePageState();
|
State<CirclePage> createState() => _CirclePageState();
|
||||||
@ -37,6 +39,14 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
|
|
||||||
int currentIndex = 0;
|
int currentIndex = 0;
|
||||||
|
|
||||||
|
|
||||||
|
final logic = Get.find<CircleLogic>();
|
||||||
|
|
||||||
|
final state = Get.find<CircleLogic>().state;
|
||||||
|
|
||||||
|
var getContext;
|
||||||
|
|
||||||
|
// 是否需要缓存
|
||||||
@override
|
@override
|
||||||
bool get wantKeepAlive => true;
|
bool get wantKeepAlive => true;
|
||||||
|
|
||||||
@ -45,10 +55,12 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
currentIndex = Random().nextInt(3);
|
currentIndex = Random().nextInt(3);
|
||||||
_pageController = PageController(initialPage: currentIndex);
|
_pageController = PageController(initialPage: currentIndex);
|
||||||
_tabController = TabController(length: 3, vsync: this, initialIndex: currentIndex);
|
_tabController = TabController(length: 3, vsync: this, initialIndex: currentIndex);
|
||||||
_tabController.addListener(_handleTabChange);
|
_tabController.addListener(_handleTabChange);
|
||||||
|
getContext = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _handleTabChange() {
|
void _handleTabChange() {
|
||||||
@ -59,12 +71,6 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
logic.update();
|
logic.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否需要缓存
|
|
||||||
final logic = Get.put(CircleLogic());
|
|
||||||
|
|
||||||
final state = Get.find<CircleLogic>().state;
|
|
||||||
|
|
||||||
var getContext;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
@ -76,13 +82,13 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
getContext = context;
|
super.build(context);
|
||||||
return GetBuilder<CircleLogic>(builder: (logic) {
|
|
||||||
|
return GetBuilder<CircleLogic>(builder: (controller) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: GetBuilder(builder: (CircleLogic controller) {
|
child:Stack(
|
||||||
return Stack(
|
|
||||||
children: [
|
children: [
|
||||||
Column(children: [
|
Column(children: [
|
||||||
Obx(() {
|
Obx(() {
|
||||||
@ -93,42 +99,44 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
]),
|
]),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 45.sp),
|
margin: EdgeInsets.only(top: 45.sp),
|
||||||
child: PageView(
|
child: TabBarView(
|
||||||
controller: _pageController,
|
controller: _tabController,
|
||||||
onPageChanged: (index) {
|
// controller: _pageController,
|
||||||
_tabController.animateTo(index);
|
// onPageChanged: (index) {
|
||||||
print("index=" + index.toString());
|
// _tabController.animateTo(index);
|
||||||
},
|
// print("index=" + index.toString());
|
||||||
|
// },
|
||||||
children: [
|
children: [
|
||||||
circleList(controller),
|
LikeView(),
|
||||||
|
// circleList(controller),
|
||||||
Vicinity(controller),
|
Vicinity(controller),
|
||||||
Discover(0)
|
Discover(0)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
_tabController.index == 0
|
// _tabController.index == 0
|
||||||
? Positioned(
|
// ? Positioned(
|
||||||
bottom: 36.sp,
|
// bottom: 36.sp,
|
||||||
right: 10.sp,
|
// right: 10.sp,
|
||||||
child: GestureDetector(
|
// child: GestureDetector(
|
||||||
onTap: () async {
|
// onTap: () async {
|
||||||
List<MyConfigData> numbers = [];
|
// List<MyConfigData> numbers = [];
|
||||||
numbers.add(MyConfigData(
|
// numbers.add(MyConfigData(
|
||||||
logic.getCircleIndex().id.toString(),
|
// logic.getCircleIndex().id.toString(),
|
||||||
logic.getCircleIndex().title!,
|
// logic.getCircleIndex().title!,
|
||||||
false));
|
// false));
|
||||||
var data = await Get.toNamed(AppRoutes.Call_out,
|
// var data = await Get.toNamed(AppRoutes.Call_out,
|
||||||
arguments: {'numbers': numbers});
|
// arguments: {'numbers': numbers});
|
||||||
},
|
// },
|
||||||
child: Image.asset(
|
// child: Image.asset(
|
||||||
getCircleImage('send_msg'),
|
// getCircleImage('send_msg'),
|
||||||
width: 60.sp,
|
// width: 60.sp,
|
||||||
)))
|
// )))
|
||||||
: Center()
|
// : Center()
|
||||||
],
|
],
|
||||||
);
|
)
|
||||||
}),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -691,7 +699,7 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
tabs: [
|
tabs: [
|
||||||
Tab(
|
Tab(
|
||||||
child: Text(
|
child: Text(
|
||||||
'圈子',
|
'喜欢',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20.sp,
|
fontSize: 20.sp,
|
||||||
),
|
),
|
||||||
@ -750,11 +758,11 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
currentIndex = index;
|
currentIndex = index;
|
||||||
_pageController.animateToPage(
|
// _pageController.animateToPage(
|
||||||
index, // 目标页面索引
|
// index, // 目标页面索引
|
||||||
duration: const Duration(milliseconds: 300), // 动画时长
|
// duration: const Duration(milliseconds: 300), // 动画时长
|
||||||
curve: Curves.ease, // 动画曲线
|
// curve: Curves.ease, // 动画曲线
|
||||||
);
|
// );
|
||||||
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -766,11 +774,11 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
child: _tabController.index == 0
|
child: _tabController.index == 0
|
||||||
? GestureDetector(
|
? GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(AppRoutes.MyCircle, arguments: '');
|
Get.toNamed(AppRoutes.Call_out);
|
||||||
},
|
},
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
getCircleImage('my_circle'),
|
getCircleImage('callout_icon'),
|
||||||
width: 64.sp,
|
width: 75.sp,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: GestureDetector(
|
: GestureDetector(
|
||||||
|
|||||||
@ -507,7 +507,7 @@ class _DiscoverState extends State<Discover>
|
|||||||
user.userId.toString());
|
user.userId.toString());
|
||||||
}),
|
}),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.sp,
|
height: 15.sp,
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
@ -562,13 +562,13 @@ class _DiscoverState extends State<Discover>
|
|||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
width: Get.width - 120.sp,
|
width: Get.width - 120.sp,
|
||||||
margin: EdgeInsets.only(top: 5.sp),
|
margin: EdgeInsets.only(top: 10.sp,bottom: 10.sp),
|
||||||
child: Text(
|
child: Text(
|
||||||
user.signature! ?? '',
|
user.signature! ?? '',
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 15.sp,
|
fontSize: 16.sp,
|
||||||
color: const Color(0XFFF7FAFA)),
|
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/state.dart';
|
||||||
import 'package:circle_app/app/circle/widgets/list_logic.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/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/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/common/Widgets/text_more.dart';
|
||||||
import 'package:circle_app/main.dart';
|
import 'package:circle_app/main.dart';
|
||||||
import 'package:circle_app/network/dio_manager.dart';
|
import 'package:circle_app/network/dio_manager.dart';
|
||||||
@ -53,6 +56,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
List<Lists> lists = [];
|
List<Lists> lists = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
// TODO: implement dispose
|
// TODO: implement dispose
|
||||||
@ -92,29 +96,42 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
callRefreshCicle = EventBusManager.on<CallRefreshCircle>().listen((event) {
|
callRefreshCicle = EventBusManager.on<CallRefreshCircle>().listen((event) {
|
||||||
if(widget.bean.id.toString() == event.circleId){
|
if(widget.bean.id.toString() == event.circleId){
|
||||||
loadCallOutListData();
|
loadCallOutListData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//
|
||||||
scroToTop = EventBusManager.on<ScrollToTop>().listen((event) {
|
// scroToTop = EventBusManager.on<ScrollToTop>().listen((event) {
|
||||||
if (widget.logic.state.index == widget.index) {
|
// if (widget.logic.state.index == widget.index) {
|
||||||
scrollController.animateTo(
|
// scrollController.animateTo(
|
||||||
0.0,
|
// 0.0,
|
||||||
duration: Duration(milliseconds: 300),
|
// duration: Duration(milliseconds: 300),
|
||||||
curve: Curves.easeInOut,
|
// curve: Curves.easeInOut,
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
});
|
// });
|
||||||
|
|
||||||
// widget.back(widget.createState());
|
// 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 {
|
loadCallOutListData() async {
|
||||||
var data = await DioManager.instance.get(
|
var data = await DioManager.instance.get(
|
||||||
@ -143,6 +160,8 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setCircleId(String id) {
|
setCircleId(String id) {
|
||||||
circleId = id;
|
circleId = id;
|
||||||
loadCallOutListData();
|
loadCallOutListData();
|
||||||
@ -245,6 +264,9 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
if (widget.bean.image.isEmpty) {
|
||||||
|
loadCircleInfo();
|
||||||
|
}
|
||||||
List<JoinUser> urlList = widget.bean.lastJoinUsers;
|
List<JoinUser> urlList = widget.bean.lastJoinUsers;
|
||||||
List<Widget> widgets = [];
|
List<Widget> widgets = [];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -267,17 +289,18 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
borderRadius: BorderRadius.circular(10.sp),
|
borderRadius: BorderRadius.circular(10.sp),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
margin:
|
// margin:
|
||||||
EdgeInsets.only(left: widget.index > 0 ? 4.sp : 0, right: 4.sp),
|
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
ClipRRect(
|
ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(10.sp),
|
borderRadius: BorderRadius.circular(10.sp),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
|
height: Get.height,
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
getCircleImage('circle_bg'),
|
getCircleImage('circle_bg'),
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
Container(
|
Container(
|
||||||
@ -321,7 +344,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
margin: EdgeInsets.only(bottom: 7.sp),
|
margin: EdgeInsets.only(bottom: 7.sp),
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
// height: 50.sp,
|
// 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(
|
_showTextContentDialog(
|
||||||
context, widget.bean.intro,widget.bean.title);
|
context, widget.bean.intro,widget.bean.title);
|
||||||
},
|
},
|
||||||
@ -333,39 +356,51 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
// showToast("点个鸡毛,星哥还没做");
|
// showToast("点个鸡毛,星哥还没做");
|
||||||
// Get.toNamed(AppRoutes.FriendsActivity,arguments: '3');
|
// Get.toNamed(AppRoutes.FriendsActivity,arguments: '3');
|
||||||
},
|
},
|
||||||
child:urlList.length==0?Container(): Row(
|
child:urlList.length==0?Container(): Container(
|
||||||
children: [
|
height: 30.sp,
|
||||||
Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 30.sp,
|
height: 30.sp,
|
||||||
width: 30.0.sp +
|
width: 30.0.sp +
|
||||||
15.sp *
|
15.sp *
|
||||||
(widgets.length -
|
(widgets.length -
|
||||||
1.sp),
|
1.sp),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: widgets,
|
alignment: Alignment.center,
|
||||||
),
|
children: widgets,
|
||||||
),
|
),
|
||||||
SizedBox(
|
),
|
||||||
width: 8.sp,
|
SizedBox(
|
||||||
),
|
width: 4.sp,
|
||||||
Text(
|
),
|
||||||
'${convertToTenThousand(widget.bean.joinTotal)}圈友加入',
|
Text(
|
||||||
style: TextStyle(
|
'${convertToTenThousand(widget.bean.joinTotal)}圈友加入',
|
||||||
color: Colors.white,
|
style: TextStyle(
|
||||||
fontSize: 12.sp),
|
color: Colors.white,
|
||||||
),
|
fontSize: 12.sp),
|
||||||
SizedBox(
|
),
|
||||||
width: 8.sp,
|
SizedBox(
|
||||||
),
|
width: 8.sp,
|
||||||
// Image.asset(
|
),
|
||||||
// getCircleImage('play'),
|
// GestureDetector(
|
||||||
// width: 20.sp,
|
// 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(
|
child: Row(
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
GestureDetector(
|
||||||
width: 42.sp,
|
onTap: () {
|
||||||
height: 42.sp,
|
if (widget.bean.isJoin) {
|
||||||
decoration: BoxDecoration(
|
_showOutCircleDialog(Get.context!, widget.logic, widget.bean);
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
}
|
||||||
gradient: const LinearGradient(
|
},
|
||||||
begin: Alignment.topCenter,
|
child: Container(
|
||||||
end: Alignment.bottomCenter,
|
width: 42.sp,
|
||||||
colors: [
|
height: 42.sp,
|
||||||
Color(0xFF71F3F2),
|
decoration: BoxDecoration(
|
||||||
Color(0xFFF558FF),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
],
|
gradient: const LinearGradient(
|
||||||
stops: [0.0365, 0.9427],
|
begin: Alignment.topCenter,
|
||||||
),
|
end: Alignment.bottomCenter,
|
||||||
),
|
colors: [
|
||||||
padding: EdgeInsets.all(1.sp),
|
Color(0xFF71F3F2),
|
||||||
child: ClipRRect(
|
Color(0xFFF558FF),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
],
|
||||||
child: CachedNetworkImage(
|
stops: [0.0365, 0.9427],
|
||||||
imageUrl:widget.bean.image,
|
),
|
||||||
width: 40.sp,
|
|
||||||
height: 40.sp,
|
|
||||||
memCacheHeight: 40,
|
|
||||||
memCacheWidth: 40,
|
|
||||||
fit:BoxFit.cover
|
|
||||||
),
|
),
|
||||||
|
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(
|
Expanded(
|
||||||
@ -473,8 +515,10 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
GestureDetector(//加入圈子
|
GestureDetector(//加入圈子
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (widget.bean.isJoin) {
|
if (widget.bean.isJoin) {
|
||||||
_showOutCircleDialog(
|
Get.bottomSheet(
|
||||||
context, widget.logic, widget.bean);
|
CircleShare('','',widget.bean), isScrollControlled: true,
|
||||||
|
enableDrag: false
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
await widget.logic.outCircle(
|
await widget.logic.outCircle(
|
||||||
widget.bean.id.toString(),
|
widget.bean.id.toString(),
|
||||||
@ -490,7 +534,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
width: 77.sp,
|
width: 77.sp,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
!widget.bean.isJoin ? '申请加入' : '已加入',
|
!widget.bean.isJoin ? '申请加入' : '分享有奖',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white, fontSize: 12.sp),
|
color: Colors.white, fontSize: 12.sp),
|
||||||
)
|
)
|
||||||
@ -505,6 +549,26 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
getCircleImage('circle_line'),
|
getCircleImage('circle_line'),
|
||||||
width: Get.width,
|
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) {
|
vipDynamicItem(Lists lists) {
|
||||||
Text descText = Text(
|
Text descText = Text(
|
||||||
lists.content!,
|
lists.content!,
|
||||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
style: TextStyle(color: Colors.white, fontSize: 17.sp),
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -624,10 +688,11 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
Album info = lists.album!.first;
|
Album info = lists.album!.first;
|
||||||
|
|
||||||
if (info.type == 1) {
|
if (info.type == 1) {
|
||||||
|
double picWidth = (Get.width - (widget.logic.runtimeType == LikeLogic ? 100.sp : 60.sp))/3;
|
||||||
if (lists.album!.length > 3) {
|
if (lists.album!.length > 3) {
|
||||||
picHeight = 218.sp;
|
picHeight = picWidth * 2;
|
||||||
} else {
|
} else {
|
||||||
picHeight = 109.sp;
|
picHeight = picWidth;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
picHeight = 140.sp;
|
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(
|
return Container(
|
||||||
margin: EdgeInsets.only(top: 10.sp),
|
margin: EdgeInsets.only(top: 10.sp),
|
||||||
@ -657,17 +722,17 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
Positioned(
|
Positioned(
|
||||||
right: 2.sp,
|
right: 2.sp,
|
||||||
top: 2.sp,
|
top: 2.sp,
|
||||||
height: 18.sp,
|
|
||||||
child: Stack(
|
child: Stack(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
getCircleImage('location'),
|
getCircleImage('location'),
|
||||||
height: 20.sp,
|
height: 30.sp,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
lists.user!.city ?? '外星',
|
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(
|
Container(
|
||||||
height: 34.sp,
|
height: 30.sp,
|
||||||
padding: EdgeInsets.only(left: 5.sp, right: 10.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(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(17.sp),
|
borderRadius: BorderRadius.circular(15.sp),
|
||||||
gradient: const LinearGradient(
|
color: Color(0x33000000)
|
||||||
begin: Alignment(0.25, 0.5),
|
),
|
||||||
end: Alignment(0.75, 0.5),
|
|
||||||
colors: [Color(0xff261240), Color(0xff122D40)])),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
widgets.isNotEmpty
|
widgets.isNotEmpty
|
||||||
? SizedBox(
|
? SizedBox(
|
||||||
width: 24 + 12.sp * widgets.length - 12.sp,
|
width: 24 + 12.sp * widgets.length - 8.sp,
|
||||||
height: 24.sp,
|
height: 24.sp,
|
||||||
child: Stack(children: widgets),
|
child: Stack(children: widgets),
|
||||||
)
|
)
|
||||||
@ -875,13 +938,13 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
child: Text(
|
child: Text(
|
||||||
'${lists.chat!.count!}位圈友已私聊',
|
'${lists.chat!.count!}位圈友已私聊',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white, fontSize: 12.sp),
|
color: Colors.white, fontSize: 14.sp),
|
||||||
))
|
))
|
||||||
: Expanded(
|
: Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
'赶紧成为第一位私聊ta的圈友吧',
|
'赶紧成为第一位私聊ta的圈友吧',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white, fontSize: 12.sp),
|
color: Colors.white, fontSize: 14.sp),
|
||||||
)),
|
)),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@ -907,7 +970,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
normalDynamicItem(Lists lists) {
|
normalDynamicItem(Lists lists) {
|
||||||
Text descText = Text(
|
Text descText = Text(
|
||||||
lists.content!,
|
lists.content!,
|
||||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
style: TextStyle(color: Colors.white, fontSize: 17.sp),
|
||||||
// maxLines: 2,
|
// maxLines: 2,
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -917,10 +980,11 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
Album info = lists.album!.first;
|
Album info = lists.album!.first;
|
||||||
|
|
||||||
if (info.type == 1) {
|
if (info.type == 1) {
|
||||||
|
double picWidth = (Get.width - (widget.logic.runtimeType == LikeLogic ? 100.sp : 60.sp))/3;
|
||||||
if (lists.album!.length > 3) {
|
if (lists.album!.length > 3) {
|
||||||
picHeight = 218.sp;
|
picHeight = picWidth * 2;
|
||||||
} else {
|
} else {
|
||||||
picHeight = 109.sp;
|
picHeight = picWidth;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
picHeight = 140.sp;
|
picHeight = 140.sp;
|
||||||
@ -952,7 +1016,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.only(top: 10.sp),
|
margin: EdgeInsets.only(top: 10.sp),
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
height: 130.sp + contentHeight(lists.content!) + picHeight,
|
height: 120.sp + contentHeight(lists.content!) + picHeight,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
@ -969,19 +1033,19 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
getCircleImage('location'),
|
getCircleImage('location'),
|
||||||
height: 20.sp,
|
height: 30.sp,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
lists.user!.city ?? '外星',
|
lists.user!.city ?? '外星',
|
||||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
style: TextStyle(color: Colors.white, fontSize: 15.sp),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
// height: 18.sp,
|
// height: 18.sp,
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
height: 130.sp + contentHeight(lists.content!) + picHeight,
|
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
|
|
||||||
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@ -1167,20 +1231,17 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
}))
|
}))
|
||||||
: Container(),
|
: Container(),
|
||||||
Container(
|
Container(
|
||||||
height: 34.sp,
|
height: 30.sp,
|
||||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp),
|
padding: EdgeInsets.only(left: 5.sp, right: 10.sp,),
|
||||||
margin: EdgeInsets.only(top: 5.sp),
|
margin: EdgeInsets.only(top: picHeight > 0 ? 5.sp : 10.sp),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(17.sp),
|
borderRadius: BorderRadius.circular(15.sp),
|
||||||
gradient: const LinearGradient(
|
color: Color(0x33000000)),
|
||||||
begin: Alignment(0.25, 0.5),
|
|
||||||
end: Alignment(0.75, 0.5),
|
|
||||||
colors: [Color(0xff261240), Color(0xff122D40)])),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
widgets.isNotEmpty
|
widgets.isNotEmpty
|
||||||
? SizedBox(
|
? SizedBox(
|
||||||
width: 24 + 12.sp * widgets.length - 12.sp,
|
width: 24 + 12.sp * widgets.length - 8.sp,
|
||||||
height: 24.sp,
|
height: 24.sp,
|
||||||
child: Stack(children: widgets),
|
child: Stack(children: widgets),
|
||||||
)
|
)
|
||||||
@ -1193,13 +1254,13 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
child: Text(
|
child: Text(
|
||||||
'${lists.chat!.count!}位圈友已私聊',
|
'${lists.chat!.count!}位圈友已私聊',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white, fontSize: 12.sp),
|
color: Colors.white, fontSize: 14.sp),
|
||||||
))
|
))
|
||||||
: Expanded(
|
: Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
'赶紧成为第一位私聊ta的圈友吧',
|
'赶紧成为第一位私聊ta的圈友吧',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white, fontSize: 12.sp),
|
color: Colors.white, fontSize: 14.sp),
|
||||||
)),
|
)),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () async{
|
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(
|
return GestureDetector(
|
||||||
onTap: (){
|
onTap: (){
|
||||||
Get.toNamed(AppRoutes.UserInfoActivity, arguments: userId);
|
Get.toNamed(AppRoutes.UserInfoActivity, arguments: userId);
|
||||||
@ -1345,7 +1528,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
await widget.logic
|
await widget.logic
|
||||||
.outCircle(bean.id.toString(), bean.isJoin);
|
.outCircle(bean.id.toString(), bean.isJoin);
|
||||||
widget.logic.update();
|
// widget.logic.update();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.only(top: 24.sp),
|
margin: EdgeInsets.only(top: 24.sp),
|
||||||
@ -1389,7 +1572,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
|
|
||||||
double contentHeight(String content) {
|
double contentHeight(String content) {
|
||||||
return calculateTextHeight(
|
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 {
|
void refreshCircleData() async {
|
||||||
@ -1400,10 +1583,10 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
|||||||
.get(url: 'up-service/interest/${widget.bean.id}');
|
.get(url: 'up-service/interest/${widget.bean.id}');
|
||||||
if (data['code'] == 200) {
|
if (data['code'] == 200) {
|
||||||
widget.bean = Circle.fromJson(data['data']);
|
widget.bean = Circle.fromJson(data['data']);
|
||||||
widget.logic.updateCircleInfo(widget.bean);
|
// widget.logic.updateCircleInfo(widget.bean);
|
||||||
setState(() {
|
// setState(() {
|
||||||
|
//
|
||||||
});
|
// });
|
||||||
// final logic = Get.put(CircleLogic());
|
// final logic = Get.put(CircleLogic());
|
||||||
// logic.update();
|
// 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),
|
margin: EdgeInsets.only(top: 10.sp),
|
||||||
// padding: EdgeInsets.only( left: 8.sp, right: 8.sp),
|
// padding: EdgeInsets.only( left: 8.sp, right: 8.sp),
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
height: 200.sp,
|
height: 210.sp,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
@ -264,14 +264,12 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
|
|||||||
topLeft: Radius.circular(10.sp),
|
topLeft: Radius.circular(10.sp),
|
||||||
topRight: Radius.circular(10.sp),
|
topRight: Radius.circular(10.sp),
|
||||||
),
|
),
|
||||||
child: item.images.length == 0
|
child: Image(
|
||||||
? Image(
|
|
||||||
image: AssetImage(getCircleImage("icon_list_null")),
|
image: AssetImage(getCircleImage("icon_list_null")),
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
height: 92.sp,
|
height: 92.sp,
|
||||||
)
|
)
|
||||||
: Container(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Column(children: [
|
Column(children: [
|
||||||
@ -355,7 +353,7 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
height: 38.sp, // 设置固定高度
|
height: 55.sp, // 设置固定高度
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
margin: EdgeInsets.symmetric(horizontal: 8.0),
|
margin: EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
child: Align(
|
child: Align(
|
||||||
@ -363,7 +361,7 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
|
|||||||
child: Text(
|
child: Text(
|
||||||
item.signature,
|
item.signature,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
style: TextStyle(color: Colors.white, fontSize: 18.sp),
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -203,7 +203,7 @@ class UnlockCallDialog extends GetxController {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'¥$amount',
|
'¥${int.parse(amount)}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xffE845FF),
|
color: Color(0xffE845FF),
|
||||||
fontSize: 16.sp,
|
fontSize: 16.sp,
|
||||||
@ -213,7 +213,7 @@ class UnlockCallDialog extends GetxController {
|
|||||||
width: 2.sp,
|
width: 2.sp,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'(原价$oldAmount)',
|
'(原价${int.parse(oldAmount)})',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white70,
|
color: Colors.white70,
|
||||||
fontSize: 16.sp,
|
fontSize: 16.sp,
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import 'dart:io';
|
|||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_install_app/flutter_install_app.dart';
|
// import 'package:flutter_install_app/flutter_install_app.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ class _CustomDialogState extends State<UpdateDialog> {
|
|||||||
// SmartDialog.dismiss();
|
// SmartDialog.dismiss();
|
||||||
print(error);
|
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 'package:get/get.dart';
|
||||||
|
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
@ -6,5 +7,6 @@ class HomeBinding extends Bindings {
|
|||||||
@override
|
@override
|
||||||
void dependencies() {
|
void dependencies() {
|
||||||
Get.lazyPut(() => HomeLogic());
|
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/circle/logic.dart';
|
||||||
|
import 'package:circle_app/app/like/view.dart';
|
||||||
import 'package:circle_app/app/minefragment/logic.dart';
|
import 'package:circle_app/app/minefragment/logic.dart';
|
||||||
import 'package:circle_app/main.dart';
|
import 'package:circle_app/main.dart';
|
||||||
import 'package:circle_app/network/api.dart';
|
import 'package:circle_app/network/api.dart';
|
||||||
@ -26,25 +27,32 @@ import '../msg/view.dart';
|
|||||||
import 'state.dart';
|
import 'state.dart';
|
||||||
|
|
||||||
class HomeLogic extends GetxController {
|
class HomeLogic extends GetxController {
|
||||||
PageController pageController = PageController(initialPage: 1);
|
late TabController tabController;
|
||||||
int currentIndex = 1;
|
|
||||||
|
int currentIndex = 0;
|
||||||
Widget currentPage = Container();
|
Widget currentPage = Container();
|
||||||
|
|
||||||
final HomeState state = HomeState();
|
final HomeState state = HomeState();
|
||||||
|
|
||||||
final List<Widget> tabs = [];
|
List<Widget> tabs = [];
|
||||||
var circlePage = CirclePage();
|
|
||||||
static final MessageService _messageService =
|
static final MessageService _messageService =
|
||||||
serviceLocator<MessageService>();
|
serviceLocator<MessageService>();
|
||||||
final RxString unreadSIze = "0".obs;
|
final RxString unreadSIze = "0".obs;
|
||||||
|
|
||||||
|
final RxBool showcirlceUnred = false.obs;
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
|
||||||
getIMData();
|
getIMData();
|
||||||
|
|
||||||
tabs.add(MsgPage());
|
|
||||||
|
|
||||||
tabs.add(CirclePage());
|
tabs.add(CirclePage());
|
||||||
|
tabs.add(LikePage());
|
||||||
|
tabs.add(MsgPage());
|
||||||
tabs.add(MinefragmentPage());
|
tabs.add(MinefragmentPage());
|
||||||
|
|
||||||
EventBusManager.on<RefreshUnread>().listen((event) {
|
EventBusManager.on<RefreshUnread>().listen((event) {
|
||||||
@ -110,6 +118,12 @@ class HomeLogic extends GetxController {
|
|||||||
|
|
||||||
_messageService.addSimpleMsgListener(listener: msgListener);
|
_messageService.addSimpleMsgListener(listener: msgListener);
|
||||||
|
|
||||||
|
checkVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Future<void> checkVersion() async {
|
||||||
var data = await DioManager.instance.get(url: Api.APP_VERSION);
|
var data = await DioManager.instance.get(url: Api.APP_VERSION);
|
||||||
var bean = BaseResponse<UpdateInfo>.fromJson(
|
var bean = BaseResponse<UpdateInfo>.fromJson(
|
||||||
data, (data) => UpdateInfo.fromJson(data));
|
data, (data) => UpdateInfo.fromJson(data));
|
||||||
@ -174,6 +188,10 @@ class HomeLogic extends GetxController {
|
|||||||
super.onReady();
|
super.onReady();
|
||||||
|
|
||||||
FlutterNativeSplash.remove();
|
FlutterNativeSplash.remove();
|
||||||
|
final logic = Get.find<CircleLogic>();
|
||||||
|
logic.loadCirclePeopleData();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void showReportDialog(
|
void showReportDialog(
|
||||||
@ -206,13 +224,13 @@ class HomeLogic extends GetxController {
|
|||||||
|
|
||||||
updateIndex(int index) {
|
updateIndex(int index) {
|
||||||
currentIndex = index;
|
currentIndex = index;
|
||||||
if (index == 1) {
|
if (index == 0) {
|
||||||
final logic = Get.put(CircleLogic());
|
final logic = Get.put(CircleLogic());
|
||||||
logic.loadCirclePeopleData();
|
logic.loadCirclePeopleData();
|
||||||
} else if (index == 2) {
|
} else if (index == 3) {
|
||||||
final logic = Get.put(MinefragmentLogic());
|
final logic = Get.put(MinefragmentLogic());
|
||||||
logic.getMode();
|
logic.getMode();
|
||||||
} else {
|
} else if (index == 2) {
|
||||||
getUnreadSize();
|
getUnreadSize();
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
|
|
||||||
import 'package:circle_app/app/circle/view.dart';
|
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/util/util.dart';
|
||||||
import 'package:circle_app/view/ExitAppConfirmation.dart';
|
import 'package:circle_app/view/ExitAppConfirmation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@ -16,62 +18,71 @@ class HomePage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _HomePageState extends State<HomePage>
|
class _HomePageState extends State<HomePage>
|
||||||
with AutomaticKeepAliveClientMixin {
|
with AutomaticKeepAliveClientMixin,SingleTickerProviderStateMixin {
|
||||||
@override
|
@override
|
||||||
bool get wantKeepAlive => true;
|
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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
super.build(context);
|
|
||||||
|
|
||||||
return GetBuilder(builder: (HomeLogic controller) {
|
return GetBuilder(builder: (HomeLogic controller) {
|
||||||
return ExitAppConfirmation(child: Scaffold(
|
return ExitAppConfirmation(
|
||||||
resizeToAvoidBottomInset: false,
|
child: Scaffold(
|
||||||
backgroundColor: const Color.fromRGBO(15, 10, 31, 1.0),
|
resizeToAvoidBottomInset: false,
|
||||||
bottomNavigationBar: Container(
|
backgroundColor: const Color.fromRGBO(15, 10, 31, 1.0),
|
||||||
height: 49.sp + MediaQuery.of(context).padding.bottom,
|
bottomNavigationBar: Container(
|
||||||
width: Get.width,
|
height: 49.sp + MediaQuery.of(context).padding.bottom,
|
||||||
// color: Colors.red,
|
width: Get.width,
|
||||||
padding: EdgeInsets.only(left: 40.sp, right: 40.sp),
|
// color: Colors.red,
|
||||||
decoration: BoxDecoration(
|
padding: EdgeInsets.only(left: 20.sp, right: 20.sp),
|
||||||
color: const Color(0xFF423055),
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
color: const Color(0xFF423055),
|
||||||
fit: BoxFit.fill,
|
image: DecorationImage(
|
||||||
image: AssetImage(
|
fit: BoxFit.fill,
|
||||||
getTabbarImage('tabbar_bg'),
|
image: AssetImage(
|
||||||
))),
|
getTabbarImage('tabbar_bg'),
|
||||||
child: Row(
|
))),
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
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: [
|
children: [
|
||||||
funcItem(0, 'msg', 0 == controller.currentIndex, controller),
|
Container(
|
||||||
funcItem(1, 'circle', 1 == controller.currentIndex, controller),
|
width: MediaQuery.of(context).size.width,
|
||||||
funcItem(2, 'mine', 2 == controller.currentIndex, controller),
|
// 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,
|
behavior: HitTestBehavior.opaque,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (!isSelected) {
|
if (!isSelected) {
|
||||||
controller.pageController.jumpToPage(index);
|
logic.tabController.animateTo(index, duration: Duration(milliseconds: 0), curve: Curves.ease);
|
||||||
controller.updateIndex(index);
|
controller.updateIndex(index);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Stack(
|
child: Stack(alignment: Alignment.center, children: [
|
||||||
alignment: Alignment.center,
|
Container(
|
||||||
children:[
|
|
||||||
Container(
|
|
||||||
|
|
||||||
margin: EdgeInsets.only(top: 8.sp),
|
margin: EdgeInsets.only(top: 8.sp),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
isSelected
|
isSelected
|
||||||
? getTabbarImage('${image}_selected')
|
? getTabbarImage('${image}_selected')
|
||||||
: getTabbarImage('${image}_normal'),
|
: getTabbarImage('${image}_normal'),
|
||||||
width: 38.sp,
|
width: 38.sp,
|
||||||
height: 38.sp,
|
height: 38.sp,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
excludeFromSemantics: true,
|
excludeFromSemantics: true,
|
||||||
gaplessPlayback: 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(() => null)
|
||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: index == 0 && controller.unreadSIze != "0",
|
visible: index == 2 && controller.unreadSIze != "0",
|
||||||
child: Positioned(
|
child: Positioned(
|
||||||
// right: 4.sp,
|
// right: 4.sp,
|
||||||
top: 6.sp,
|
top: 6.sp,
|
||||||
|
|||||||
@ -487,7 +487,6 @@ void showCodePicker(InviteLogic logic) {
|
|||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: TextField(
|
child: TextField(
|
||||||
controller: logic.codeEditingController,
|
controller: logic.codeEditingController,
|
||||||
keyboardType: TextInputType.phone,
|
|
||||||
maxLength: 8,
|
maxLength: 8,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(color: Colors.white, fontSize: 16.sp),
|
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) {
|
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)) {
|
if (!wxReg.hasMatch(state.wxEditingController.text)) {
|
||||||
showOKToast('请输入正确的微信号');
|
showOKToast('请输入正确的微信号');
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -119,8 +119,8 @@ class Sys_notify_listPage extends StatelessWidget {
|
|||||||
break;
|
break;
|
||||||
case "my_main":
|
case "my_main":
|
||||||
final homeLogic = Get.put(HomeLogic());
|
final homeLogic = Get.put(HomeLogic());
|
||||||
homeLogic.pageController.jumpToPage(2);
|
homeLogic.tabController.animateTo(3);
|
||||||
homeLogic.updateIndex(2);
|
homeLogic.updateIndex(3);
|
||||||
|
|
||||||
Get.back();
|
Get.back();
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import 'package:tencent_cloud_chat_uikit/ui/controller/tim_uikit_conversation_co
|
|||||||
import '../../util/eventBus.dart';
|
import '../../util/eventBus.dart';
|
||||||
import 'TIMUIKitConversation/tim_uikit_conversation.dart';
|
import 'TIMUIKitConversation/tim_uikit_conversation.dart';
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
const bgWidget = DecorationImage(
|
const msgBgWidget = DecorationImage(
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
image: AssetImage('assets/images/base/home_back.png'));
|
image: AssetImage('assets/images/base/home_back.png'));
|
||||||
class MsgPage extends StatelessWidget {
|
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/logic.dart';
|
||||||
import 'package:circle_app/app/circle/widgets/info_list_view.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/my_circle/logic.dart';
|
||||||
import 'package:circle_app/app/select_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/components/my_app_bar.dart';
|
||||||
import 'package:circle_app/router/app_routers.dart';
|
import 'package:circle_app/router/app_routers.dart';
|
||||||
import 'package:circle_app/util/util.dart';
|
import 'package:circle_app/util/util.dart';
|
||||||
@ -12,7 +15,6 @@ import 'package:get/get.dart';
|
|||||||
|
|
||||||
import '../../util/eventBus.dart';
|
import '../../util/eventBus.dart';
|
||||||
|
|
||||||
|
|
||||||
class My_circlePage extends StatefulWidget {
|
class My_circlePage extends StatefulWidget {
|
||||||
My_circlePage({Key? key}) : super(key: key);
|
My_circlePage({Key? key}) : super(key: key);
|
||||||
@override
|
@override
|
||||||
@ -29,92 +31,324 @@ class _My_circlePageState extends State<My_circlePage>
|
|||||||
|
|
||||||
final state = Get.find<MyCircleLogic>().state;
|
final state = Get.find<MyCircleLogic>().state;
|
||||||
|
|
||||||
|
|
||||||
var getContext;
|
var getContext;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
getContext = context;
|
getContext = context;
|
||||||
return Container(
|
return Container(
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
height: MediaQuery.of(context).size.height,
|
height: MediaQuery.of(context).size.height,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Color(0xFF423055),
|
color: Color(0xFF423055),
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
image: AssetImage(getBaseImage('home_back')))),
|
image: AssetImage(getBaseImage('home_back')))),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: GetBuilder(builder: (MyCircleLogic controller) {
|
child: GetBuilder(builder: (MyCircleLogic controller) {
|
||||||
return Stack(
|
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: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: MediaQuery.of(context).size.width,
|
width: 42.sp,
|
||||||
height: MediaQuery.of(context).size.height,
|
height: 42.sp,
|
||||||
child: Container(
|
decoration: BoxDecoration(
|
||||||
child: Column(children: [
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
backNavigatorItem(),
|
gradient: const LinearGradient(
|
||||||
// Text(controller.state.msg),
|
begin: Alignment.topCenter,
|
||||||
//组件使用
|
end: Alignment.bottomCenter,
|
||||||
Expanded(
|
colors: [
|
||||||
child: logic.circle.lists.isEmpty ? !logic.isMore ? noResultWidget() : loaddingWidget(logic.isMore) : Swiper(
|
Color(0xFF71F3F2),
|
||||||
itemBuilder: (BuildContext context, int index) {
|
Color(0xFFF558FF),
|
||||||
var bean = logic.circle.lists[index];
|
],
|
||||||
// final GlobalKey<InfoListViewState> infoListViewKey = GlobalKey<InfoListViewState>();
|
stops: [0.0365, 0.9427],
|
||||||
// MyinfoListViewKey = infoListViewKey;
|
),
|
||||||
return InfoListView(
|
),
|
||||||
index,
|
padding: EdgeInsets.all(1.sp),
|
||||||
bean,
|
child: ClipRRect(
|
||||||
controller
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
);
|
child: CachedNetworkImage(
|
||||||
},
|
imageUrl: bean.image,
|
||||||
index: controller.state.index,
|
width: 40.sp,
|
||||||
itemCount: logic.circle.lists.length,
|
height: 40.sp,
|
||||||
viewportFraction: 0.93,
|
memCacheHeight: 40,
|
||||||
// scale: 0.9,
|
memCacheWidth: 40,
|
||||||
loop: false,
|
fit: BoxFit.cover),
|
||||||
onIndexChanged: (index) {
|
|
||||||
controller.state.index = index;
|
|
||||||
if (index == logic.circle.lists.length - 1 && controller.isMore) {
|
|
||||||
|
|
||||||
logic.loadMore();
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
// pagination: new SwiperPagination(),//如果不填则不显示指示点
|
|
||||||
// control: new SwiperControl(),//如果不填则不显示左右按钮
|
|
||||||
))
|
|
||||||
]),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
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() {
|
backNavigatorItem() {
|
||||||
return MyAppBar(
|
return MyAppBar(
|
||||||
centerTitle: '我的圈子',
|
centerTitle: '我的圈子',
|
||||||
onCenterTitlePressed: (){
|
onCenterTitlePressed: () {
|
||||||
EventBusManager.fire(ScrollToTop());
|
EventBusManager.fire(ScrollToTop());
|
||||||
},
|
},
|
||||||
actionWdiget: const Text(
|
actionWdiget: Image.asset(
|
||||||
"发布喊话",
|
getCircleImage('callout_icon'),
|
||||||
style: TextStyle(color: Colors.white),
|
width: 75.sp,
|
||||||
),
|
),
|
||||||
onPressed: () async{
|
onPressed: () async {
|
||||||
List<MyConfigData> numbers = [];
|
List<MyConfigData> numbers = [];
|
||||||
numbers.add(MyConfigData(
|
numbers.add(MyConfigData(logic.getCircleIndex().id.toString(),
|
||||||
logic.getCircleIndex().id.toString(),
|
logic.getCircleIndex().title!, false));
|
||||||
logic.getCircleIndex().title!,
|
var data = await Get.toNamed(AppRoutes.Call_out,
|
||||||
false));
|
arguments: {'numbers': numbers});
|
||||||
var data = await Get.toNamed(AppRoutes.Call_out, arguments: {'numbers': numbers});
|
// MyinfoListViewKey.currentState?.loadCallOutListData();
|
||||||
// MyinfoListViewKey.currentState?.loadCallOutListData();
|
|
||||||
// logic.refresh();
|
// logic.refresh();
|
||||||
// logic.update();
|
// logic.update();
|
||||||
},
|
},
|
||||||
@ -146,7 +380,6 @@ class _My_circlePageState extends State<My_circlePage>
|
|||||||
Positioned(
|
Positioned(
|
||||||
left: 0,
|
left: 0,
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|
||||||
width: 30.sp * widgets.length,
|
width: 30.sp * widgets.length,
|
||||||
height: 44.sp,
|
height: 44.sp,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
@ -177,7 +410,8 @@ class _My_circlePageState extends State<My_circlePage>
|
|||||||
right: 0,
|
right: 0,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(AppRoutes.MyCircle,arguments: '',preventDuplicates:false);
|
Get.toNamed(AppRoutes.MyCircle,
|
||||||
|
arguments: '', preventDuplicates: false);
|
||||||
},
|
},
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
getCircleImage('my_circle'),
|
getCircleImage('my_circle'),
|
||||||
@ -192,26 +426,24 @@ class _My_circlePageState extends State<My_circlePage>
|
|||||||
circleWidget(String url, {double width = 30}) {
|
circleWidget(String url, {double width = 30}) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
child: Stack(
|
child: Stack(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
getCircleImage('avatar_bg'),
|
getCircleImage('avatar_bg'),
|
||||||
width: width.sp,
|
width: width.sp,
|
||||||
),
|
),
|
||||||
ClipOval(
|
ClipOval(
|
||||||
child: Image.network(
|
child: Image.network(
|
||||||
url,
|
url,
|
||||||
width: (width - 1).sp,
|
width: (width - 1).sp,
|
||||||
height: (width - 1).sp,
|
height: (width - 1).sp,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void _showTextContentDialog(BuildContext context, String msg) {
|
void _showTextContentDialog(BuildContext context, String msg) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
@ -272,8 +504,7 @@ class _My_circlePageState extends State<My_circlePage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _showOutCircleDialog(
|
void _showOutCircleDialog(BuildContext context, var controller, Circle bean) {
|
||||||
BuildContext context, CircleLogic controller, Circle bean) {
|
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@ -315,7 +546,7 @@ class _My_circlePageState extends State<My_circlePage>
|
|||||||
child: Text(
|
child: Text(
|
||||||
"提示",
|
"提示",
|
||||||
style:
|
style:
|
||||||
TextStyle(color: Colors.white, fontSize: 16.sp),
|
TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
@ -410,4 +641,3 @@ class _My_circlePageState extends State<My_circlePage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,41 +7,41 @@ import 'state.dart';
|
|||||||
class Select_circleLogic extends GetxController {
|
class Select_circleLogic extends GetxController {
|
||||||
late Map<String, dynamic> interestMap = Get.arguments['interestMap'];
|
late Map<String, dynamic> interestMap = Get.arguments['interestMap'];
|
||||||
bool isRodio = Get.arguments['isRodio'];
|
bool isRodio = Get.arguments['isRodio'];
|
||||||
List<MyConfigData> selectCircle = Get.arguments['selectCircle'];
|
List<MyConfigData> selectCircle = Get.arguments['selectCircle'];
|
||||||
var selectIndex = -1;
|
var selectIndex = -1;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
if(isRodio){
|
if (isRodio) {
|
||||||
List<MapEntry<String, dynamic>> entries = interestMap.entries.toList();
|
List<MapEntry<String, dynamic>> entries = interestMap.entries.toList();
|
||||||
|
|
||||||
for (var entry in entries.asMap().entries) {
|
for (var entry in entries.asMap().entries) {
|
||||||
MyConfigData bean = MyConfigData(entry.value.key, entry.value.value, false);
|
MyConfigData bean =
|
||||||
if(selectCircle.isEmpty){
|
MyConfigData(entry.value.key, entry.value.value, false);
|
||||||
|
if (selectCircle.isEmpty) {
|
||||||
arrList.add(bean);
|
arrList.add(bean);
|
||||||
}else{
|
} else {
|
||||||
selectCircle.forEach((element) {
|
selectCircle.forEach((element) {
|
||||||
if(entry.value.key==element.id){
|
if (entry.value.key == element.id) {
|
||||||
bean.isSelect = true;
|
bean.isSelect = true;
|
||||||
selectIndex = entry.key;
|
selectIndex = entry.key;
|
||||||
}
|
}
|
||||||
arrList.add(bean);
|
arrList.add(bean);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
interestMap.forEach((key, value) {
|
interestMap.forEach((key, value) {
|
||||||
MyConfigData bean = MyConfigData(key, value, false);
|
MyConfigData bean = MyConfigData(key, value, false);
|
||||||
selectCircle.forEach((element) {
|
selectCircle.forEach((element) {
|
||||||
if(key==element.id){
|
if (key == element.id) {
|
||||||
bean.isSelect = true;
|
bean.isSelect = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
arrList.add(bean);
|
arrList.add(bean);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
print(arrList.length.toString());
|
print(arrList.length.toString());
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
import 'package:circle_app/app/circle/logic.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/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/components/my_app_bar.dart';
|
||||||
|
import 'package:circle_app/router/app_routers.dart';
|
||||||
import 'package:circle_app/util/util.dart';
|
import 'package:circle_app/util/util.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@ -28,7 +30,21 @@ class Signal_circle_listPage extends StatelessWidget {
|
|||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
appBar: MyAppBar(
|
appBar: MyAppBar(
|
||||||
centerTitle: logic.circle?.title ?? '',
|
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(
|
body: Container(
|
||||||
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
|
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,
|
showJoinCiclePiker(String cicleId, String pirce, String oldPrice, int type,
|
||||||
MyCallback payResult,String iosItem) {
|
MyCallback payResult,String iosItem) {
|
||||||
String title = ['解锁圈子才能发布喊话', '解锁圈子才能查看主页', '解锁圈子才能主动私聊'][type];
|
String title = ['解锁圈子才能发布喊话', '解锁圈子才能查看主页', '解锁圈子才能主动私聊'][type];
|
||||||
|
int intP = double.parse(pirce).toInt();
|
||||||
|
int intoldPrice = double.parse(oldPrice).toInt();
|
||||||
return Get.bottomSheet(
|
return Get.bottomSheet(
|
||||||
joiinCircileTipWdiget(cicleId, pirce, oldPrice, title, payResult,iosItem: iosItem),
|
joiinCircileTipWdiget(cicleId,intP.toString(), intoldPrice.toString(), title, payResult,iosItem: iosItem),
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
enableDrag: false);
|
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,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
controller.priceBean[index].amount.toString(),
|
'${controller.priceBean[index].amount.toInt()}',
|
||||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 4.sp,
|
width: 4.sp,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"${controller.priceBean[index].oldAmount}元",
|
"${controller.priceBean[index].oldAmount.toInt()}元",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white70,
|
color: Colors.white70,
|
||||||
fontSize: 10.sp,
|
fontSize: 10.sp,
|
||||||
|
|||||||
@ -11,7 +11,8 @@ class HideText extends StatefulWidget {
|
|||||||
required this.style, //正常字样式
|
required this.style, //正常字样式
|
||||||
required this.additionText, //附加字,如点击查看更多
|
required this.additionText, //附加字,如点击查看更多
|
||||||
this.additionStyle, //附加字的样式
|
this.additionStyle, //附加字的样式
|
||||||
this.maxLines = 3, //行数,不传 默认为3
|
this.maxLines = 3, //行数,不传 默认为3
|
||||||
|
required this.maxWidth,
|
||||||
this.additionUrl, //点击附加字跳转URL
|
this.additionUrl, //点击附加字跳转URL
|
||||||
this.additionParams,
|
this.additionParams,
|
||||||
this.onTap,//点击附加字跳转时携带的参数
|
this.onTap,//点击附加字跳转时携带的参数
|
||||||
@ -22,6 +23,7 @@ class HideText extends StatefulWidget {
|
|||||||
final String? additionText;
|
final String? additionText;
|
||||||
final TextStyle? additionStyle;
|
final TextStyle? additionStyle;
|
||||||
final int? maxLines;
|
final int? maxLines;
|
||||||
|
final double maxWidth;
|
||||||
final String? additionUrl;
|
final String? additionUrl;
|
||||||
GestureTapCallback? onTap;
|
GestureTapCallback? onTap;
|
||||||
final Map<String, dynamic>? additionParams;
|
final Map<String, dynamic>? additionParams;
|
||||||
@ -72,7 +74,7 @@ class _HideTextState extends State<HideText> {
|
|||||||
children: children
|
children: children
|
||||||
),
|
),
|
||||||
textDirection: TextDirection.ltr)
|
textDirection: TextDirection.ltr)
|
||||||
..layout(maxWidth: Get.width - 60.sp); //若新功能宽度不一致,可尝试修改,
|
..layout(maxWidth: widget.maxWidth); //若新功能宽度不一致,可尝试修改,
|
||||||
//UIUtils.screenWidth(context)是自定义的获取屏幕宽度的方法
|
//UIUtils.screenWidth(context)是自定义的获取屏幕宽度的方法
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -248,7 +248,10 @@ class Api {
|
|||||||
|
|
||||||
|
|
||||||
// /up-service/my/interests /up-service/interest/statistics
|
// /up-service/my/interests /up-service/interest/statistics
|
||||||
|
|
||||||
static const getMyCircleInterests = 'up-service/my/interests';
|
static const getMyCircleInterests = 'up-service/my/interests';
|
||||||
|
//我的所有圈子
|
||||||
|
static const getMyCircleAll = '/up-service/my/interests/all';
|
||||||
//缘分匹配
|
//缘分匹配
|
||||||
static const getMatch = 'msg-service/im/chat/match';
|
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 resetPassword = '/user-service/register/user/password/reset';
|
||||||
|
|
||||||
|
//获取多个圈子是否有新喊话
|
||||||
|
static const calloutsNew = '/up-service/interests/callouts/new';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -57,7 +57,7 @@ void showFloatingButtonOverlay(
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 70.sp,
|
// width: 70.sp,
|
||||||
child: Text(
|
child: Text(
|
||||||
nickname,
|
nickname,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user