|
@@ -58,7 +58,7 @@ class OrderInformationPage extends StatefulWidget {
|
|
|
this.commodityCover,
|
|
this.commodityCover,
|
|
|
this.commodityTitle,
|
|
this.commodityTitle,
|
|
|
this.commodityCount,
|
|
this.commodityCount,
|
|
|
- this.discountAmount=0.0});
|
|
|
|
|
|
|
+ this.discountAmount = 0.0});
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
_OrderInformationPageState createState() => _OrderInformationPageState();
|
|
_OrderInformationPageState createState() => _OrderInformationPageState();
|
|
@@ -90,10 +90,17 @@ class _OrderInformationPageState extends State<OrderInformationPage> {
|
|
|
MyCookie().balance = balance.data;
|
|
MyCookie().balance = balance.data;
|
|
|
this.balance = balanceDisplay(balance.data);
|
|
this.balance = balanceDisplay(balance.data);
|
|
|
if (widget.amount > balance.data) {
|
|
if (widget.amount > balance.data) {
|
|
|
- if(MyCookie().prefs.getInt('payWay')!=null){
|
|
|
|
|
- if(MyCookie().prefs.getInt('payWay')==payWayAliPay){
|
|
|
|
|
|
|
+ if (MyCookie().prefs.getInt('payWay') != null) {
|
|
|
|
|
+ if (MyCookie().prefs.getInt('payWay') == payWayAliPay &&
|
|
|
|
|
+ payWays[payWays.indexWhere(
|
|
|
|
|
+ (element) => element.way == payWayAliPay)]
|
|
|
|
|
+ .pay) {
|
|
|
payWay = payWayAliPay;
|
|
payWay = payWayAliPay;
|
|
|
- }else if(MyCookie().prefs.getInt('payWay')==payWayWeChat){
|
|
|
|
|
|
|
+ } else if (MyCookie().prefs.getInt('payWay') ==
|
|
|
|
|
+ payWayWeChat &&
|
|
|
|
|
+ payWays[payWays.indexWhere(
|
|
|
|
|
+ (element) => element.way == payWayWeChat)]
|
|
|
|
|
+ .pay) {
|
|
|
payWay = payWayWeChat;
|
|
payWay = payWayWeChat;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -222,34 +229,36 @@ class _OrderInformationPageState extends State<OrderInformationPage> {
|
|
|
alignment: Alignment.centerLeft,
|
|
alignment: Alignment.centerLeft,
|
|
|
padding: EdgeInsets.all(10),
|
|
padding: EdgeInsets.all(10),
|
|
|
),
|
|
),
|
|
|
- if(widget.discountAmount!=null&&widget.discountAmount!=0)
|
|
|
|
|
- Container(
|
|
|
|
|
- height: 10,
|
|
|
|
|
- color: MyColors.cEFEFEF,
|
|
|
|
|
- ),
|
|
|
|
|
- if(widget.discountAmount!=null&&widget.discountAmount!=0)
|
|
|
|
|
- Container(
|
|
|
|
|
- color: Colors.white,
|
|
|
|
|
- child: Row(
|
|
|
|
|
- children: [
|
|
|
|
|
- MyViews().myText('店铺折扣', MyColors.c333333, 16),
|
|
|
|
|
- Row(
|
|
|
|
|
- children: [
|
|
|
|
|
- Container(
|
|
|
|
|
- child: MyViews().myText(
|
|
|
|
|
- widget.discountAmount.toStringAsFixed(2),
|
|
|
|
|
- MyColors.c333333,
|
|
|
|
|
- 13),
|
|
|
|
|
- margin: EdgeInsets.only(left: 6, right: 6),
|
|
|
|
|
- ),
|
|
|
|
|
- ],
|
|
|
|
|
- )
|
|
|
|
|
- ],
|
|
|
|
|
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
+ if (widget.discountAmount != null &&
|
|
|
|
|
+ widget.discountAmount != 0)
|
|
|
|
|
+ Container(
|
|
|
|
|
+ height: 10,
|
|
|
|
|
+ color: MyColors.cEFEFEF,
|
|
|
|
|
+ ),
|
|
|
|
|
+ if (widget.discountAmount != null &&
|
|
|
|
|
+ widget.discountAmount != 0)
|
|
|
|
|
+ Container(
|
|
|
|
|
+ color: Colors.white,
|
|
|
|
|
+ child: Row(
|
|
|
|
|
+ children: [
|
|
|
|
|
+ MyViews().myText('店铺折扣', MyColors.c333333, 16),
|
|
|
|
|
+ Row(
|
|
|
|
|
+ children: [
|
|
|
|
|
+ Container(
|
|
|
|
|
+ child: MyViews().myText(
|
|
|
|
|
+ widget.discountAmount.toStringAsFixed(2),
|
|
|
|
|
+ MyColors.c333333,
|
|
|
|
|
+ 13),
|
|
|
|
|
+ margin: EdgeInsets.only(left: 6, right: 6),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ],
|
|
|
|
|
+ )
|
|
|
|
|
+ ],
|
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
+ ),
|
|
|
|
|
+ alignment: Alignment.centerLeft,
|
|
|
|
|
+ padding: EdgeInsets.all(10),
|
|
|
),
|
|
),
|
|
|
- alignment: Alignment.centerLeft,
|
|
|
|
|
- padding: EdgeInsets.all(10),
|
|
|
|
|
- ),
|
|
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
@@ -647,9 +656,8 @@ class _OrderInformationPageState extends State<OrderInformationPage> {
|
|
|
void toPayPage() {
|
|
void toPayPage() {
|
|
|
MyTools().toPage(
|
|
MyTools().toPage(
|
|
|
context,
|
|
context,
|
|
|
- PayPage(
|
|
|
|
|
- widget.uid, widget.cancelOrder, widget.amount, payWay, couponData,widget.discountAmount),
|
|
|
|
|
- (then) {
|
|
|
|
|
|
|
+ PayPage(widget.uid, widget.cancelOrder, widget.amount, payWay,
|
|
|
|
|
+ couponData, widget.discountAmount), (then) {
|
|
|
if (then is int) {
|
|
if (then is int) {
|
|
|
if (then == 1) {
|
|
if (then == 1) {
|
|
|
Navigator.pop(context, then);
|
|
Navigator.pop(context, then);
|
|
@@ -875,7 +883,8 @@ class _ChooseACouponState extends State<ChooseACoupon> {
|
|
|
"paging": [page, 20]
|
|
"paging": [page, 20]
|
|
|
}, (response, hasError) {
|
|
}, (response, hasError) {
|
|
|
if (!hasError) {
|
|
if (!hasError) {
|
|
|
- MyCouponBeanEntity entity = MyCouponBeanEntity.fromJson(json.decode(response.data.toString()));
|
|
|
|
|
|
|
+ MyCouponBeanEntity entity =
|
|
|
|
|
+ MyCouponBeanEntity.fromJson(json.decode(response.data.toString()));
|
|
|
if (page == 1) {
|
|
if (page == 1) {
|
|
|
coupons.clear();
|
|
coupons.clear();
|
|
|
}
|
|
}
|