Browse Source

Merge remote-tracking branch 'origin/new_revision_app' into new_revision_app

dart3_last
fmk 2 years ago
parent
commit
880f489a70
  1. BIN
      assets/image/2x/mine_order.webp
  2. BIN
      assets/image/2x/mine_vip_logo.webp
  3. BIN
      assets/image/2x/set.webp
  4. BIN
      assets/image/2x/vip_code.webp
  5. BIN
      assets/image/2x/wallet.webp
  6. BIN
      assets/image/3x/mine_order.webp
  7. BIN
      assets/image/3x/mine_vip_logo.webp
  8. BIN
      assets/image/3x/set.webp
  9. BIN
      assets/image/3x/vip_code.webp
  10. BIN
      assets/image/3x/wallet.webp
  11. BIN
      assets/image/mine_order.webp
  12. BIN
      assets/image/mine_vip_logo.webp
  13. BIN
      assets/image/set.webp
  14. BIN
      assets/image/vip_code.webp
  15. BIN
      assets/image/wallet.webp
  16. 2
      lib/community/community_child_page.dart
  17. 113
      lib/community/community_details.dart
  18. 71
      lib/community/community_view/class_details.dart
  19. 12
      lib/community/community_view/class_details_video.dart
  20. 64
      lib/community/new_community_details.dart
  21. 4
      lib/home/welfare_exchange.dart
  22. 5
      lib/main.dart
  23. 13
      lib/message/system_message.dart
  24. 65
      lib/mine/mine_page.dart
  25. 8
      lib/mine/mine_view/community_follow.dart
  26. 2
      lib/mine/mine_view/mine_item.dart
  27. 301
      lib/mine/mine_view/mine_navbar.dart
  28. 137
      lib/mine/mine_view/mine_view.dart
  29. 623
      lib/mine/personal_page.dart
  30. 43
      lib/mine/scan_web.dart
  31. 253
      lib/mine/vip_pay_code.dart
  32. 2
      lib/order/exchange_order_page.dart
  33. 2
      lib/order/order_detail_page.dart
  34. 86
      lib/qr/qr_code_scan.dart
  35. 2
      lib/retrofit/min_api.dart
  36. 2
      lib/retrofit/retrofit_api.dart
  37. 6
      lib/setting/logout_ing.dart
  38. 2
      lib/settlement/settlement.dart
  39. 4
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  40. 2
      lib/settlement/settlement_view/settlement_order_commodity.dart
  41. 240
      lib/view_widget/mine_vip_entry.dart
  42. 5
      lib/view_widget/update_dialog.dart
  43. 3
      lib/vip/vip_view/vip_top.dart
  44. 65
      lib/web/web_page.dart
  45. 295
      lib/web/web_view/input_comment.dart
  46. 4
      pubspec.yaml

BIN
assets/image/2x/mine_order.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

BIN
assets/image/2x/mine_vip_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
assets/image/2x/set.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/2x/vip_code.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/2x/wallet.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
assets/image/3x/mine_order.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/3x/mine_vip_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
assets/image/3x/set.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
assets/image/3x/vip_code.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
assets/image/3x/wallet.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
assets/image/mine_order.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 B

BIN
assets/image/mine_vip_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 B

BIN
assets/image/set.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

BIN
assets/image/vip_code.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

BIN
assets/image/wallet.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 710 B

2
lib/community/community_child_page.dart

@ -213,6 +213,8 @@ class CommunityChildPageState extends State<CommunityChildPage>
setState(() {}); setState(() {});
}); });
setState(() {}); setState(() {});
// Navigator.of(context).pushNamed( '/router/eom');
}, },
); );
}, },

113
lib/community/community_details.dart

