Browse Source

Merge branches 'dev' and 'master' of https://git.lotus-wallet.com/fmk/huixiang_app

 Conflicts:
	lib/store/store_order.dart
master
fmk 3 years ago
parent
commit
b30a7111e6
  1. 3
      lib/main.dart
  2. 1
      lib/order/order_detail_page.dart
  3. 34
      lib/order/order_view/order_address.dart
  4. 10
      lib/order/order_view/order_commodity.dart
  5. 1046
      lib/store/store_order.dart
  6. 107
      lib/union/union_details_page.dart
  7. 273
      lib/union/union_view/store_activity.dart

3
lib/main.dart

@ -52,6 +52,7 @@ import 'package:huixiang/setting/help_feedback_page.dart';
import 'package:huixiang/setting/permission_setting_page.dart';
import 'package:huixiang/setting/setting_page.dart';
import 'package:huixiang/setting/treaty_page.dart';
import 'package:huixiang/store/settlement.dart';
import 'package:huixiang/store/store_order.dart';
import 'package:huixiang/union/location_map_page.dart';
@ -261,6 +262,8 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/order_history_page': (context, {arguments}) => OrderHistoryPage(arguments: arguments),
'/router/order_details': (context, {arguments}) =>
OrderDetailPage(arguments: arguments),
'/router/settlement': (context, {arguments}) =>
Settlement(arguments: arguments),
'/router/recharge_page': (context, {arguments}) => RechargePage(),
'/router/hot_article_page': (context, {arguments}) => HotArticlePage(),
'/router/address_edit_page': (context, {arguments}) =>

1
lib/order/order_detail_page.dart

