Browse Source

更改

master
w-R 3 years ago
parent
commit
4b5a0fd71c
  1. BIN
      assets/image/2x/closed_bill.png
  2. BIN
      assets/image/2x/distribution.png
  3. BIN
      assets/image/2x/service.png
  4. BIN
      assets/image/3x/closed_bill.png
  5. BIN
      assets/image/3x/distribution.png
  6. BIN
      assets/image/3x/service.png
  7. BIN
      assets/image/closed_bill.png
  8. BIN
      assets/image/distribution.png
  9. BIN
      assets/image/service.png
  10. 8
      lib/main.dart
  11. 144
      lib/mine/fans_page.dart
  12. 144
      lib/mine/follow_page.dart
  13. 85
      lib/mine/mine_page.dart
  14. 65
      lib/mine/mine_view/community_follow.dart
  15. 226
      lib/mine/release_page.dart
  16. 8
      lib/order/order_view/order_status.dart
  17. 111
      lib/retrofit/min_api.g.dart
  18. 6
      lib/store/store_order.dart
  19. 382
      lib/store/store_view/settlement.dart
  20. 3
      lib/store/store_view/store_activity.dart

BIN
assets/image/2x/closed_bill.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
assets/image/2x/distribution.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
assets/image/2x/service.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
assets/image/3x/closed_bill.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
assets/image/3x/distribution.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
assets/image/3x/service.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
assets/image/closed_bill.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

BIN
assets/image/distribution.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
assets/image/service.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

8
lib/main.dart

@ -72,7 +72,11 @@ import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'home/guide_page.dart';
import 'main_page.dart';
import 'mine/fans_page.dart';
import 'mine/follow_page.dart';
import 'mine/manage_address_page.dart';
import 'mine/mine_view/community_follow.dart';
import 'mine/release_page.dart';
import 'mine/roll_center_page.dart';
void main() async {
@ -267,4 +271,8 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/main_page': (context, {arguments}) => MainPage(),
'/router/test_page': (context, {arguments}) => TestPage(),
// '/router/ui_test': (context, {arguments}) => UITest(),
'/router/communityFollow': (context, {arguments}) => CommunityFollow(),
'/router/followPage': (context, {arguments}) => FollowPage(),
'/router/fansPage': (context, {arguments}) => FansPage(),
'/router/releasePage': (context, {arguments}) => ReleasePage(),
};

144
lib/mine/fans_page.dart