@ -1,3 +1,5 @@
import 'dart:ui';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
@ -15,6 +17,8 @@ import 'package:huixiang/web/web_view/comment_list.dart';
import 'package:huixiang/web/web_view/input_comment.dart'; import 'package:huixiang/web/web_view/input_comment.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../web/web_view/input_comment_o.dart';
class CommunityDetails extends StatefulWidget { class CommunityDetails extends StatefulWidget {
final Map<String, dynamic> arguments; final Map<String, dynamic> arguments;
@ -46,14 +50,23 @@ class _CommunityDetails extends State<CommunityDetails>
Article article; Article article;
String businessId; String businessId;
@override final GlobalKey inputKey = GlobalKey();
final TextEditingController commentTextController = TextEditingController();
bool emojiShowing = false;
static double keyboard_height=300;
double keyboard = -1;
bool needShowSmiley = false;
bool needHideSmiley = false;
void didChangeMetrics() { void didChangeMetrics() {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
// isKeyBoardShow = MediaQuery.of(context).viewInsets.bottom > 0;
if (!mounted) return; if (!mounted) return;
if (MediaQuery.of(context).viewInsets.bottom == 0) { if (MediaQuery.of(context).viewInsets.bottom == 0) {
if (isKeyBoardShow) { if (isKeyBoardShow) {
FocusScope.of(context).requestFocus(FocusNode()); FocusScope.of(context).requestFocus(FocusNode());
if (mounted) if (mounted)
if(!emojiShowing)
setState(() { setState(() {
hintText = S.current.liuxianinjingcaidepinglunba; hintText = S.current.liuxianinjingcaidepinglunba;
isKeyBoardShow = false; isKeyBoardShow = false;
@ -66,6 +79,18 @@ class _CommunityDetails extends State<CommunityDetails>
}); });
} }
}); });
if (needShowSmiley && window.viewInsets.bottom <= 0.1) {
needShowSmiley = false;
setState(() {
emojiShowing = true;
});
}
if(needHideSmiley && window.viewInsets.bottom > 0.1) {
needHideSmiley = false;
setState(() {
emojiShowing = false;
});
}
} }
@override @override
@ -74,11 +99,45 @@ class _CommunityDetails extends State<CommunityDetails>
// comunity = widget.arguments["comment"]; // comunity = widget.arguments["comment"];
businessId = widget.arguments["businessId"]; businessId = widget.arguments["businessId"];
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
commentFocus.addListener(_focusNodeListener);
_queryMemberCommentList(); _queryMemberCommentList();
queryDetails(businessId); queryDetails(businessId);
} }
void _focusNodeListener() {
/*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){
setState(() {
smileyPadGone = true;
});
}*/
}
_onTextFieldTap() {
if(emojiShowing) {
needHideSmiley = true;
}
}
_onSmileyTap() {
if(!emojiShowing && commentFocus.hasFocus && isKeyBoardShow) {
needShowSmiley = true;
commentFocus.unfocus();
} else {
setState(() {
emojiShowing = !emojiShowing;
isKeyBoardShow = emojiShowing;
});
}
}
@override
void dispose(){
WidgetsBinding.instance.removeObserver(this);
commentFocus.removeListener(_focusNodeListener);
super.dispose();
}
/// ///
queryDetails(id) async { queryDetails(id) async {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
@ -101,21 +160,31 @@ class _CommunityDetails extends State<CommunityDetails>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( double h = MediaQuery.of(context).viewInsets.bottom;
appBar: MyAppBar( if(h > 0 && keyboard <= 0) {
title: S.of(context).dongtaixiangqing, setState(() {
titleColor: Colors.black, keyboard = h;
titleSize: 18.sp, });
background: Colors.white, }
leading: true, return GestureDetector(
leadingColor: Colors.black, behavior: HitTestBehavior.translucent,
), onTap: () {
body: GestureDetector( setState(() {
behavior: HitTestBehavior.translucent, emojiShowing = false;
onTap: () { isKeyBoardShow = emojiShowing;
FocusScope.of(context).requestFocus(FocusNode()); FocusScope.of(context).requestFocus(FocusNode());
}, });
child: Container( },
child: Scaffold(
appBar: MyAppBar(
title: S.of(context).dongtaixiangqing,
titleColor: Colors.black,
titleSize: 18.sp,
background: Colors.white,
leading: true,
leadingColor: Colors.black,
),
body: Container(
child: Column( child: Column(
children: [ children: [
Expanded( Expanded(
@ -184,17 +253,22 @@ class _CommunityDetails extends State<CommunityDetails>
inputKey, inputKey,
hintText, hintText,
isKeyBoardShow, isKeyBoardShow,
keyboard_height,
keyboard,
emojiShowing,
commentFocus, commentFocus,
commentTextController, commentTextController,
_toComment, _toComment,
_onSmileyTap,
_onTextFieldTap,
_queryMemberComment, _queryMemberComment,
_queryInformationLikes, _queryInformationLikes,
isLike: article?.liked ?? false, isLike: article?.liked ?? false,
), ),
], ],
), ),
)), ),
); ));
} }
//// ////
@ -246,9 +320,6 @@ class _CommunityDetails extends State<CommunityDetails>
); );
} }
final GlobalKey inputKey = GlobalKey();
final TextEditingController commentTextController = TextEditingController();
contentHeight() { contentHeight() {
double contentHeight = MediaQuery.of(context).size.height - double contentHeight = MediaQuery.of(context).size.height -
kToolbarHeight - kToolbarHeight -
@ -290,7 +361,7 @@ class _CommunityDetails extends State<CommunityDetails>
Dio(), Dio(),
context: context, context: context,
token: sharedPreferences.getString("token"), token: sharedPreferences.getString("token"),
showLoading: false, showLoading: true,
); );
BaseData<PageInfo<MemberCommentList>> baseData = BaseData<PageInfo<MemberCommentList>> baseData =
await apiService.memberCommentList({ await apiService.memberCommentList({

71
lib/community/community_view/class_details.dart

@ -1,4 +1,5 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:ui';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -53,11 +54,17 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
int chapterIndex = 0; int chapterIndex = 0;
double height = 0; double height = 0;
var isShowMore = false; var isShowMore = false;
bool emojiShowing = false;
static double keyboard_height=300;
double keyboard = -1;
bool needShowSmiley = false;
bool needHideSmiley = false;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
commentFocus.addListener(_focusNodeListener);
courseDetails(widget.arguments["id"]); courseDetails(widget.arguments["id"]);
queryChapterList(widget.arguments["id"]); queryChapterList(widget.arguments["id"]);
} }
@ -70,6 +77,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token"),
showLoading: true
); );
} }
BaseData<List<Chapter>> baseData = BaseData<List<Chapter>> baseData =
@ -114,6 +122,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
if (isKeyBoardShow) { if (isKeyBoardShow) {
FocusScope.of(context).requestFocus(FocusNode()); FocusScope.of(context).requestFocus(FocusNode());
if (mounted) if (mounted)
if(!emojiShowing)
setState(() { setState(() {
hintText = S.current.liuxianinjingcaidepinglunba; hintText = S.current.liuxianinjingcaidepinglunba;
isKeyBoardShow = false; isKeyBoardShow = false;
@ -126,10 +135,61 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
}); });
} }
}); });
if (needShowSmiley && window.viewInsets.bottom <= 0.1) {
needShowSmiley = false;
setState(() {
emojiShowing = true;
});
}
if(needHideSmiley && window.viewInsets.bottom > 0.1) {
needHideSmiley = false;
setState(() {
emojiShowing = false;
});
}
}
void _focusNodeListener() {
/*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){
setState(() {
smileyPadGone = true;
});
}*/
}
_onTextFieldTap() {
if(emojiShowing) {
needHideSmiley = true;
}
}
_onSmileyTap() {
if(!emojiShowing && commentFocus.hasFocus && isKeyBoardShow) {
needShowSmiley = true;
commentFocus.unfocus();
} else {
setState(() {
emojiShowing = !emojiShowing;
isKeyBoardShow = emojiShowing;
});
}
}
@override
void dispose(){
WidgetsBinding.instance.removeObserver(this);
commentFocus.removeListener(_focusNodeListener);
super.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double h = MediaQuery.of(context).viewInsets.bottom;
if(h > 0 && keyboard <= 0) {
setState(() {
keyboard = h;
});
}
return AnnotatedRegion<SystemUiOverlayStyle>( return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light, value: SystemUiOverlayStyle.light,
child: Material( child: Material(
@ -137,7 +197,11 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
body: GestureDetector( body: GestureDetector(
behavior: HitTestBehavior.translucent, behavior: HitTestBehavior.translucent,
onTap: () { onTap: () {
FocusScope.of(context).requestFocus(FocusNode()); setState(() {
emojiShowing = false;
isKeyBoardShow = emojiShowing;
FocusScope.of(context).requestFocus(FocusNode());
});
}, },
child: Container( child: Container(
// margin: EdgeInsets.only(top:25), // margin: EdgeInsets.only(top:25),
@ -411,9 +475,14 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
inputKey, inputKey,
hintText, hintText,
isKeyBoardShow, isKeyBoardShow,
keyboard_height,
keyboard,
emojiShowing,
commentFocus, commentFocus,
commentTextController, commentTextController,
_toComment, _toComment,
_onSmileyTap,
_onTextFieldTap,
_queryMemberComment, _queryMemberComment,
_queryCourseLikes, _queryCourseLikes,
isLike: course?.selfLiked, isLike: course?.selfLiked,

12
lib/community/community_view/class_details_video.dart

@ -138,16 +138,16 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
? Container( ? Container(
color: Colors.black, color: Colors.black,
width: width, width: width,
// height: width / 7 * 5, height:MediaQuery.of(context).size.width / 1.5,
height: height, margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
child: chewies = Chewie( child: chewies = Chewie(
controller: chewieAudioController, controller: chewieAudioController,
), ),
) )
: Container( : Container(
width: width, width: width,
// height:width / 7 * 5, height:MediaQuery.of(context).size.width / 1.5,
height: height, margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
)), )),
if (widget.isShowImg) if (widget.isShowImg)
GestureDetector( GestureDetector(
@ -160,8 +160,8 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
}, },
child: Container( child: Container(
width: width, width: width,
// height: width / 7 * 5, height: MediaQuery.of(context).size.width / 1.5,
height: height, margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
color: Colors.black, color: Colors.black,
child: Stack( child: Stack(
children: [ children: [

64
lib/community/new_community_details.dart

@ -1,3 +1,4 @@
import 'dart:ui';
import 'dart:convert'; import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
@ -55,6 +56,11 @@ class _NewCommunityDetails extends State<NewCommunityDetails> with WidgetsBindin
Article article; Article article;
String commentsId; String commentsId;
String userId; String userId;
bool emojiShowing =false;
static double keyboard_height=300;
double keyboard = -1;
bool needShowSmiley = false;
bool needHideSmiley = false;
@override @override
void initState() { void initState() {
@ -62,6 +68,7 @@ class _NewCommunityDetails extends State<NewCommunityDetails> with WidgetsBindin
commentsId = widget.arguments["commentsId"]; commentsId = widget.arguments["commentsId"];
userId = widget.arguments["userId"]; userId = widget.arguments["userId"];
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
commentFocus.addListener(_focusNodeListener);
queryDetails(commentsId); queryDetails(commentsId);
} }
@ -105,6 +112,7 @@ class _NewCommunityDetails extends State<NewCommunityDetails> with WidgetsBindin
if (isKeyBoardShow) { if (isKeyBoardShow) {
FocusScope.of(context).requestFocus(FocusNode()); FocusScope.of(context).requestFocus(FocusNode());
if (mounted) if (mounted)
if(!emojiShowing)
setState(() { setState(() {
hintText = S.current.liuxianinjingcaidepinglunba; hintText = S.current.liuxianinjingcaidepinglunba;
isKeyBoardShow = false; isKeyBoardShow = false;
@ -117,10 +125,61 @@ class _NewCommunityDetails extends State<NewCommunityDetails> with WidgetsBindin
}); });
} }
}); });
if (needShowSmiley && window.viewInsets.bottom <= 0.1) {
needShowSmiley = false;
setState(() {
emojiShowing = true;
});
}
if(needHideSmiley && window.viewInsets.bottom > 0.1) {
needHideSmiley = false;
setState(() {
emojiShowing = false;
});
}
}
void _focusNodeListener() {
/*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){
setState(() {
smileyPadGone = true;
});
}*/
}
_onTextFieldTap() {
if(emojiShowing) {
needHideSmiley = true;
}
}
_onSmileyTap() {
if(!emojiShowing && commentFocus.hasFocus && isKeyBoardShow) {
needShowSmiley = true;
commentFocus.unfocus();
} else {
setState(() {
emojiShowing = !emojiShowing;
isKeyBoardShow = emojiShowing;
});
}
}
@override
void dispose(){
WidgetsBinding.instance.removeObserver(this);
commentFocus.removeListener(_focusNodeListener);
super.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double h = MediaQuery.of(context).viewInsets.bottom;
if(h > 0 && keyboard <= 0) {
setState(() {
keyboard = h;
});
}
return WillPopScope( return WillPopScope(
onWillPop: () async { onWillPop: () async {
Navigator.of(context).pop(true); Navigator.of(context).pop(true);
@ -312,9 +371,14 @@ class _NewCommunityDetails extends State<NewCommunityDetails> with WidgetsBindin
inputKey, inputKey,
hintText, hintText,
isKeyBoardShow, isKeyBoardShow,
keyboard_height,
keyboard,
emojiShowing,
commentFocus, commentFocus,
commentTextController, commentTextController,
_toComment, _toComment,
_onSmileyTap,
_onTextFieldTap,
_queryMemberComment, _queryMemberComment,
_queryInformationLikes, _queryInformationLikes,
isLike: article?.liked ?? false, isLike: article?.liked ?? false,

4
lib/home/welfare_exchange.dart

@ -166,7 +166,7 @@ class _WelfareExchange extends State<WelfareExchange>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.white,
body: NestedScrollView( body: NestedScrollView(
headerSliverBuilder: (context, inner) { headerSliverBuilder: (context, inner) {
return [ return [
@ -265,7 +265,7 @@ class _WelfareExchange extends State<WelfareExchange>
body: SmartRefresher( body: SmartRefresher(
controller: refreshController, controller: refreshController,
enablePullDown: true, enablePullDown: true,
enablePullUp: false, enablePullUp: true,
physics: ClampingScrollPhysics(), physics: ClampingScrollPhysics(),
header: MyHeader(), header: MyHeader(),
footer: CustomFooter( footer: CustomFooter(

5
lib/main.dart

@ -111,6 +111,7 @@ import 'mine/mine_vip/legal_right_details.dart';
import 'mine/mine_vip/mine_attainment_page.dart'; import 'mine/mine_vip/mine_attainment_page.dart';
import 'mine/mine_vip/mine_vip_core.dart'; import 'mine/mine_vip/mine_vip_core.dart';
import 'mine/scan_web.dart'; import 'mine/scan_web.dart';
import 'mine/vip_pay_code.dart';
import 'order/bargain_group_order.dart'; import 'order/bargain_group_order.dart';
import 'mine/personal_page.dart'; import 'mine/personal_page.dart';
import 'order/exchange_write_off_page.dart'; import 'order/exchange_write_off_page.dart';
@ -349,7 +350,7 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/qr_share': (context, {arguments}) => QrSharePage(), '/router/qr_share': (context, {arguments}) => QrSharePage(),
'/router/main_page': (context, {arguments}) => MainPage(arguments: arguments), '/router/main_page': (context, {arguments}) => MainPage(arguments: arguments),
'/router/test_page': (context, {arguments}) => TestPage(), '/router/test_page': (context, {arguments}) => TestPage(),
'/router/communityFollow': (context, {arguments}) => CommunityFollow(), '/router/communityFollow': (context, {arguments}) => CommunityFollow(arguments:arguments),
'/router/releasePage': (context, {arguments}) => ReleasePage(), '/router/releasePage': (context, {arguments}) => ReleasePage(),
'/router/activity_list': (context, {arguments}) => ActivityList(), '/router/activity_list': (context, {arguments}) => ActivityList(),
'/router/class_details': (context, {arguments}) => '/router/class_details': (context, {arguments}) =>
@ -420,4 +421,6 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
HelpFarmersPage(), HelpFarmersPage(),
'/router/scan_web': (context, {arguments}) => '/router/scan_web': (context, {arguments}) =>
ScanWeb(arguments:arguments), ScanWeb(arguments:arguments),
'/router/vip_pay_code': (context, {arguments}) =>
VipPayCode(),
}; };

13
lib/message/system_message.dart

@ -124,12 +124,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return Scaffold(
onWillPop: () async {
Navigator.of(context).pop(true);
return false;
},
child:Scaffold(
appBar: MyAppBar( appBar: MyAppBar(
background: Colors.white, background: Colors.white,
leadingColor: Colors.black, leadingColor: Colors.black,
@ -139,7 +134,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
actions: [ actions: [
Container( Container(
margin: EdgeInsets.only(right: 16.w), margin: EdgeInsets.only(right: 16.w),
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
@ -147,7 +142,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
}); });
}, },
child: Text( child: Text(
S.of(context).biaojiweiyidu, S.of(context).biaoweiyidu,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight:MyFontWeight.semi_bold, fontWeight:MyFontWeight.semi_bold,
@ -192,7 +187,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
), ),
), ),
)); );
} }
Widget newsSurvey(){ Widget newsSurvey(){

65
lib/mine/mine_page.dart

@ -8,6 +8,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/main.dart'; import 'package:huixiang/main.dart';
import 'package:huixiang/mine/mine_view/mine_calendar.dart'; import 'package:huixiang/mine/mine_view/mine_calendar.dart';
import 'package:huixiang/mine/mine_view/mine_navbar.dart';
import 'package:huixiang/mine/mine_view/mine_order.dart'; import 'package:huixiang/mine/mine_view/mine_order.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/examine_instance.dart'; import 'package:huixiang/retrofit/data/examine_instance.dart';
@ -26,6 +27,8 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/coupon.dart';
import '../retrofit/data/page.dart';
import '../utils/flutter_utils.dart'; import '../utils/flutter_utils.dart';
import 'mine_view/mine_item.dart'; import 'mine_view/mine_item.dart';
import 'mine_view/mine_view.dart'; import 'mine_view/mine_view.dart';
@ -46,6 +49,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
SocialInfo infoNumber; SocialInfo infoNumber;
final RefreshController _refreshController = RefreshController(); final RefreshController _refreshController = RefreshController();
int totalMsg = 0; int totalMsg = 0;
String couponNum;
_toUserInfo() async { _toUserInfo() async {
SharedPreferences shared = await SharedPreferences.getInstance(); SharedPreferences shared = await SharedPreferences.getInstance();
@ -74,6 +78,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
super.initState(); super.initState();
querySocialInfo(); querySocialInfo();
queryMsgStats(); queryMsgStats();
// queryCard();
eventBus.on<EventType>().listen((event) { eventBus.on<EventType>().listen((event) {
print("EventType: ${event.type}"); print("EventType: ${event.type}");
@ -113,6 +118,22 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
ranks.addAll(rankData.data); ranks.addAll(rankData.data);
} }
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCard({
"centre": true,
"pageNum": 1,
"pageSize": 10,
"searchKey": "",
"state": 1
}).catchError((error) {
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
couponNum = baseData.data.total;
_refreshController.refreshCompleted();
} else {
_refreshController.refreshFailed();
}
BaseData<UserInfo> baseDate = BaseData<UserInfo> baseDate =
await apiService.queryInfo().catchError((onError) { await apiService.queryInfo().catchError((onError) {
_refreshController.refreshFailed(); _refreshController.refreshFailed();
@ -203,14 +224,13 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
child: Stack( child: Stack(
// alignment: Alignment.centerRight,
children: [ children: [
Container( Container(
height: 502.h, height: 306.h,
decoration: BoxDecoration( decoration: BoxDecoration(
// color: Color(0xFF32A060) // color: Color(0xFF32A060)
image: DecorationImage( image: DecorationImage(
fit: BoxFit.cover, fit: BoxFit.fill,
image: AssetImage("assets/image/settlement_bg.webp"), image: AssetImage("assets/image/settlement_bg.webp"),
), ),
), ),
@ -229,21 +249,34 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
setState(() { setState(() {
totalMsg = 0; totalMsg = 0;
}); });
}, totalMsg, infoNumber), }, totalMsg,
infoNumber,
ranks
),
/// VIP等级信息 //////
MineVipEntry( MineNavbar(
tag: "vip", couponNum,
ranks: ranks, userInfo,
userInfo: userInfo, infoNumber,
rank: double.tryParse(userInfo?.expendAmount ?? "0") () {
.toInt(), toIntegralPage();
rankMax: userInfo?.memberRankVo?.nextOrigin ?? 0, },
createTime: userInfo?.createTime ?? "",
), ),
/// VIP等级信息
// MineVipEntry(
// tag: "vip",
// ranks: ranks,
// userInfo: userInfo,
// rank: double.tryParse(userInfo?.expendAmount ?? "0")
// .toInt(),
// rankMax: userInfo?.memberRankVo?.nextOrigin ?? 0,
// createTime: userInfo?.createTime ?? "",
// ),
/// ///
MineOrderView(), // MineOrderView(),
///广 ///广
spreadImage(), spreadImage(),
@ -287,7 +320,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
); );
}, },
child: Container( child: Container(
margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 15.h), margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 30.h),
padding: padding:
EdgeInsets.only(left: 12.w, top: 12.h, right: 10.w, bottom: 17.h), EdgeInsets.only(left: 12.w, top: 12.h, right: 10.w, bottom: 17.h),
width: double.infinity, width: double.infinity,
@ -389,7 +422,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
///广 ///广
Widget spreadImage() { Widget spreadImage() {
return Container( return Container(
margin: EdgeInsets.only(right: 14.w, bottom: 15.h, left: 14.w), margin: EdgeInsets.only(right: 14.w, bottom: 30.h, left: 14.w),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/invite_friends'); Navigator.of(context).pushNamed('/router/invite_friends');

8
lib/mine/mine_view/community_follow.dart

@ -14,6 +14,11 @@ import 'package:shared_preferences/shared_preferences.dart';
import '../fans_page.dart'; import '../fans_page.dart';
class CommunityFollow extends StatefulWidget { class CommunityFollow extends StatefulWidget {
final Map<String, dynamic> arguments;
CommunityFollow({this.arguments});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _CommunityFollow(); return _CommunityFollow();
@ -24,11 +29,13 @@ class _CommunityFollow extends State<CommunityFollow>
with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin { with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin {
ApiService apiService; ApiService apiService;
SocialInfo infoNumber; SocialInfo infoNumber;
int status;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
querySocialInfo(); querySocialInfo();
status = widget.arguments["status"];
} }
///(//) ///(//)
@ -51,6 +58,7 @@ class _CommunityFollow extends State<CommunityFollow>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return DefaultTabController( return DefaultTabController(
length: 2, length: 2,
initialIndex: status,
child: Scaffold( child: Scaffold(
appBar: MyAppBar( appBar: MyAppBar(
title: "", title: "",

2
lib/mine/mine_view/mine_item.dart

@ -20,7 +20,7 @@ class _MineItem extends State<MineItem> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
margin: EdgeInsets.fromLTRB(16.w,0.h, 16.w, 15.h), margin: EdgeInsets.fromLTRB(16.w,0.h, 16.w,30.h),
// padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h), // padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,

301
lib/mine/mine_view/mine_navbar.dart

@ -0,0 +1,301 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../retrofit/data/social_info.dart';
import '../../retrofit/data/user_info.dart';
class MineNavbar extends StatefulWidget {
final String couponNum;
final UserInfo userInfo;
final SocialInfo infoNumber;
final GestureTapCallback toIntegralPage;
MineNavbar(this.couponNum,this.userInfo,this.infoNumber,this.toIntegralPage);
@override
State<StatefulWidget> createState() {
return _MineNavbar();
}
}
class _MineNavbar extends State<MineNavbar> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.fromLTRB(13.5.w, 15.h, 13.5.w,30.h),
padding: EdgeInsets.only(
top: 26.h,
bottom: 24.h,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(6),
boxShadow: [
BoxShadow(
color: Color(0x08213303).withAlpha(12),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
///
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed(
'/router/order_history_page',
arguments: {"status": 0});
});
},
child: mineTopItem(
S.of(context).dingdan,
"assets/image/mine_order.webp",
),
),
),
///
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/mine_wallet');
});
},
child: mineTopItem(
"钱包",
"assets/image/wallet.webp",
),
),
),
///
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/vip_pay_code');
});
},
child: mineTopItem(
"会员码",
"assets/image/vip_code.webp",
),
),
),
///
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/setting_page');
});
},
child: mineTopItem(
S.of(context).shezhi,
"assets/image/set.webp",
),
),
),
],
),
Container(
width: double.infinity,
margin: EdgeInsets.only(top:17.h,left: 16.w,right: 16.w,bottom: 27.h),
child: Flex(
children: List.generate(120, (_) {
return SizedBox(
width: 1,
height: 1,
child: DecoratedBox(
decoration: BoxDecoration(color: Color(0xFFEDEDED)),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
),
),
Row(
children: [
///
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/coupon_page');
});
},
child: mineBottomItem(
widget?.couponNum ?? "0",
S.of(context).youhuiquan,
),
),
),
///
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
widget.toIntegralPage();
});
},
child: mineBottomItem(
widget?.userInfo?.points?? "0",
"积分",
),
),
),
///
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/communityFollow',arguments: {
"status":0
});
});},
child: mineBottomItem(
"${widget?.infoNumber?.follow ?? "0"}",
S.of(context).guanzhu,
),
),
),
///
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/communityFollow',arguments: {
"status":1
});
});
},
child: mineBottomItem(
"${widget?.infoNumber?.fans ?? "0"}",
S.of(context).fensi,
),
),
),
],
)
],
),
);
}
///
Widget mineTopItem(text, icon) {
return Container(
color: Colors.white,
margin: EdgeInsets.symmetric(vertical: 6.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
icon,
width: 23,
height: 23,
),
SizedBox(
height: 5.h,
),
Text(
text,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 12.sp,
color: Color(0xFF0D0D0D),
),
),
],
),
);
}
///
Widget mineBottomItem(textTop, text) {
return Container(
color: Colors.white,
margin: EdgeInsets.symmetric(vertical: 6.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
textTop,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 18.sp,
color: Color(0xFF000000),
),
),
SizedBox(
height:11.h,
),
Text(
text,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 12.sp,
color: Color(0xFF4D4D4D),
),
),
],
),
);
}
}

