Browse Source

部分ui更改;

zyh
w-R 3 years ago
parent
commit
ee31644c58
  1. 6
      lib/home/home_view/discount_zone.dart
  2. 14
      lib/home/home_view/home_recommend_goods.dart
  3. 26
      lib/home/home_view/shortcut_operation.dart
  4. 12
      lib/home/home_view/top_selling_list.dart
  5. 26
      lib/home/home_view/union_entry.dart
  6. 6
      lib/home/points_mall_view/points_goods_view.dart
  7. 7
      lib/integral_store/integral_store_details_page.dart
  8. 2
      lib/mine/mine_page.dart
  9. 30
      lib/mine/mine_view/mine_calendar.dart
  10. 9
      lib/order/exchange_order_page.dart
  11. 51
      lib/order/order_history_page.dart
  12. 6
      lib/retrofit/data/order_product_vo.dart
  13. 26
      lib/retrofit/data/placeOrderFirst.dart
  14. 6
      lib/retrofit/min_api.dart
  15. 6
      lib/retrofit/min_api.g.dart
  16. 21
      lib/settlement/settlement.dart
  17. 5
      lib/store/store_view/store_order_list.dart
  18. 7
      lib/view_widget/activity_poster.dart
  19. 7
      lib/view_widget/custom_image.dart

6
lib/home/home_view/discount_zone.dart

@ -102,7 +102,7 @@ class _DiscountZone extends State<DiscountZone> {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
height: 1.5, height: 1.5.h,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFFFA607), color: Color(0xFFFFA607),
), ),
@ -206,7 +206,7 @@ class _DiscountZone extends State<DiscountZone> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
padding: EdgeInsets.only(bottom:10,top: 7,left: 12), padding: EdgeInsets.only(bottom:10.h,top: 7.h,left: 12.w),
child: Text( child: Text(
S.of(context).duihuanquan, S.of(context).duihuanquan,
style: TextStyle( style: TextStyle(
@ -232,7 +232,7 @@ class _DiscountZone extends State<DiscountZone> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
padding: EdgeInsets.only(bottom:10,top: 7,left: 12), padding: EdgeInsets.only(bottom:10.h,top: 7.h,left: 12.w),
child: Text( child: Text(
S.of(context).duihuanquan, S.of(context).duihuanquan,
style: TextStyle( style: TextStyle(

14
lib/home/home_view/home_recommend_goods.dart

@ -86,14 +86,14 @@ class _HomeRecommendGoods extends State<HomeRecommendGoods> {
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4.r),
), ),
child: MImage( child: MImage(
commodityZone?.productImg ?? "", commodityZone?.productImg ?? "",
fit: BoxFit.contain, fit: BoxFit.contain,
radius: BorderRadius.circular(4), radius: BorderRadius.circular(4.r),
width: 158, width: 158.w,
height: 158, height: 158.h,
errorSrc: "assets/image/default_2_1.webp", errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp", fadeSrc: "assets/image/default_2_1.webp",
), ),
@ -116,7 +116,7 @@ class _HomeRecommendGoods extends State<HomeRecommendGoods> {
SizedBox( SizedBox(
height: 4.h, height: 4.h,
), ),
Row( Expanded(child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@ -128,7 +128,7 @@ class _HomeRecommendGoods extends State<HomeRecommendGoods> {
color: Color(0xFFF85400), color: Color(0xFFF85400),
), ),
), ),
SizedBox(width: 5,), SizedBox(width: 5.w,),
Text( Text(
"¥${AppUtils.calculateDouble(double.tryParse(commodityZone?.price) ?? 0)}", "¥${AppUtils.calculateDouble(double.tryParse(commodityZone?.price) ?? 0)}",
style: TextStyle( style: TextStyle(
@ -139,7 +139,7 @@ class _HomeRecommendGoods extends State<HomeRecommendGoods> {
), ),
), ),
], ],
), )),
], ],
), ),
); );

26
lib/home/home_view/shortcut_operation.dart