@ -0,0 +1,144 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/vip_card.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class FansPage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _FansPage();
}
}
class _FansPage extends State<FansPage> {
RefreshController _refreshController;
ApiService apiService;
@override
void initState() {
super.initState();
_refreshController = RefreshController();
SharedPreferences.getInstance().then((value) {
apiService =
ApiService(Dio(), context: context, token: value.getString("token"));
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
controller: _refreshController,
// onRefresh: ,
physics: BouncingScrollPhysics(),
child: ListView.builder(
padding: EdgeInsets.symmetric(vertical: 8.h),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
child: fansItem(),
);
},
itemCount:5,
)
// NoDataView(
// isShowBtn: false,
// text: "共关注0人",
// fontSize: 16.sp,
// margin: EdgeInsets.only(top: 120.h),
// ),
),
),
);
}
Widget fansItem() {
return Container(
margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
child:Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment:CrossAxisAlignment.center,
children: [
MImage(
"assets/image/default_1.png",
width: 44,
height: 44,
isCircle: true,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
SizedBox(
width:8,
),
Expanded(child:Text(
"百花谷",
style: TextStyle(
color: Color(0xFF1A1A1A),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
)),
Container(
width: 56.w,
height: 21.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(11.w),
color: Color(0xFF32A060),
),
child:Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment:CrossAxisAlignment.center,
children: [
Icon(
Icons.add,
color: Colors.white,
size: 14,
),
SizedBox(
width:4,
),
Text(
"关注",
style: TextStyle(
color: Colors.white,
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
),
),
],
),
);
}
}

144
lib/mine/follow_page.dart

@ -0,0 +1,144 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/vip_card.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class FollowPage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _FollowPage();
}
}
class _FollowPage extends State<FollowPage> {
RefreshController _refreshController;
ApiService apiService;
@override
void initState() {
super.initState();
_refreshController = RefreshController();
SharedPreferences.getInstance().then((value) {
apiService =
ApiService(Dio(), context: context, token: value.getString("token"));
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
controller: _refreshController,
// onRefresh: ,
physics: BouncingScrollPhysics(),
child: ListView.builder(
padding: EdgeInsets.symmetric(vertical: 8.h),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
child: followItem(),
);
},
itemCount:5,
)
// NoDataView(
// isShowBtn: false,
// text: "共关注0人",
// fontSize: 16.sp,
// margin: EdgeInsets.only(top: 120.h),
// ),
),
),
);
}
Widget followItem() {
return Container(
margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
child:Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment:CrossAxisAlignment.center,
children: [
MImage(
"assets/image/default_1.png",
width: 44,
height: 44,
isCircle: true,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
SizedBox(
width:8,
),
Expanded(child:Text(
"百花谷",
style: TextStyle(
color: Color(0xFF1A1A1A),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
)),
Container(
width: 69.w,
height: 21.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(11.w),
color: Color(0xFFE6E6E6),
),
child:Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment:CrossAxisAlignment.center,
children: [
Icon(
Icons.check,
color: Color(0xFF808080),
size: 14,
),
SizedBox(
width:4,
),
Text(
"已关注",
style: TextStyle(
color: Color(0xFF808080),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
),
),
],
),
);
}
}

85
lib/mine/mine_page.dart

@ -164,6 +164,9 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
},
),
/////
attention(),
/// VIP等级信息
MineVipView(
tag: "vip",
@ -205,6 +208,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
);
}
///
Widget buildNotice() {
return Container(
@ -278,6 +282,87 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
);
}
/////
Widget attention(){
return Container(
margin: EdgeInsets.only(left: 16,right: 17,top: 10),
child:GestureDetector(
onTap:(){
Navigator.of(context).pushNamed(
'/router/communityFollow',
arguments: {},
);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
"关注",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
Text(
"45",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
),
),
],
),
Row(
children: [
Text(
"粉丝",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
Text(
"666",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
),
),
],
),
Row(
children: [
Text(
"发布",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
Text(
"666",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
),
),
],
),
],
),
),
);
}
toIntegralPage() async {
SharedPreferences shared = await SharedPreferences.getInstance();
if (shared.getString("token") == null || shared.getString("token") == "") {

65
lib/mine/mine_view/community_follow.dart

@ -0,0 +1,65 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/mine/follow_page.dart';
import 'package:huixiang/mine/release_page.dart';
import 'package:huixiang/mine/vip_card_page.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:huixiang/view_widget/my_tab.dart';
import '../fans_page.dart';
class CommunityFollow extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _CommunityFollow();
}
}
class _CommunityFollow extends State<CommunityFollow>
with SingleTickerProviderStateMixin {
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 3,
child: Scaffold(
appBar: MyAppBar(
title: "",
titleColor: Colors.black,
background: Colors.white,
leadingColor: Colors.black,
toolbarHeight: kToolbarHeight + MediaQuery.of(context).padding.top,
bottom: TabBar(
// isScrollable: true, //
indicatorColor: Color(0xff39B54A),
labelColor: Colors.black,
labelStyle: TextStyle(
fontSize: 17.sp,
fontWeight: FontWeight.bold,
),
unselectedLabelStyle: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
),
// controller: tabController,
//
unselectedLabelColor: Color(0xffA29E9E),
indicatorSize: TabBarIndicatorSize.label,
//
tabs: <Widget>[
MyTab(text:"关注(23)"),
MyTab(text: "粉丝(55)"),
MyTab(text: "发布(26)"),
],
),
),
body: TabBarView(
children: [FollowPage(),FansPage(),ReleasePage()],
),
),
);
}
}

226
lib/mine/release_page.dart

