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. 99
      lib/community/community_details.dart
  18. 69
      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. 11
      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. 9
      lib/mine/personal_page.dart
  30. 33
      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. 72
      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. 214
      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. 63
      lib/web/web_page.dart
  45. 81
      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(() {});
// Navigator.of(context).pushNamed( '/router/eom');
},
);
},

99
lib/community/community_details.dart

@ -1,3 +1,5 @@
import 'dart:ui';
import 'package:dio/dio.dart';
import 'package:flutter/material.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:shared_preferences/shared_preferences.dart';
import '../web/web_view/input_comment_o.dart';
class CommunityDetails extends StatefulWidget {
final Map<String, dynamic> arguments;
@ -46,14 +50,23 @@ class _CommunityDetails extends State<CommunityDetails>
Article article;
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() {
WidgetsBinding.instance.addPostFrameCallback((_) {
// isKeyBoardShow = MediaQuery.of(context).viewInsets.bottom > 0;
if (!mounted) return;
if (MediaQuery.of(context).viewInsets.bottom == 0) {
if (isKeyBoardShow) {
FocusScope.of(context).requestFocus(FocusNode());
if (mounted)
if(!emojiShowing)
setState(() {
hintText = S.current.liuxianinjingcaidepinglunba;
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
@ -74,11 +99,45 @@ class _CommunityDetails extends State<CommunityDetails>
// comunity = widget.arguments["comment"];
businessId = widget.arguments["businessId"];
WidgetsBinding.instance.addObserver(this);
commentFocus.addListener(_focusNodeListener);
_queryMemberCommentList();
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 {
SharedPreferences value = await SharedPreferences.getInstance();
@ -101,7 +160,22 @@ class _CommunityDetails extends State<CommunityDetails>
@override
Widget build(BuildContext context) {
return Scaffold(
double h = MediaQuery.of(context).viewInsets.bottom;
if(h > 0 && keyboard <= 0) {
setState(() {
keyboard = h;
});
}
return GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
setState(() {
emojiShowing = false;
isKeyBoardShow = emojiShowing;
FocusScope.of(context).requestFocus(FocusNode());
});
},
child: Scaffold(
appBar: MyAppBar(
title: S.of(context).dongtaixiangqing,
titleColor: Colors.black,
@ -110,12 +184,7 @@ class _CommunityDetails extends State<CommunityDetails>
leading: true,
leadingColor: Colors.black,
),
body: GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: Container(
body: Container(
child: Column(
children: [
Expanded(
@ -184,17 +253,22 @@ class _CommunityDetails extends State<CommunityDetails>
inputKey,
hintText,
isKeyBoardShow,
keyboard_height,
keyboard,
emojiShowing,
commentFocus,
commentTextController,
_toComment,
_onSmileyTap,
_onTextFieldTap,
_queryMemberComment,
_queryInformationLikes,
isLike: article?.liked ?? false,
),
],
),
)),
);
),
));
}
////
@ -246,9 +320,6 @@ class _CommunityDetails extends State<CommunityDetails>
);
}
final GlobalKey inputKey = GlobalKey();
final TextEditingController commentTextController = TextEditingController();
contentHeight() {
double contentHeight = MediaQuery.of(context).size.height -
kToolbarHeight -
@ -290,7 +361,7 @@ class _CommunityDetails extends State<CommunityDetails>
Dio(),
context: context,
token: sharedPreferences.getString("token"),
showLoading: false,
showLoading: true,
);
BaseData<PageInfo<MemberCommentList>> baseData =
await apiService.memberCommentList({

69
lib/community/community_view/class_details.dart

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

12
lib/community/community_view/class_details_video.dart

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

64
lib/community/new_community_details.dart

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

4
lib/home/welfare_exchange.dart

@ -166,7 +166,7 @@ class _WelfareExchange extends State<WelfareExchange>
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.transparent,
backgroundColor: Colors.white,
body: NestedScrollView(
headerSliverBuilder: (context, inner) {
return [
@ -265,7 +265,7 @@ class _WelfareExchange extends State<WelfareExchange>
body: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
enablePullUp: true,
physics: ClampingScrollPhysics(),
header: MyHeader(),
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_vip_core.dart';
import 'mine/scan_web.dart';
import 'mine/vip_pay_code.dart';
import 'order/bargain_group_order.dart';
import 'mine/personal_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/main_page': (context, {arguments}) => MainPage(arguments: arguments),
'/router/test_page': (context, {arguments}) => TestPage(),
'/router/communityFollow': (context, {arguments}) => CommunityFollow(),
'/router/communityFollow': (context, {arguments}) => CommunityFollow(arguments:arguments),
'/router/releasePage': (context, {arguments}) => ReleasePage(),
'/router/activity_list': (context, {arguments}) => ActivityList(),
'/router/class_details': (context, {arguments}) =>
@ -420,4 +421,6 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
HelpFarmersPage(),
'/router/scan_web': (context, {arguments}) =>
ScanWeb(arguments:arguments),
'/router/vip_pay_code': (context, {arguments}) =>
VipPayCode(),
};

11
lib/message/system_message.dart

@ -124,12 +124,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async {
Navigator.of(context).pop(true);
return false;
},
child:Scaffold(
return Scaffold(
appBar: MyAppBar(
background: Colors.white,
leadingColor: Colors.black,
@ -147,7 +142,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
});
},
child: Text(
S.of(context).biaojiweiyidu,
S.of(context).biaoweiyidu,
style: TextStyle(
fontSize: 16.sp,
fontWeight:MyFontWeight.semi_bold,
@ -192,7 +187,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
),
),
));
);
}
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/main.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/retrofit/data/base_data.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:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/coupon.dart';
import '../retrofit/data/page.dart';
import '../utils/flutter_utils.dart';
import 'mine_view/mine_item.dart';
import 'mine_view/mine_view.dart';
@ -46,6 +49,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
SocialInfo infoNumber;
final RefreshController _refreshController = RefreshController();
int totalMsg = 0;
String couponNum;
_toUserInfo() async {
SharedPreferences shared = await SharedPreferences.getInstance();
@ -74,6 +78,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
super.initState();
querySocialInfo();
queryMsgStats();
// queryCard();
eventBus.on<EventType>().listen((event) {
print("EventType: ${event.type}");
@ -113,6 +118,22 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
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 =
await apiService.queryInfo().catchError((onError) {
_refreshController.refreshFailed();
@ -203,14 +224,13 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
child: SingleChildScrollView(
child: Container(
child: Stack(
// alignment: Alignment.centerRight,
children: [
Container(
height: 502.h,
height: 306.h,
decoration: BoxDecoration(
// color: Color(0xFF32A060)
image: DecorationImage(
fit: BoxFit.cover,
fit: BoxFit.fill,
image: AssetImage("assets/image/settlement_bg.webp"),
),
),
@ -229,21 +249,34 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
setState(() {
totalMsg = 0;
});
}, totalMsg, infoNumber),
}, totalMsg,
infoNumber,
ranks
),
/// VIP等级信息
MineVipEntry(
tag: "vip",
ranks: ranks,
userInfo: userInfo,
rank: double.tryParse(userInfo?.expendAmount ?? "0")
.toInt(),
rankMax: userInfo?.memberRankVo?.nextOrigin ?? 0,
createTime: userInfo?.createTime ?? "",
//////
MineNavbar(
couponNum,
userInfo,
infoNumber,
() {
toIntegralPage();
},
),
/// 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(),
@ -287,7 +320,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
);
},
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:
EdgeInsets.only(left: 12.w, top: 12.h, right: 10.w, bottom: 17.h),
width: double.infinity,
@ -389,7 +422,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
///广
Widget spreadImage() {
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(
onTap: () {
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';
class CommunityFollow extends StatefulWidget {
final Map<String, dynamic> arguments;
CommunityFollow({this.arguments});
@override
State<StatefulWidget> createState() {
return _CommunityFollow();
@ -24,11 +29,13 @@ class _CommunityFollow extends State<CommunityFollow>
with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin {
ApiService apiService;
SocialInfo infoNumber;
int status;
@override
void initState() {
super.initState();
querySocialInfo();
status = widget.arguments["status"];
}
///(//)
@ -51,6 +58,7 @@ class _CommunityFollow extends State<CommunityFollow>
Widget build(BuildContext context) {
return DefaultTabController(
length: 2,
initialIndex: status,
child: Scaffold(
appBar: MyAppBar(
title: "",

2
lib/mine/mine_view/mine_item.dart

@ -20,7 +20,7 @@ class _MineItem extends State<MineItem> {
@override
Widget build(BuildContext context) {
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),
decoration: BoxDecoration(
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:flutter/cupertino.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_svg/svg.dart';
import 'package:huixiang/generated/l10n.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/user_info.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:permission_handler/permission_handler.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;
class MineView extends StatefulWidget {
@ -31,9 +30,10 @@ class MineView extends StatefulWidget {
final Function messageZero;
final int totalMsg;
final SocialInfo infoNumber;
final List<Rank> ranks;
MineView(this.userInfo, this.toUserInfo, this.toIntegralPage,
this.messageZero, this.totalMsg, this.infoNumber);
this.messageZero, this.totalMsg, this.infoNumber,this.ranks);
@override
State<StatefulWidget> createState() {
@ -43,6 +43,7 @@ class MineView extends StatefulWidget {
class _MineView extends State<MineView> {
ApiService apiService;
String levelText = "普通用户";
///
queryWiped(memberCouponId) async {
@ -136,21 +137,21 @@ class _MineView extends State<MineView> {
),
),
),
InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/setting_page');
},
child: Container(
padding: EdgeInsets.all(8.h),
margin: EdgeInsets.only(right: 12.w),
child: Image.asset(
"assets/image/icon_mine_setting.webp",
width: 32,
height: 32,
color: Colors.white,
),
),
),
// InkWell(
// onTap: () {
// Navigator.of(context).pushNamed('/router/setting_page');
// },
// child: Container(
// padding: EdgeInsets.all(8.h),
// margin: EdgeInsets.only(right: 12.w),
// child: Image.asset(
// "assets/image/icon_mine_setting.webp",
// width: 32,
// height: 32,
// color: Colors.white,
// ),
// ),
// ),
],
),
),
@ -215,6 +216,7 @@ class _MineView extends State<MineView> {
);
return;
}
String title = uri.queryParameters["title"];
if (result.toString().contains("http:") ||
result.toString().contains("https:")) {
///
@ -222,6 +224,7 @@ class _MineView extends State<MineView> {
'/router/scan_web',
arguments: {
"result": result,
"title":title,
},
);
}
@ -259,21 +262,21 @@ class _MineView extends State<MineView> {
MImage(
widget.userInfo == null ? "" : widget.userInfo.headimg,
isCircle: true,
width: 58,
height: 58,
width: 60,
height: 60,
fit: BoxFit.cover,
errorSrc: "assets/image/default_user.webp",
fadeSrc: "assets/image/default_user.webp",
),
Positioned(
bottom: 0,
right: 2.w,
child: Image.asset(
"assets/image/icon_mine_edit.webp",
width: 17,
height: 17,
),
),
// Positioned(
// bottom: 0,
// right: 2.w,
// child: Image.asset(
// "assets/image/icon_mine_edit.webp",
// width: 17,
// height: 17,
// ),
// ),
],
),
),
@ -336,34 +339,35 @@ class _MineView extends State<MineView> {
color: Color(0xFFFFFFFF),
),
)
: Row(
children: [
Text(
"${S.of(context).guanzhu} ${widget?.infoNumber?.follow ?? "0"}",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
fontFamily: 'JDZhengHT',
color: Color(0xFFFFFFFF),
),
),
Container(
width: 1.w,
height: 12.h,
margin: EdgeInsets.symmetric(horizontal: 3.w),
color: Color(0xFFFFFFFF),
),
Text(
"${S.of(context).fensi} ${widget?.infoNumber?.fans ?? "0"}",
style: TextStyle(
fontSize: 12.sp,
fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.regular,
color: Color(0xFFFFFFFF),
),
),
],
),
: mineVip(),
// Row(
// children: [
// Text(
// "${S.of(context).guanzhu} ${widget?.infoNumber?.follow ?? "0"}",
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.regular,
// fontFamily: 'JDZhengHT',
// color: Color(0xFFFFFFFF),
// ),
// ),
// Container(
// width: 1.w,
// height: 12.h,
// margin: EdgeInsets.symmetric(horizontal: 3.w),
// color: Color(0xFFFFFFFF),
// ),
// Text(
// "${S.of(context).fensi} ${widget?.infoNumber?.fans ?? "0"}",
// style: TextStyle(
// fontSize: 12.sp,
// fontFamily: 'JDZhengHT',
// 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 ?? "",
),
);
}
}

9
lib/mine/personal_page.dart

@ -320,7 +320,9 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
@override
Widget build(BuildContext context) {
return SmartRefresher(
return Scaffold(
backgroundColor: Colors.white,
body:SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: true,
@ -644,6 +646,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
),
],
)),
)
);
}
@ -670,7 +673,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
builder: (context) => PhotoViewGalleryScreen(
images: [
(memberInfor?.headimg ?? "").isEmpty
? "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg"
? "https://i.postimg.cc/Pq6vjfnw/default-1.webp"
: memberInfor?.headimg
], //list
index: 0, //index
@ -749,7 +752,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
isShowBtn: false,
text: "目前暂无发布动态,要把开心的事讲出来哦~",
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(
physics: NeverScrollableScrollPhysics(),

33
lib/mine/scan_web.dart

@ -1,12 +1,8 @@
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:webview_flutter/webview_flutter.dart';
class ScanWeb extends StatefulWidget {
@ -21,29 +17,42 @@ class ScanWeb extends StatefulWidget {
class _ScanWeb extends State<ScanWeb> {
var controller = new ScrollController();
WebViewController webViewController;
String result;
String title;
@override
void initState() {
super.initState();
result = widget.arguments["result"];
title = widget.arguments["title"];
EasyLoading.show(status: S.current.zhengzaijiazai);
}
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(top:MediaQuery.of(context).padding.top),
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
alignment: Alignment.center,
child:
return Scaffold(
appBar: MyAppBar(
title:title ?? "",
titleColor: Colors.black,
background: Colors.transparent,
leadingColor: Colors.black,
),
body:
WebView(
initialUrl:result,
javascriptMode: JavascriptMode.unrestricted,
onPageFinished: (initialUrl){
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,
),
Text(
S.of(context).pingtaiyue,
S.of(context).huixiangqianbao,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),

2
lib/order/order_detail_page.dart

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

72
lib/qr/qr_code_scan.dart

@ -57,19 +57,43 @@ class _QrCodeScanPage extends State<QrCodeScanPage> {
right: 0,
),
Positioned(
child: 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(
child: Container(
margin: EdgeInsets.only(left:12.w,right: 16.w,top: 16.h),
child:Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
Navigator.of(context).pop();
},
child: Container(
padding: EdgeInsets.symmetric(horizontal:10.w),
alignment: Alignment.centerLeft,
child: Image.asset(
"assets/image/return_left.webp",
fit: BoxFit.fill,
color: Colors.white,
),
),
),
Spacer(),
Expanded(child:Text(
S.of(context).saoma,
style: TextStyle(
color: Colors.white,
fontSize: 18.sp,
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(
@ -80,8 +104,34 @@ class _QrCodeScanPage extends State<QrCodeScanPage> {
),
),
),
],
),
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,
right: 0,
),

2
lib/retrofit/min_api.dart

@ -26,7 +26,7 @@ import 'data/shopping_home_config.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 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';
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 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: EdgeInsets.only(bottom: 13),
child: Text(
(balance == "0.00" && money == "0.00") ? "由于当于帐号已注销,系统将自动退出登录":"您的平台余额及店铺余额未使用完!",
(balance == "0.00" && money == "0.00") ? "由于当于帐号已注销,系统将自动退出登录":"您的回乡钱包余额及门店余额未使用完!",
textAlign: TextAlign.center,
style: TextStyle(
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")
Text(
"${S.of(context).pingtaiyue}$money",
"${S.of(context).huixiangqianbao}$money",
textAlign: TextAlign.center,
style: TextStyle(
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")
Text(
"${S.of(context).dianpuyue}:¥ $balance",
"${S.of(context).mendianyue}:¥ $balance",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16.sp,

2
lib/settlement/settlement.dart

@ -82,7 +82,7 @@ class _Settlement extends State<Settlement> {
int count1 = 0;
String productId;
bool orderButton = false;
bool useVipPriceSelect = false;
bool useVipPriceSelect = true;
bool showVipTips = 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> {
bool vipSelect = false;
bool vipSelect = true;
@override
Widget build(BuildContext context) {
@ -76,7 +76,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if(!(widget?.settleOrderInfo?.isRaise ?? false))
if(!(widget?.settleOrderInfo?.isRaise ?? false) && (widget?.settleOrderInfo?.memberVO?.isVip ?? false))
Row(
mainAxisAlignment: MainAxisAlignment.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 ?? ""));
}

214
lib/view_widget/mine_vip_entry.dart

@ -32,6 +32,9 @@ class MineVipEntry extends StatelessWidget {
String topLeft = "";
String levelText = "普通用户";
Color logoColor = Color(0xFFCACACA);
Color levelTextColor = Color(0xFFCACACA);
Color levelTextBackdrop = Color(0xFFFFF8EC);
@override
Widget build(BuildContext context) {
@ -54,109 +57,184 @@ class MineVipEntry extends StatelessWidget {
case 1:
{
levelText = "${S.of(context).yinkahuiyuan}";
logoColor = Color(0xFFA0C4E7);
levelTextColor = Color(0xFF61ABF3);
levelTextBackdrop = Color(0xFFC1DBF4);
break;
}
case 2:
{
levelText = "${S.of(context).jinkahuiyuan}";
logoColor = Color(0xFFFBB43A);
levelTextColor = Color(0xFFFBB43A);
levelTextBackdrop = Color(0xFFFFECD2);
break;
}
case 3:
{
levelText = "${S.of(context).gongchuanghuiyuan}";
logoColor = Color(0xFF352822);
levelTextColor = Color(0xFF92755D);
levelTextBackdrop = Color(0xFFFFECD2);
break;
}
}
Widget widget = Container(
width: double.infinity,
padding: EdgeInsets.only(top: 12.h, bottom: 22.h, left: 12.w, right: 12.w),
margin: EdgeInsets.only(top: 23.h,left: 13.5.w,right: 13.5.w,bottom:15.h),
child: Row(
children: [
Container(
padding: EdgeInsets.symmetric(horizontal:4.w,vertical: 3.h),
decoration: BoxDecoration(
color: Color(0xFF3D3D5D),
borderRadius: BorderRadius.circular(6),
color: logoColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(4),
bottomLeft: Radius.circular(4),),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
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,
child: Image.asset(
"assets/image/mine_vip_logo.webp",
fit: BoxFit.cover,
width: 13.w,
height: 11.h,
),
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),
padding: EdgeInsets.symmetric(horizontal:2.w,vertical:3.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),
),
color: levelTextBackdrop,
borderRadius: BorderRadius.only(
topRight: Radius.circular(4),
bottomRight: Radius.circular(4),),
boxShadow: [
BoxShadow(
color: Color(0x08213303).withAlpha(12),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
),
)
],
),
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),
),
child:Row(
children: [
Text(
levelText,
textAlign: TextAlign.center,
style: TextStyle(
color: levelTextColor,
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(
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(
color: Color(0xFFFFEAD2),
fontWeight: MyFontWeight.light,
fontFamily: 'JDZhengHT',
fontSize: 14.sp,
],
),
)
],
));
),
);
// Container(
// width: double.infinity,
// padding: EdgeInsets.only(top: 12.h, bottom: 22.h, left: 12.w, right: 12.w),
// margin: EdgeInsets.only(top: 23.h,left: 13.5.w,right: 13.5.w,bottom:15.h),
// 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(
onTap: () {

5
lib/view_widget/update_dialog.dart

@ -43,17 +43,12 @@ class _UpdateDialog extends State<UpdateDialog> {
alignment: Alignment.bottomCenter,
children: [
Container(
// height: 100.h,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.white,
width: 0,
style: BorderStyle.solid),
// borderRadius: BorderRadius.only(
// topLeft: Radius.circular(8.r),
// topRight: Radius.circular(8.r),
// ),
),
),
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),
topRight: const Radius.circular(8.0))),
child: Container(
height: 230.h,
// height: 230.h,
height: 160.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,

63
lib/web/web_page.dart

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

81
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/article.dart';
import 'package:like_button/like_button.dart';
import 'dart:io';
import 'package:emoji_picker_flutter/emoji_picker_flutter.dart';
class InputComment extends StatefulWidget {
final String hintText;
final Activity activity;
final Article article;
final bool isKeyBoardShow;
final double keyboard_height;
final double keyboard;
final bool emojiShowing;
final FocusNode commentFocus;
final Function toComment;
final Function onSmileyTap;
final Function onTextFieldTap;
final Function(String text) queryMemberComment;
final Function() queryInformationLikes;
final TextEditingController commentTextController;
final bool isLike;
final Function(bool emojiShow) emojiShowFunction;
InputComment(
Key key,
this.hintText,
this.isKeyBoardShow,
this.keyboard_height,
this.keyboard,
this.emojiShowing,
this.commentFocus,
this.commentTextController,
this.toComment,
this.onSmileyTap,
this.onTextFieldTap,
this.queryMemberComment,
this.queryInformationLikes,
{
this.activity,
this.article,
this.isLike
this.isLike,
this.emojiShowFunction
}
) : super(key: key);
@ -41,11 +55,12 @@ class InputComment extends StatefulWidget {
}
class _InputComment extends State<InputComment> {
bool emojiShowing = false;
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(16),
padding: EdgeInsets.only(top: 16.h,),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
@ -60,8 +75,19 @@ class _InputComment extends State<InputComment> {
top: Radius.circular(8),
),
),
child: Row(
child: Column(
children: [
Row(
children: [
IconButton(
onPressed: () {
widget.onSmileyTap();
},
icon: Icon(
Icons.emoji_emotions,
color: Color(0xFF868686),
),
),
Expanded(
flex: 1,
child: Container(
@ -74,6 +100,9 @@ class _InputComment extends State<InputComment> {
alignment: Alignment.topLeft,
child: TextField(
textInputAction:TextInputAction.send,
onTap: (){
widget.onTextFieldTap();
},
onEditingComplete: () {
var commentText = widget.commentTextController.text;
if (commentText.trim() == "") {
@ -188,6 +217,46 @@ class _InputComment extends State<InputComment> {
),
],
),
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
version: 3.1.9+39
version: 3.2.0+41
environment:
sdk: ">=2.7.0 <3.0.0"
@ -101,6 +101,8 @@ dependencies:
flutter_slidable: ^1.3.0
emoji_picker_flutter: ^1.4.1
dev_dependencies:
flutter_test:
sdk: flutter

Loading…
Cancel
Save