微信支付宝支付

This commit is contained in:
YangYuhao 2023-07-17 14:37:28 +08:00
parent 9d2f928014
commit 6c5f3bfd47
38 changed files with 2635 additions and 730 deletions

View File

@ -8,6 +8,7 @@
.buildlog/ .buildlog/
.history .history
.svn/ .svn/
pubspec.lock
migrate_working_dir/ migrate_working_dir/
# IntelliJ related # IntelliJ related

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

@ -27,7 +27,7 @@ class AccountPage extends StatelessWidget {
), ),
child: Scaffold( child: Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
appBar: MyAppBar( appBar: const MyAppBar(
centerTitle: '账号中心', centerTitle: '账号中心',
), ),
body: Scaffold( body: Scaffold(
@ -68,15 +68,15 @@ class AccountPage extends StatelessWidget {
Text( Text(
"换绑手机号", "换绑手机号",
style: TextStyle( style: TextStyle(
color: Color(0xFFF7FAFA), color: const Color(0xFFF7FAFA),
fontSize: 16.0.sp, fontSize: 16.0.sp,
), ),
), ),
Spacer(), const Spacer(),
Text( Text(
logic.photo, logic.photo,
style: TextStyle( style: TextStyle(
color: Color(0xFFB7BECC), color: const Color(0xFFB7BECC),
fontSize: 16.0.sp, fontSize: 16.0.sp,
), ),
), ),
@ -122,11 +122,11 @@ class AccountPage extends StatelessWidget {
Text( Text(
"注销账号", "注销账号",
style: TextStyle( style: TextStyle(
color: Color(0xFFF7FAFA), color: const Color(0xFFF7FAFA),
fontSize: 16.0.sp, fontSize: 16.0.sp,
), ),
), ),
Spacer(), const Spacer(),
Image.asset( Image.asset(
getHomeImage("icon_in"), getHomeImage("icon_in"),
width: 24.0.sp, width: 24.0.sp,
@ -273,13 +273,13 @@ class AccountPage extends StatelessWidget {
height: 42.sp, height: 42.sp,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(21.0.sp), borderRadius: BorderRadius.circular(21.0.sp),
color: Color(0xFF21BEAB), color: const Color(0xFF21BEAB),
), ),
child: Center( child: Center(
child: Text( child: Text(
"退出登录", "退出登录",
style: TextStyle( style: TextStyle(
color: Color(0xFFF7FAFA), color: const Color(0xFFF7FAFA),
fontSize: 16.0.sp, fontSize: 16.0.sp,
), ),
), ),

View File

@ -1,4 +1,3 @@
import 'dart:math';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -9,7 +8,6 @@ import '../../components/my_app_bar.dart';
import '../../router/app_routers.dart'; import '../../router/app_routers.dart';
import '../../util/util.dart'; import '../../util/util.dart';
import 'logic.dart'; import 'logic.dart';
import 'package:flutter/material.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
class BlacklistPage extends StatelessWidget { class BlacklistPage extends StatelessWidget {
@ -32,10 +30,12 @@ class BlacklistPage extends StatelessWidget {
), ),
child: Scaffold( child: Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
appBar: MyAppBar(centerTitle: '黑名单',), appBar: const MyAppBar(centerTitle: '黑名单',),
body: SafeArea( body: SafeArea(
child: logic.isLoad ? loaddingWidget(true) : logic.lists.isEmpty ? noResultWidget() : SmartRefresher( child: logic.isLoad ? loaddingWidget(true) : logic.lists.isEmpty ? noResultWidget() : SmartRefresher(
controller: logic.refreshController, controller: logic.refreshController,
onRefresh: _onRefresh,
onLoading: _onLoading,
child: ListView.builder( child: ListView.builder(
itemCount: logic.lists.length, itemCount: logic.lists.length,
@ -45,8 +45,6 @@ class BlacklistPage extends StatelessWidget {
); );
}, },
), ),
onRefresh: _onRefresh,
onLoading: _onLoading,
), ),
),), ),),
); );
@ -55,13 +53,12 @@ class BlacklistPage extends StatelessWidget {
Widget ListItem(User item) { Widget ListItem(User item) {
return Container( return GestureDetector(
child: GestureDetector(
onTap: () { onTap: () {
Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString()); Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString());
}, },
child: Container( child: Container(
margin: EdgeInsets.only(bottom: 16), margin: const EdgeInsets.only(bottom: 16),
child: Row( child: Row(
children: [ children: [
Stack(children: [ Stack(children: [
@ -114,17 +111,17 @@ class BlacklistPage extends StatelessWidget {
), ),
SizedBox(height: 8.sp), SizedBox(height: 8.sp),
Container( SizedBox(
width: 150.sp, width: 150.sp,
child: Text( child: Text(
item.signature, item.signature,
style: TextStyle(fontSize: 12.sp, color: Color(0xFFB7BECC)), style: TextStyle(fontSize: 12.sp, color: const Color(0xFFB7BECC)),
), ),
), ),
], ],
), ),
// Pla // Pla
Spacer(), const Spacer(),
GestureDetector(onTap: () { GestureDetector(onTap: () {
logic.setBlock(item.id.toString()); logic.setBlock(item.id.toString());
}, },
@ -132,11 +129,11 @@ class BlacklistPage extends StatelessWidget {
width: 80, width: 80,
height: 28, height: 28,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFFF4D7C), color: const Color(0xFFFF4D7C),
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
), ),
child: child:
Center( const Center(
child: Text( child: Text(
"移出黑名单", "移出黑名单",
style: TextStyle(fontSize: 14, color: Colors.white), style: TextStyle(fontSize: 14, color: Colors.white),
@ -145,18 +142,17 @@ class BlacklistPage extends StatelessWidget {
),), ),),
], ],
), ),
),), ),);
);
} }
Widget _buildInfoRow(User userInfoBean) { Widget _buildInfoRow(User userInfoBean) {
String ageMsg = getAgeCOntent(userInfoBean!.gender, userInfoBean!.age, String ageMsg = getAgeCOntent(userInfoBean.gender, userInfoBean.age,
userInfoBean!.role, userInfoBean!.orientation); userInfoBean.role, userInfoBean.orientation);
return Row( return Row(
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17), borderRadius: BorderRadius.circular(17),
gradient: LinearGradient( gradient: const LinearGradient(
colors: [ colors: [
Color.fromRGBO(141, 255, 248, 1.0), Color.fromRGBO(141, 255, 248, 1.0),
Color.fromRGBO(181, 211, 255, 1.0), Color.fromRGBO(181, 211, 255, 1.0),
@ -169,7 +165,7 @@ class BlacklistPage extends StatelessWidget {
top: 2.sp, bottom: 2.sp, left: 10.sp, right: 10.sp), top: 2.sp, bottom: 2.sp, left: 10.sp, right: 10.sp),
child: Text( child: Text(
ageMsg , ageMsg ,
style: TextStyle( style: const TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 10, fontSize: 10,
), ),

View File

@ -74,6 +74,9 @@ class Call_outLogic extends GetxController {
quniuData, (quniuData) => QnTokenData.fromJson(quniuData)); quniuData, (quniuData) => QnTokenData.fromJson(quniuData));
quToken = qiniuBean.data!.token.toString(); quToken = qiniuBean.data!.token.toString();
} }
showRechargeDialog(){ showRechargeDialog(){
Get.bottomSheet( Get.bottomSheet(
Scaffold( Scaffold(
@ -145,15 +148,11 @@ class Call_outLogic extends GetxController {
// return; // return;
// } // }
showToast(beandata.msg); showToast(beandata.msg);
var callOutBean = BaseResponse<List<String>>.fromJson( var callOutBean = BaseResponse<List<String>>.fromJson(data, (jsonData) => List<String>.from(jsonData),);
data,
(jsonData) => List<String>.from(jsonData),
);
textEditingController.text = textEditingController.text =
filterSensitiveWords(textEditingController.text, callOutBean.data!); filterSensitiveWords(textEditingController.text, callOutBean.data!);
print( print(filterSensitiveWords(textEditingController.text, callOutBean.data!));
filterSensitiveWords(textEditingController.text, callOutBean.data!));
update(); update();
} else if (beandata.code == 30505) { } else if (beandata.code == 30505) {
var callOutBean = BaseResponse<CirclePaymentBean>.fromJson( var callOutBean = BaseResponse<CirclePaymentBean>.fromJson(

View File

@ -6,7 +6,6 @@ import 'package:get/get.dart';
import 'package:video_player/video_player.dart'; import 'package:video_player/video_player.dart';
import '../../router/app_routers.dart'; import '../../router/app_routers.dart';
import '../circle/widgets/video_item.dart';
import 'logic.dart'; import 'logic.dart';
class Call_outPage extends StatelessWidget { class Call_outPage extends StatelessWidget {
@ -46,8 +45,7 @@ class Call_outPage extends StatelessWidget {
), ),
body: SafeArea( body: SafeArea(
child: GetBuilder(builder: (Call_outLogic controller) { child: GetBuilder(builder: (Call_outLogic controller) {
return Container( return Column(
child: Column(
children: [ children: [
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
@ -83,7 +81,7 @@ class Call_outPage extends StatelessWidget {
Color(0xffD739EA) Color(0xffD739EA)
])), ])),
child: Text( child: Text(
logic.circleName ?? '', logic.circleName,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 12.sp), fontSize: 12.sp),
@ -107,7 +105,7 @@ class Call_outPage extends StatelessWidget {
padding: EdgeInsets.only(top: 15.sp), padding: EdgeInsets.only(top: 15.sp),
child: Stack( child: Stack(
children: [ children: [
Container( SizedBox(
height: 200.sp, height: 200.sp,
child: TextField( child: TextField(
controller: controller.textEditingController, controller: controller.textEditingController,
@ -120,14 +118,14 @@ class Call_outPage extends StatelessWidget {
maxLength: 200, maxLength: 200,
decoration: InputDecoration( decoration: InputDecoration(
hintStyle: TextStyle( hintStyle: TextStyle(
color: Color.fromRGBO( color: const Color.fromRGBO(
255, 255, 255, 0.6), 255, 255, 255, 0.6),
fontSize: 14.sp), fontSize: 14.sp),
hintText: '请输入...(左下角上传图片或视频哦)', hintText: '请输入...(左下角上传图片或视频哦)',
border: InputBorder.none, border: InputBorder.none,
contentPadding: EdgeInsets.only( contentPadding: EdgeInsets.only(
left: 17.sp, right: 17.sp), left: 17.sp, right: 17.sp),
counter: Text('')), counter: const Text('')),
), ),
), ),
Positioned( Positioned(
@ -213,7 +211,7 @@ class Call_outPage extends StatelessWidget {
child: Text( child: Text(
'内容规范', '内容规范',
style: TextStyle( style: TextStyle(
color: Color(0xff00FFF4), color: const Color(0xff00FFF4),
fontSize: 14.sp), fontSize: 14.sp),
), ),
) )
@ -221,7 +219,6 @@ class Call_outPage extends StatelessWidget {
), ),
) )
], ],
),
); );
}), }),
), ),
@ -235,47 +232,44 @@ class Call_outPage extends StatelessWidget {
return Container(); return Container();
} else { } else {
return _mixVideo(controller); return _mixVideo(controller);
} }
} }
Widget _maxVideo(Call_outLogic controller){ // Widget _maxVideo(Call_outLogic controller){
return Container( // return SizedBox(
width:controller.videoPlayerController!.value.size.width < controller.videoPlayerController!.value.size.height ? 9*15.sp : 16*15.sp, // width:controller.videoPlayerController!.value.size.width < controller.videoPlayerController!.value.size.height ? 9*15.sp : 16*15.sp,
height:controller.videoPlayerController!.value.size.width < controller.videoPlayerController!.value.size.height ? 16*15.sp :9*15.sp, // height:controller.videoPlayerController!.value.size.width < controller.videoPlayerController!.value.size.height ? 16*15.sp :9*15.sp,
//
child: Stack( // child: Stack(
children: [ // children: [
ClipRRect( // ClipRRect(
borderRadius: BorderRadius.circular(6.sp), // borderRadius: BorderRadius.circular(6.sp),
child: VideoItemWidget(controller.state.videolist[0])), // child: VideoItemWidget(controller.state.videolist[0])),
// Center(child:controller.videoPlayerController!.value.isPlaying ? Container() : Image(image: AssetImage(getMineImage("icon_play")),width: 30.sp,height: 30.sp,),), // // Center(child:controller.videoPlayerController!.value.isPlaying ? Container() : Image(image: AssetImage(getMineImage("icon_play")),width: 30.sp,height: 30.sp,),),
Positioned( // Positioned(
top: 0, // top: 0,
right: 0, // right: 0,
child: GestureDetector( // child: GestureDetector(
onTap: () { // onTap: () {
// showToast("删除"); // // showToast("删除");
_showDelVideoDialog(Get.context!, controller); // _showDelVideoDialog(Get.context!, controller);
}, // },
child: Image( // child: Image(
image: AssetImage(getMineImage("icon_img_del")), // image: AssetImage(getMineImage("icon_img_del")),
width: 20.sp, // width: 20.sp,
height: 20.sp, // height: 20.sp,
), // ),
)) // ))
//
// ClosedCaption(text: controller.videoPlayerController!.value.caption.text), // // ClosedCaption(text: controller.videoPlayerController!.value.caption.text),
// _ControlsOverlay(controller: controller.videoPlayerController), // // _ControlsOverlay(controller: controller.videoPlayerController),
// VideoProgressIndicator(controller.videoPlayerController!, allowScrubbing: true), // // VideoProgressIndicator(controller.videoPlayerController!, allowScrubbing: true),
], // ],
), // ),
); // );
} // }
Widget _mixVideo(Call_outLogic controller){ Widget _mixVideo(Call_outLogic controller){
return Container( return SizedBox(
width:controller.videoPlayerController!.value.size.width < controller.videoPlayerController!.value.size.height ? 135.sp : 240.sp, width:controller.videoPlayerController!.value.size.width < controller.videoPlayerController!.value.size.height ? 135.sp : 240.sp,
height:controller.videoPlayerController!.value.size.width < controller.videoPlayerController!.value.size.height ? 240.sp :135.sp, height:controller.videoPlayerController!.value.size.width < controller.videoPlayerController!.value.size.height ? 240.sp :135.sp,
child: GestureDetector( child: GestureDetector(
@ -320,7 +314,7 @@ class Call_outPage extends StatelessWidget {
Widget _imageAdapter(Call_outLogic controller) { Widget _imageAdapter(Call_outLogic controller) {
return GridView.builder( return GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, // crossAxisCount: 3, //
), ),
itemCount: controller.state.imaglist.length, // itemCount: controller.state.imaglist.length, //
@ -340,7 +334,7 @@ class Call_outPage extends StatelessWidget {
children: [ children: [
ClipRRect( ClipRRect(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
child: Container( child: SizedBox(
width: double.infinity, // width: double.infinity, //
height: double.infinity, // height: double.infinity, //
child: ClipRRect( child: ClipRRect(
@ -387,14 +381,14 @@ class Call_outPage extends StatelessWidget {
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
child: Container( child: Container(
height: 160.sp, height: 160.sp,
padding: EdgeInsets.all(1.0), padding: const EdgeInsets.all(1.0),
child: Stack( child: Stack(
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
gradient: LinearGradient( gradient: const LinearGradient(
colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)], colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)],
begin: Alignment.topCenter, begin: Alignment.topCenter,
end: Alignment.bottomCenter, end: Alignment.bottomCenter,
@ -406,7 +400,7 @@ class Call_outPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
gradient: LinearGradient( gradient: const LinearGradient(
colors: [Color(0xFF4C3E5F), Color(0xFF324140)], colors: [Color(0xFF4C3E5F), Color(0xFF324140)],
begin: Alignment.topCenter, begin: Alignment.topCenter,
end: Alignment.bottomCenter, end: Alignment.bottomCenter,
@ -432,7 +426,7 @@ class Call_outPage extends StatelessWidget {
"是否确认删除该照片。", "是否确认删除该照片。",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Color(0xCCF7FAFA), fontSize: 16.sp), color: const Color(0xCCF7FAFA), fontSize: 16.sp),
), ),
), ),
Row( Row(
@ -447,7 +441,7 @@ class Call_outPage extends StatelessWidget {
margin: EdgeInsets.only(top: 30.sp), margin: EdgeInsets.only(top: 30.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17), borderRadius: BorderRadius.circular(17),
gradient: LinearGradient( gradient: const LinearGradient(
colors: [ colors: [
Color(0x26FFFFFF), Color(0x26FFFFFF),
Color(0x26FFFFFF), Color(0x26FFFFFF),
@ -461,7 +455,7 @@ class Call_outPage extends StatelessWidget {
bottom: 10.sp, bottom: 10.sp,
left: 52.sp, left: 52.sp,
right: 52.sp), right: 52.sp),
child: Text( child: const Text(
"", "",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
@ -481,7 +475,7 @@ class Call_outPage extends StatelessWidget {
margin: EdgeInsets.only(top: 24.sp), margin: EdgeInsets.only(top: 24.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17), borderRadius: BorderRadius.circular(17),
gradient: LinearGradient( gradient: const LinearGradient(
colors: [ colors: [
Color(0xFF06F9FA), Color(0xFF06F9FA),
Color(0xFFDC5BFD), Color(0xFFDC5BFD),
@ -495,7 +489,7 @@ class Call_outPage extends StatelessWidget {
bottom: 10.sp, bottom: 10.sp,
left: 52.sp, left: 52.sp,
right: 52.sp), right: 52.sp),
child: Text( child: const Text(
"", "",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
@ -529,14 +523,14 @@ class Call_outPage extends StatelessWidget {
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
child: Container( child: Container(
height: 160.sp, height: 160.sp,
padding: EdgeInsets.all(1.0), padding: const EdgeInsets.all(1.0),
child: Stack( child: Stack(
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
gradient: LinearGradient( gradient: const LinearGradient(
colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)], colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)],
begin: Alignment.topCenter, begin: Alignment.topCenter,
end: Alignment.bottomCenter, end: Alignment.bottomCenter,
@ -548,7 +542,7 @@ class Call_outPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
gradient: LinearGradient( gradient: const LinearGradient(
colors: [Color(0xFF4C3E5F), Color(0xFF324140)], colors: [Color(0xFF4C3E5F), Color(0xFF324140)],
begin: Alignment.topCenter, begin: Alignment.topCenter,
end: Alignment.bottomCenter, end: Alignment.bottomCenter,
@ -574,7 +568,7 @@ class Call_outPage extends StatelessWidget {
"是否确认删除该视频。", "是否确认删除该视频。",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Color(0xCCF7FAFA), fontSize: 16.sp), color: const Color(0xCCF7FAFA), fontSize: 16.sp),
), ),
), ),
Row( Row(
@ -589,7 +583,7 @@ class Call_outPage extends StatelessWidget {
margin: EdgeInsets.only(top: 30.sp), margin: EdgeInsets.only(top: 30.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17), borderRadius: BorderRadius.circular(17),
gradient: LinearGradient( gradient: const LinearGradient(
colors: [ colors: [
Color(0x26FFFFFF), Color(0x26FFFFFF),
Color(0x26FFFFFF), Color(0x26FFFFFF),
@ -603,7 +597,7 @@ class Call_outPage extends StatelessWidget {
bottom: 10.sp, bottom: 10.sp,
left: 52.sp, left: 52.sp,
right: 52.sp), right: 52.sp),
child: Text( child: const Text(
"", "",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
@ -625,7 +619,7 @@ class Call_outPage extends StatelessWidget {
margin: EdgeInsets.only(top: 24.sp), margin: EdgeInsets.only(top: 24.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17), borderRadius: BorderRadius.circular(17),
gradient: LinearGradient( gradient: const LinearGradient(
colors: [ colors: [
Color(0xFF06F9FA), Color(0xFF06F9FA),
Color(0xFFDC5BFD), Color(0xFFDC5BFD),
@ -639,7 +633,7 @@ class Call_outPage extends StatelessWidget {
bottom: 10.sp, bottom: 10.sp,
left: 52.sp, left: 52.sp,
right: 52.sp), right: 52.sp),
child: Text( child: const Text(
"", "",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,

View File

@ -35,19 +35,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
@override @override
bool get wantKeepAlive => true; bool get wantKeepAlive => true;
List<String> genderList = ['', '女,' 'MTF', 'FTM', 'CD', '酷儿'];
List<String> orientationList = [
'异性恋',
'同性恋',
'双性恋',
'泛性恋',
'无性恋',
'智性恋',
'性单恋'
];
List<String> roleList = ['Sado', 'Maso', 'Dom', 'Sub', 'Switch'];
ListLogic? listsLg; ListLogic? listsLg;
@ -421,7 +409,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
], ],
), ),
)), )),
GestureDetector( GestureDetector(//
onTap: () async { onTap: () async {
if (widget.bean.isJoin) { if (widget.bean.isJoin) {
_showOutCircleDialog( _showOutCircleDialog(
@ -475,7 +463,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
gradient: LinearGradient( gradient: const LinearGradient(
colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)], colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)],
begin: Alignment.topCenter, begin: Alignment.topCenter,
end: Alignment.bottomCenter, end: Alignment.bottomCenter,
@ -487,7 +475,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
gradient: LinearGradient( gradient: const LinearGradient(
colors: [Color(0xFF4C3E5F), Color(0xFF324140)], colors: [Color(0xFF4C3E5F), Color(0xFF324140)],
begin: Alignment.topCenter, begin: Alignment.topCenter,
end: Alignment.bottomCenter, end: Alignment.bottomCenter,
@ -617,6 +605,22 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
GestureDetector( GestureDetector(
onTap: ()async {
var sp = await SharedPreferencesHelper.getInstance();
String myUserId = sp.getMyUserId();
if(lists.user?.id!.toString() == myUserId){
Get.toNamed(AppRoutes.UserInfoActivity, arguments: {});
return;
}
if (widget.bean.is_limit) {
showJoinCiclePiker(widget.bean.id.toString(),widget.bean.amount.toString(),widget.bean.oldAmount.toString(),1,(payResult){
});
return;
}
pushHomePage(lists, lists.id.toString());
},
child: Stack( child: Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
@ -624,22 +628,13 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
getCircleImage('avatar_bg'), getCircleImage('avatar_bg'),
width: 42.sp, width: 42.sp,
), ),
GestureDetector( ClipOval(
onTap: () {
if (widget.bean.is_limit) {
showJoinCiclePiker(widget.bean.id.toString(),widget.bean.amount.toString(),widget.bean.oldAmount.toString(),1);
return;
}
pushHomePage(lists, lists.id.toString());
},
child: ClipOval(
child: Image.network( child: Image.network(
lists.user!.avatar!, lists.user!.avatar!,
width: 40.sp, width: 40.sp,
height: 40.sp, height: 40.sp,
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
),
) )
], ],
)), )),
@ -690,7 +685,9 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
Color(0xffB5D3FF) Color(0xffB5D3FF)
])), ])),
child: Text( child: Text(
'${genderList[lists.user!.gender!]}.${lists.user!.age}.${roleList[lists.user!.role!]}.${orientationList[lists.user!.orientation!]}', getAgeCOntent(lists.user!.gender!, lists.user!.age!,
lists.user!.role!, lists.user!.orientation!),
// '${genderList[lists.user!.gender!]}.${lists.user!.age}.${roleList[lists.user!.role!]}.${orientationList[lists.user!.orientation!]}',
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 12.sp, fontSize: 12.sp,
@ -907,6 +904,21 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
GestureDetector( GestureDetector(
onTap: ()async {
var sp = await SharedPreferencesHelper.getInstance();
String myUserId = sp.getMyUserId();
if(lists.user?.id!.toString() == myUserId){
Get.toNamed(AppRoutes.UserInfoActivity, arguments: "");
return;
}
if (widget.bean.is_limit) {
showJoinCiclePiker(widget.bean.id.toString(),widget.bean.amount.toString(),widget.bean.oldAmount.toString(),1,(payResult){
});
return;
}
pushHomePage(lists, lists.id.toString());
},
child: Stack( child: Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
@ -914,23 +926,14 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
getCircleImage('avatar_bg'), getCircleImage('avatar_bg'),
width: 42.sp, width: 42.sp,
), ),
GestureDetector( ClipOval(
onTap: () {
if (widget.bean.is_limit) {
showJoinCiclePiker(widget.bean.id.toString(),widget.bean.amount.toString(),widget.bean.oldAmount.toString(),1);
return;
}
pushHomePage(
lists, widget.bean.id.toString());
},
child: ClipOval(
child: Image.network( child: Image.network(
lists.user!.avatar!, lists.user!.avatar!,
width: 40.sp, width: 40.sp,
height: 40.sp, height: 40.sp,
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
)) )
], ],
)), )),
Expanded( Expanded(
@ -981,7 +984,8 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
Color(0xffB5D3FF) Color(0xffB5D3FF)
])), ])),
child: Text( child: Text(
'${genderList[lists.user!.gender!]}.${lists.user!.age}.${roleList[lists.user!.role!]}.${orientationList[lists.user!.orientation!]}', getAgeCOntent(lists.user!.gender!, lists.user!.age!,
lists.user!.role!, lists.user!.orientation!),
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 12.sp, fontSize: 12.sp,

View File

@ -58,7 +58,7 @@ class HelpPage extends StatelessWidget {
padding: EdgeInsets.only(left: 16.sp, right: 16.sp), padding: EdgeInsets.only(left: 16.sp, right: 16.sp),
child: Row( child: Row(
children: [ children: [
Container( SizedBox(
height: 300.sp, height: 300.sp,
child: Align( child: Align(
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
@ -73,10 +73,10 @@ class HelpPage extends StatelessWidget {
Expanded( Expanded(
child: Container( child: Container(
height: 300, height: 300,
padding: EdgeInsets.all(16), padding: const EdgeInsets.all(16),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.sp), borderRadius: BorderRadius.circular(4.sp),
color: Color(0xFF2E2E3B), color: const Color(0xFF2E2E3B),
), ),
child: Center( child: Center(
child: Column( child: Column(
@ -85,7 +85,7 @@ class HelpPage extends StatelessWidget {
Text( Text(
'猜你想问', '猜你想问',
style: TextStyle( style: TextStyle(
color: Color(0xFFB7BECC), color: const Color(0xFFB7BECC),
fontSize: 14.sp, fontSize: 14.sp,
), ),
), ),
@ -126,7 +126,7 @@ class HelpPage extends StatelessWidget {
children: [ children: [
Text( Text(
logic.msgList[index].question, logic.msgList[index].question,
style: TextStyle( style: const TextStyle(
color: Colors.white), color: Colors.white),
), ),
Image( Image(
@ -181,7 +181,7 @@ class HelpPage extends StatelessWidget {
width: 14.sp, width: 14.sp,
height: 14.sp, height: 14.sp,
), ),
label: Text( label: const Text(
'意见反馈', '意见反馈',
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,

View File

@ -5,6 +5,7 @@ import 'package:circle_app/app/circle/view.dart';
import 'package:circle_app/app/msg/view.dart'; import 'package:circle_app/app/msg/view.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';
import 'package:circle_app/view/ExitAppConfirmation.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';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -33,7 +34,7 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin
onTap: () { onTap: () {
// Get.toNamed(AppRoutes.Complete_materialPage); // Get.toNamed(AppRoutes.Complete_materialPage);
}, },
child: Stack(children: [ child: ExitAppConfirmation(child: Stack(children: [
Scaffold( Scaffold(
// backgroundColor: Color.fromRGBO(244, 245, 245, 1.0), // backgroundColor: Color.fromRGBO(244, 245, 245, 1.0),
bottomNavigationBar: Container( bottomNavigationBar: Container(
@ -68,7 +69,7 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin
), ),
), ),
],), ],),)
); );
}); });
} }

View File

@ -39,6 +39,7 @@ class LoginLogic extends GetxController {
// //
starDownTimer() { starDownTimer() {
if (sendCodeBtn == false && seconds == 60) { if (sendCodeBtn == false && seconds == 60) {
isPhoto = true;
getCode(); getCode();
} }

View File

@ -1,4 +1,3 @@
import 'dart:math';
import 'package:circle_app/util/util.dart'; import 'package:circle_app/util/util.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -109,7 +108,7 @@ class LoginPage extends StatelessWidget {
Stack( Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
Container( SizedBox(
width: 200.sp, width: 200.sp,
child: TextField( child: TextField(
controller: logic.codeEditingController, controller: logic.codeEditingController,
@ -142,7 +141,7 @@ class LoginPage extends StatelessWidget {
width: 76.sp, width: 76.sp,
height: 29.sp, height: 29.sp,
decoration: BoxDecoration( decoration: BoxDecoration(
color:logic.isPhoto ? Color(0xFF21BEAB) : Colors.white30, color:logic.isPhoto ? logic.sendCodeBtn? Colors.white30: const Color(0xFF21BEAB) : Colors.white30,
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(
29.sp / 2) 29.sp / 2)
), ),

View File

@ -10,7 +10,7 @@ import 'package:shared_preferences/shared_preferences.dart';
class MinefragmentLogic extends GetxController { class MinefragmentLogic extends GetxController {
final MinefragmentState state = MinefragmentState(); final MinefragmentState state = MinefragmentState();
User? userInfoBean = null; User? userInfoBean;
String ageMsg = ""; String ageMsg = "";
var isVip = 0; var isVip = 0;
var like_count = 0; var like_count = 0;
@ -27,7 +27,7 @@ class MinefragmentLogic extends GetxController {
int orientation = -1; int orientation = -1;
String enterHomeInfoMsg = "进入主页"; String enterHomeInfoMsg = "进入主页";
String JoinedCircle = ""; String joinedCircle = "";
@override @override
void onInit() async { void onInit() async {
@ -43,7 +43,7 @@ class MinefragmentLogic extends GetxController {
like_count = bean.data.likeCount ?? 0; like_count = bean.data.likeCount ?? 0;
like_me_count = bean.data.likeMeCount ?? 0; like_me_count = bean.data.likeMeCount ?? 0;
recent_visit_count = bean.data.recentVisitCount ?? 0; recent_visit_count = bean.data.recentVisitCount ?? 0;
JoinedCircle = "${"加入了"+bean.data.joininterestcount.toString()}个圈子"; joinedCircle = "${"加入了${bean.data.joininterestcount}"}";
SharedPreferences sharedPreferences = SharedPreferences sharedPreferences =
await SharedPreferences.getInstance(); await SharedPreferences.getInstance();

View File

@ -46,14 +46,12 @@ class MinefragmentPage extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
_buildAvatarRow(logic), _buildAvatarRow(logic),
_FriendsRow(logic), _friendsRow(logic),
Container( Image(
child: Image(
image: AssetImage(getHomeImage("icon_vip")), image: AssetImage(getHomeImage("icon_vip")),
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
), _circleLiveView(logic),
_CircleLiveView(logic),
], ],
), ),
), ),
@ -62,13 +60,13 @@ class MinefragmentPage extends StatelessWidget {
}); });
} }
Widget _CircleLiveView(MinefragmentLogic logic) { Widget _circleLiveView(MinefragmentLogic logic) {
return Column( return Column(
children: [_CircleItemView(logic), _HelpItemView(), _SetUpItemView()], children: [_circleItemView(logic), _helpItemView(), _setUpItemView()],
); );
} }
Widget _SetUpItemView() { Widget _setUpItemView() {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
@ -110,7 +108,7 @@ class MinefragmentPage extends StatelessWidget {
); );
} }
Widget _HelpItemView() { Widget _helpItemView() {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
@ -151,7 +149,7 @@ class MinefragmentPage extends StatelessWidget {
); );
} }
Widget _CircleItemView(MinefragmentLogic logic) { Widget _circleItemView(MinefragmentLogic logic) {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
@ -179,7 +177,7 @@ class MinefragmentPage extends StatelessWidget {
Row( Row(
children: [ children: [
Text( Text(
logic.JoinedCircle, logic.joinedCircle,
style: const TextStyle(color: Colors.white30), style: const TextStyle(color: Colors.white30),
), ),
Image( Image(
@ -195,7 +193,7 @@ class MinefragmentPage extends StatelessWidget {
); );
} }
Widget _FriendsRow(MinefragmentLogic logic) { Widget _friendsRow(MinefragmentLogic logic) {
return Center( return Center(
child: Container( child: Container(
width: Get.width, width: Get.width,
@ -242,11 +240,9 @@ class MinefragmentPage extends StatelessWidget {
onTap: ()async { onTap: ()async {
logic.like_me_count_new = 0; logic.like_me_count_new = 0;
logic.update(); logic.update();
if(null!=logic.like_me_count){
SharedPreferencesHelper.getInstance().then((sharedPreferences) { SharedPreferencesHelper.getInstance().then((sharedPreferences) {
sharedPreferences.setInt(SharedPreferencesHelper.LIKEMECOUNT, logic.like_me_count); sharedPreferences.setInt(SharedPreferencesHelper.LIKEMECOUNT, logic.like_me_count);
}); });
}
Get.toNamed(AppRoutes.LikeListActivity); Get.toNamed(AppRoutes.LikeListActivity);
}, },
child: Stack( child: Stack(
@ -300,11 +296,9 @@ class MinefragmentPage extends StatelessWidget {
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () async{ onTap: () async{
logic.recent_visit_count_new = 0; logic.recent_visit_count_new = 0;
if(null!=logic.recent_visit_count){
SharedPreferencesHelper.getInstance().then((sharedPreferences) { SharedPreferencesHelper.getInstance().then((sharedPreferences) {
sharedPreferences.setInt(SharedPreferencesHelper.RECENTVISITCOUNT, logic.recent_visit_count); sharedPreferences.setInt(SharedPreferencesHelper.RECENTVISITCOUNT, logic.recent_visit_count);
}); });
}
Get.toNamed(AppRoutes.VisitorListActivity); Get.toNamed(AppRoutes.VisitorListActivity);
}, },
child: Stack( child: Stack(

View File

@ -31,7 +31,7 @@ class ReportPage extends StatelessWidget {
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
appBar: MyAppBar( appBar: MyAppBar(
centerTitle: '举报', centerTitle: '举报',
actionWdiget: Text( actionWdiget: const Text(
"提交", "提交",
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
@ -52,13 +52,13 @@ class ReportPage extends StatelessWidget {
), ),
), ),
), ),
Container( SizedBox(
height: 120.sp, height: 120.sp,
child: _reportAdapter(controller), child: _reportAdapter(controller),
), ),
Expanded( Expanded(
child: Padding( child: Padding(
padding: EdgeInsets.fromLTRB(16, 20, 16, 0), padding: const EdgeInsets.fromLTRB(16, 20, 16, 0),
child: ListView( child: ListView(
children: [ children: [
Text( Text(
@ -71,7 +71,7 @@ class ReportPage extends StatelessWidget {
SizedBox(height: 20.sp), SizedBox(height: 20.sp),
// RecyclerViewListView // RecyclerViewListView
// : MyRecyclerViewWidget(), // : MyRecyclerViewWidget(),
Container( SizedBox(
height: 130.sp, height: 130.sp,
child: _imageAdapter(controller)), child: _imageAdapter(controller)),
Text( Text(
@ -81,19 +81,19 @@ class ReportPage extends StatelessWidget {
fontSize: 14.sp, fontSize: 14.sp,
), ),
), ),
SizedBox(height: 30), const SizedBox(height: 30),
Container( Container(
// margin: EdgeInsets.only(left: 10, right: 10), // margin: EdgeInsets.only(left: 10, right: 10),
height: 200.sp, height: 200.sp,
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF4C3E5F), color: const Color(0xFF4C3E5F),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),
padding: EdgeInsets.all(16.sp), padding: EdgeInsets.all(16.sp),
child: Stack( child: Stack(
children: [ children: [
Container( SizedBox(
height: 200.sp, height: 200.sp,
child: TextField( child: TextField(
controller: controller.textEditingController, controller: controller.textEditingController,
@ -106,13 +106,13 @@ class ReportPage extends StatelessWidget {
maxLength: 200, maxLength: 200,
decoration: InputDecoration( decoration: InputDecoration(
hintStyle: TextStyle( hintStyle: TextStyle(
color: Color.fromRGBO( color: const Color.fromRGBO(
255, 255, 255, 0.6), 255, 255, 255, 0.6),
fontSize: 14.sp), fontSize: 14.sp),
hintText: '违规补充说明,帮助审核处理,选填', hintText: '违规补充说明,帮助审核处理,选填',
border: InputBorder.none, border: InputBorder.none,
counter: Text('')), counter: const Text('')),
), ),
), ),
Positioned( Positioned(
@ -164,7 +164,7 @@ class ReportPage extends StatelessWidget {
Widget _reportAdapter(ReportLogic controller) { Widget _reportAdapter(ReportLogic controller) {
return GridView.builder( return GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, crossAxisCount: 3,
// crossAxisSpacing: 6.sp, // crossAxisSpacing: 6.sp,
childAspectRatio: 3, childAspectRatio: 3,
@ -189,7 +189,7 @@ class ReportPage extends StatelessWidget {
Widget _imageAdapter(ReportLogic controller) { Widget _imageAdapter(ReportLogic controller) {
return GridView.builder( return GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, // crossAxisCount: 3, //
), ),
itemCount: controller.state.imaglist.length<3 ? controller.state.imaglist.length+1: controller.state.imaglist.length, // Replace with your item count// itemCount: controller.state.imaglist.length<3 ? controller.state.imaglist.length+1: controller.state.imaglist.length, // Replace with your item count//
@ -231,7 +231,7 @@ class ReportPage extends StatelessWidget {
EdgeInsets.only(left: 8.sp, right: 8.sp, top: 6.sp, bottom: 6.sp), EdgeInsets.only(left: 8.sp, right: 8.sp, top: 6.sp, bottom: 6.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.sp), borderRadius: BorderRadius.circular(20.sp),
gradient: LinearGradient( gradient: const LinearGradient(
colors: [ colors: [
Color(0xFF06F9FA), Color(0xFF06F9FA),
Color(0xFFDC5BFD), Color(0xFFDC5BFD),
@ -260,9 +260,9 @@ class ReportPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.0), // borderRadius: BorderRadius.circular(20.0), //
border: Border.all( border: Border.all(
color: Color(0xFF392D53), color: const Color(0xFF392D53),
), ),
color: Color(0xFF392D53), color: const Color(0xFF392D53),
), ),
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
@ -270,7 +270,7 @@ class ReportPage extends StatelessWidget {
child: Center( child: Center(
child: Text( child: Text(
bean.name, bean.name,
style: TextStyle( style: const TextStyle(
fontSize: 11.0, fontSize: 11.0,
color: Colors.white, color: Colors.white,
), ),
@ -287,7 +287,7 @@ class ReportPage extends StatelessWidget {
children: [ children: [
ClipRRect( ClipRRect(
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
child: Container( child: SizedBox(
width: double.infinity, // width: double.infinity, //
height: double.infinity, // height: double.infinity, //
child: ClipRRect( child: ClipRRect(

View File

@ -16,7 +16,7 @@ class UserinfoLogic extends GetxController {
var userId = Get.arguments ?? ""; var userId = Get.arguments ?? "";
final UserinfoState state = UserinfoState(); final UserinfoState state = UserinfoState();
final ImagePicker _picker = ImagePicker(); final ImagePicker _picker = ImagePicker();
UserBean? userInfoBean = null; UserBean? userInfoBean;
String imId = ''; String imId = '';
String ageMsg = ""; String ageMsg = "";
var isVip = 0; var isVip = 0;
@ -34,7 +34,7 @@ class UserinfoLogic extends GetxController {
@override @override
void onInit() async { void onInit() async {
super.onInit(); super.onInit();
SmartDialog.showLoading();
if (userId != '') { if (userId != '') {
SharedPreferences sharedPreferences = SharedPreferences sharedPreferences =
await SharedPreferences.getInstance(); await SharedPreferences.getInstance();
@ -86,12 +86,12 @@ class UserinfoLogic extends GetxController {
var bean = BaseResponse<ResponseBean>.fromJson( var bean = BaseResponse<ResponseBean>.fromJson(
data, (data) => ResponseBean.fromJson(data)); data, (data) => ResponseBean.fromJson(data));
if (bean.isSuccess()) { if (bean.isSuccess()) {
isLike = bean.data.is_follow; isLike = bean.data.isFollow;
isLikeFoMsg = isLikeFoMsg =
"${bean.data.imageUrgeCount}位圈友感兴趣,其中${bean.data.likeMeCount}位已催您更新"; "${bean.data.imageUrgeCount}位圈友感兴趣,其中${bean.data.likeMeCount}位已催您更新";
userInfoBean = bean.data!.user; userInfoBean = bean.data!.user;
isVip = userInfoBean!.vip; isVip = userInfoBean!.vip;
imId = bean.data.account_id; imId = bean.data.accountId;
onLineCity = userInfoBean!.isOnline == true ? "在线" : "离线"; onLineCity = userInfoBean!.isOnline == true ? "在线" : "离线";
if (userInfoBean!.city != null) { if (userInfoBean!.city != null) {
onLineCity = "$onLineCity·${userInfoBean!.city}"; onLineCity = "$onLineCity·${userInfoBean!.city}";
@ -123,7 +123,7 @@ class UserinfoLogic extends GetxController {
//} //}
} }
update(); update();
SmartDialog.dismiss();
var data = var data =
await DioManager.instance.get(url: Api.getqiniuToken, params: {}); await DioManager.instance.get(url: Api.getqiniuToken, params: {});
var bean = BaseResponse<QnTokenData>.fromJson( var bean = BaseResponse<QnTokenData>.fromJson(
@ -209,7 +209,7 @@ class UserinfoLogic extends GetxController {
update(); update();
} }
}); });
} catch (e) {} } catch (_) {}
} }
} }
@ -300,23 +300,23 @@ class ResponseBean {
UserBean user; UserBean user;
int likeMeCount; int likeMeCount;
int imageUrgeCount; int imageUrgeCount;
bool is_follow; bool isFollow;
String account_id; String accountId;
ResponseBean( ResponseBean(
{required this.user, {required this.user,
required this.likeMeCount, required this.likeMeCount,
required this.imageUrgeCount, required this.imageUrgeCount,
required this.account_id, required this.accountId,
required this.is_follow}); required this.isFollow});
factory ResponseBean.fromJson(Map<String, dynamic> json) { factory ResponseBean.fromJson(Map<String, dynamic> json) {
return ResponseBean( return ResponseBean(
account_id: json['account_id'], accountId: json['account_id'],
user: UserBean.fromJson(json['user']), user: UserBean.fromJson(json['user']),
likeMeCount: json['like_me_count'], likeMeCount: json['like_me_count'],
imageUrgeCount: json['image_urge_count'], imageUrgeCount: json['image_urge_count'],
is_follow: json['is_follow'], isFollow: json['is_follow'],
); );
} }
} }

View File

@ -86,7 +86,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
Positioned( Positioned(
bottom: 27.sp, bottom: 27.sp,
width: Get.width, width: Get.width,
child: _MeInfoButton(logic), child: _meInfoButton(logic),
), ),
], ],
), ),
@ -97,7 +97,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
Widget _MeInfoButton(UserinfoLogic controller) { Widget _meInfoButton(UserinfoLogic controller) {
if (controller.isMe) { if (controller.isMe) {
return const SizedBox(); return const SizedBox();
} else { } else {

View File

@ -23,19 +23,6 @@ class HomeCallOutView extends StatefulWidget {
} }
class _HomeCallOutViewState extends State<HomeCallOutView> { class _HomeCallOutViewState extends State<HomeCallOutView> {
List<String> genderList = ['', '女,' 'MTF', 'FTM', 'CD', '酷儿'];
List<String> orientationList = [
'异性恋',
'同性恋',
'双性恋',
'泛性恋',
'无性恋',
'智性恋',
'性单恋'
];
List<String> roleList = ['Sado', 'Maso', 'Dom', 'Sub', 'Switch'];
HomeCallOutLogic? listsLg; HomeCallOutLogic? listsLg;
@ -252,8 +239,12 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
Color(0xff8DFFF8), Color(0xff8DFFF8),
Color(0xffB5D3FF) Color(0xffB5D3FF)
])), ])),
child: Text( child: Text(
'${genderList[lists.user!.gender!]}.${lists.user!.age}.${roleList[lists.user!.role!]}.${orientationList[lists.user!.orientation!]}', getAgeCOntent(lists.user!.gender!, lists.user!.age!,
lists.user!.role!, lists.user!.orientation!),
// '${genderList[lists.user!.gender!]}.${lists.user!.age}.${roleList[lists.user!.role!]}.${orientationList[lists.user!.orientation!]}',
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 12.sp, fontSize: 12.sp,
@ -483,7 +474,9 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
Color(0xffB5D3FF) Color(0xffB5D3FF)
])), ])),
child: Text( child: Text(
'${genderList[lists.user!.gender!]}.${lists.user!.age}.${roleList[lists.user!.role!]}.${orientationList[lists.user!.orientation!]}', getAgeCOntent(lists.user!.gender!, lists.user!.age!,
lists.user!.role!, lists.user!.orientation!),
// '${genderList[lists.user!.gender!]}.${lists.user!.age}.${roleList[lists.user!.role!]}.${orientationList[lists.user!.orientation!]}',
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 12.sp, fontSize: 12.sp,

View File

@ -1,11 +1,19 @@
import 'dart:math'; import 'dart:math';
import 'package:alipay_kit/alipay_kit.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';
import 'package:get/get.dart'; import 'package:get/get.dart';
joiinCircileTipWdiget(String cicleId,String pirce,String oldPrice,String title) { import '../../network/api.dart';
import '../../network/dio_manager.dart';
import '../../util/PaymentUtils.dart';
import 'open_vip_tip/logic.dart';
bool isZfbPrice = true;
joiinCircileTipWdiget(String cicleId,String pirce,String oldPrice,String title,MyCallback myCallback) {
return StatefulBuilder(
builder:(BuildContext context, StateSetter setState) {
return Scaffold( return Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
body: Container( body: Container(
@ -14,7 +22,6 @@ joiinCircileTipWdiget(String cicleId,String pirce,String oldPrice,String title)
alignment: Alignment.center, alignment: Alignment.center,
child: child:
Stack( Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
Container( Container(
@ -60,8 +67,96 @@ joiinCircileTipWdiget(String cicleId,String pirce,String oldPrice,String title)
color: Color.fromRGBO(247, 250, 250, 0.8), color: Color.fromRGBO(247, 250, 250, 0.8),
fontSize: 12.sp)), fontSize: 12.sp)),
)), )),
Positioned(
bottom: 108.sp,
child: Container(
margin: EdgeInsets.only(top: 24.0.sp),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: () {
setState(() {
isZfbPrice = true;
});
},
child: Row(
children: [
Image.asset(
isZfbPrice
? getMineImage("icon_pay_select")
: getMineImage("icon_pay_is_no_select"),
width: 20.0.sp,
height: 20.0.sp,
),
SizedBox(width: 8.0.sp),
Image.asset(
getMineImage('icon_cooperate_ali'),
width: 20.0.sp,
height: 20.0.sp,
),
SizedBox(width: 4.0.sp),
Text(
'支付宝支付',
style: TextStyle(
color: Color(0xFFF7FAFA),
fontSize: 14.0.sp,
),
),
SizedBox(width: 4.0.sp),
Image.asset(
getMineImage('icon_recommend_pay_way'),
width: 32.0.sp,
height: 16.0.sp,
),
],
),
),
SizedBox(width: 24.0.sp),
GestureDetector(
onTap: () {
setState(() {
isZfbPrice = false;
});
},
child: Row(
children: [
Image.asset(
!isZfbPrice
? getMineImage("icon_pay_select")
: getMineImage("icon_pay_is_no_select"),
width: 20.0.sp,
height: 20.0.sp,
),
SizedBox(width: 8.0.sp),
Image.asset(
getMineImage('icon_cooperate_wx'),
width: 20.0.sp,
height: 20.0.sp,
),
SizedBox(width: 4.0.sp),
Text(
'微信支付',
style: TextStyle(
color: Color(0xFFF7FAFA),
fontSize: 14.0.sp,
),
),
],
),
),
],
),
),
),
Positioned( Positioned(
bottom: 18.sp, bottom: 18.sp,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
unlockingPayment(myCallback);
},
child: Container( child: Container(
width: 168.sp, width: 168.sp,
height: 42.sp, height: 42.sp,
@ -76,6 +171,7 @@ joiinCircileTipWdiget(String cicleId,String pirce,String oldPrice,String title)
'立即解锁', '立即解锁',
style: TextStyle(color: Colors.white, fontSize: 16.sp), style: TextStyle(color: Colors.white, fontSize: 16.sp),
), ),
),
)), )),
Positioned( Positioned(
bottom: 72.sp, bottom: 72.sp,
@ -110,12 +206,45 @@ joiinCircileTipWdiget(String cicleId,String pirce,String oldPrice,String title)
), ),
); );
});
} }
showJoinCiclePiker(String cicleId,String pirce,String oldPrice,int type) { unlockingPayment(MyCallback myCallback)async{
if (isZfbPrice) {
var data = await DioManager.instance.post(url: Api.postAliPayOrder, params: {
//"product_id": priceBean[index].id,
"type": 1});
var bean = BaseResponse<PayUrlBean>.fromJson(data, (data) => PayUrlBean.fromJson(data));
if(bean.isSuccess()){
var data = await AlipayKitPlatform.instance.pay(
orderInfo: bean.data.payUrl,
isShowLoading :true
);
}else {
showToast(bean.msg);
}
} else{
initWxApi();
var data = await DioManager.instance.post(url: Api.postWxOrder, params: {
// "product_id": priceBean[index].id,
"type": 1});
var bean = BaseResponse<PaymentData>.fromJson(data, (data) => PaymentData.fromJson(data));
if(bean.isSuccess()){
openWxPay(bean.data);
}else {
showToast(bean.msg);
}
}
}
typedef void MyCallback(bool payResult);
showJoinCiclePiker(String cicleId,String pirce,String oldPrice,int type,MyCallback payResult) {
String title = ['解锁圈子才能发布喊话','解锁圈子才能查看主页','解锁圈子才能主动私聊'][type]; String title = ['解锁圈子才能发布喊话','解锁圈子才能查看主页','解锁圈子才能主动私聊'][type];
return Get.bottomSheet( return Get.bottomSheet(
joiinCircileTipWdiget(cicleId,pirce,oldPrice,title), joiinCircileTipWdiget(cicleId,pirce,oldPrice,title,payResult),
isScrollControlled: true, isScrollControlled: true,
enableDrag: false enableDrag: false
); );

View File

@ -1,8 +1,143 @@
import 'dart:convert';
import 'package:alipay_kit/alipay_kit.dart';
import 'package:circle_app/util/util.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../../network/api.dart';
import '../../../network/dio_manager.dart';
import '../../../util/PaymentUtils.dart';
import 'state.dart'; import 'state.dart';
import 'package:fluwx/fluwx.dart' as fluwx;
class Open_vip_tipLogic extends GetxController { class Open_vip_tipLogic extends GetxController {
List<PriceBean> priceBean = [];
bool isZfbPrice = true;
@override
void onInit() async {
super.onInit();
var data = await DioManager.instance.get(url: Api.getVipPrice, params: {});
var vipPriceList = BaseResponse<List<PriceBean>>.fromJson(data, (data) =>
List<PriceBean>.from(data.map((item) => PriceBean.fromJson(item))),
);
priceBean = vipPriceList.data;
update();
}
int index = 0; int index = 0;
final Open_vip_tipState state = Open_vip_tipState(); final Open_vip_tipState state = Open_vip_tipState();
startPayment() async {
if (isZfbPrice) {
var data = await DioManager.instance.post(url: Api.postAliPayOrder, params: {"product_id": priceBean[index].id, "type": 2});
var bean = BaseResponse<PayUrlBean>.fromJson(data, (data) => PayUrlBean.fromJson(data));
if(bean.isSuccess()){
AlipayKitPlatform.instance.pay(
orderInfo: bean.data.payUrl,
isShowLoading :true
);
}else {
showToast(bean.msg);
}
} else{
initWxApi();
var data = await DioManager.instance.post(url: Api.postWxOrder, params: {"product_id": priceBean[index].id, "type": 2});
var bean = BaseResponse<PaymentData>.fromJson(data, (data) => PaymentData.fromJson(data));
if(bean.isSuccess()){
openWxPay(bean.data);
}else {
showToast(bean.msg);
}
}
}
}
//
void initWxApi() {
fluwx.registerWxApi(
appId: "wx6c6f4c89465dac4b",
universalLink: "dcc5bd5012a417eb585684700fbd1307",
);
}
class PayUrlBean {
String payUrl;
PayUrlBean({
required this.payUrl,
});
factory PayUrlBean.fromJson(Map<String, dynamic> json) {
return PayUrlBean(
payUrl: json['pay_url'],
);
}
}
class PaymentData {
String appId;
String mchId;
String nonceStr;
String sign;
String prepayId;
String packageX;
String timestamp;
PaymentData({
required this.appId,
required this.mchId,
required this.nonceStr,
required this.sign,
required this.prepayId,
required this.packageX,
required this.timestamp,
});
factory PaymentData.fromJson(Map<String, dynamic> json) {
return PaymentData(
appId: json['appid'],
mchId: json['mchId'],
nonceStr: json['nonceStr'],
sign: json['sign'],
prepayId: json['prepayId'],
packageX: json['packageX'],
timestamp: json['timestamp'],
);
}
}
class PriceBean {
int id;
String title;
double amount;
double oldAmount;
String iosItem;
PriceBean({
required this.id,
required this.title,
required this.amount,
required this.oldAmount,
required this.iosItem,
});
factory PriceBean.fromJson(Map<String, dynamic> json) {
return PriceBean(
id: json['id'],
title: json['title'],
amount: json['amount'].toDouble(),
oldAmount: json['old_amount'].toDouble(),
iosItem: json['ios_item'],
);
}
} }

View File

@ -14,7 +14,8 @@ class Open_vip_tipPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
List vipFuncList = ["身份标识", List vipFuncList = [
"身份标识",
"专属客服", "专属客服",
"无限畅聊", "无限畅聊",
"至尊喊话", "至尊喊话",
@ -22,16 +23,20 @@ class Open_vip_tipPage extends StatelessWidget {
"视频私聊", "视频私聊",
"看谁喜欢你", "看谁喜欢你",
"看谁看过你", "看谁看过你",
"缘分匹配"]; "缘分匹配"
];
List vipDescList = ['会员专属,更显尊贵',"给您更加贴心的服务", List vipDescList = [
'会员专属,更显尊贵',
"给您更加贴心的服务",
"可以随心所欲畅聊", "可以随心所欲畅聊",
"发布的喊话在圈内凸显", "发布的喊话在圈内凸显",
"聊天可以一直使用图片", "聊天可以一直使用图片",
"聊天可以一直使用视频", "聊天可以一直使用视频",
"看到所有喜欢你的人", "看到所有喜欢你的人",
"看到所有看过你的人", "看到所有看过你的人",
"为您匹配更合适的人"]; "为您匹配更合适的人"
];
// for (int i = 1; i < 10; i++) { // for (int i = 1; i < 10; i++) {
// //
// } // }
@ -39,13 +44,13 @@ class Open_vip_tipPage extends StatelessWidget {
return GetBuilder(builder: (Open_vip_tipLogic controller) { return GetBuilder(builder: (Open_vip_tipLogic controller) {
return Scaffold( return Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
body: Container( body: SizedBox(
width: Get.width, width: Get.width,
height: Get.height, height: Get.height,
child: Center( child: Center(
child: Container( child: Container(
width: 339.sp, width: 339.sp,
height: 453.sp, height: 483.sp,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
fit: BoxFit.fill, fit: BoxFit.fill,
@ -89,26 +94,114 @@ class Open_vip_tipPage extends StatelessWidget {
color: Color(0x99FFFFFF), color: Color(0x99FFFFFF),
size: 4.sp, size: 4.sp,
activeColor: Color(0xFF00FFD2), activeColor: Color(0xFF00FFD2),
activeSize: 4.sp activeSize: 4.sp)), //
)
),//
), ),
)), )),
Positioned( Positioned(
top: 227.sp, top: 227.sp,
child: Container( child: controller.priceBean.isEmpty
? Container()
: Container(
width: 339.sp, width: 339.sp,
padding: EdgeInsets.only(left: 17.sp, right: 17.sp), padding:
EdgeInsets.only(left: 17.sp, right: 17.sp),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
typeItem(controller, controller.index == 0, 0), typeItem(
typeItem(controller, controller.index == 1, 1), controller, controller.index == 0, 0),
typeItem(controller, controller.index == 2, 2), typeItem(
controller, controller.index == 1, 1),
typeItem(
controller, controller.index == 2, 2),
], ],
))), ))),
Positioned(
bottom: 108.sp,
child: Container(
margin: EdgeInsets.only(top: 24.0.sp),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: () {
//
controller.isZfbPrice = true;
controller.update();
},
child: Row(
children: [
Image.asset(
controller.isZfbPrice?
getMineImage("icon_pay_select"): getMineImage("icon_pay_is_no_select"),
width: 20.0.sp,
height: 20.0.sp,
),
SizedBox(width: 8.0.sp),
Image.asset(
getMineImage('icon_cooperate_ali'),
width: 20.0.sp,
height: 20.0.sp,
),
SizedBox(width: 4.0.sp),
Text(
'支付宝支付',
style: TextStyle(
color: Color(0xFFF7FAFA),
fontSize: 14.0.sp,
),
),
SizedBox(width: 4.0.sp),
Image.asset(
getMineImage('icon_recommend_pay_way'),
width: 32.0.sp,
height: 16.0.sp,
),
],
),
),
SizedBox(width: 24.0.sp),
GestureDetector(
onTap: () {
controller.isZfbPrice = false;
controller.update();
},
child: Row(
children: [
Image.asset(
!controller.isZfbPrice?
getMineImage("icon_pay_select"): getMineImage("icon_pay_is_no_select"),
width: 20.0.sp,
height: 20.0.sp,
),
SizedBox(width: 8.0.sp),
Image.asset(
getMineImage('icon_cooperate_wx'),
width: 20.0.sp,
height: 20.0.sp,
),
SizedBox(width: 4.0.sp),
Text(
'微信支付',
style: TextStyle(
color: Color(0xFFF7FAFA),
fontSize: 14.0.sp,
),
),
],
),
),
],
),
)),
Positioned( Positioned(
bottom: 48.sp, bottom: 48.sp,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
controller.startPayment();
},
child: Container( child: Container(
width: 168.sp, width: 168.sp,
height: 42.sp, height: 42.sp,
@ -127,7 +220,7 @@ class Open_vip_tipPage extends StatelessWidget {
style: style:
TextStyle(color: Colors.white, fontSize: 16.sp), TextStyle(color: Colors.white, fontSize: 16.sp),
), ),
)), ),)),
Positioned( Positioned(
bottom: 17.sp, bottom: 17.sp,
child: Container( child: Container(
@ -164,6 +257,8 @@ class Open_vip_tipPage extends StatelessWidget {
} }
typeItem(Open_vip_tipLogic controller, bool isSelected, int index) { typeItem(Open_vip_tipLogic controller, bool isSelected, int index) {
double pricePerDay = controller.priceBean[index].amount / 30;
String formattedPricePerDay = '${pricePerDay.toStringAsFixed(2)}元/天';
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
controller.index = index; controller.index = index;
@ -191,25 +286,25 @@ class Open_vip_tipPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
Text( Text(
'3个月', controller.priceBean[index].title,
style: TextStyle(color: Colors.white, fontSize: 14.sp), style: TextStyle(color: Colors.white, fontSize: 14.sp),
), ),
Text( Text(
'0.67元/天', formattedPricePerDay,
style: TextStyle(color: Colors.white, fontSize: 14.sp), style: TextStyle(color: Colors.white, fontSize: 14.sp),
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
'58元', controller.priceBean[index].amount.toString(),
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(
'388元', "${controller.priceBean[index].oldAmount}",
style: TextStyle( style: TextStyle(
color: Colors.white70, color: Colors.white70,
fontSize: 10.sp, fontSize: 10.sp,
@ -222,6 +317,13 @@ class Open_vip_tipPage extends StatelessWidget {
], ],
), ),
), ),
controller.priceBean[index].title=="年度会员"? Positioned(
top: 0.sp,
left: 0.sp,
child: Image.asset(getMineImage("icon_yean_vip")),
width: 44.sp,
height: 18.sp,
) :Container()
], ],
)); ));
} }

View File

@ -24,6 +24,24 @@ class Api {
static const getCircleList = 'user-service/app/config'; static const getCircleList = 'user-service/app/config';
//vip价格
static const getVipPrice = 'mall-service/vips';
//
static const postAliPayOrder = 'mall-service/alipay/order';
//
static const postWxOrder = 'mall-service/wxpay/order';
//token //token
static const refreshToken = 'user-service/login/token/refresh'; static const refreshToken = 'user-service/login/token/refresh';

View File

@ -39,9 +39,9 @@ class DioManager {
// //
baseUrl: baseUrl, baseUrl: baseUrl,
// //
connectTimeout: Duration(seconds: 30000000000), connectTimeout: const Duration(seconds: 300),
// //
receiveTimeout: Duration(seconds: 30000000000), receiveTimeout: const Duration(seconds: 300),
)); ));
_dio!.interceptors.add(LogInterceptor(responseBody: true)); _dio!.interceptors.add(LogInterceptor(responseBody: true));
// _dio!.interceptors.add(ConnectivityInterceptor()); // _dio!.interceptors.add(ConnectivityInterceptor());
@ -175,7 +175,7 @@ class DioManager {
'Imei': await getImei(), 'Imei': await getImei(),
'Brand': await getBrand(), 'Brand': await getBrand(),
}); });
print(">>>>>"+params.toString()); print(">>>>>$params");
/// ,. /// ,.
/// get queryParameters data. FormData data /// get queryParameters data. FormData data

View File

@ -0,0 +1,32 @@
import 'package:circle_app/util/util.dart';
import '../common/Widgets/open_vip_tip/logic.dart';
import 'package:fluwx/fluwx.dart' as fluwx;
//
Future<void> openWxPay(PaymentData data) async {
//
bool isInstalled = await fluwx.isWeChatInstalled;
if (!isInstalled) {
showToast("请先安装微信");
return;
}
//
fluwx.payWithWeChat(
appId: data.appId,
partnerId: data.mchId,
prepayId: data.prepayId,
packageValue: data.packageX,
nonceStr: data.nonceStr,
timeStamp: int.parse(data.timestamp),
sign: data.sign,
);
//
fluwx.weChatResponseEventHandler.listen((event) {
if(event.isSuccessful) {
showToast("微信支付成功");
} else {
showToast(event.errStr??"微信支付成功");
}
});
}

View File

@ -0,0 +1,40 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../util/util.dart';
class ExitAppConfirmation extends StatefulWidget {
final Widget child;
ExitAppConfirmation({required this.child});
@override
_ExitAppConfirmationState createState() => _ExitAppConfirmationState();
}
class _ExitAppConfirmationState extends State<ExitAppConfirmation> {
DateTime? _lastPressed;
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: _onBackPressed,
child: widget.child,
);
}
Future<bool> _onBackPressed() {
final currentTime = DateTime.now();
if (_lastPressed == null ||
currentTime.difference(_lastPressed!) > Duration(seconds: 2)) {
_lastPressed = currentTime;
// ScaffoldMessenger.of(context).showSnackBar(
// const SnackBar(content: Text('再按一次返回键退出应用')),
// );
showToast("再按一次返回键退出应用");
return Future.value(false);
}
return Future.value(true);
}
}

View File

@ -1,10 +0,0 @@
import 'package:get/get.dart';
import 'logic.dart';
class HometabBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut(() => HometabLogic());
}
}

View File

@ -1,7 +0,0 @@
import 'package:get/get.dart';
import 'state.dart';
class HometabLogic extends GetxController {
final HometabState state = HometabState();
}

View File

@ -1,5 +0,0 @@
class HometabState {
HometabState() {
///Initialize variables
}
}

View File

@ -1,51 +0,0 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:circle_app/app/minefragment/view.dart';
import 'logic.dart';
class HometabPage extends StatefulWidget {
HometabPage({Key? key}) : super(key: key);
// final logic = Get.find<HometabLogic>();
// final state = Get.find<HometabLogic>().state;
@override
_TabsState createState() => _TabsState();
}
class _TabsState extends State<HometabPage>{
int _currentIndex = 0;
List _pageList = [
MinefragmentPage(),
MinefragmentPage(),
MinefragmentPage(),
];
@override
Widget build(BuildContext context) {
// TODO: implement build
return Scaffold(
body: this._pageList[this._currentIndex],
bottomNavigationBar: BottomNavigationBar(
currentIndex: this._currentIndex,
onTap: (int index){
setState(() {
this._currentIndex = index;
});
},
iconSize: 30,
fixedColor: Colors.red,
type: BottomNavigationBarType.fixed,
items: [
BottomNavigationBarItem(icon: Icon(Icons.home),label: ''),
BottomNavigationBarItem(icon: Icon(Icons.home), label: ''),
BottomNavigationBarItem(icon: Icon(Icons.home), label: ''),
],
),
);
}
}

View File

@ -6,6 +6,7 @@ import FlutterMacOS
import Foundation import Foundation
import audioplayers_darwin import audioplayers_darwin
import connectivity_macos
import desktop_drop import desktop_drop
import device_info_plus_macos import device_info_plus_macos
import fc_native_video_thumbnail_for_us import fc_native_video_thumbnail_for_us
@ -18,10 +19,12 @@ import photo_manager
import shared_preferences_foundation import shared_preferences_foundation
import sqflite import sqflite
import url_launcher_macos import url_launcher_macos
import video_compress
import wakelock_macos import wakelock_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin")) AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin"))
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
DesktopDropPlugin.register(with: registry.registrar(forPlugin: "DesktopDropPlugin")) DesktopDropPlugin.register(with: registry.registrar(forPlugin: "DesktopDropPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FcNativeVideoThumbnailPlugin.register(with: registry.registrar(forPlugin: "FcNativeVideoThumbnailPlugin")) FcNativeVideoThumbnailPlugin.register(with: registry.registrar(forPlugin: "FcNativeVideoThumbnailPlugin"))
@ -34,5 +37,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
VideoCompressPlugin.register(with: registry.registrar(forPlugin: "VideoCompressPlugin"))
WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin")) WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin"))
} }

File diff suppressed because it is too large Load Diff

View File

@ -88,6 +88,10 @@ dependencies:
flutter_install_app: 1.3.0 flutter_install_app: 1.3.0
#网络拦截 #网络拦截
connectivity: ^3.0.6 connectivity: ^3.0.6
# 支付宝SDK插件
alipay_kit: 5.0.0
# 微信SDK插件
fluwx: ^3.8.1+1

View File

@ -10,6 +10,7 @@
#include <desktop_drop/desktop_drop_plugin.h> #include <desktop_drop/desktop_drop_plugin.h>
#include <fc_native_video_thumbnail_for_us/fc_native_video_thumbnail_for_us_plugin_c_api.h> #include <fc_native_video_thumbnail_for_us/fc_native_video_thumbnail_for_us_plugin_c_api.h>
#include <file_selector_windows/file_selector_windows.h> #include <file_selector_windows/file_selector_windows.h>
#include <geolocator_windows/geolocator_windows.h>
#include <pasteboard/pasteboard_plugin.h> #include <pasteboard/pasteboard_plugin.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h> #include <permission_handler_windows/permission_handler_windows_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h> #include <url_launcher_windows/url_launcher_windows.h>
@ -23,6 +24,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("FcNativeVideoThumbnailForUsPluginCApi")); registry->GetRegistrarForPlugin("FcNativeVideoThumbnailForUsPluginCApi"));
FileSelectorWindowsRegisterWithRegistrar( FileSelectorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorWindows")); registry->GetRegistrarForPlugin("FileSelectorWindows"));
GeolocatorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("GeolocatorWindows"));
PasteboardPluginRegisterWithRegistrar( PasteboardPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PasteboardPlugin")); registry->GetRegistrarForPlugin("PasteboardPlugin"));
PermissionHandlerWindowsPluginRegisterWithRegistrar( PermissionHandlerWindowsPluginRegisterWithRegistrar(

View File

@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
desktop_drop desktop_drop
fc_native_video_thumbnail_for_us fc_native_video_thumbnail_for_us
file_selector_windows file_selector_windows
geolocator_windows
pasteboard pasteboard
permission_handler_windows permission_handler_windows
url_launcher_windows url_launcher_windows