@ -0,0 +1,226 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/vip_card.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class ReleasePage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _ReleasePage();
}
}
class _ReleasePage extends State<ReleasePage> {
RefreshController _refreshController;
var isShowShrink = false;
ApiService apiService;
@override
void initState() {
super.initState();
_refreshController = RefreshController();
SharedPreferences.getInstance().then((value) {
apiService =
ApiService(Dio(), context: context, token: value.getString("token"));
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
controller: _refreshController,
// onRefresh: ,
physics: BouncingScrollPhysics(),
child: ListView.builder(
padding: EdgeInsets.symmetric(vertical: 8.h),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
child: releaseItem(),
);
},
itemCount:5,
)
// NoDataView(
// isShowBtn: false,
// text: "共关注0人",
// fontSize: 16.sp,
// margin: EdgeInsets.only(top: 120.h),
// ),
),
),
);
}
Widget releaseItem() {
return Container(
color: Colors.white,
padding: EdgeInsets.symmetric(horizontal: 16.w),
margin: EdgeInsets.symmetric(vertical: 16.w),
child:Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment:CrossAxisAlignment.start,
children: [
Row(
children: [
ClipOval(
child: Image.network(
"https://t7.baidu.com/it/u=2841334870,333581502&fm=193&f=GIF",
fit: BoxFit.cover,
width: 44.w,
height: 44.h,
),
clipBehavior: Clip.hardEdge,
),
SizedBox(
width: 8.w,
),
Expanded(
child: Container(
height: 60.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(child: Text(
"百花谷",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xff808080),
),
), ),
InkWell(
onTap: () {
},
child: Icon(
Icons.close,
color: Colors.black,
size: 16,
),
),
],
),
Text(
"2021.04.12 12:12",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xff808080),
),
),
],
),
),
flex: 1,
),
],
),
SizedBox(height: 12),
Text(
"文本,是指书面语言的表现形式,从文学角度说,通常是具有完整、系统含义(Message)的一个句子或多个句子的组合。"
"一个文本可以是一个句子(Sentence)、一个段落(Paragraph)或者一个篇章(Discourse)。广义“文本”:"
"任何由书写所固定下来的任何话语。(利科尔) 狭义“文本”:由语言文字组成的文学实体,代指“作品”,相对于作者、世界构成一个独立、自足的系统。",
overflow: isShowShrink
? TextOverflow.visible
: TextOverflow.ellipsis,
maxLines: isShowShrink ? 10 :5,
style: TextStyle(
fontSize: 14.sp,
color:Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular,
),
),
SizedBox(height: 4.h),
GestureDetector(
onTap: () {
setState(() {
isShowShrink = !isShowShrink;
});
},
child: Row(
// mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Text(
(isShowShrink != null && !isShowShrink)
?"查看全文":"收起",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF32A060),
fontWeight: MyFontWeight.medium,
),
),
],
),
),
SizedBox(height:16.h),
Image.asset(
"assets/image/laoban.png",
height: 310.h,
),
SizedBox(height: 17.h),
Row(
children: [
Row(
children: [
InkWell(
onTap: () {
},
child: Icon(
Icons.close,
color: Colors.black,
size: 16,
),
),
SizedBox(width:4),
Text(
"52",
style: TextStyle(
fontSize: 12.sp,
color:Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular,
),
),
],
),
],
),
SizedBox(height: 16.h),
],
),
);
}
}

8
lib/order/order_view/order_status.dart

@ -211,10 +211,16 @@ class _OrderStatus extends State<OrderStatus> {
tripStatus = "assets/image/order_ok.png";
} else if (status.contains(S.of(context).dingdanyituikuan)) {
tripStatus = "assets/image/order_refund.png";
} else if (status.contains(S.of(context).quxiaodingdan)) {
} else if (status.contains(S.of(context).yiquxiao)) {
tripStatus = "assets/image/oeder_cancel.png";
} else if (status.contains(S.of(context).dengdaiyonghuqucan)) {
tripStatus = "assets/image/wait_meal.png";
}else if (status.contains(S.of(context).zhengzaihujiaoqishou)) {
tripStatus = "assets/image/distribution.png";
}else if (status.contains(S.of(context).qishouyijiedanquhuozhong)) {
tripStatus = "assets/image/closed_bill.png";
} else if (status.contains(S.of(context).dingdanyisongda)) {
tripStatus = "assets/image/service.png";
}
return tripStatus;
}

111
lib/retrofit/min_api.g.dart

