Browse Source

更改

master
w-R 3 years ago
parent
commit
1f8c1ae435
  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. 82
      lib/store/store_order.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
),
)
],

82
lib/store/store_order.dart

@ -35,6 +35,7 @@ class StoreOrderPage extends StatefulWidget {
class testModel {
String name;
bool isSelected;
testModel(String name) {
this.name = name;
this.isSelected = false;
@ -47,7 +48,12 @@ class _StoreOrderPage extends State<StoreOrderPage>
ApiService apiService;
StoreInfo storeInfo;
RefreshController refreshController;
List<testModel> temperatureStoreList = [testModel("正常冰"),testModel("少冰"),testModel("多冰"),testModel("去冰")];
List<testModel> temperatureStoreList = [
testModel("正常冰"),
testModel("少冰"),
testModel("多冰"),
testModel("去冰")
];
List<testModel> sweetnessStoreList = [testModel("正常糖"), testModel("5分糖")];
int isSelected = 0;
int isChoice = 0;
@ -253,14 +259,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
color: Colors.black,
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.width,
child: Text(
S.of(context).xindianhuodong,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
),
)
],
controller: tabcontroller,
@ -303,9 +301,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
onTap: () {
Navigator.of(context).pushNamed(
'/router/settlement',
arguments: {
},
arguments: {},
);
},
child: RoundButton(
@ -319,7 +315,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
padding: EdgeInsets.symmetric(vertical: 5.h),
),
),
],
),
),
@ -354,7 +349,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
)
],
),
],
),
)
@ -362,17 +356,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
);
}
///
Widget starGoodsItem() {
return Container(
child: Text(
S.of(context).xindianhuodong,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
),
);
return Container(
child: Swiper(
viewportFraction: 0.95,
@ -502,6 +487,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
);
}
///
Widget order() {
return Container(
width: double.infinity,
@ -760,8 +746,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return StatefulBuilder(
builder:(context1, state) {
return StatefulBuilder(builder: (context1, state) {
return Container(
alignment: Alignment.topCenter,
padding: EdgeInsets.only(top: 16, left: 16, right: 16),
@ -859,13 +844,16 @@ class _StoreOrderPage extends State<StoreOrderPage>
SizedBox(
height: 15,
),
sweetnessStore((){state((){
sweetnessStore(() {
state(() {
for (var i = 0; i < temperatureStoreList.length; i++) {
if (tempClickIndex == i)
temperatureStoreList[i].isSelected = true;
else temperatureStoreList[i].isSelected = false;
else
temperatureStoreList[i].isSelected = false;
}
});},temperatureStoreList),
});
}, temperatureStoreList),
SizedBox(
height: 24,
),
@ -880,28 +868,31 @@ class _StoreOrderPage extends State<StoreOrderPage>
SizedBox(
height: 15,
),
sweetnessStore((){state((){
sweetnessStore(() {
state(() {
for (var i = 0; i < sweetnessStoreList.length; i++) {
if (tempClickIndex == i)
sweetnessStoreList[i].isSelected = true;
else sweetnessStoreList[i].isSelected = false;
else
sweetnessStoreList[i].isSelected = false;
}
});},sweetnessStoreList),
});
}, sweetnessStoreList),
SizedBox(
height: 24,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(child: Text(
Expanded(
child: Text(
"数量",
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
))
,
)),
InkWell(
onTap: () {},
child: Image.asset(
@ -947,7 +938,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
),
],
),
);});
);
});
},
);
}
@ -1005,8 +997,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return StatefulBuilder(
builder:(context1, state) {
return StatefulBuilder(builder: (context1, state) {
return Container(
alignment: Alignment.topCenter,
width: double.infinity,
@ -1036,8 +1027,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
),
),
InkWell(
onTap: () {
},
onTap: () {},
child: Image.asset(
"assets/image/delete.png",
width: 22,
@ -1047,8 +1037,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
],
),
SizedBox(height: 24.h),
Expanded(child:
Container(
Expanded(
child: Container(
child: ListView.builder(
itemCount: 10,
shrinkWrap: true,
@ -1056,7 +1046,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
itemBuilder: (context, position) {
return shoppGoodsItem();
}),
),)
),
)
],
),
),
@ -1136,13 +1127,13 @@ class _StoreOrderPage extends State<StoreOrderPage>
)
],
),
],
),
)
],
),
);});
);
});
},
);
}
@ -1261,7 +1252,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
);
}
// @override
// bool get wantKeepAlive => true;
}

Loading…
Cancel
Save