137
lib/mine/mine_view/mine_view.dart

@ -3,12 +3,9 @@ import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_svg/svg.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/msg_stats.dart';
import 'package:huixiang/retrofit/data/social_info.dart'; import 'package:huixiang/retrofit/data/social_info.dart';
import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
@ -21,7 +18,9 @@ import 'package:huixiang/view_widget/request_permission.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:webview_flutter/webview_flutter.dart';
import '../../retrofit/data/rank.dart';
import '../../view_widget/mine_vip_entry.dart';
// import 'package:qrscan/qrscan.dart' as scanner; // import 'package:qrscan/qrscan.dart' as scanner;
class MineView extends StatefulWidget { class MineView extends StatefulWidget {
@ -31,9 +30,10 @@ class MineView extends StatefulWidget {
final Function messageZero; final Function messageZero;
final int totalMsg; final int totalMsg;
final SocialInfo infoNumber; final SocialInfo infoNumber;
final List<Rank> ranks;
MineView(this.userInfo, this.toUserInfo, this.toIntegralPage, MineView(this.userInfo, this.toUserInfo, this.toIntegralPage,
this.messageZero, this.totalMsg, this.infoNumber); this.messageZero, this.totalMsg, this.infoNumber,this.ranks);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -43,6 +43,7 @@ class MineView extends StatefulWidget {
class _MineView extends State<MineView> { class _MineView extends State<MineView> {
ApiService apiService; ApiService apiService;
String levelText = "普通用户";
/// ///
queryWiped(memberCouponId) async { queryWiped(memberCouponId) async {
@ -136,21 +137,21 @@ class _MineView extends State<MineView> {
), ),
), ),
), ),
InkWell( // InkWell(
onTap: () { // onTap: () {
Navigator.of(context).pushNamed('/router/setting_page'); // Navigator.of(context).pushNamed('/router/setting_page');
}, // },
child: Container( // child: Container(
padding: EdgeInsets.all(8.h), // padding: EdgeInsets.all(8.h),
margin: EdgeInsets.only(right: 12.w), // margin: EdgeInsets.only(right: 12.w),
child: Image.asset( // child: Image.asset(
"assets/image/icon_mine_setting.webp", // "assets/image/icon_mine_setting.webp",
width: 32, // width: 32,
height: 32, // height: 32,
color: Colors.white, // color: Colors.white,
), // ),
), // ),
), // ),
], ],
), ),
), ),
@ -215,6 +216,7 @@ class _MineView extends State<MineView> {
); );
return; return;
} }
String title = uri.queryParameters["title"];
if (result.toString().contains("http:") || if (result.toString().contains("http:") ||
result.toString().contains("https:")) { result.toString().contains("https:")) {
/// ///
@ -222,6 +224,7 @@ class _MineView extends State<MineView> {
'/router/scan_web', '/router/scan_web',
arguments: { arguments: {
"result": result, "result": result,
"title":title,
}, },
); );
} }
@ -259,21 +262,21 @@ class _MineView extends State<MineView> {
MImage( MImage(
widget.userInfo == null ? "" : widget.userInfo.headimg, widget.userInfo == null ? "" : widget.userInfo.headimg,
isCircle: true, isCircle: true,
width: 58, width: 60,
height: 58, height: 60,
fit: BoxFit.cover, fit: BoxFit.cover,
errorSrc: "assets/image/default_user.webp", errorSrc: "assets/image/default_user.webp",
fadeSrc: "assets/image/default_user.webp", fadeSrc: "assets/image/default_user.webp",
), ),
Positioned( // Positioned(
bottom: 0, // bottom: 0,
right: 2.w, // right: 2.w,
child: Image.asset( // child: Image.asset(
"assets/image/icon_mine_edit.webp", // "assets/image/icon_mine_edit.webp",
width: 17, // width: 17,
height: 17, // height: 17,
), // ),
), // ),
], ],
), ),
), ),
@ -336,34 +339,35 @@ class _MineView extends State<MineView> {
color: Color(0xFFFFFFFF), color: Color(0xFFFFFFFF),
), ),
) )
: Row( : mineVip(),
children: [ // Row(
Text( // children: [
"${S.of(context).guanzhu} ${widget?.infoNumber?.follow ?? "0"}", // Text(
style: TextStyle( // "${S.of(context).guanzhu} ${widget?.infoNumber?.follow ?? "0"}",
fontSize: 12.sp, // style: TextStyle(
fontWeight: MyFontWeight.regular, // fontSize: 12.sp,
fontFamily: 'JDZhengHT', // fontWeight: MyFontWeight.regular,
color: Color(0xFFFFFFFF), // fontFamily: 'JDZhengHT',
), // color: Color(0xFFFFFFFF),
), // ),
Container( // ),
width: 1.w, // Container(
height: 12.h, // width: 1.w,
margin: EdgeInsets.symmetric(horizontal: 3.w), // height: 12.h,
color: Color(0xFFFFFFFF), // margin: EdgeInsets.symmetric(horizontal: 3.w),
), // color: Color(0xFFFFFFFF),
Text( // ),
"${S.of(context).fensi} ${widget?.infoNumber?.fans ?? "0"}", // Text(
style: TextStyle( // "${S.of(context).fensi} ${widget?.infoNumber?.fans ?? "0"}",
fontSize: 12.sp, // style: TextStyle(
fontFamily: 'JDZhengHT', // fontSize: 12.sp,
fontWeight: MyFontWeight.regular, // fontFamily: 'JDZhengHT',
color: Color(0xFFFFFFFF), // fontWeight: MyFontWeight.regular,
), // color: Color(0xFFFFFFFF),
), // ),
], // ),
), // ],
// ),
], ],
), ),
), ),
@ -421,4 +425,19 @@ class _MineView extends State<MineView> {
), ),
); );
} }
Widget mineVip(){
return Container(
child: MineVipEntry(
tag: "vip",
ranks: widget.ranks,
userInfo: widget.userInfo,
rank: double.tryParse(widget.userInfo?.expendAmount ?? "0")
.toInt(),
rankMax: widget.userInfo?.memberRankVo?.nextOrigin ?? 0,
createTime: widget.userInfo?.createTime ?? "",
),
);
}
} }