@ -0,0 +1,111 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'min_api.dart';
// **************************************************************************
// RetrofitGenerator
// **************************************************************************
class _MinApiService implements MinApiService {
_MinApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://192.168.10.236:8765/app/';
}
final Dio _dio;
String baseUrl;
@override
Future<BaseData<List<FindMiNiGroupList>>> findMiNiGroupList(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'product/findMiNiGroupList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<FindMiNiGroupList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<FindMiNiGroupList>(
(i) => FindMiNiGroupList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<MiNiDetail>> miNiDetail(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/product/queryMiNiProductDetail?id=$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<MiNiDetail>.fromJson(
_result.data,
(json) => MiNiDetail.fromJson(json),
);
return value;
}
@override
Future<BaseData<ShoppingCart>> shoppingCart(param, header) async {
ArgumentError.checkNotNull(param, 'param');
ArgumentError.checkNotNull(header, 'header');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('shoppingcart',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<ShoppingCart>.fromJson(
_result.data,
(json) => ShoppingCart.fromJson(json),
);
return value;
}
@override
Future<BaseData<SettleOrderInfo>> getOrderInfo(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'order/getOrderInfo',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<SettleOrderInfo>.fromJson(
_result.data,
(json) => SettleOrderInfo.fromJson(json),
);
return value;
}
}

6
lib/store/store_order.dart

@ -241,16 +241,12 @@ class _StoreOrderPage extends State<StoreOrderPage>
coupon: true,
),
SizedBox(
height: 8,
),
///VIP信息
Vip(storeInfo, () {}, false),
],
),
),
top: 110.h,
top: 100.h,
bottom: 0,
left: 0,
right: 0,

382
lib/store/store_view/settlement.dart