@ -30,7 +30,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
return Container( return Container(
height: 80.h, height: 80.h,
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(bottom:15,left: 10,right: 10), margin: EdgeInsets.only(bottom:15.h,left: 10.w,right: 10.w),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -85,8 +85,8 @@ class _ShortcutOperation extends State<ShortcutOperation> {
SizedBox(width: 3.w), SizedBox(width: 3.w),
Expanded(child: Image.asset( Expanded(child: Image.asset(
"assets/image/home_lm.webp", "assets/image/home_lm.webp",
width:36, width:36.w,
height:36, height:36.h,
),), ),),
], ],
), ),
@ -98,7 +98,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.symmetric(horizontal:5), margin: EdgeInsets.symmetric(horizontal:5.w),
padding: EdgeInsets.all(10.h), padding: EdgeInsets.all(10.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -110,7 +110,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
spreadRadius: 0, spreadRadius: 0,
) )
], ],
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4.r),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -128,7 +128,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
color: Color(0xFF0D0D0D), color: Color(0xFF0D0D0D),
), ),
), ),
SizedBox(height: 5), SizedBox(height: 5.h),
Text( Text(
"充值福利多", "充值福利多",
style: TextStyle( style: TextStyle(
@ -142,8 +142,8 @@ class _ShortcutOperation extends State<ShortcutOperation> {
SizedBox(width: 3.w), SizedBox(width: 3.w),
Expanded(child: Image.asset( Expanded(child: Image.asset(
"assets/image/home_recharge.webp", "assets/image/home_recharge.webp",
width:36, width:36.w,
height:36, height:36.h,
),), ),),
], ],
), ),
@ -156,7 +156,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
}, },
child:Container( child:Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.symmetric(horizontal:5), margin: EdgeInsets.symmetric(horizontal:5.w),
padding: EdgeInsets.all(10.h), padding: EdgeInsets.all(10.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -168,7 +168,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
spreadRadius: 0, spreadRadius: 0,
) )
], ],
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4.r),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -186,7 +186,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
color: Color(0xFF0D0D0D), color: Color(0xFF0D0D0D),
), ),
), ),
SizedBox(height: 5), SizedBox(height: 5.h),
Text( Text(
"天天得福利", "天天得福利",
style: TextStyle( style: TextStyle(
@ -200,8 +200,8 @@ class _ShortcutOperation extends State<ShortcutOperation> {
SizedBox(width: 3.w), SizedBox(width: 3.w),
Expanded(child: Image.asset( Expanded(child: Image.asset(
"assets/image/home_welfare.webp", "assets/image/home_welfare.webp",
width:36, width:36.w,
height:36, height:36.h,
),), ),),
], ],
), ),

12
lib/home/home_view/top_selling_list.dart

@ -88,7 +88,7 @@ class _TopSellingList extends State<TopSellingList> {
return Container( return Container(
width: 290.w, width: 290.w,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4.r),
color: Color(0xB3FFFFFF), color: Color(0xB3FFFFFF),
), ),
margin: EdgeInsets.only(right:8.w,top: 12.h), margin: EdgeInsets.only(right:8.w,top: 12.h),
@ -147,15 +147,15 @@ class _TopSellingList extends State<TopSellingList> {
goodList.productImg ?? "", goodList.productImg ?? "",
fit: BoxFit.cover, fit: BoxFit.cover,
radius: BorderRadius.circular(4), radius: BorderRadius.circular(4),
width: 54, width: 54.w,
height: 54, height: 54.h,
errorSrc: "assets/image/default_2_1.webp", errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp", fadeSrc: "assets/image/default_2_1.webp",
), ),
Image.asset( Image.asset(
index == 0 ? "assets/image/ranking1.webp" :(index == 1 ? "assets/image/ranking2.webp": "assets/image/ranking3.webp"), index == 0 ? "assets/image/ranking1.webp" :(index == 1 ? "assets/image/ranking2.webp": "assets/image/ranking3.webp"),
width: 25, width: 25.w,
height: 25, height: 25.h,
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
], ],
@ -189,7 +189,7 @@ class _TopSellingList extends State<TopSellingList> {
color: Color(0xFF0D0D0D), color: Color(0xFF0D0D0D),
), ),
), ),
SizedBox(width: 5,), SizedBox(width: 5.w,),
Text( Text(
"¥${AppUtils.calculateDouble(double.tryParse(goodList?.applyPrice) ?? 0)}", "¥${AppUtils.calculateDouble(double.tryParse(goodList?.applyPrice) ?? 0)}",
style: TextStyle( style: TextStyle(

26
lib/home/home_view/union_entry.dart

@ -30,7 +30,7 @@ class _UnionEntry extends State<UnionEntry> {
return Container( return Container(
height: 130.h, height: 130.h,
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(bottom:10,left: 10,right: 10,top: 14.h), margin: EdgeInsets.only(bottom:10.h,left: 10.w,right: 10.w,top: 14.h),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -41,7 +41,7 @@ class _UnionEntry extends State<UnionEntry> {
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.symmetric(horizontal:5), margin: EdgeInsets.symmetric(horizontal:5.w),
padding: EdgeInsets.symmetric(vertical:12.h), padding: EdgeInsets.symmetric(vertical:12.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -53,7 +53,7 @@ class _UnionEntry extends State<UnionEntry> {
spreadRadius: 0, spreadRadius: 0,
) )
], ],
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6.r),
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -62,8 +62,8 @@ class _UnionEntry extends State<UnionEntry> {
Image.asset( Image.asset(
"assets/image/home_chi.webp", "assets/image/home_chi.webp",
fit: BoxFit.cover, fit: BoxFit.cover,
width: 60, width: 60.w,
height: 60, height: 60.h,
), ),
SizedBox(height:4.h), SizedBox(height:4.h),
Text( Text(
@ -84,7 +84,7 @@ class _UnionEntry extends State<UnionEntry> {
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.symmetric(horizontal:5), margin: EdgeInsets.symmetric(horizontal:5.w),
// padding: EdgeInsets.symmetric(vertical:12.h), // padding: EdgeInsets.symmetric(vertical:12.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -96,7 +96,7 @@ class _UnionEntry extends State<UnionEntry> {
spreadRadius: 0, spreadRadius: 0,
) )
], ],
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6.r),
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -105,8 +105,8 @@ class _UnionEntry extends State<UnionEntry> {
Image.asset( Image.asset(
"assets/image/home_he.webp", "assets/image/home_he.webp",
fit: BoxFit.cover, fit: BoxFit.cover,
width: 60, width: 60.w,
height: 60, height: 60.h,
), ),
SizedBox(height:4.h), SizedBox(height:4.h),
Text( Text(
@ -127,7 +127,7 @@ class _UnionEntry extends State<UnionEntry> {
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.symmetric(horizontal:5), margin: EdgeInsets.symmetric(horizontal:5.w),
padding: EdgeInsets.symmetric(vertical:12.h), padding: EdgeInsets.symmetric(vertical:12.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -139,7 +139,7 @@ class _UnionEntry extends State<UnionEntry> {
spreadRadius: 0, spreadRadius: 0,
) )
], ],
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6.r),
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -148,8 +148,8 @@ class _UnionEntry extends State<UnionEntry> {
Image.asset( Image.asset(
"assets/image/home_wan.webp", "assets/image/home_wan.webp",
fit: BoxFit.cover, fit: BoxFit.cover,
width: 60, width: 60.w,
height: 60, height: 60.h,
), ),
SizedBox(height:4.h), SizedBox(height:4.h),
Text( Text(

6
lib/home/points_mall_view/points_goods_view.dart

@ -111,7 +111,7 @@ class _PointGoods extends State<PointGoods> {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Expanded(child: Text(
goods.name, goods.name,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
@ -120,8 +120,8 @@ class _PointGoods extends State<PointGoods> {
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
fontSize: 15.sp, fontSize: 15.sp,
), ),
), )),
SizedBox(height: 5,), SizedBox(height: 5.h,),
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

7
lib/integral_store/integral_store_details_page.dart

@ -247,11 +247,6 @@ class _IntegralStoreDetailsPage extends State<IntegralStoreDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( Text(
// goods?.onePrice == null || goods?.onePrice == "0"?
// ((goods?.price == null || goods?.price == "0"?"":S.of(context).jifen_(goods?.price)) +
// (goods?.money == null|| goods?.money == "0.00" ?"":" + ${goods.money}"))==""?
// (goods?.oneMoney == null || goods?.oneMoney == "0.00"?"":"${goods?.oneMoney}"):""
// :S.of(context).jifen_(goods?.onePrice),
pointPrice(), pointPrice(),
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
@ -264,7 +259,7 @@ class _IntegralStoreDetailsPage extends State<IntegralStoreDetailsPage> {
), ),
Expanded( Expanded(
child: Text( child: Text(
S.of(context).yuan_(goods?.worth ?? goods?.worth ?? ""), S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(goods?.worth ?? goods?.worth ?? "") ?? 0)),
style: TextStyle( style: TextStyle(
color: Color(0xFF585858), color: Color(0xFF585858),
decoration: TextDecoration.lineThrough, decoration: TextDecoration.lineThrough,

2
lib/mine/mine_page.dart

@ -245,7 +245,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
), ),
), ),
Container( Container(
margin: EdgeInsets.only(top: 265.h), margin: EdgeInsets.only(top: 258 .h),
child: Column( child: Column(
children: [ children: [
/// ///

30
lib/mine/mine_view/mine_calendar.dart

@ -46,27 +46,27 @@ class _MineCalendar extends State<MineCalendar> {
child: Row( child: Row(
children: [ children: [
Expanded(child: Text( Expanded(child: Text(
"我的5月足迹日历", "我的${DateTime.now().month}月足迹日历",
style: TextStyle( style: TextStyle(
color: Color(0xFF0D0D0D), color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 15.sp, fontSize: 15.sp,
), ),
),), ),),
Text( // Text(
"查看绿叶", // "查看绿叶",
style: TextStyle( // style: TextStyle(
color: Color(0xFF000000), // color: Color(0xFF000000),
fontWeight: MyFontWeight.regular, // fontWeight: MyFontWeight.regular,
fontSize: 15.sp, // fontSize: 15.sp,
), // ),
), // ),
Icon( // Icon(
Icons.navigate_next, // Icons.navigate_next,
size: 24, // size: 24,
color: Colors.black, // color: Colors.black,
), // ),
SizedBox(width:12,), // SizedBox(width:12,),
], ],
), ),
), ),

9
lib/order/exchange_order_page.dart

@ -10,6 +10,7 @@ import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/data/wx_pay.dart'; import 'package:huixiang/retrofit/data/wx_pay.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
@ -616,12 +617,12 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
: ((widget.arguments["price"] == null || : ((widget.arguments["price"] == null ||
widget.arguments["price"] == "0" widget.arguments["price"] == "0"
? "" ? ""
: "${(double.parse(widget.arguments["onePrice"]) * buyNum).toInt()}积分") + : "${(double.parse(widget.arguments["price"]) * buyNum).toInt()}积分") +
(widget.arguments["money"] == null || (widget.arguments["money"] == null ||
widget.arguments["money"] == widget.arguments["money"] ==
"0.00" "0.00"
? "" ? ""
: " + ${double.parse(widget.arguments["money"]) * buyNum}")), : " + ${AppUtils.calculateDouble(double.tryParse(widget.arguments["money"]) * buyNum) ?? 0}")),
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
decoration: (widget.arguments["payType"] == 3) decoration: (widget.arguments["payType"] == 3)
@ -1015,9 +1016,9 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
(widget.arguments["money"] == null || (widget.arguments["money"] == null ||
widget.arguments["money"] == "0.00" widget.arguments["money"] == "0.00"
? "" ? ""
: " + ${double.parse(widget.arguments["money"]) * buyNum}"); : " + ${AppUtils.calculateDouble(double.tryParse(widget.arguments["money"]) * buyNum) ?? 0}");
}else if(widget.arguments["payType"] == 3){ }else if(widget.arguments["payType"] == 3){
return "${double.parse(widget.arguments["oneMoney"]) * buyNum}"; return "${AppUtils.calculateDouble(double.tryParse(widget.arguments["oneMoney"]) * buyNum) ?? 0}";
} }
} }

51
lib/order/order_history_page.dart

@ -560,6 +560,24 @@ class _OrderHistoryList extends State<OrderHistoryList>
}); });
} }
queryDetails(id) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: true
);
}
BaseData<OrderInfo> baseData = await apiService
.orderDetail(id)
.catchError((error) {});
if (baseData != null && baseData.isSuccess) {
return baseData.data;
}
}
paySelected(OrderInfo orderInfo, MinApiService minService) async { paySelected(OrderInfo orderInfo, MinApiService minService) async {
var payChannel = await showModalBottomSheet( var payChannel = await showModalBottomSheet(
context: context, context: context,
@ -568,30 +586,23 @@ class _OrderHistoryList extends State<OrderHistoryList>
return OrderPaySelected(); return OrderPaySelected();
}, },
); );
// if (payChannel != null && payChannel > 0) {
// OrderUtils.carryOnPay(
// payChannel,
// minService,
// orderInfo,
// (BaseData baseData) {
// SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center);
// Future.delayed(Duration(seconds: 3), () {
// _onRefresh();
// });
// },
// );
// }
if (payChannel != null && payChannel > 0) { if (payChannel != null && payChannel > 0) {
OrderUtils.carryOnPay(payChannel, minService, orderInfo, payResult); orderInfo = await queryDetails(orderInfo.id);
OrderUtils.carryOnPay(
payChannel,
minService,
orderInfo,
(BaseData baseData) {
SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center);
Future.delayed(Duration(seconds: 3), () {
_onRefresh();
});
},
);
} }
} }
payResult(BaseData baseData) { payResult(BaseData baseData) {}
SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center);
Future.delayed(Duration(seconds: 3), () {
_onRefresh();
});
}
orderCancel(String orderId) async { orderCancel(String orderId) async {
BaseData baseData = BaseData baseData =

6
lib/retrofit/data/order_product_vo.dart

@ -10,9 +10,9 @@ class OrderProductVOList {
String id, String id,
String productId, String productId,
String productName, String productName,
String returnCode, dynamic returnCode,
String returnStatus, dynamic returnStatus,
String returnType, dynamic returnType,
String sellPrice, String sellPrice,
String skuId, String skuId,
String skuImg, String skuImg,

26
lib/retrofit/data/placeOrderFirst.dart

@ -5,25 +5,25 @@ import 'package:huixiang/retrofit/data/shoppingCart.dart';
class PlaceOrderFirst { class PlaceOrderFirst {
int cartNum; int cartNum;
String cartSum; dynamic cartSum;
String addressId; dynamic addressId;
bool isSubscribe; bool isSubscribe;
num isTakeOut; int isTakeOut;
String notes; dynamic notes;
String id; dynamic id;
String numberOfPeople; dynamic numberOfPeople;
num orderSource; int orderSource;
String orderType; dynamic orderType;
num orderTypeId; int orderTypeId;
String parentCode; dynamic parentCode;
String parentId; dynamic parentId;
num payChannel; int payChannel;
PromotionInfoDTOBean promotionInfoDTO; PromotionInfoDTOBean promotionInfoDTO;
String recMobile; String recMobile;
List<OrderProductVOList> orderProductVOList; List<OrderProductVOList> orderProductVOList;
List<OrderProductVOList> shoppingCartSkuItemList; List<OrderProductVOList> shoppingCartSkuItemList;
List<dynamic> skuItemDTOList; List<dynamic> skuItemDTOList;
num source; int source;
String storeId; String storeId;
String subcribeTime; String subcribeTime;
String tableId; String tableId;

6
lib/retrofit/min_api.dart

@ -65,8 +65,8 @@ abstract class MinApiService {
} }
headers["Environment"] = "app"; headers["Environment"] = "app";
dio.options = BaseOptions( dio.options = BaseOptions(
connectTimeout: 15000, connectTimeout: 18000,
receiveTimeout: 15000, receiveTimeout: 18000,
headers: headers, headers: headers,
responseType: ResponseType.json, responseType: ResponseType.json,
); );
@ -191,7 +191,7 @@ abstract class MinApiService {
/// ///
@POST("order/addOrder") @POST("order/addOrder")
Future<BaseData<DownOrder>> addOrder(@Body() Map<String, dynamic> param); Future<BaseData<dynamic>> addOrder(@Body() Map<String, dynamic> param);
/// ///
@POST("order/settlement") @POST("order/settlement")

6
lib/retrofit/min_api.g.dart

@ -292,7 +292,7 @@ class _MinApiService implements MinApiService {
} }
@override @override
Future<BaseData<DownOrder>> addOrder(param) async { Future<BaseData<dynamic>> addOrder(param) async {
ArgumentError.checkNotNull(param, 'param'); ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
@ -306,9 +306,9 @@ class _MinApiService implements MinApiService {
extra: _extra, extra: _extra,
baseUrl: baseUrl), baseUrl: baseUrl),
data: _data); data: _data);
final value = BaseData<DownOrder>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => json??""==""?null:DownOrder.fromJson(json), (json) => json,
); );
return value; return value;
} }