623
lib/mine/personal_page.dart

@ -320,330 +320,333 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SmartRefresher( return Scaffold(
controller: refreshController, backgroundColor: Colors.white,
enablePullDown: true, body:SmartRefresher(
enablePullUp: true, controller: refreshController,
header: MyHeader(), enablePullDown: true,
footer: CustomFooter( enablePullUp: true,
builder: (context, mode) { header: MyHeader(),
return MyFooter(mode); footer: CustomFooter(
}, builder: (context, mode) {
), return MyFooter(mode);
onRefresh: _onRefresh, },
onLoading: () { ),
isLoadMore = true; onRefresh: _onRefresh,
setState(() { onLoading: () {
_onRefresh(); isLoadMore = true;
}); setState(() {
}, _onRefresh();
physics: BouncingScrollPhysics(), });
scrollController: scrollController, },
child: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Column( scrollController: scrollController,
mainAxisAlignment: MainAxisAlignment.spaceAround, child: SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.start, physics: BouncingScrollPhysics(),
children: [ child: Column(
Container( mainAxisAlignment: MainAxisAlignment.spaceAround,
height: 248.h, crossAxisAlignment: CrossAxisAlignment.start,
color: Color(0xFFFFFFFF), children: [
// color: Colors.red, Container(
child: Stack( height: 248.h,
// alignment: Alignment.bottomLeft, color: Color(0xFFFFFFFF),
children: [ // color: Colors.red,
Positioned( child: Stack(
top: 0, // alignment: Alignment.bottomLeft,
left: 0, children: [
bottom: 36.h, Positioned(
right: 0, top: 0,
child: Stack( left: 0,
alignment: Alignment.bottomRight, bottom: 36.h,
children: [ right: 0,
Container( child: Stack(
color: Colors.black, alignment: Alignment.bottomRight,
child: Opacity( children: [
opacity: 0.9, Container(
child: MImage( color: Colors.black,
memberInfor?.background ?? "", child: Opacity(
width: double.infinity, opacity: 0.9,
height: 260.h, child: MImage(
fit: BoxFit.cover, memberInfor?.background ?? "",
errorSrc: "assets/image/default_1.webp", width: double.infinity,
fadeSrc: "assets/image/default_1.webp", height: 260.h,
))), fit: BoxFit.cover,
Container( errorSrc: "assets/image/default_1.webp",
margin: EdgeInsets.only( fadeSrc: "assets/image/default_1.webp",
top: 50.h, left: 16.w, right: 16.w), ))),
alignment: Alignment.topLeft, Container(
decoration: BoxDecoration( margin: EdgeInsets.only(
color: Colors.transparent, top: 50.h, left: 16.w, right: 16.w),
), alignment: Alignment.topLeft,
child: Column( decoration: BoxDecoration(
mainAxisAlignment: MainAxisAlignment.spaceBetween, color: Colors.transparent,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
child: Image.asset(
"assets/image/integral_return.webp",
width: 24,
height: 24,
),
onTap: () {
Navigator.of(context).pop();
},
), ),
], child: Column(
), mainAxisAlignment: MainAxisAlignment.spaceBetween,
), crossAxisAlignment: CrossAxisAlignment.center,
if (memberId == "0") children: [
Positioned( GestureDetector(
bottom: 9.h, child: Image.asset(
right: 16.w, "assets/image/integral_return.webp",
child: GestureDetector( width: 24,
onTap: () { height: 24,
showImagePicker(); ),
}, onTap: () {
child: Container( Navigator.of(context).pop();
padding: EdgeInsets.only(left: 2, right: 2), },
width: 59.w,
height: 23.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: Color(0x80000000),
),
child: Text(
S.of(context).genghuanbeijing,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFFFFFFF),
), ),
), ],
), ),
), ),
), if (memberId == "0")
], Positioned(
), bottom: 9.h,
), right: 16.w,
homeInfo(), child: GestureDetector(
], onTap: () {
), showImagePicker();
), },
Container( child: Container(
color: Color(0xFFFFFFFF), padding: EdgeInsets.only(left: 2, right: 2),
margin: EdgeInsets.only(bottom: 30.h), width: 59.w,
child: Column( height: 23.h,
mainAxisAlignment: MainAxisAlignment.spaceAround, alignment: Alignment.center,
crossAxisAlignment: CrossAxisAlignment.start, decoration: BoxDecoration(
children: [ borderRadius: BorderRadius.circular(2),
Container( color: Color(0x80000000),
margin:
EdgeInsets.only(left: 86.w, top: 12.h, right: 16.w),
child: GestureDetector(
onTap: () {
setState(() {
isShrink = !isShrink;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
flex: 1,
child: Text(
memberId == "0"
? ((memberInfor?.signature == "")
? "还未编辑个性签名~"
: memberInfor?.signature ?? "")
: "个性签名: ${(memberInfor?.signature == "") ? "还未编辑个性签名~" : memberInfor?.signature ?? ""}",
overflow: isShrink
? TextOverflow.visible
: TextOverflow.ellipsis,
maxLines: isShrink ? 10 : 2,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
fontWeight: MyFontWeight.regular,
height: 1.5.h),
)),
Icon(
(isShrink != null && !isShrink)
? Icons.chevron_right
: Icons.keyboard_arrow_up,
color: Colors.black,
size: 18,
),
],
),
)),
Container(
margin: EdgeInsets.only(left: 16.w, right: 16.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {},
child: Container(
color: Colors.transparent,
padding: EdgeInsets.all(16),
child: Column(
children: [
Text(
memberInfor != null
? memberInfor.follow.toString()
: "0",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
height: 4.h,
),
Text(
S.of(context).guanzhu,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
)),
),
),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {},
child: Container(
color: Colors.transparent,
padding: EdgeInsets.all(16),
child: Column(
children: [
Text(
memberInfor != null
? memberInfor.fans.toString()
: "0",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
height: 4.h,
),
Text(
S.of(context).fensi,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
)),
),
),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {},
child: Container(
color: Colors.transparent,
padding: EdgeInsets.all(16),
child: Column(
children: [
Text(
(memberInfor?.trendTotal ?? 0)
.toString(),
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
),
), ),
SizedBox( child: Text(
height: 4.h, S.of(context).genghuanbeijing,
), overflow: TextOverflow.ellipsis,
Text(
S.of(context).dongtai,
style: TextStyle( style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Color(0xFFFFFFFF),
), ),
), ),
], ),
)), ),
), ),
],
), ),
Expanded( ),
homeInfo(),
],
),
),
Container(
color: Color(0xFFFFFFFF),
margin: EdgeInsets.only(bottom: 30.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin:
EdgeInsets.only(left: 86.w, top: 12.h, right: 16.w),
child: GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.opaque, onTap: () {
onTap: () {}, setState(() {
child: Container( isShrink = !isShrink;
color: Colors.transparent, });
padding: EdgeInsets.all(16), },
child: Column( child: Row(
children: [ mainAxisAlignment: MainAxisAlignment.start,
Text( crossAxisAlignment: CrossAxisAlignment.end,
(memberInfor?.gainLikeTotal ?? 0) children: [
.toString(), Expanded(
style: TextStyle( flex: 1,
color: Color(0xFF353535), child: Text(
fontSize: 16.sp, memberId == "0"
fontWeight: MyFontWeight.semi_bold, ? ((memberInfor?.signature == "")
), ? "还未编辑个性签名~"
), : memberInfor?.signature ?? "")
SizedBox( : "个性签名: ${(memberInfor?.signature == "") ? "还未编辑个性签名~" : memberInfor?.signature ?? ""}",
height: 4.h, overflow: isShrink
), ? TextOverflow.visible
Text( : TextOverflow.ellipsis,
S.of(context).huozan, maxLines: isShrink ? 10 : 2,
style: TextStyle( style: TextStyle(
color: Color(0xFF353535), fontSize: 12.sp,
fontSize: 12.sp, color: Color(0xFF868686),
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
), height: 1.5.h),
), )),
], Icon(
)), (isShrink != null && !isShrink)
), ? Icons.chevron_right
: Icons.keyboard_arrow_up,
color: Colors.black,
size: 18,
),
],
),
)),
Container(
margin: EdgeInsets.only(left: 16.w, right: 16.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {},
child: Container(
color: Colors.transparent,
padding: EdgeInsets.all(16),
child: Column(
children: [
Text(
memberInfor != null
? memberInfor.follow.toString()
: "0",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
height: 4.h,
),
Text(
S.of(context).guanzhu,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
)),
),
),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {},
child: Container(
color: Colors.transparent,
padding: EdgeInsets.all(16),
child: Column(
children: [
Text(
memberInfor != null
? memberInfor.fans.toString()
: "0",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
height: 4.h,
),
Text(
S.of(context).fensi,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
)),
),
),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {},
child: Container(
color: Colors.transparent,
padding: EdgeInsets.all(16),
child: Column(
children: [
Text(
(memberInfor?.trendTotal ?? 0)
.toString(),
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
height: 4.h,
),
Text(
S.of(context).dongtai,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
)),
),
),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {},
child: Container(
color: Colors.transparent,
padding: EdgeInsets.all(16),
child: Column(
children: [
Text(
(memberInfor?.gainLikeTotal ?? 0)
.toString(),
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
height: 4.h,
),
Text(
S.of(context).huozan,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
)),
),
),
],
), ),
], ),
), Container(
), margin: EdgeInsets.all(16),
Container( height: 1.h,
margin: EdgeInsets.all(16), color: Color(0xFFF7F7F7),
height: 1.h, ),
color: Color(0xFFF7F7F7), Padding(
padding: EdgeInsets.only(left: 16.w),
child: Text(
memberId != "0" ? "TA的动态" : "我的动态",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
)),
dynamicList(),
],
), ),
Padding( ),
padding: EdgeInsets.only(left: 16.w), ],
child: Text( )),
memberId != "0" ? "TA的动态" : "我的动态", )
style: TextStyle(
color: Color(0xFF353535),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
)),
dynamicList(),
],
),
),
],
)),
); );
} }
@ -670,7 +673,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
builder: (context) => PhotoViewGalleryScreen( builder: (context) => PhotoViewGalleryScreen(
images: [ images: [
(memberInfor?.headimg ?? "").isEmpty (memberInfor?.headimg ?? "").isEmpty
? "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg" ? "https://i.postimg.cc/Pq6vjfnw/default-1.webp"
: memberInfor?.headimg : memberInfor?.headimg
], //list ], //list
index: 0, //index index: 0, //index
@ -749,7 +752,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
isShowBtn: false, isShowBtn: false,
text: "目前暂无发布动态,要把开心的事讲出来哦~", text: "目前暂无发布动态,要把开心的事讲出来哦~",
fontSize: 16.sp, fontSize: 16.sp,
margin: EdgeInsets.only(left: 60.w, right: 60.w, bottom: 75.h), margin: EdgeInsets.only(left: 60.w, right: 60.w, bottom:80.h),
) )
: ListView.builder( : ListView.builder(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),

43
lib/mine/scan_web.dart

@ -1,12 +1,8 @@
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_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:webview_flutter/webview_flutter.dart'; import 'package:webview_flutter/webview_flutter.dart';
class ScanWeb extends StatefulWidget { class ScanWeb extends StatefulWidget {
@ -21,29 +17,42 @@ class ScanWeb extends StatefulWidget {
class _ScanWeb extends State<ScanWeb> { class _ScanWeb extends State<ScanWeb> {
var controller = new ScrollController(); var controller = new ScrollController();
WebViewController webViewController;
String result; String result;
String title;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
result = widget.arguments["result"]; result = widget.arguments["result"];
title = widget.arguments["title"];
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai);
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Scaffold(
margin: EdgeInsets.only(top:MediaQuery.of(context).padding.top), appBar: MyAppBar(
width: MediaQuery.of(context).size.width, title:title ?? "",
height: MediaQuery.of(context).size.height, titleColor: Colors.black,
alignment: Alignment.center, background: Colors.transparent,
child: leadingColor: Colors.black,
WebView( ),
initialUrl:result, body:
javascriptMode: JavascriptMode.unrestricted, WebView(
onPageFinished: (initialUrl){ initialUrl:result,
EasyLoading.dismiss(); javascriptMode: JavascriptMode.unrestricted,
}, onWebViewCreated: (WebViewController controller){
)); webViewController =controller;
},
onProgress: (int progress) async {
if(widget.arguments["title"] != null)
return;
title = await webViewController?.getTitle();
setState((){});
EasyLoading.dismiss();
},
),
);
} }
} }

253
lib/mine/vip_pay_code.dart

@ -0,0 +1,253 @@
import 'dart:convert';
import 'package:barcode_widget/barcode_widget.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bmflocation/flutter_bmflocation.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/product.dart';
import 'package:huixiang/retrofit/data/vip_card.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/scan.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/location.dart';
import 'package:huixiang/utils/painter_bg.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:qr_flutter/qr_flutter.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../retrofit/data/user_info.dart';
import '../view_widget/classic_header.dart';
class VipPayCode extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _VipPayCode();
}
}
class _VipPayCode extends State<VipPayCode> {
ApiService apiService;
@override
void dispose() {
super.dispose();
refreshController.dispose();
Location.getInstance().stopLocation();
}
@override
void initState() {
super.initState();
queryUser();
}
UserInfo userInfo;
final RefreshController refreshController = RefreshController();
bool vipCodeText = false;
///
queryUser() async {
try{
SharedPreferences value = await SharedPreferences.getInstance();
if (apiService == null)
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {
refreshController.refreshFailed();});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
setState(() {});
SharedPreferences.getInstance().then((value) => {
value.setString('user', jsonEncode(baseData.data)),
});
refreshController.refreshCompleted();
}else{
refreshController.refreshFailed();
}
}finally{
setState((){});
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
title: "会员码",
background: Colors.white,
titleColor: Colors.black,
brightness: Brightness.dark,
leadingColor: Colors.black,
),
body: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
onRefresh: () {
queryUser();
},
child: SingleChildScrollView(
child: Container(
color: Colors.white,
padding: EdgeInsets.only(top: 45.h),
child: Stack(
alignment: Alignment.topCenter,
children: [
Container(
padding: EdgeInsets.only(top: 50.h),
child: Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 14.w),
padding: EdgeInsets.only(top: 68.h, bottom: 16.h),
decoration: BoxDecoration(
color: Color(0xFF32A060),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 2),
blurRadius: 14,
spreadRadius: 0,
),
],
borderRadius: BorderRadius.circular(6),
),
child: Container(
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 2),
blurRadius: 14,
spreadRadius: 0,
),
],
borderRadius: BorderRadius.circular(6),
),
margin: EdgeInsets.symmetric(horizontal: 16.w),
padding: EdgeInsets.only(
top: 46.h, left:16.w, right: 15.w, bottom: 79.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
onTap: (){
setState(() {
vipCodeText = !vipCodeText;
});
},
child:
vipCodeText ? Text(
userInfo != null
? "${(userInfo?.vipNo ?? "").substring(0, 4)} "
"${(userInfo?.vipNo ?? "").substring(4, 8)} "
"${(userInfo?.vipNo ?? "").substring(8, 12)} "
"${(userInfo?.vipNo ?? "").substring(12, 16)} "
"${(userInfo?.vipNo ?? "").substring(16, (userInfo?.vipNo ?? "").length)}"
: "",
style: TextStyle(
fontSize: 14.sp,
wordSpacing: userInfo == null
? 10
: (MediaQuery.of(context).size.width - 64.w) /
((((userInfo?.vipNo ?? "")
.length) *
4)),
letterSpacing: userInfo == null
? 8
: (MediaQuery.of(context).size.width - 64.w) /
((((userInfo?.vipNo ?? "")
.length) *
4)),
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF353535),
),
)
:Text(
"轻触可查看会员码数字",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 13.sp,
color: Color(0xFFCACACA),
),
),
),
SizedBox(
height: 12.h,
),
BarcodeWidget(
barcode: Barcode.code128(useCode128C: true),
data:
userInfo != null ? userInfo?.vipNo : "",
height: 72.h,
color: Colors.black,
drawText: false,
),
SizedBox(
height: 16.h,
),
QrImage(
data: userInfo != null
? (userInfo?.vipNo ?? "")
: "",
version: QrVersions.auto,
size: 200.w,
gapless: true,
),
],
),
),
),
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(56),
color: Colors.white,
border: Border.all(
color: Colors.white,
width: 8.w,
),
),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(56),
color: Colors.white,
border: Border.all(
color: Color(0xFF32A060),
width: 2.w,
),
),
child: MImage(
userInfo?.headimg ?? "",
width: 80,
height: 80,
radius: BorderRadius.circular(56),
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
),
),
],
),
),
),
),
);
}
}