@ -4,24 +4,27 @@ import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/order/order_view/order_commodity.dart';
import 'package:huixiang/order/order_view/order_info.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/coupon.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/rename_dialog.dart';
import 'package:huixiang/view_widget/rename_dialog_content.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:huixiang/view_widget/separator.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class Settlement extends StatefulWidget {
final arguments;
final OrderInfo orderInfo;
Settlement({this.arguments});
Settlement({this.arguments,this.orderInfo});
@override
State<StatefulWidget> createState() {
@ -33,6 +36,10 @@ class _Settlement extends State<Settlement> {
MinApiService minService;
int selectedBtn = 0;
OrderInfo orderInfo;
Coupon coupon;
Function(int type) callback;
GestureTapCallback callbackEx;
int isSelected = 0;
@override
void initState() {
@ -44,21 +51,23 @@ class _Settlement extends State<Settlement> {
context: context,
token: value.getString("token"),
);
// queryOrderInfo();
queryOrderInfo();
});
storeInfo = widget.arguments["storeInfo"];
}
StoreInfo storeInfo;
SettleOrderInfo settleOrderInfo;
int payStatus = 0;
int orderStatus = 0;
int sendStatus = 0;
int isTakeOut = 0;
int refundStatus = 0;
// String storeType = "NORMALSTORE"; //NORMALSTORE FASTSTORE RETAILSTORE
// queryDetails() async {
// BaseData<OrderInfo> baseData = await minService.orderDetail(widget.arguments["id"]);
// BaseData<OrderInfo> baseData = await apiService.orderDetail(widget.arguments["id"]);
// if (baseData != null && baseData.isSuccess) {
// orderInfo = baseData.data;
// payStatus = orderInfo.payStatus;
@ -81,16 +90,18 @@ class _Settlement extends State<Settlement> {
///
queryOrderInfo() async {
// BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({
// "addressId":0,
// "isTake": 0,
// "memberCouponId": 0,
// "orderId": widget.arguments["orderId"],
// "promotionId": 0
// });
// if (baseData != null && baseData.isSuccess) {
// setState(() {});
// }
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({
"addressId":0,
"isTake": 0,
"memberCouponId": 0,
"orderId": widget.arguments["orderId"],
"promotionId": 0
});
if (baseData != null && baseData.isSuccess) {
settleOrderInfo = baseData.data;
setState(() {
});
}
}
@override
@ -140,8 +151,6 @@ class _Settlement extends State<Settlement> {
///
payMethod(),
],
),
),
@ -209,6 +218,7 @@ class _Settlement extends State<Settlement> {
String center = "";
TextEditingController _vc = TextEditingController();
statusTitle() {
if (isTakeOut == 0) {
if (payStatus == 0) {
@ -643,10 +653,18 @@ class _Settlement extends State<Settlement> {
fontWeight: MyFontWeight.semi_bold
),
),
Icon(
InkWell(
onTap: () {
setState(() {
couponCart();
});
},
child: Icon(
Icons.keyboard_arrow_right,
size: 16,
),
),
],
),
SizedBox(height: 13,
@ -802,6 +820,7 @@ class _Settlement extends State<Settlement> {
);
}
///
showAlertDialog() {
//
showDialog(
@ -823,6 +842,335 @@ class _Settlement extends State<Settlement> {
});
}
///
couponCart() {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return StatefulBuilder(builder: (context1, state) {
return Container(
alignment: Alignment.topCenter,
width: double.infinity,
height: MediaQuery.of(context).size.height / 2,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(
top: 16,
left: 16,
right: 16,
bottom: 8,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"可用优惠券",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
SizedBox(width: 4,),
Expanded(child: Text(
"(1)",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),),
InkWell(
onTap: () {
Navigator.of(context).pop();
},
child: Image.asset(
"assets/image/cancel.png",
width: 24,
height: 24,
),
),
],
),
),
Expanded(
child: Container(
padding: EdgeInsets.only(
top: 8,
left: 16,
right: 16,
),
child: ListView.builder(
itemCount:5,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
// return shoppGoodsItem();
return GestureDetector(
onTap: () {
},
child: couponItem(position),
);
},
),
),
),
],
),
);
});
},
);
}
///
Widget couponItem(int index) {
return StatefulBuilder(builder: (context1, state){
return Container(
height:170,
width: double.infinity,
margin: EdgeInsets.fromLTRB(14.w, 6.h, 14.w, 6.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Container(
margin: EdgeInsets.only(top: 14.h, bottom: 8.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child:Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
Text(
"¥",
style: TextStyle(
fontSize: 22.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xff32A060),
),
),
SizedBox(
height: 4.h,
),
Text(
"5",
style: TextStyle(
fontSize: 40.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060),
),
),
],
),
),
Text(
S.of(context).manyuankeyong(30),
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060),
),
),
],
),
flex: 1,
),
Expanded(
flex: 2,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
padding: EdgeInsets.fromLTRB(4, 2, 4, 2),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
border: Border.all(
width: 1,
color: Color(0xFFFF7A1A),
style: BorderStyle.solid,
),
),
child: Text(
S.of(context).shangjiaquan,
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFFFF7A1A),
),
),
),
SizedBox(
width: 8.w,
),
Expanded(
child: Text(
"百年川椒火锅店",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xff353535),
),
),
flex: 1,
)
],
),
Text(
"#新客户满减优惠#",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff727272),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
S.of(context).quanchangtongyong,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
),
),
Container(
margin: EdgeInsets.only(right: 23.w),
child:GestureDetector(
onTap: (){
state(() {
isSelected = index;
});
},
child:Image.asset(
isSelected != index
? "assets/image/icon_radio_unselected.png"
: "assets/image/icon_radio_selected.png",
width: 24,
height: 24,
),
),
),
],
),
],
),
),
],
),
),
flex: (coupon != null && coupon.isEx) ? 97 : 97,
),
Container(
padding: EdgeInsets.symmetric(horizontal: 23.w),
child: MySeparator(
width: 5.w,
height: 1.h,
color: Color(0xFF353535),
),
),
Expanded(
flex: (coupon != null && coupon.isEx) ? 56 : 42,
child: Container(
margin: EdgeInsets.symmetric(horizontal: 23.w, vertical: 8.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
S.of(context).xiangqing,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 10.sp,
),
),
GestureDetector(
child: Icon(
(coupon != null && !coupon.isEx)
? Icons.keyboard_arrow_down
: Icons.keyboard_arrow_up,
color: Colors.black,
size: 18,
), //
onTap: callbackEx,
),
],
),
if (coupon != null && coupon.isEx)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
S.of(context).shiyongriqi,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 10.sp,
),
),
Text(
(coupon.useStartTime == null &&
coupon.useEndTime == null)
? S.of(context).quantian
: "${coupon.useStartTime.replaceAll("-", ".").split(" ")[0]} - ${coupon.useEndTime.replaceAll("-", ".").split(" ")[0]}",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 10.sp,
),
),
],
),
],
),
),
),
],
),
);
});
}
var checkIndex = 1;
Widget checkView(var index) {

3
lib/store/store_view/store_activity.dart

@ -31,6 +31,7 @@ class _StoreActivity extends State<StoreActivity> {
: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
margin: EdgeInsets.only(top: 160.h),
color: Colors.white,
child: Swiper(
viewportFraction: 0.95,
@ -53,7 +54,7 @@ class _StoreActivity extends State<StoreActivity> {
child: Container(
margin: EdgeInsets.symmetric(horizontal: 5.w),
decoration: BoxDecoration(
color: Colors.white,
// color: Colors.white,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(

Loading…
Cancel
Save