Browse Source

Merge remote-tracking branch 'origin/dev' into remove_uniapp

ff_new
fmk 3 years ago
parent
commit
a4741f2699
  1. 2
      lib/community/headlines/article_page.dart
  2. 3
      lib/integral_store/integral_store_details_page.dart
  3. 314
      lib/order/exchange_order_page.dart
  4. 28
      lib/settlement/settlement.dart
  5. 16
      lib/store/store_order.dart

2
lib/community/headlines/article_page.dart

@ -217,7 +217,7 @@ class _ArticlePage extends State<ArticlePage>
List<Widget> classChildItem() {
var widgets = <Widget>[
///banner
///banner
HeadlinesBanner(bannerData,),
SizedBox(height: 28),

3
lib/integral_store/integral_store_details_page.dart

@ -298,7 +298,8 @@ class _IntegralStoreDetailsPage extends State<IntegralStoreDetailsPage> {
: Image.network(
goods.viceImgPaths.elementAt(position),
fit: BoxFit.cover,
);
)
;
},
itemCount: (goods == null || goods.viceImgPaths == null)
? 1

314
lib/order/exchange_order_page.dart

@ -9,8 +9,10 @@ import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/data/wx_pay.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/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/receiving_method_dialog.dart';
import 'package:huixiang/view_widget/round_button.dart';
@ -31,33 +33,33 @@ class ExchangeOrderPage extends StatefulWidget {
class _ExchangeOrderPage extends State<ExchangeOrderPage> {
ApiService apiService;
String money = "0";
String balance = "0";
int buyNum = 1;
var checkIndex = 1;
UserInfo userInfo;
dynamic mBalance = 0;
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) {
if(value.getString("minMember") == null){
return;
}
Map<String, dynamic> memberInfo =
jsonDecode(value.getString("minMember"));
balance = memberInfo["balance"];
money = memberInfo["money"];
setState(() {});
});
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
context: context, token: value.getString("token")),
points =
UserInfo.fromJson(jsonDecode(value.getString('user'))).points,
queryUserBalance(),
});
}
queryUserBalance() async {
BaseData<UserInfo> baseData = await apiService.queryInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
mBalance = double.tryParse(userInfo.money);
if (mounted) setState(() {});
}
}
String points;
@override
@ -70,15 +72,16 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
background: Color(0xFFFAFAFA),
leadingColor: Colors.black,
),
body: Stack(children: [
body: Stack(
children: [
SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
widget.arguments["useTyped"] == 1?
Container(
margin:
EdgeInsets.only(left: 16, right: 16, top: 26, bottom: 8),
widget.arguments["useTyped"] == 1
? Container(
margin: EdgeInsets.only(
left: 16, right: 16, top: 26, bottom: 8),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.white,
@ -90,7 +93,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
spreadRadius: 0,
)
],
borderRadius: BorderRadius.all(Radius.circular(8)),
borderRadius:
BorderRadius.all(Radius.circular(8)),
),
child: Column(
children: [
@ -114,7 +118,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
SizedBox(
height: 18.h,
),
GestureDetector(onTap: (){
GestureDetector(
onTap: () {
setState(() {
showAlertDialog();
});
@ -131,7 +136,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
SizedBox(
width: 12.w,
),
Expanded(child:Text(
Expanded(
child: Text(
widget.arguments["useTyped"] == 1
? S.of(context).ziti
: widget.arguments["useTyped"] == 2
@ -148,7 +154,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
color: Color(0xFF32A060),
),
],
),),
),
),
Visibility(
child: SizedBox(
height: 13.h,
@ -174,23 +181,34 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
toAddressPicker();
},
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: Text(
(address != null && address != "")
(address != null &&
address != "")
? address
: widget.arguments["useTyped"] == 1
? S.of(context).qingxuanzhemendian
: widget.arguments["useTyped"] ==
: widget.arguments[
"useTyped"] ==
1
? S
.of(context)
.qingxuanzhemendian
: widget.arguments[
"useTyped"] ==
2
? S
.of(context)
.qingxuanzeshouhuodizhi
: S.of(context).xuni,
overflow: TextOverflow.ellipsis,
: S
.of(context)
.xuni,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF32A060),
@ -218,28 +236,34 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
Row(
children: [
Visibility(
visible: widget.arguments["useTyped"] != 3,
visible:
widget.arguments["useTyped"] != 3,
child: Text(
S.of(context).zitishijian,
style: TextStyle(
fontSize: 14.sp, color: Color(0xFF353535)),
fontSize: 14.sp,
color: Color(0xFF353535)),
),
),
Visibility(
visible: widget.arguments["useTyped"] != 3,
visible:
widget.arguments["useTyped"] != 3,
child: SizedBox(
width: 12.w,
),
),
Text(
widget.arguments["useTyped"] == 1
? S.of(context).duihuanhouwugegongzuori
? S
.of(context)
.duihuanhouwugegongzuori
: widget.arguments["useTyped"] == 2
? S.of(context).duihuanhoufahuo
: S.of(context).feishiwushangpin,
style: TextStyle(
fontSize: 14.sp,
color: widget.arguments["useTyped"] == 3
color:
widget.arguments["useTyped"] == 3
? Color(0xFF32A060)
: Color(0xFF353535)),
),
@ -247,7 +271,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
),
],
),
):
)
:
// Container(
// margin:
// EdgeInsets.only(left: 16, right: 16, top: 26, bottom: 8),
@ -328,8 +353,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
// ),
// ),
Container(
margin:
EdgeInsets.only(left: 16, right: 16, top: 26, bottom: 8),
margin: EdgeInsets.only(
left: 16, right: 16, top: 26, bottom: 8),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.white,
@ -341,7 +366,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
spreadRadius: 0,
)
],
borderRadius: BorderRadius.all(Radius.circular(8)),
borderRadius:
BorderRadius.all(Radius.circular(8)),
),
child: Column(
children: [
@ -365,7 +391,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
SizedBox(
height: 18.h,
),
GestureDetector(onTap: (){
GestureDetector(
onTap: () {
setState(() {
showAlertDialog();
});
@ -382,7 +409,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
SizedBox(
width: 12.w,
),
Expanded(child:Text(
Expanded(
child: Text(
widget.arguments["useTyped"] == 1
? S.of(context).ziti
: widget.arguments["useTyped"] == 2
@ -399,7 +427,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
color: Color(0xFF32A060),
),
],
),),
),
),
Visibility(
child: SizedBox(
height: 13.h,
@ -425,23 +454,34 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
toAddressPicker();
},
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: Text(
(address != null && address != "")
(address != null &&
address != "")
? address
: widget.arguments["useTyped"] == 1
? S.of(context).qingxuanzhemendian
: widget.arguments["useTyped"] ==
: widget.arguments[
"useTyped"] ==
1
? S
.of(context)
.qingxuanzhemendian
: widget.arguments[
"useTyped"] ==
2
? S
.of(context)
.qingxuanzeshouhuodizhi
: S.of(context).xuni,
overflow: TextOverflow.ellipsis,
: S
.of(context)
.xuni,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF32A060),
@ -470,8 +510,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
),
),
Container(
margin:
EdgeInsets.only(left: 16, right: 16, top: 8, bottom: 16),
margin: EdgeInsets.only(
left: 16, right: 16, top: 8, bottom: 16),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.white,
@ -513,19 +553,13 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
if (widget.arguments["image"] != null)
Image.network(
widget.arguments["image"],
fit: BoxFit.cover,
MImage(
widget?.arguments["image"] ?? "",
width: 80,
height: 80,
)
else
Image.asset(
"assets/image/default_1.png",
fit: BoxFit.cover,
width: 80,
height: 80,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
Expanded(
child: Container(
@ -537,6 +571,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
children: [
Text(
widget.arguments["name"],
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.bold,
@ -567,23 +603,31 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
children: [
Text(
"应付数额",
style:
TextStyle(fontSize: 14, color: Color(0xFF353535),fontWeight: MyFontWeight.regular),
style: TextStyle(
fontSize: 14,
color: Color(0xFF353535),
fontWeight: MyFontWeight.regular),
),
SizedBox(
width: 12,
),
Text(
widget.arguments["payType"] == 1 ? "${double.parse(widget.arguments["onePrice"])*buyNum}积分":
((widget.arguments["price"] == null || widget.arguments["price"] == "0"
widget.arguments["payType"] == 1
? "${double.parse(widget.arguments["onePrice"]) * buyNum}积分"
: ((widget.arguments["price"] == null ||
widget.arguments["price"] == "0"
? ""
: "${double.parse(widget.arguments["price"])*buyNum}积分") +
(widget.arguments["money"] == null || widget.arguments["money"] == "0.00"
: "${double.parse(widget.arguments["price"]) * buyNum}积分") +
(widget.arguments["money"] == null ||
widget.arguments["money"] ==
"0.00"
? ""
: " + ${double.parse(widget.arguments["money"])*buyNum}")),
: " + ${double.parse(widget.arguments["money"]) * buyNum}")),
style: TextStyle(
fontSize: 12,
decoration:(widget.arguments["payType"] == 3) ? TextDecoration.lineThrough:TextDecoration.none,
decoration: (widget.arguments["payType"] == 3)
? TextDecoration.lineThrough
: TextDecoration.none,
color: Color(0xFF32A060),
),
),
@ -592,21 +636,23 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
SizedBox(
height: 12,
),
if(widget.arguments["payType"] == 3)
if (widget.arguments["payType"] == 3)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"现金抵扣积分",
style:
TextStyle(fontSize: 14, color: Color(0xFF353535),fontWeight: MyFontWeight.regular),
style: TextStyle(
fontSize: 14,
color: Color(0xFF353535),
fontWeight: MyFontWeight.regular),
),
SizedBox(
width: 12,
),
Text(
"${double.parse(widget.arguments["oneMoney"])*buyNum}",
"${double.parse(widget.arguments["oneMoney"]) * buyNum}",
style: TextStyle(
fontSize: 12,
color: Colors.black,
@ -624,7 +670,9 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
Text(
"合计",
style: TextStyle(
fontSize: 14.sp, color: Color(0xFF353535),fontWeight: MyFontWeight.regular),
fontSize: 14.sp,
color: Color(0xFF353535),
fontWeight: MyFontWeight.regular),
),
SizedBox(
width: 12.w,
@ -640,8 +688,7 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
),
),
Container(
margin:
EdgeInsets.only(left: 16, right: 16, bottom: 8),
margin: EdgeInsets.only(left: 16, right: 16, bottom: 8),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.white,
@ -659,7 +706,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
children: [
Row(
children: [
Expanded(child: Text(
Expanded(
child: Text(
"兑换数量",
style: TextStyle(
fontWeight: MyFontWeight.regular,
@ -669,8 +717,7 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
InkWell(
onTap: () {
setState(() {
if(buyNum > 1)
buyNum -= 1;
if (buyNum > 1) buyNum -= 1;
});
},
child: Image.asset(
@ -694,13 +741,20 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
InkWell(
onTap: () {
setState(() {
if(widget.arguments["payType"] == 1 ?
(double.parse(widget.arguments["onePrice"])*(buyNum+1))
> double.parse(points):
(widget.arguments["price"] == null || widget.arguments["price"] == "0"
if (widget.arguments["payType"] == 1
? (double.parse(widget
.arguments["onePrice"]) *
(buyNum + 1)) >
double.parse(points)
: (widget.arguments["price"] == null ||
widget.arguments["price"] == "0"
? false
: (double.parse(widget.arguments["price"])*(buyNum+1)) > double.parse(points))){
SmartDialog.showToast("您的积分不足", alignment: Alignment.center);
: (double.parse(widget
.arguments["price"]) *
(buyNum + 1)) >
double.parse(points))) {
SmartDialog.showToast("您的积分不足",
alignment: Alignment.center);
return;
}
buyNum += 1;
@ -717,7 +771,7 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
],
),
),
if(widget.arguments["payType"] == 3 ||
if (widget.arguments["payType"] == 3 ||
(widget.arguments["payType"] == 2 &&
widget.arguments["money"] != "0.00"))
Container(
@ -726,7 +780,7 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
left: 16.w,
right: 16.w,
top: 12.h,
bottom:20.h,
bottom: 20.h,
),
padding: EdgeInsets.only(
left: 16.w,
@ -777,7 +831,7 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
flex: 1,
),
Text(
"¥$money",
"¥$mBalance",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
@ -848,7 +902,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
checkPayView(3),
@ -874,15 +929,17 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
SizedBox(height: 40)
],
)),
Align(alignment: Alignment.bottomCenter,child:
Container(
Align(
alignment: Alignment.bottomCenter,
child: Container(
height: 54.h,
color: Colors.white,
child: Row(
children: [
Spacer(),
Padding(padding: EdgeInsets.only(top: 7,right: 16),
child:Column(
Padding(
padding: EdgeInsets.only(top: 7, right: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
@ -893,7 +950,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
color: Colors.black,
),
),
Text(handleNeedPay(),
Text(
handleNeedPay(),
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
@ -912,8 +970,9 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
height: 54.h,
text: widget.arguments["payType"] == 3 ||
(widget.arguments["payType"] == 2 &&
widget.arguments["money"] != "0.00") ?
S.current.jiesuan : S.current.duihuan,
widget.arguments["money"] != "0.00")
? S.current.jiesuan
: S.current.duihuan,
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060),
@ -925,8 +984,8 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
],
),
))
],)
);
],
));
}
///
@ -935,7 +994,7 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
showDialog(
context: context,
builder: (BuildContext context) {
return ReceivingMethodDialog(widget.arguments["useTyped"],(value){
return ReceivingMethodDialog(widget.arguments["useTyped"], (value) {
setState(() {
widget.arguments["useTyped"] = value;
});
@ -944,13 +1003,19 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
);
}
String handleNeedPay(){
return widget.arguments["payType"] == 1 ?
"${double.parse(widget.arguments["onePrice"])*buyNum}积分".toString() : (widget.arguments["payType"] == 2
? ((widget.arguments["price"] == null || widget.arguments["price"] == "0"
? "" : "${double.parse(widget.arguments["price"]) * buyNum}积分") +
(widget.arguments["money"] == null || widget.arguments["money"] == "0.00"
? "" : " + ${double.parse(widget.arguments["money"])*buyNum}")):"${double.parse(widget.arguments["oneMoney"])*buyNum}");
String handleNeedPay() {
return widget.arguments["payType"] == 1
? "${double.parse(widget.arguments["onePrice"]) * buyNum}积分".toString()
: (widget.arguments["payType"] == 2
? ((widget.arguments["price"] == null ||
widget.arguments["price"] == "0"
? ""
: "${double.parse(widget.arguments["price"]) * buyNum}积分") +
(widget.arguments["money"] == null ||
widget.arguments["money"] == "0.00"
? ""
: " + ${double.parse(widget.arguments["money"]) * buyNum}"))
: "${double.parse(widget.arguments["oneMoney"]) * buyNum}");
}
Widget checkPayView(var index) {
@ -1004,19 +1069,21 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
}
BaseData baseDate = await apiService.creditOrder({
"goodsId": widget.arguments["goodsId"],
"isOneSell":widget.arguments["payType"] != 2,
"isPoints":!handleNeedPay().contains(""),
"isOneSell": widget.arguments["payType"] != 2,
"isPoints": !handleNeedPay().contains(""),
"number": buyNum,
"useTyped": widget.arguments["useTyped"],
"payChannel":handleNeedPay().contains("") ? (checkIndex == 3?"1":"4") : "0",
"payChannel":
handleNeedPay().contains("") ? (checkIndex == 3 ? "1" : "4") : "0",
if (widget.arguments["useTyped"] == 1) "storeId": storeId,
if (widget.arguments["useTyped"] == 2) "userAddressId": userAddressId,
});
if (baseDate.isSuccess) {
if((widget.arguments["payType"] == 3 ||
String realPay = handleNeedPay();
if ((widget.arguments["payType"] == 3 ||
(widget.arguments["payType"] == 2 &&
widget.arguments["money"] != "0.00")) &&
checkIndex == 3){
checkIndex == 3) {
// if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调
// getPackage空指针
@ -1040,39 +1107,30 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
);
weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}");
if(event.errCode == 0){
if (event.errCode == 0) {
Navigator.of(context).popAndPushNamed(
'/router/exchange_order_success_page',
arguments: {
"id": widget.arguments["goodsId"],
"price": (widget.arguments["payType"] == 1 ?
(double.parse(widget.arguments["onePrice"])*buyNum).toString():
(widget.arguments["price"] == null || widget.arguments["price"] == "0"
? "0"
: (double.parse(widget.arguments["price"])*buyNum).toString())),
"price": realPay.contains("积分") ? realPay.substring(0,realPay.indexOf("积分")) : "0",
"points": points,
"realPay":handleNeedPay(),
"payChannel":widget.arguments["payChannel"],
"realPay": realPay,
"payChannel": widget.arguments["payChannel"],
},
);
}else {
} else {
SmartDialog.showToast("支付失败", alignment: Alignment.center);
return;
}
});
return;
}
await Navigator.of(context)
.pushNamed('/router/exchange_order_success_page', arguments: {
"price": (widget.arguments["payType"] == 1 ?
(double.parse(widget.arguments["onePrice"])*buyNum).toString():
(widget.arguments["price"] == null || widget.arguments["price"] == "0"
? "0"
: (double.parse(widget.arguments["price"])*buyNum).toString())),
"realPay":handleNeedPay(),
"price": realPay.contains("积分") ? realPay.substring(0,realPay.indexOf("积分")) : "0",
"realPay": realPay,
"points": points,
"payChannel":widget.arguments["payChannel"],
"payChannel": widget.arguments["payChannel"],
"id": baseDate.data
});
points =

28
lib/settlement/settlement.dart

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -72,8 +74,8 @@ class _Settlement extends State<Settlement> {
parentId = widget.arguments["parentId"] ?? "";
storeInfo = widget.arguments["storeInfo"];
numberOfPeople = widget.arguments["numberOfPeople"] ?? 0;
promotions=widget.arguments["pid"]??"";
coupons=widget.arguments["cid"]??"";
promotions=widget.arguments["pName"]??"";
coupons=widget.arguments["cName"]??"";
if (tableId == 0) {
placeOrder = true;
}
@ -89,6 +91,24 @@ class _Settlement extends State<Settlement> {
tenant: tenant,
storeId: storeId,
);
if(promotions != null && promotions != ""){
queryOrderInfo(
address != null ? address.id : null,
selectedBtn,
null,
0,
widget.arguments["pid"],
);
}else if(coupons != null && coupons != ""){
queryOrderInfo(
address != null ? address.id : null,
selectedBtn,
widget.arguments["cid"],
0,
null,
);
}
else
queryOrderInfo(null, selectedBtn, null, 0, null);
});
}
@ -209,9 +229,9 @@ class _Settlement extends State<Settlement> {
placeOrderFirst.payChannel = payChannel;
placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean();
placeOrderFirst.promotionInfoDTO.promotionId =
promotion != null ? promotion.id : "";
promotion != null ? promotion.id : widget.arguments["pid"]??"";
placeOrderFirst.promotionInfoDTO.couponId =
couponListBean != null ? couponListBean.id : "";
couponListBean != null ? couponListBean.id : widget.arguments["cid"]??"";
placeOrderFirst.recMobile =
(mobile == null || mobile == "") ? mobile : storeInfo.headMobile;
placeOrderFirst.shoppingCartSkuItemList = settleOrderInfo.orderProductList;

16
lib/store/store_order.dart

@ -62,7 +62,9 @@ class _StoreOrderPage extends State<StoreOrderPage>
int numberOfPeople = 0;
///token
String minToken;
String pName;
String pid;
String cName;
String cid;
@override
@ -554,7 +556,9 @@ class _StoreOrderPage extends State<StoreOrderPage>
"tableId": tableId,
"parentCode": parentCode,
"parentId": parentId,
"pName":pName,
"pid":pid,
"cName":cName,
"cid":cid,
"shoppingCart": shopCarGoods,
"numberOfPeople": numberOfPeople,
@ -733,8 +737,10 @@ class _StoreOrderPage extends State<StoreOrderPage>
///
Future<ShoppingCart> queryShopCar() async {
pid="";
cid="";
pName="";//
pid="";//
cName="";//
cid="";//
BaseData<List<ShoppingCart>> baseDate =
await minService.getShoppingCart(tableId);
if (baseDate != null &&
@ -744,13 +750,15 @@ class _StoreOrderPage extends State<StoreOrderPage>
if( baseDate.data[0].selectDiscount ==1){
baseDate.data[0].couponList.forEach((element) {
if(element.isMaxCoupon){
cid = element.promotionName;
cName = element.promotionName;
cid = element.id;
}
});
}else if(baseDate.data[0].selectDiscount==2){
baseDate.data[0].promotionInfoList.forEach((element) {
if(element.isMaxPromotion){
pid=element.name;
pName=element.name;
pid=element.id;
}
});
}

Loading…
Cancel
Save