2
lib/order/exchange_order_page.dart

@ -878,7 +878,7 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
width: 10, width: 10,
), ),
Text( Text(
S.of(context).pingtaiyue, S.of(context).huixiangqianbao,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),

2
lib/order/order_detail_page.dart

@ -225,7 +225,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
payResult(BaseData baseData) async{ payResult(BaseData baseData) async{
await queryDetails(); await queryDetails();
Future.delayed(Duration(milliseconds: 400), () { Future.delayed(Duration(milliseconds: 800), () {
EasyLoading.dismiss(); EasyLoading.dismiss();
SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center); SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center);
}); });

86
lib/qr/qr_code_scan.dart

@ -57,31 +57,81 @@ class _QrCodeScanPage extends State<QrCodeScanPage> {
right: 0, right: 0,
), ),
Positioned( Positioned(
child: MyAppBar( child: Container(
title: "扫码", margin: EdgeInsets.only(left:12.w,right: 16.w,top: 16.h),
titleColor: Colors.white, child:Row(
leadingColor: Colors.white, mainAxisAlignment: MainAxisAlignment.spaceBetween,
brightness: Brightness.dark, crossAxisAlignment: CrossAxisAlignment.center,
background: Colors.transparent, children: [
action: Container( GestureDetector(
alignment: Alignment.center, behavior: HitTestBehavior.opaque,
margin: EdgeInsets.only(right: 16.w), onTap: (){
child: GestureDetector( Navigator.of(context).pop();
onTap: () { },
pickImage(); child: Container(
}, padding: EdgeInsets.symmetric(horizontal:10.w),
child: Text( alignment: Alignment.centerLeft,
S.of(context).xiangce, child: Image.asset(
"assets/image/return_left.webp",
fit: BoxFit.fill,
color: Colors.white,
),
),
),
Spacer(),
Expanded(child:Text(
S.of(context).saoma,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.white,
fontSize: 18.sp, fontSize: 18.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
pickImage();
},
child:Container(
padding: EdgeInsets.symmetric(horizontal:10.w),
child: Text(
S.of(context).xiangce,
style: TextStyle(
color: Colors.black,
fontSize: 18.sp,
fontWeight: FontWeight.bold,
),
),
),
), ),
), ],
), ),
), ),
top: 0, // MyAppBar(
// title: "扫码",
// titleColor: Colors.white,
// leadingColor: Colors.white,
// brightness: Brightness.dark,
// background: Colors.transparent,
// action: Container(
// alignment: Alignment.center,
// margin: EdgeInsets.only(right: 16.w),
// child: GestureDetector(
// onTap: () {
// pickImage();
// },
// child: Text(
// S.of(context).xiangce,
// style: TextStyle(
// color: Colors.black,
// fontSize: 18.sp,
// fontWeight: FontWeight.bold,
// ),
// ),
// ),
// ),
// ),
top:MediaQuery.of(context).padding.top,
left: 0, left: 0,
right: 0, right: 0,
), ),