21
lib/settlement/settlement.dart

@ -78,6 +78,7 @@ class _Settlement extends State<Settlement> {
String productSkuId; String productSkuId;
int count1 = 0; int count1 = 0;
String productId; String productId;
bool orderButton = false;
@override @override
void initState() { void initState() {
@ -437,6 +438,7 @@ class _Settlement extends State<Settlement> {
.catchError((error) { .catchError((error) {
print("error: $error"); print("error: $error");
}); });
// orderButton =false;
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
placeOrder = true; placeOrder = true;
this.downOrder = DownOrder.fromJson(baseData.data); this.downOrder = DownOrder.fromJson(baseData.data);
@ -446,7 +448,7 @@ class _Settlement extends State<Settlement> {
} }
} else { } else {
/// ///
BaseData<DownOrder> baseData; BaseData<dynamic> baseData;
if (placeOrder) { if (placeOrder) {
// //
querySettlement(); querySettlement();
@ -467,9 +469,10 @@ class _Settlement extends State<Settlement> {
}); });
} }
} }
orderButton =false;
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
placeOrder = true; placeOrder = true;
this.downOrder = baseData.data; this.downOrder = DownOrder.fromJson(baseData.data);
queryOrderDetails( queryOrderDetails(
(parentId == null || parentId == "") ? baseData.data.id : parentId); (parentId == null || parentId == "") ? baseData.data.id : parentId);
setState(() {}); setState(() {});
@ -482,7 +485,7 @@ class _Settlement extends State<Settlement> {
/// ///
querySettlement() async { querySettlement() async {
placeOrderFirst.id = parentId != "" ? parentId : downOrder.id; placeOrderFirst.id = parentId != "" ? parentId : downOrder.id;
placeOrderFirst.orderProductVOList = downOrder == null placeOrderFirst.orderProductVOList = (downOrder == null)
? minOrderInfo.orderProductVOList ? minOrderInfo.orderProductVOList
: downOrder.orderProductVOList; : downOrder.orderProductVOList;
if (placeOrderFirst.payChannel == 1) { if (placeOrderFirst.payChannel == 1) {
@ -499,6 +502,7 @@ class _Settlement extends State<Settlement> {
.catchError((error) { .catchError((error) {
print(error); print(error);
}); });
orderButton =false;
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
WxPay wxPay = baseData.data; WxPay wxPay = baseData.data;
await registerWxApi( await registerWxApi(
@ -522,8 +526,9 @@ class _Settlement extends State<Settlement> {
.catchError((error) { .catchError((error) {
print(error); print(error);
}); });
orderButton =false;
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast(baseData?.msg == "ok" ? "订单支付成功":"", alignment: Alignment.center); SmartDialog.showToast(baseData.data, alignment: Alignment.center);
toOrderDetails(placeOrderFirst.id); toOrderDetails(placeOrderFirst.id);
} else { } else {
SmartDialog.show( SmartDialog.show(
@ -531,7 +536,7 @@ class _Settlement extends State<Settlement> {
() { () {
toOrderDetails(placeOrderFirst.id); toOrderDetails(placeOrderFirst.id);
}, },
text: "${baseData.msg}", text: "${baseData?.msg}",
)); ));
} }
} }
@ -780,6 +785,12 @@ class _Settlement extends State<Settlement> {
vertical: 5.h, vertical: 5.h,
), ),
callback: () { callback: () {
if(orderButton){
SmartDialog.showToast("订单正在提交中...",alignment: Alignment.center);
return;
}
else
orderButton = true;
pageType != null pageType != null
? bargainOrderId != null ? bargainOrderId != null
? activityPay() ? activityPay()

5
lib/store/store_view/store_order_list.dart

@ -129,6 +129,11 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
if (widget.storeInfo.posType.code ==
"NORMALSTORE" &&
widget.storeInfo.storeName == "百年川椒(光谷店)"||widget.storeInfo.storeName == "百年川椒(汉街店)")
return;
else
goShopDetailsPage(position); goShopDetailsPage(position);
}, },
child: goodsItem(position), child: goodsItem(position),

7
lib/view_widget/activity_poster.dart

@ -24,7 +24,6 @@ class _ActivityPoster extends State<ActivityPoster> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: double.infinity, width: double.infinity,
height: 332.h,
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only( margin: EdgeInsets.only(
left:27.w, left:27.w,
@ -45,9 +44,9 @@ class _ActivityPoster extends State<ActivityPoster> {
), ),
child:MImage( child:MImage(
widget?.activityPos?.showImage ?? "", widget?.activityPos?.showImage ?? "",
width: double.infinity, aspectRatio: 0.75,
height: MediaQuery.of(context).size.height / 2, fit: BoxFit.cover,
fit: BoxFit.fill, noCompress: true,
radius: BorderRadius.all(Radius.circular(12)), radius: BorderRadius.all(Radius.circular(12)),
errorSrc: "assets/image/default_1.webp", errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp",

7
lib/view_widget/custom_image.dart

@ -14,6 +14,7 @@ class MImage extends StatelessWidget {
double height; double height;
final BoxFit fit; final BoxFit fit;
final bool isCircle; final bool isCircle;
final bool noCompress;//
double scaleIndex = 2.5; double scaleIndex = 2.5;
@ -26,6 +27,7 @@ class MImage extends StatelessWidget {
this.height, this.height,
this.fit, this.fit,
this.isCircle = false, this.isCircle = false,
this.noCompress = false,
this.radius = BorderRadius.zero, this.radius = BorderRadius.zero,
}); });
@ -52,7 +54,10 @@ class MImage extends StatelessWidget {
MediaQuery.of(context).size.height:constraints.constrainHeight()) * scaleIndex).toInt(); MediaQuery.of(context).size.height:constraints.constrainHeight()) * scaleIndex).toInt();
/// ///
if ((src??"").startsWith("http")) { if ((src??"").startsWith("http")) {
imageUrl = "$src?imageView2/1/w/${_w}/h/${_h}/format/jpg/q/75"; if(!noCompress)
imageUrl = src;
else
imageUrl = "$src?imageView2/1/w/${_w}/h/${_h}/format/jpg/q/75";
} }
// print("imageUrl:$imageUrl"); // print("imageUrl:$imageUrl");

Loading…
Cancel
Save