@ -125,7 +125,6 @@ class _OrderDetailPage extends State<OrderDetailPage> {
///
OrderStatus(orderStatus, isTakeOut, sendStatus, payStatus,
refundStatus, title, center, orderInfo),
///
OrderAddress(
orderStatus,

34
lib/order/order_view/order_address.dart

@ -1,5 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
@ -12,8 +10,6 @@ import 'package:huixiang/view_widget/text_image_dialog.dart';
import 'package:url_launcher/url_launcher.dart';
class OrderAddress extends StatefulWidget {
final int orderStatus;
final int isTakeOut;
final int sendStatus;
@ -24,14 +20,21 @@ class OrderAddress extends StatefulWidget {
final Function orderCancel;
final OrderInfo orderInfo;
OrderAddress(this.orderStatus, this.isTakeOut, this.sendStatus, this.payStatus, this.refundStatus, this.title, this.center, this.orderCancel, this.orderInfo);
OrderAddress(
this.orderStatus,
this.isTakeOut,
this.sendStatus,
this.payStatus,
this.refundStatus,
this.title,
this.center,
this.orderCancel,
this.orderInfo);
@override
State<StatefulWidget> createState() {
return _OrderAddress();
}
}
class _OrderAddress extends State<OrderAddress> {
@ -63,7 +66,8 @@ class _OrderAddress extends State<OrderAddress> {
height: 28.h,
),
Text(
(widget.orderInfo != null && widget.orderInfo.addressExt != null)
(widget.orderInfo != null &&
widget.orderInfo.addressExt != null)
? ((widget.isTakeOut == 0
? widget.orderInfo.storeName
: widget.orderInfo.addressExt.recName) ??
@ -80,7 +84,8 @@ class _OrderAddress extends State<OrderAddress> {
),
Expanded(
child: Text(
(widget.orderInfo != null && widget.orderInfo.addressExt != null)
(widget.orderInfo != null &&
widget.orderInfo.addressExt != null)
? (widget.orderInfo.addressExt.recMobile ?? "")
: "",
overflow: TextOverflow.ellipsis,
@ -190,12 +195,12 @@ class _OrderAddress extends State<OrderAddress> {
if (widget.payStatus == 0) {
carryOnPay();
} else {
String storeId =
(widget.orderInfo != null && widget.orderInfo.storeVO != null)
String storeId = (widget.orderInfo != null &&
widget.orderInfo.storeVO != null)
? (widget.orderInfo.storeVO.id ?? "")
: "";
String storeName =
(widget.orderInfo != null && widget.orderInfo.storeVO != null)
String storeName = (widget.orderInfo != null &&
widget.orderInfo.storeVO != null)
? (widget.orderInfo.storeVO.storeName ?? "")
: "";
aginOrder(storeId, storeName);
@ -237,7 +242,6 @@ class _OrderAddress extends State<OrderAddress> {
);
}
callMobile(mobile) async {
String url = "tel:$mobile";
if (await canLaunch(url)) {
@ -325,6 +329,4 @@ class _OrderAddress extends State<OrderAddress> {
},
);
}
}

10
lib/order/order_view/order_commodity.dart

@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/separator.dart';
@ -90,7 +91,7 @@ class _OrderCommodity extends State<OrderCommodity> {
widget.orderInfo.orderDetail.couponDTO != null) {
//
widgets.add(discountItem(
Color(0xFF32A060),
Color(0xFFFF7A1A),
S.of(context).youhuiquan,
widget.orderInfo.orderDetail.couponDTO.name,
widget.orderInfo.orderDetail.couponDTO.money));
@ -335,6 +336,7 @@ class _OrderCommodity extends State<OrderCommodity> {
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
fontWeight: MyFontWeight.semi_bold
),
),
flex: 1,
@ -343,8 +345,9 @@ class _OrderCommodity extends State<OrderCommodity> {
child: Text(
S.of(context).jiesuanjine,
style: TextStyle(
fontSize: 10.sp,
fontSize: 12.sp,
color: Color(0xFF353535),
fontWeight:MyFontWeight.semi_bold
),
),
),
@ -355,8 +358,9 @@ class _OrderCommodity extends State<OrderCommodity> {
totalPrice(),
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 30.sp,
fontSize:14.sp,
color: Color(0xFF32A060),
fontWeight: MyFontWeight.semi_bold
),
)
],

1046
lib/store/store_order.dart

File diff suppressed because it is too large Load Diff

107
lib/union/union_details_page.dart

@ -21,7 +21,6 @@ import 'package:huixiang/union/union_view/vip.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/min.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/receive_success.dart';
import 'package:path_provider/path_provider.dart';
@ -45,8 +44,6 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
@override
void dispose() {
SmartDialog.dismiss();
EasyLoading.dismiss();
super.dispose();
refreshController.dispose();
}
@ -83,45 +80,17 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
future: queryStoreInfo(),
builder: (context, snapshot) {
return Scaffold(
// appBar: MyAppBar(
// background: Color(0xFFF7F7F7),
// // title: storeInfo == null
// // ? (widget.arguments["storeName"] ?? "")
// // : storeInfo.storeName,
// title: "",
// titleColor: Colors.black87,
// titleSize: 18.sp,
// leadingColor: Colors.black,
// ),
body:
Stack(
children: [
MImage(
storeInfo != null && storeInfo.bannerList != null?
storeInfo.bannerList.first.imgUrl:"",
width: double.infinity,
height: 190.h,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
appBar: MyAppBar(
background: Color(0xFFF7F7F7),
title: storeInfo == null
? (widget.arguments["storeName"] ?? "")
: storeInfo.storeName,
titleColor: Colors.black87,
titleSize: 18.sp,
leadingColor: Colors.black,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
body: Column(
children: [
SizedBox(height:54.h,),
Padding(padding:EdgeInsets.only(left: 17.w),
child: GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child:Icon(
Icons.arrow_back_ios,
color: Colors.black,
size: 24,
)
),),
SizedBox(height:29.h,),
Expanded(
child: SmartRefresher(
controller: refreshController,
@ -139,49 +108,45 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
///
StoreInfos(storeInfo),
///
UnionCoupon(storeInfo, _receiveCoupon),
///VIP信息
Vip(storeInfo, _receiveVip, isReceive),
///
UnionCoupon(storeInfo, _receiveCoupon),
///
StoreActivity(widget.arguments, activitys),
],
),
),
),
// flex: 1,
flex: 1,
),
InkWell(
onTap: _loginMin,
child: Container(
padding: EdgeInsets.only(top: 16.h, bottom: 16.h),
decoration: BoxDecoration(
color: isEnable() ? Color(0xFF32A060) : Color(0xFFD8D8D8),
borderRadius: BorderRadius.vertical(
top: Radius.circular(4),
),
),
alignment: Alignment.center,
child: Text(
isEnable()
? S.of(context).jinrushangdian
: S.of(context).zanwuxianshangjindian,
style: TextStyle(
fontSize: 16.sp,
color: isEnable() ? Colors.white : Color(0xFFA0A0A0),
fontWeight: MyFontWeight.semi_bold,
),
),
),
// InkWell(
// onTap: _loginMin,
// child: Container(
// padding: EdgeInsets.only(top: 16.h, bottom: 16.h),
// decoration: BoxDecoration(
// color: isEnable() ? Color(0xFF32A060) : Color(0xFFD8D8D8),
// borderRadius: BorderRadius.vertical(
// top: Radius.circular(4),
// ),
// ),
// alignment: Alignment.center,
// child: Text(
// isEnable()
// ? S.of(context).jinrushangdian
// : S.of(context).zanwuxianshangjindian,
// style: TextStyle(
// fontSize: 16.sp,
// color: isEnable() ? Colors.white : Color(0xFFA0A0A0),
// fontWeight: MyFontWeight.semi_bold,
// ),
// ),
// ),
// ),
],
),
],
),
);
},
);
@ -339,7 +304,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
} else {
print("print 下载失败");
}
Future.delayed(Duration(seconds: 1), (){
Future.delayed(Duration(seconds: 1), () {
EasyLoading.dismiss();
});
}

273
lib/union/union_view/store_activity.dart

@ -5,6 +5,7 @@ import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/item_title.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/round_button.dart';
@ -23,51 +24,17 @@ class StoreActivity extends StatefulWidget {
}
class _StoreActivity extends State<StoreActivity> {
int page = 0;
int isSelected =0;
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
alignment:Alignment.centerLeft,
margin: EdgeInsets.only(top: 20.h, bottom: 20.h,left: 17.w),
child: Row(
children: [
GestureDetector(
onTap: (){setState(() {
page = 0;
});},
child: Text(
S.of(context).diandan,
textAlign: TextAlign.center,
style: TextStyle(
color: page==0?Colors.black:Colors.grey,
fontSize: page==0?16.sp:14.sp,
fontWeight: page==0?FontWeight.bold:FontWeight.normal,
),
),
),
Padding(padding: EdgeInsets.only(left: 10)),
GestureDetector(
onTap: (){setState(() {
page = 1;
});},
child: Text(
S.of(context).xindianhuodong,
textAlign: TextAlign.center,
style: TextStyle(
color: page==1?Colors.black:Colors.grey,
fontSize: page==1?16.sp:14.sp,
fontWeight: page==1?FontWeight.bold:FontWeight.normal,
margin: EdgeInsets.only(top: 20.h, bottom: 20.h),
child: ItemTitle(
text: S.of(context).xindianhuodong,
imgPath: "assets/image/icon_union_start_store.png",
),
),
),
],
),
),
page == 0 ? order():
(widget.activitys != null && widget.activitys.length > 0)
? Container(
margin: EdgeInsets.only(bottom: 30.h),
@ -94,45 +61,6 @@ class _StoreActivity extends State<StoreActivity> {
);
}
Widget order(){
return Container(
width: double.infinity,
child: Row(
children: [
Container(
// decoration: BoxDecoration(
// color: Color(0xFFFAFAFA),
// boxShadow: [
// BoxShadow(
// color: Color(0x0D000000),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0,
// )
// ],
// ),
width: 104.w,
child:ListView.builder(
itemCount:5,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return orderItem(position);
}),
),
Expanded(flex:1,child:Container(
child:ListView.builder(
itemCount:5,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return goodsItem();
}),
)),
],),
);
}
Widget buildSwiper2Bottom() {
return Container(
@ -263,195 +191,4 @@ class _StoreActivity extends State<StoreActivity> {
}
Widget orderItem(int index) {
return Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
onTap: (){setState(() {
isSelected = index;
});},
child: Container(
color: isSelected != index ?Color(0xFFFAFAFA):Colors.white,
child: Padding(padding: EdgeInsets.only(left: 16,right: 28,top:8,bottom: 16),
child: Row(
children: [
Container(
color: isSelected != index ? Color(0xFFFAFAFA):Color(0xFF32A060),
width: 2.w,
height: 17.h,
),
SizedBox(width: 10.w,),
Text(
"人气推荐",
textAlign: TextAlign.center,
style: TextStyle(
color:isSelected != index ?Color(0xFF202020):Color(0xFF000000),
fontSize:12.sp,
fontWeight: MyFontWeight.medium,
),
),
],
),),
),
),
],
),
);
}
Widget goodsItem() {
return Container(
color: Colors.white,
padding: EdgeInsets.only(right: 16.w),
child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 12.w
),
MImage(
"assets/image/default_1.png",
width: 70,
height: 70,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
SizedBox(width:10),
Expanded(child:
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"手工啵啵奶茶",
style: TextStyle(
color:Colors.black,
fontSize:13.sp,
fontWeight: MyFontWeight.medium,
),
),
SizedBox(height:2),
Row(
children: [
Text(
"无香精",
style: TextStyle(
color:Color(0xFF4C4C4C),
fontSize:10.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(width:10),
Text(
"无香精",
style: TextStyle(
color:Color(0xFF4C4C4C),
fontSize:10.sp,
fontWeight: MyFontWeight.regular,
),
)
],
),
SizedBox(height:7),
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
"会员价",
style: TextStyle(
color:Color(0xFFFF7A1A),
fontSize:10.sp,
fontWeight: MyFontWeight.medium,
),
),
Text(
"¥19.00",
style: TextStyle(
color:Color(0xFFFF7A1A),
fontSize:11.sp,
fontWeight: MyFontWeight.medium,
),
)
],
),
Row(
children: [
Text(
"原价",
style: TextStyle(
color:Color(0xFFA29E9E),
fontSize:9.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(width:10),
Text(
"¥19.00",
style: TextStyle(
color:Color(0xFFA29E9E),
fontSize:10.sp,
fontWeight: MyFontWeight.regular,
),
)
],
),
],
),
Spacer(),
true?RoundButton(
width: 49.w,
text: "选规格",
textColor: Colors.white,
fontWeight: MyFontWeight.medium,
radius: 11,
backgroup: Color(0xFF32A060),
fontSize: 11.sp,
padding: EdgeInsets.symmetric(vertical: 5.h),
):
InkWell(
onTap: () {
},
child: Image.asset(
"assets/image/reduce.png",
width: 22,
height: 22,
),
),
if(false)
Padding(padding: EdgeInsets.only(left: 8,right: 8),
child:Text(
"1",
style: TextStyle(
color:Colors.black,
fontSize:14.sp,
fontWeight: MyFontWeight.medium,
),
),),
if(false)
InkWell(
onTap: () {
},
child: Image.asset(
"assets/image/add.png",
width: 22,
height: 22,
),
),
],
),
],
),)
],
),
);
}
}
Loading…
Cancel
Save