2
lib/retrofit/min_api.dart

@ -26,7 +26,7 @@ import 'data/shopping_home_config.dart';
part 'min_api.g.dart'; part 'min_api.g.dart';
const localBaseUrl = "https://pos.api.lotus-wallet.com/app/";/// const localBaseUrl = "http://192.168.10.78:8765/app/";///
// const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";/// // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///
const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线

2
lib/retrofit/retrofit_api.dart

@ -64,7 +64,7 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
const localBaseUrl = "https://pos.platform.lotus-wallet.com/app/";/// const localBaseUrl = "http://192.168.10.78:8766/app/";///
// const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";/// // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///
const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线

6
lib/setting/logout_ing.dart

@ -422,7 +422,7 @@ class _LogoutIng extends State<LogoutIng> {
Padding( Padding(
padding: EdgeInsets.only(bottom: 13), padding: EdgeInsets.only(bottom: 13),
child: Text( child: Text(
(balance == "0.00" && money == "0.00") ? "由于当于帐号已注销,系统将自动退出登录":"您的平台余额及店铺余额未使用完!", (balance == "0.00" && money == "0.00") ? "由于当于帐号已注销,系统将自动退出登录":"您的回乡钱包余额及门店余额未使用完!",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
@ -434,7 +434,7 @@ class _LogoutIng extends State<LogoutIng> {
), ),
if(balance != "0.00" && money != "0.00" || balance != "0.00" || money != "0.00") if(balance != "0.00" && money != "0.00" || balance != "0.00" || money != "0.00")
Text( Text(
"${S.of(context).pingtaiyue}$money", "${S.of(context).huixiangqianbao}$money",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
@ -444,7 +444,7 @@ class _LogoutIng extends State<LogoutIng> {
), ),
if(balance != "0.00" && money != "0.00" || balance != "0.00" || money != "0.00") if(balance != "0.00" && money != "0.00" || balance != "0.00" || money != "0.00")
Text( Text(
"${S.of(context).dianpuyue}:¥ $balance", "${S.of(context).mendianyue}:¥ $balance",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,

2
lib/settlement/settlement.dart

@ -82,7 +82,7 @@ class _Settlement extends State<Settlement> {
int count1 = 0; int count1 = 0;
String productId; String productId;
bool orderButton = false; bool orderButton = false;
bool useVipPriceSelect = false; bool useVipPriceSelect = true;
bool showVipTips = false; bool showVipTips = false;
bool isRaiseChannel = false; bool isRaiseChannel = false;

4
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -47,7 +47,7 @@ class ActivityCouponRemarks extends StatefulWidget {
} }
class _ActivityCouponRemarks extends State<ActivityCouponRemarks> { class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
bool vipSelect = false; bool vipSelect = true;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -76,7 +76,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
if(!(widget?.settleOrderInfo?.isRaise ?? false)) if(!(widget?.settleOrderInfo?.isRaise ?? false) && (widget?.settleOrderInfo?.memberVO?.isVip ?? false))
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,

2
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -105,7 +105,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
); );
} }
if(widget.useVipPriceSelect ){ if(widget.useVipPriceSelect && widget.settleOrderInfo.memberVO.isVip && (!widget.settleOrderInfo.isRaise) && (widget?.settleOrderInfo?.discountAmount!= "0")){
widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠", widget?.settleOrderInfo?.discountAmount ?? "")); widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠", widget?.settleOrderInfo?.discountAmount ?? ""));
} }

240
lib/view_widget/mine_vip_entry.dart

@ -32,6 +32,9 @@ class MineVipEntry extends StatelessWidget {
String topLeft = ""; String topLeft = "";
String levelText = "普通用户"; String levelText = "普通用户";
Color logoColor = Color(0xFFCACACA);
Color levelTextColor = Color(0xFFCACACA);
Color levelTextBackdrop = Color(0xFFFFF8EC);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -54,109 +57,184 @@ class MineVipEntry extends StatelessWidget {
case 1: case 1:
{ {
levelText = "${S.of(context).yinkahuiyuan}"; levelText = "${S.of(context).yinkahuiyuan}";
logoColor = Color(0xFFA0C4E7);
levelTextColor = Color(0xFF61ABF3);
levelTextBackdrop = Color(0xFFC1DBF4);
break; break;
} }
case 2: case 2:
{ {
levelText = "${S.of(context).jinkahuiyuan}"; levelText = "${S.of(context).jinkahuiyuan}";
logoColor = Color(0xFFFBB43A);
levelTextColor = Color(0xFFFBB43A);
levelTextBackdrop = Color(0xFFFFECD2);
break; break;
} }
case 3: case 3:
{ {
levelText = "${S.of(context).gongchuanghuiyuan}"; levelText = "${S.of(context).gongchuanghuiyuan}";
logoColor = Color(0xFF352822);
levelTextColor = Color(0xFF92755D);
levelTextBackdrop = Color(0xFFFFECD2);
break; break;
} }
} }
Widget widget = Container( Widget widget = Container(
width: double.infinity, child: Row(
padding: EdgeInsets.only(top: 12.h, bottom: 22.h, left: 12.w, right: 12.w), children: [
margin: EdgeInsets.only(top: 23.h,left: 13.5.w,right: 13.5.w,bottom:15.h), Container(
decoration: BoxDecoration( padding: EdgeInsets.symmetric(horizontal:4.w,vertical: 3.h),
color: Color(0xFF3D3D5D), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6), color: logoColor,
boxShadow: [ borderRadius: BorderRadius.only(
BoxShadow( topLeft: Radius.circular(4),
color: Colors.black.withAlpha(12), bottomLeft: Radius.circular(4),),
offset: Offset(0, 3), boxShadow: [
blurRadius: 14, BoxShadow(
spreadRadius: 0, color: Color(0x08213303).withAlpha(12),
) offset: Offset(0, 2),
], blurRadius: 4,
), spreadRadius: 0,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Image.asset(
"assets/image/vip_logo.webp",
width: 24,
height: 24,
),
SizedBox(
width: 5.w,
), ),
Expanded(
child: Text(
levelText,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFFFEAD2)),
)),
Container(
padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h),
decoration: BoxDecoration(
color: Color(0xFFFFECD2),
borderRadius: BorderRadius.circular(10),
),
child: Text(
S.of(context).chakanquanyi,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF92755D),
),
),
)
], ],
), ),
SizedBox( child: Image.asset(
height: 16.h, "assets/image/mine_vip_logo.webp",
fit: BoxFit.cover,
width: 13.w,
height: 11.h,
), ),
Container( ),
height: 4.h, Container(
child: ClipRRect( padding: EdgeInsets.symmetric(horizontal:2.w,vertical:3.h),
borderRadius: BorderRadius.circular(6.5), decoration: BoxDecoration(
child: LinearProgressIndicator( color: levelTextBackdrop,
value: rankMax > (rank ?? 0) borderRadius: BorderRadius.only(
? ((vipLevel < curLevel) topRight: Radius.circular(4),
? rankMax / rankMax bottomRight: Radius.circular(4),),
: (rank ?? 0) / rankMax) boxShadow: [
: 0, BoxShadow(
backgroundColor: Color(0xFF222233), color: Color(0x08213303).withAlpha(12),
color: Color(0xFFFFECD2), offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
), ),
), ],
), ),
SizedBox( child:Row(
height: 8.h, children: [
Text(
levelText,
textAlign: TextAlign.center,
style: TextStyle(
color: levelTextColor,
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
Image.asset(
"assets/image/icon_right.webp",
fit: BoxFit.cover,
width: 8.w,
height: 8.h,
color: levelTextColor,
),
],
), ),
Text( )
rank > rankMax ],
? S.of(context).dangqiandengji ),
: "消费金额¥${rank.toStringAsFixed(2).toString()}${S.of(context).xiayidengji}还需¥${(rankMax - (rank ?? 0)).toStringAsFixed(2)}", );
style: TextStyle( // Container(
color: Color(0xFFFFEAD2), // width: double.infinity,
fontWeight: MyFontWeight.light, // padding: EdgeInsets.only(top: 12.h, bottom: 22.h, left: 12.w, right: 12.w),
fontFamily: 'JDZhengHT', // margin: EdgeInsets.only(top: 23.h,left: 13.5.w,right: 13.5.w,bottom:15.h),
fontSize: 14.sp, // decoration: BoxDecoration(
), // color: Color(0xFF3D3D5D),
) // borderRadius: BorderRadius.circular(6),
], // boxShadow: [
)); // BoxShadow(
// color: Colors.black.withAlpha(12),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0,
// )
// ],
// ),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// children: [
// Image.asset(
// "assets/image/vip_logo.webp",
// width: 24,
// height: 24,
// ),
// SizedBox(
// width: 5.w,
// ),
// Expanded(
// child: Text(
// levelText,
// style: TextStyle(
// fontSize: 16.sp,
// fontWeight: MyFontWeight.semi_bold,
// color: Color(0xFFFFEAD2)),
// )),
// Container(
// padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h),
// decoration: BoxDecoration(
// color: Color(0xFFFFECD2),
// borderRadius: BorderRadius.circular(10),
// ),
// child: Text(
// S.of(context).chakanquanyi,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.semi_bold,
// color: Color(0xFF92755D),
// ),
// ),
// )
// ],
// ),
// SizedBox(
// height: 16.h,
// ),
// Container(
// height: 4.h,
// child: ClipRRect(
// borderRadius: BorderRadius.circular(6.5),
// child: LinearProgressIndicator(
// value: rankMax > (rank ?? 0)
// ? ((vipLevel < curLevel)
// ? rankMax / rankMax
// : (rank ?? 0) / rankMax)
// : 0,
// backgroundColor: Color(0xFF222233),
// color: Color(0xFFFFECD2),
// ),
// ),
// ),
// SizedBox(
// height: 8.h,
// ),
// Text(
// rank > rankMax
// ? S.of(context).dangqiandengji
// : "消费金额¥${rank.toStringAsFixed(2).toString()}${S.of(context).xiayidengji}还需¥${(rankMax - (rank ?? 0)).toStringAsFixed(2)}",
// style: TextStyle(
// color: Color(0xFFFFEAD2),
// fontWeight: MyFontWeight.light,
// fontFamily: 'JDZhengHT',
// fontSize: 14.sp,
// ),
// )
// ],
// ));
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {

5
lib/view_widget/update_dialog.dart

@ -43,17 +43,12 @@ class _UpdateDialog extends State<UpdateDialog> {
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
children: [ children: [
Container( Container(
// height: 100.h,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
border: Border.all( border: Border.all(
color: Colors.white, color: Colors.white,
width: 0, width: 0,
style: BorderStyle.solid), style: BorderStyle.solid),
// borderRadius: BorderRadius.only(
// topLeft: Radius.circular(8.r),
// topRight: Radius.circular(8.r),
// ),
), ),
), ),
Image.asset( Image.asset(

3
lib/vip/vip_view/vip_top.dart

@ -717,7 +717,8 @@ class _VipTop extends State<VipTop> {
topLeft: const Radius.circular(8.0), topLeft: const Radius.circular(8.0),
topRight: const Radius.circular(8.0))), topRight: const Radius.circular(8.0))),
child: Container( child: Container(
height: 230.h, // height: 230.h,
height: 160.h,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,

65
lib/web/web_page.dart

@ -51,11 +51,17 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
final GlobalKey inputKey = GlobalKey(); final GlobalKey inputKey = GlobalKey();
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
final TextEditingController commentTextController = TextEditingController(); final TextEditingController commentTextController = TextEditingController();
bool emojiShowing = false;
static double keyboard_height=300;
double keyboard = -1;
bool needShowSmiley = false;
bool needHideSmiley = false;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
commentFocus.addListener(_focusNodeListener);
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
queryHtml(); queryHtml();
@ -69,6 +75,7 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
if (MediaQuery.of(context).viewInsets.bottom == 0) { if (MediaQuery.of(context).viewInsets.bottom == 0) {
if (isKeyBoardShow) { if (isKeyBoardShow) {
FocusScope.of(context).requestFocus(FocusNode()); FocusScope.of(context).requestFocus(FocusNode());
if(!emojiShowing)
setState(() { setState(() {
hintText = S.current.liuxianinjingcaidepinglunba; hintText = S.current.liuxianinjingcaidepinglunba;
isKeyBoardShow = false; isKeyBoardShow = false;
@ -80,11 +87,50 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
}); });
} }
}); });
if (needShowSmiley && window.viewInsets.bottom <= 0.1) {
needShowSmiley = false;
setState(() {
emojiShowing = true;
});
}
if(needHideSmiley && window.viewInsets.bottom > 0.1) {
needHideSmiley = false;
setState(() {
emojiShowing = false;
});
}
}
void _focusNodeListener() {
/*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){
setState(() {
smileyPadGone = true;
});
}*/
}
_onTextFieldTap() {
if(emojiShowing) {
needHideSmiley = true;
}
}
_onSmileyTap() {
if(!emojiShowing && commentFocus.hasFocus && isKeyBoardShow) {
needShowSmiley = true;
commentFocus.unfocus();
} else {
setState(() {
emojiShowing = !emojiShowing;
isKeyBoardShow = emojiShowing;
});
}
} }
@override @override
void dispose() { void dispose(){
WidgetsBinding.instance.removeObserver(this); WidgetsBinding.instance.removeObserver(this);
commentFocus.removeListener(_focusNodeListener);
super.dispose(); super.dispose();
} }
@ -218,10 +264,20 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double h = MediaQuery.of(context).viewInsets.bottom;
if(h > 0 && keyboard <= 0) {
setState(() {
keyboard = h;
});
}
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.translucent, behavior: HitTestBehavior.translucent,
onTap: () { onTap: () {
FocusScope.of(context).requestFocus(FocusNode()); setState(() {
emojiShowing = false;
isKeyBoardShow = emojiShowing;
FocusScope.of(context).requestFocus(FocusNode());
});
}, },
child:Scaffold( child:Scaffold(
appBar: MyAppBar( appBar: MyAppBar(
@ -307,9 +363,14 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
inputKey, inputKey,
hintText, hintText,
isKeyBoardShow, isKeyBoardShow,
keyboard_height,
keyboard,
emojiShowing,
commentFocus, commentFocus,
commentTextController, commentTextController,
_toComment, _toComment,
_onSmileyTap,
_onTextFieldTap,
_queryMemberComment, _queryMemberComment,
_queryInformationLikes, _queryInformationLikes,
activity: activity, activity: activity,

295
lib/web/web_view/input_comment.dart

@ -4,33 +4,47 @@ import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/article.dart';
import 'package:like_button/like_button.dart'; import 'package:like_button/like_button.dart';
import 'dart:io';
import 'package:emoji_picker_flutter/emoji_picker_flutter.dart';
class InputComment extends StatefulWidget { class InputComment extends StatefulWidget {
final String hintText; final String hintText;
final Activity activity; final Activity activity;
final Article article; final Article article;
final bool isKeyBoardShow; final bool isKeyBoardShow;
final double keyboard_height;
final double keyboard;
final bool emojiShowing;
final FocusNode commentFocus; final FocusNode commentFocus;
final Function toComment; final Function toComment;
final Function onSmileyTap;
final Function onTextFieldTap;
final Function(String text) queryMemberComment; final Function(String text) queryMemberComment;
final Function() queryInformationLikes; final Function() queryInformationLikes;
final TextEditingController commentTextController; final TextEditingController commentTextController;
final bool isLike; final bool isLike;
final Function(bool emojiShow) emojiShowFunction;
InputComment( InputComment(
Key key, Key key,
this.hintText, this.hintText,
this.isKeyBoardShow, this.isKeyBoardShow,
this.keyboard_height,
this.keyboard,
this.emojiShowing,
this.commentFocus, this.commentFocus,
this.commentTextController, this.commentTextController,
this.toComment, this.toComment,
this.onSmileyTap,
this.onTextFieldTap,
this.queryMemberComment, this.queryMemberComment,
this.queryInformationLikes, this.queryInformationLikes,
{ {
this.activity, this.activity,
this.article, this.article,
this.isLike this.isLike,
this.emojiShowFunction
} }
) : super(key: key); ) : super(key: key);
@ -41,11 +55,12 @@ class InputComment extends StatefulWidget {
} }
class _InputComment extends State<InputComment> { class _InputComment extends State<InputComment> {
bool emojiShowing = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.all(16), padding: EdgeInsets.only(top: 16.h,),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
boxShadow: [ boxShadow: [
@ -60,134 +75,188 @@ class _InputComment extends State<InputComment> {
top: Radius.circular(8), top: Radius.circular(8),
), ),
), ),
child: Row( child: Column(
children: [ children: [
Expanded( Row(
flex: 1, children: [
child: Container( IconButton(
decoration: BoxDecoration( onPressed: () {
color: Color(0xffF2F2F2), widget.onSmileyTap();
borderRadius: BorderRadius.circular(2.0), },
icon: Icon(
Icons.emoji_emotions,
color: Color(0xFF868686),
),
), ),
child: Container( Expanded(
margin: EdgeInsets.symmetric(horizontal: 4.w), flex: 1,
alignment: Alignment.topLeft, child: Container(
child: TextField( decoration: BoxDecoration(
textInputAction:TextInputAction.send, color: Color(0xffF2F2F2),
onEditingComplete: () { borderRadius: BorderRadius.circular(2.0),
),
child: Container(
margin: EdgeInsets.symmetric(horizontal: 4.w),
alignment: Alignment.topLeft,
child: TextField(
textInputAction:TextInputAction.send,
onTap: (){
widget.onTextFieldTap();
},
onEditingComplete: () {
var commentText = widget.commentTextController.text;
if (commentText.trim() == "") {
return;
}
widget.queryMemberComment(commentText);
},
maxLines: 8,
minLines: 1,
focusNode: widget.commentFocus,
controller: widget.commentTextController,
decoration: InputDecoration(
border: InputBorder.none,
hintText: widget.hintText,
hintStyle: TextStyle(
fontSize: 14.sp,
color: Color(0xFF868686),
),
),
),
),
),
),
if (widget.isKeyBoardShow)
GestureDetector(
onTap: () {
var commentText = widget.commentTextController.text; var commentText = widget.commentTextController.text;
if (commentText.trim() == "") { if (commentText.trim() == "") {
return; return;
} }
widget.queryMemberComment(commentText); widget.queryMemberComment(commentText);
}, },
maxLines: 8, child: Container(
minLines: 1, padding: EdgeInsets.symmetric(horizontal: 20.w),
focusNode: widget.commentFocus, child: Text(
controller: widget.commentTextController, S.of(context).fasong,
decoration: InputDecoration( style: TextStyle(
border: InputBorder.none, fontSize: 16.sp,
hintText: widget.hintText, fontWeight: FontWeight.bold,
hintStyle: TextStyle( color: Color(0XFF1A1A1A),
fontSize: 14.sp, ),
color: Color(0xFF868686),
), ),
), ),
), ),
), if (!widget.isKeyBoardShow)
), InkWell(
), onTap: widget.toComment,
if (widget.isKeyBoardShow) child: Tooltip(
GestureDetector( message: S.of(context).daopinglunliebiaodingbu,
onTap: () { child: Container(
var commentText = widget.commentTextController.text; padding: EdgeInsets.only(left: 20.w, right: 10.w),
if (commentText.trim() == "") { child: Image.asset(
return; "assets/image/icon_comment.webp",
} width: 24,
widget.queryMemberComment(commentText); height: 24,
}, ),
child: Container( ),
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: Text(
S.of(context).fasong,
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Color(0XFF1A1A1A),
),
),
),
),
if (!widget.isKeyBoardShow)
InkWell(
onTap: widget.toComment,
child: Tooltip(
message: S.of(context).daopinglunliebiaodingbu,
child: Container(
padding: EdgeInsets.only(left: 20.w, right: 10.w),
child: Image.asset(
"assets/image/icon_comment.webp",
width: 24,
height: 24,
), ),
), ),
), if (!widget.isKeyBoardShow)
), Tooltip(
if (!widget.isKeyBoardShow) message: S.of(context).dianzanxihuan_(widget.activity == null ? S.of(context).wenzhang : S.of(context).huodong),
Tooltip( child: LikeButton(
message: S.of(context).dianzanxihuan_(widget.activity == null ? S.of(context).wenzhang : S.of(context).huodong), padding: EdgeInsets.all(10),
child: LikeButton( size: 24,
padding: EdgeInsets.all(10), circleSize: 24,
size: 24, circleColor: CircleColor(
circleSize: 24, start: Color(0xff00ddff),
circleColor: CircleColor( end: Color(0xff0099cc),
start: Color(0xff00ddff), ),
end: Color(0xff0099cc), bubblesColor: BubblesColor(
), dotPrimaryColor: Color(0xff33b5e5),
bubblesColor: BubblesColor( dotSecondaryColor: Color(0xff0099cc),
dotPrimaryColor: Color(0xff33b5e5), ),
dotSecondaryColor: Color(0xff0099cc), bubblesSize: 24,
), likeBuilder: (bool isLiked) {
bubblesSize: 24, return isLiked
likeBuilder: (bool isLiked) { ? Image.asset(
return isLiked "assets/image/icon_like.webp",
? Image.asset( width: 24,
"assets/image/icon_like.webp", height: 24,
width: 24, )
height: 24, : Image.asset(
) "assets/image/icon_like_h.webp",
: Image.asset( width: 24,
"assets/image/icon_like_h.webp", height: 24,
width: 24, );
height: 24, },
); isLiked: (widget.activity != null
}, ? widget.activity.liked
isLiked: (widget.activity != null : widget.article != null
? widget.activity.liked
: widget.article != null
? widget.article.liked ? widget.article.liked
: widget.isLike??false), : widget.isLike??false),
onTap: (isLiked) async { onTap: (isLiked) async {
await widget.queryInformationLikes(); await widget.queryInformationLikes();
return (widget.activity != null return (widget.activity != null
? widget.activity.liked ? widget.activity.liked
: widget.article != null : widget.article != null
? widget.article.liked ? widget.article.liked
: widget.isLike??false); : widget.isLike??false);
}, },
countBuilder: (int count, bool isLiked, String text) { countBuilder: (int count, bool isLiked, String text) {
return Text( return Text(
text, text,
style: TextStyle( style: TextStyle(
color: Color(0xFF1A1A1A), color: Color(0xFF1A1A1A),
fontSize: 12.sp, fontSize: 12.sp,
),
);
},
),
),
],
),
SizedBox(height: 16.h,),
Offstage(
offstage: !widget.emojiShowing,
child: SizedBox(
height: 250.h,
child:
EmojiPicker(
textEditingController: widget.commentTextController,
config: Config(
columns: 7,
emojiSizeMax: 32 * (Platform.isIOS ? 1.30 : 1.0),
verticalSpacing: 0,
horizontalSpacing: 0,
gridPadding: EdgeInsets.zero,
initCategory: Category.RECENT,
bgColor: const Color(0xFFF2F2F2),
// indicatorColor: Colors.blue,
iconColor: Colors.grey,
iconColorSelected: Colors.blue,
backspaceColor: Colors.blue,
skinToneDialogBgColor: Colors.white,
skinToneIndicatorColor: Colors.grey,
enableSkinTones: true,
showRecentsTab: true,
recentsLimit: 28,
replaceEmojiOnLimitExceed: false,
noRecents:Text(
"最近使用",
style: TextStyle(fontSize: 20, color: Colors.black26),
textAlign: TextAlign.center,
), ),
); loadingIndicator: const SizedBox.shrink(),
}, tabIndicatorAnimDuration: kTabScrollDuration,
), categoryIcons: const CategoryIcons(),
), buttonMode: ButtonMode.MATERIAL,
checkPlatformCompatibility: true,
),
)),
),
], ],
), ),
); );
} }}
}

4
pubspec.yaml

@ -3,7 +3,7 @@ description: 一心回乡.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 3.1.9+39 version: 3.2.0+41
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"
@ -101,6 +101,8 @@ dependencies:
flutter_slidable: ^1.3.0 flutter_slidable: ^1.3.0
emoji_picker_flutter: ^1.4.1
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter

Loading…
Cancel
Save