diff --git a/assets/image/2x/activity_q.png b/assets/image/2x/activity_q.png index 98422818..3b30e5d3 100644 Binary files a/assets/image/2x/activity_q.png and b/assets/image/2x/activity_q.png differ diff --git a/assets/image/3x/activity_q.png b/assets/image/3x/activity_q.png index abd4589d..5d82dfa7 100644 Binary files a/assets/image/3x/activity_q.png and b/assets/image/3x/activity_q.png differ diff --git a/assets/image/activity_q.png b/assets/image/activity_q.png index 46742d63..31b4621a 100644 Binary files a/assets/image/activity_q.png and b/assets/image/activity_q.png differ diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 8eb7af46..1e4e1d6e 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -1,5 +1,4 @@ import 'dart:convert'; - import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; diff --git a/lib/main.dart b/lib/main.dart index cdb186a8..c05021fb 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -111,7 +111,7 @@ void main() async { runApp(MyApp(locale, isFirst)); // FlutterBugly.postCatchedException((){ // }); - // FlutterBugly.init(androidAppId: "204f207673",iOSAppId: "8bb92ba0f6"); + // FlutterBugly.init(androidAppId: "85ed24e0ec",iOSAppId: "b8a258b0bc"); } final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin(); diff --git a/lib/mine/mine_vip/legal_right_details.dart b/lib/mine/mine_vip/legal_right_details.dart index 709c4e13..21a2ae9d 100644 --- a/lib/mine/mine_vip/legal_right_details.dart +++ b/lib/mine/mine_vip/legal_right_details.dart @@ -463,9 +463,9 @@ class _LegalRightDetails extends State { children: [ MImage( vipBenefitList?.icon ?? "", - width: 50, - height: 50, - // fit: BoxFit.cover, + width:51, + height: 51, + isCircle: true, errorSrc: "assets/image/default_1.png", fadeSrc: "assets/image/default_1.png", ), diff --git a/lib/mine/mine_vip/mine_vip_core.dart b/lib/mine/mine_vip/mine_vip_core.dart index 94bcaf5b..5e357a41 100644 --- a/lib/mine/mine_vip/mine_vip_core.dart +++ b/lib/mine/mine_vip/mine_vip_core.dart @@ -66,6 +66,17 @@ class _MineVipCore extends State { queryBenefitList(); queryRuleDetails(); }); + weChatResponseEventHandler.listen((event) async { + print("payCallback: ${event.errCode}"); + if (event.errCode == 0) { + widget.arguments["rankLevel"] = ranks[checkIndex].level; + queryVipLevel(); + showAlertDialog(ranks[checkIndex].rankName); + } else { + SmartDialog.showToast("支付失败", alignment: Alignment.center); + return; + } + }); } queryVipLevel() async { @@ -134,17 +145,6 @@ class _MineVipCore extends State { timeStamp: int.tryParse(wxPay.timeStamp), sign: wxPay.sign, ); - weChatResponseEventHandler.listen((event) async { - print("payCallback: ${event.errCode}"); - if (event.errCode == 0) { - widget.arguments["rankLevel"] = ranks[checkIndex].level; - queryVipLevel(); - showAlertDialog(ranks[checkIndex].rankName); - } else { - SmartDialog.showToast("支付失败", alignment: Alignment.center); - return; - } - }); } else { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index 51323858..17af36a4 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -44,6 +44,17 @@ class _RechargePage extends State { queryBenefitList(); queryRuleDetails(); }); + weChatResponseEventHandler.listen((event) async { + print("payCallback: ${event.errCode}"); + if(event.errCode == 0){ + Navigator.of(context).pop(); + SmartDialog.showToast("充值成功", alignment: Alignment.center); + } + else{ + SmartDialog.showToast("充值失败", alignment: Alignment.center); + return; + } + }); } @@ -242,25 +253,27 @@ class _RechargePage extends State { ), Align(alignment: Alignment.bottomCenter,child: Container( - height: 54.h, + height: 56.h, color: Colors.white, child: Row( children: [ - Spacer(), - Padding(padding: EdgeInsets.only(top: 7,right: 16), + Expanded(child:Container( + padding:EdgeInsets.only(top: 7.h,left:16), child:Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( children: [ Text( S.of(context).heji, style: TextStyle( - fontSize: 12.sp, + fontSize: 14.sp, fontWeight: MyFontWeight.regular, color: Colors.black, ), ), Text( - controller.text == "" ? "" :(double.parse(controller.text) * (discount/100)).toString(), + controller.text, style: TextStyle( fontSize: 16.sp, fontWeight: MyFontWeight.medium, @@ -268,7 +281,56 @@ class _RechargePage extends State { ), ), ], - )), + ), + if(controller.text != "") + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "充值", + style: TextStyle( + fontSize:12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFADADAD), + ), + ), + TextSpan( + text:"¥${controller.text}", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color:Color(0xff3541C9), + ), + ), + TextSpan( + text: "赠送", + style: TextStyle( + fontSize:12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFADADAD), + ), + ), + TextSpan( + text:"¥${((double.tryParse(controller.text)??0) - ((double.tryParse(controller.text)??0) * (discount/100))).toStringAsFixed(2)}", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xff3541C9), + ), + ),TextSpan( + text: "元", + style: TextStyle( + fontSize:12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFADADAD), + ), + ), + ], + ), + ), + ], + )) + ), GestureDetector( onTap: () { recharge(); @@ -350,17 +412,6 @@ class _RechargePage extends State { timeStamp: int.tryParse(wxPay.timeStamp), sign: wxPay.sign, ); - weChatResponseEventHandler.listen((event) async { - print("payCallback: ${event.errCode}"); - if(event.errCode == 0){ - Navigator.of(context).pop(); - SmartDialog.showToast("充值成功", alignment: Alignment.center); - } - else{ - SmartDialog.showToast("充值失败", alignment: Alignment.center); - return; - } - }); } else{ SmartDialog.showToast(baseData.msg, alignment: Alignment.center); diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index 8913271d..149dc7be 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -1,7 +1,6 @@ import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; -import 'package:fluwx/fluwx.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/order/order_view/order_address.dart'; import 'package:huixiang/order/order_view/order_commodity.dart'; @@ -10,12 +9,8 @@ import 'package:huixiang/order/order_view/order_pay_selected.dart'; import 'package:huixiang/order/order_view/order_status.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/order_info.dart'; -import 'package:huixiang/retrofit/data/placeOrderFirst.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/settlement/settlement_view/pay_method.dart'; -import 'package:huixiang/utils/min.dart'; import 'package:huixiang/view_widget/icon_text.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:shared_preferences/shared_preferences.dart'; diff --git a/lib/order/order_view/order_info.dart b/lib/order/order_view/order_info.dart index 0fdb3eff..945ead9a 100644 --- a/lib/order/order_view/order_info.dart +++ b/lib/order/order_view/order_info.dart @@ -45,8 +45,8 @@ class _OrderInfoView extends State { S.of(context).dingdanhao, widget.orderInfo != null ? widget.orderInfo.id : ""), orderInfoItem(S.of(context).xiadanshijian, widget.orderInfo != null ? widget.orderInfo.createTime : ""), - // orderInfoItem(S.of(context).peisongfangshi, orderInfo != null ? orderInfo.createTime : ""), - orderInfoItem(S.of(context).peisongfangshi,"美团配送"), + orderInfoItem(S.of(context).peisongfangshi,(widget.orderInfo != null && widget.orderInfo.logisticsName != "") ? widget.orderInfo.logisticsName : "美团配送"), + // orderInfoItem(S.of(context).peisongfangshi,"美团配送"), orderInfoItem( S.of(context).beizhuxinxi, widget.orderInfo != null diff --git a/lib/order/order_view/order_status.dart b/lib/order/order_view/order_status.dart index fd2125c6..598ede2f 100644 --- a/lib/order/order_view/order_status.dart +++ b/lib/order/order_view/order_status.dart @@ -166,18 +166,21 @@ class _OrderStatus extends State { } } return [ - AspectRatio( - aspectRatio: 1, - child: BorderText( - text: hour, - textColor: Colors.white, - fontSize: 21.sp, - fontWeight: FontWeight.bold, - borderColor: Colors.white, - borderWidth: 1, - padding: EdgeInsets.all(2), - ), - ), + Container( + alignment: Alignment.center, + child: AspectRatio( + aspectRatio: 1, + child: BorderText( + text: hour, + textColor: Colors.white, + fontSize:16.sp, + fontWeight: FontWeight.bold, + borderColor: Colors.white, + borderWidth: 1, + // padding: EdgeInsets.all(2), + ), + ), + ), SizedBox( width: 8.w, ), @@ -196,11 +199,11 @@ class _OrderStatus extends State { child: BorderText( text: minute, textColor: Colors.white, - fontSize: 21.sp, + fontSize:16.sp, fontWeight: FontWeight.bold, borderColor: Colors.white, borderWidth: 1, - padding: EdgeInsets.all(2), + // padding: EdgeInsets.all(2), ), ), ]; diff --git a/lib/retrofit/data/base_data.g.dart b/lib/retrofit/data/base_data.g.dart index 3a4ba372..8c7d9178 100644 --- a/lib/retrofit/data/base_data.g.dart +++ b/lib/retrofit/data/base_data.g.dart @@ -10,6 +10,16 @@ BaseData _$BaseDataFromJson( Map json, T Function(Object json) fromJsonT, ) { + if(!(json['isSuccess'] as bool)) + return BaseData() + ..code = json['code'] as int + ..data = null + ..extra = json['extra'] + ..isError = json['isError'] as bool + ..isSuccess = json['isSuccess'] as bool + ..msg = json['msg'] as String + ..path = json['path'] as String + ..timestamp = json['timestamp'] as String; return BaseData() ..code = json['code'] as int ..data = fromJsonT(json['data']) diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 8d0223bb..823d1620 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -21,15 +21,15 @@ import 'data/shoppingCart.dart'; part 'min_api.g.dart'; -// const base_url = "https://pos.api.lotus-wallet.com/app/"; ///正式 -// const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式 +const base_url = "https://pos.api.lotus-wallet.com/app/"; ///正式 +const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式 // const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 -const base_url = "http://192.168.10.236:8765/app/";///费韬 -const baseUrl = "http://192.168.10.236:8765/app/";///费韬 +// const base_url = "http://192.168.10.236:8765/app/";///费韬 +// const baseUrl = "http://192.168.10.236:8765/app/";///费韬 // const base_url = "http://192.168.10.88:8765/app/";///詹云久 diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index 1c1cc751..02d9988a 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -9,7 +9,7 @@ part of 'min_api.dart'; class _MinApiService implements MinApiService { _MinApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'http://192.168.10.236:8765/app/'; + baseUrl ??= 'https://pos.api.lotus-wallet.com/app/'; } final Dio _dio; diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 456c4536..adc8711d 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -54,14 +54,14 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 -// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 -const base_url = "http://192.168.10.236:8766/app/"; ///费韬 -const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 +// const base_url = "http://192.168.10.236:8766/app/"; ///费韬 +// const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 // const base_url = "http://192.168.10.159:8766/app/"; ///费韬 // const baseUrl = "http://192.168.10.159:8766/app/"; ///费韬 @@ -71,7 +71,7 @@ const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 // const base_url = "http://192.168.10.88:8766/app/";///詹云久 -// const baseUrl = "http://192.168.10.142:8766/app/";///詹云久 +// const baseUrl = "http://192.168.10.88:8766/app/";///詹云久 @RestApi(baseUrl: baseUrl) abstract class ApiService { diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 71083690..5735110a 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -9,7 +9,7 @@ part of 'retrofit_api.dart'; class _ApiService implements ApiService { _ApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'http://192.168.10.236:8766/app/'; + baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/'; } final Dio _dio; diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index b25b4a28..4b7331e1 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -111,6 +111,11 @@ class _Settlement extends State { else queryOrderInfo(null, selectedBtn, null, 0, null); }); + + weChatResponseEventHandler.listen((event) async { + print("payCallback: ${event.errCode}"); + toOrderDetails(placeOrderFirst.id); + }); } ///订单结算信息 @@ -278,6 +283,10 @@ class _Settlement extends State { this.downOrder = baseData.data; querySettlement(); } + else{ + SmartDialog.showToast(baseData.msg, + alignment: Alignment.center); + } } else { ///火锅店下单, 等待结算 BaseData baseData; @@ -351,12 +360,9 @@ class _Settlement extends State { timeStamp: int.tryParse(wxPay.timeStamp), sign: wxPay.sign, ); - weChatResponseEventHandler.listen((event) async { - print("payCallback: ${event.errCode}"); - toOrderDetails(placeOrderFirst.id); - }); } - } else { + } + else { BaseData baseData = await minService .settlementApi(placeOrderFirst.toJson()) .catchError((error) { diff --git a/pubspec.lock b/pubspec.lock index 2be72f68..9664509d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -867,7 +867,7 @@ packages: name: xdg_directories url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.0" + version: "0.2.0+1" xml: dependency: transitive description: