Browse Source

會員信息

null_safety
fmk 4 years ago
parent
commit
792b85d7ee
  1. 2
      lib/article/hot_article_item.dart
  2. 1
      lib/generated/intl/messages_en.dart
  3. 1
      lib/generated/intl/messages_zh_CN.dart
  4. 1
      lib/generated/intl/messages_zh_TW.dart
  5. 10
      lib/generated/l10n.dart
  6. 4
      lib/home/activity_list_page.dart
  7. 1
      lib/home/home_page.dart
  8. 7
      lib/home/points_mall_page.dart
  9. 1
      lib/l10n/intl_en.arb
  10. 1
      lib/l10n/intl_zh_CN.arb
  11. 1
      lib/l10n/intl_zh_TW.arb
  12. 12
      lib/login/login_page.dart
  13. 43
      lib/mine/coupons_page.dart
  14. 85
      lib/mine/mine_vip_level_page.dart
  15. 40
      lib/mine/mine_wallet_page.dart
  16. 101
      lib/mine/roll_center_page.dart
  17. 2
      lib/mine/vip_card_page.dart
  18. 25
      lib/order/order_detail_page.dart
  19. 140
      lib/order/order_history_page.dart
  20. 147
      lib/view_widget/new_coupon_widget.dart
  21. 112
      lib/view_widget/receive_success.dart
  22. 2
      lib/view_widget/selector_store_dialog.dart
  23. 275
      pubspec.lock
  24. 2
      pubspec.yaml

2
lib/article/hot_article_item.dart

@ -47,7 +47,7 @@ class _HotArticlePage extends State<HotArticlePage> {
"pageNum": pageNum,
"pageSize": 10,
"searchKey": "",
"state": 0,
"state": 1,
"type": 2
}).catchError((onError){
refreshController.refreshFailed();

1
lib/generated/intl/messages_en.dart

@ -364,6 +364,7 @@ class MessageLookup extends MessageLookupByLibrary {
"yifahuo" : MessageLookupByLibrary.simpleMessage("已发货"),
"yihujiaoqishou" : MessageLookupByLibrary.simpleMessage("已呼叫骑手"),
"yikexiao" : MessageLookupByLibrary.simpleMessage("已核销"),
"yilingqu" : MessageLookupByLibrary.simpleMessage("已领取"),
"yingyeshijian" : m25,
"yiqiandao" : MessageLookupByLibrary.simpleMessage("已签到"),
"yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "),

1
lib/generated/intl/messages_zh_CN.dart

@ -364,6 +364,7 @@ class MessageLookup extends MessageLookupByLibrary {
"yifahuo" : MessageLookupByLibrary.simpleMessage("已发货"),
"yihujiaoqishou" : MessageLookupByLibrary.simpleMessage("已呼叫骑手"),
"yikexiao" : MessageLookupByLibrary.simpleMessage("已核销"),
"yilingqu" : MessageLookupByLibrary.simpleMessage("已领取"),
"yingyeshijian" : m25,
"yiqiandao" : MessageLookupByLibrary.simpleMessage("已签到"),
"yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "),

1
lib/generated/intl/messages_zh_TW.dart

@ -364,6 +364,7 @@ class MessageLookup extends MessageLookupByLibrary {
"yifahuo" : MessageLookupByLibrary.simpleMessage("已發貨"),
"yihujiaoqishou" : MessageLookupByLibrary.simpleMessage("已呼叫騎手"),
"yikexiao" : MessageLookupByLibrary.simpleMessage("已核銷"),
"yilingqu" : MessageLookupByLibrary.simpleMessage("已領取"),
"yingyeshijian" : m25,
"yiqiandao" : MessageLookupByLibrary.simpleMessage("已簽到"),
"yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "),

10
lib/generated/l10n.dart

@ -3325,6 +3325,16 @@ class S {
);
}
/// ``
String get yilingqu {
return Intl.message(
'已领取',
name: 'yilingqu',
desc: '',
args: [],
);
}
/// `使`
String get privacy_policy4 {
return Intl.message(

4
lib/home/activity_list_page.dart

@ -74,6 +74,7 @@ class _ActivityListPage extends State<ActivityListPage>
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
@ -81,7 +82,6 @@ class _ActivityListPage extends State<ActivityListPage>
),
onRefresh: queryActivity,
child: ListView.builder(
physics: BouncingScrollPhysics(),
itemCount: activityList == null ? 0 : activityList.length,
itemBuilder: (context, position) {
return InkWell(
@ -151,6 +151,8 @@ class _ActivityListPage extends State<ActivityListPage>
),
Text(
activity.viceTitle ?? "",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 10,
color: Color(0xFF727272),

1
lib/home/home_page.dart

@ -373,6 +373,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
S
.of(context)
.yuan(double.tryParse(goods.worth).toInt()),
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF585858),
decoration: TextDecoration.lineThrough,

7
lib/home/points_mall_page.dart

@ -142,7 +142,9 @@ class _PointsMallPage extends State<PointsMallPage>
enablePullDown: true,
enablePullUp: true,
header: MyHeader(),
physics: BouncingScrollPhysics(),
footer: CustomFooter(
loadStyle: LoadStyle.ShowWhenLoading,
builder: (BuildContext context, LoadStatus mode) {
return MyFooter(mode);
},
@ -151,7 +153,6 @@ class _PointsMallPage extends State<PointsMallPage>
onRefresh: _refresh,
onLoading: creditGoods,
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
color: Color(0xFFFAFAFA),
child: Column(
@ -179,7 +180,7 @@ class _PointsMallPage extends State<PointsMallPage>
//Widget之间间距
mainAxisSpacing: 16,
//Widget宽高比例
childAspectRatio: Platform.isAndroid ? 0.55 : 0.57,
childAspectRatio: Platform.isAndroid ? 0.54 : 0.57,
),
itemBuilder: (contetx, index) {
return GestureDetector(
@ -266,7 +267,7 @@ class _PointsMallPage extends State<PointsMallPage>
),
Container(
margin:
EdgeInsets.only(left: 12.w, right: 12.w, bottom: 16.h, top: 10.h),
EdgeInsets.only(left: 12.w, right: 12.w, bottom: 10.h, top: 10.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,

1
lib/l10n/intl_en.arb

@ -345,6 +345,7 @@
"lingquchenggong": "领取成功",
"dianwolingqu": "点我领取",
"chengweidianpuzhuanshuhuiyuan": "成为店铺专属会员,享专属权益",
"yilingqu": "已领取",

1
lib/l10n/intl_zh_CN.arb

@ -346,6 +346,7 @@
"lingquchenggong": "领取成功",
"dianwolingqu": "点我领取",
"chengweidianpuzhuanshuhuiyuan": "成为店铺专属会员,享专属权益",
"yilingqu": "已领取",

1
lib/l10n/intl_zh_TW.arb

@ -338,6 +338,7 @@
"lingquchenggong": "領取成功",
"dianwolingqu": "點我領取",
"chengweidianpuzhuanshuhuiyuan": "成為專屬會員,享專屬權益",
"yilingqu": "已領取",

12
lib/login/login_page.dart

@ -15,7 +15,7 @@ import 'package:huixiang/generated/l10n.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:dio/dio.dart';
import 'package:huixiang/view_widget/loading_view.dart';
// import 'package:photo_view/photo_view.dart';
import 'package:photo_view/photo_view.dart';
import 'package:shared_preferences/shared_preferences.dart';
class LoginPage extends StatefulWidget {
@ -375,11 +375,11 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
child: Stack(
alignment: Alignment.center,
children: [
// PhotoView(
// imageProvider: AssetImage("assets/image/laoban.png"),
// initialScale: Platform.isAndroid ? 1.02 : 1.2,
// basePosition: alignmentProgress,
// ),
PhotoView(
imageProvider: AssetImage("assets/image/laoban.png"),
initialScale: Platform.isAndroid ? 1.02 : 1.2,
basePosition: alignmentProgress,
),
Container(
decoration: BoxDecoration(
color: Color(0xFF32A060).withAlpha(changeAlpha),

43
lib/mine/coupons_page.dart

@ -10,6 +10,8 @@ import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/new_coupon_widget.dart';
import 'package:huixiang/view_widget/receive_success.dart';
import 'package:huixiang/view_widget/selector_store_dialog.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -159,11 +161,18 @@ class _CouponsPage extends State<CouponsPage> {
child: ListView.builder(
itemBuilder: (context, position) {
return GestureDetector(
child: NewCouponWidget(coupons[position], (type) {}, () {
child: NewCouponWidget(coupons[position], (type) {
if (type == 1) {
receiveCoupon(coupons[position].id);
} else {
//Navigator.of(context).pushNamed('/router/mine_card')
showStoreSelector(coupons[position].storeList);
}
}, () {
setState(() {
coupons[position].isEx = !coupons[position].isEx;
});
}),
}, type: 0,),
);
},
itemCount: coupons != null ? coupons.length : 0,
@ -174,4 +183,34 @@ class _CouponsPage extends State<CouponsPage> {
),
);
}
receiveCoupon(couponId) async {
BaseData baseData = await apiService.receiveCoupon(couponId);
if (baseData.isSuccess) {
_onRefresh();
showAlertDialog();
} else {
Fluttertoast.showToast(msg: baseData.msg);
}
}
showStoreSelector(storeList) {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return SelectorStoreWidget(storeList);
});
}
showAlertDialog() {
//
showDialog(
context: context,
builder: (BuildContext context) {
return ReceiveSuccess();
},
);
}
}

85
lib/mine/mine_vip_level_page.dart

@ -89,34 +89,32 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
titleSpacing: 2.w,
leadingWidth: 56.w,
),
body: Column(
children: [
AspectRatio(
aspectRatio: 1.7,
child: Swiper(
viewportFraction: 0.95,
loop: false,
// index: (ranks != null && ranks.isNotEmpty) ? widget.arguments["rankLevel"] - 1 : 0,
controller: controller,
itemBuilder: (context, position) {
// if(ranks == null || ranks.isEmpty) return Container(width: 10, height: 10,);
return MineVipView(
position + 1,
curLevel: widget.arguments["rankLevel"],
padding: 6.w,
rank: widget.arguments["points"],
rankMax: ranks[position].rankOrigin,
createTime: ranks[position].createTime,
);
},
itemCount: (ranks != null && ranks.isNotEmpty) ? ranks.length : 0,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
AspectRatio(
aspectRatio: 1.7,
child: Swiper(
viewportFraction: 0.95,
loop: false,
// index: (ranks != null && ranks.isNotEmpty) ? widget.arguments["rankLevel"] - 1 : 0,
controller: controller,
itemBuilder: (context, position) {
// if(ranks == null || ranks.isEmpty) return Container(width: 10, height: 10,);
return MineVipView(
position + 1,
curLevel: widget.arguments["rankLevel"],
padding: 6.w,
rank: widget.arguments["points"],
rankMax: ranks[position].rankOrigin,
createTime: ranks[position].createTime,
);
},
itemCount: (ranks != null && ranks.isNotEmpty) ? ranks.length : 0,
),
),
),
Expanded(
flex: 1,
child: Container(
height: double.infinity,
width: double.infinity,
Container(
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
decoration: BoxDecoration(
@ -143,7 +141,7 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 6.w,
@ -154,13 +152,16 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
color: Color(0xFF32A060),
),
),
Text(
S.of(context).chenggongdengluzhuce,
style: TextStyle(
textBaseline: TextBaseline.alphabetic,
fontSize: 14.sp,
color: Color(0xFF353535),
Expanded(
child: Text(
S.of(context).chenggongdengluzhuce,
style: TextStyle(
textBaseline: TextBaseline.alphabetic,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
flex: 1,
),
],
),
@ -205,12 +206,12 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: ranks != null
? ranks.map((e) {
return levelItem(
e,
ranks.indexOf(e) == 0
? 0
: ranks[ranks.indexOf(e) - 1].rankOrigin);
}).toList()
return levelItem(
e,
ranks.indexOf(e) == 0
? 0
: ranks[ranks.indexOf(e) - 1].rankOrigin);
}).toList()
: [],
),
SizedBox(
@ -282,8 +283,8 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
],
),
),
),
],
],
),
),
);
}

40
lib/mine/mine_wallet_page.dart

@ -55,7 +55,20 @@ class _MineWalletPage extends State<MineWalletPage> {
loadBillInfo();
}
queryUserBalance() async {
BaseData baseData = await apiService.queryInfo();
if (baseData != null && baseData.isSuccess) {
userInfo = UserInfo.fromJson(baseData.data);
mBalance = double.tryParse(userInfo.money).toInt();
if (mounted) setState(() {});
setState(() {});
} else {
Fluttertoast.showToast(msg: baseData.msg);
}
}
loadBillInfo() async {
queryUserBalance();
BaseData baseData = await apiService.queryBillInfo({
"current": current,
"model": {"category": "", "title": "bill_tenant_balance", "type": ""},
@ -327,18 +340,23 @@ class _MineWalletPage extends State<MineWalletPage> {
SizedBox(
height: 24,
),
RoundButton(
icons: Icon(
Icons.refresh,
color: Colors.white,
InkWell(
onTap: () {
queryUserBalance();
},
child: RoundButton(
icons: Icon(
Icons.refresh,
color: Colors.white,
),
text: S.of(context).shuaxinyue,
textColor: Colors.white,
radius: 15,
backgroup: Color(0xFF20662A),
fontSize: 12,
padding: EdgeInsets.fromLTRB(12, 4, 12, 4),
),
text: S.of(context).shuaxinyue,
textColor: Colors.white,
radius: 15,
backgroup: Color(0xFF20662A),
fontSize: 12,
padding: EdgeInsets.fromLTRB(12, 4, 12, 4),
)
),
],
),
);

101
lib/mine/roll_center_page.dart

@ -11,6 +11,7 @@ import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/item_title.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/new_coupon_widget.dart';
import 'package:huixiang/view_widget/receive_success.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:huixiang/view_widget/selector_store_dialog.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
@ -151,7 +152,7 @@ class _RollCenterPage extends State<RollCenterPage> {
setState(() {
coupons[position].isEx = !coupons[position].isEx;
});
}),
}, type: 1,),
);
},
itemCount: coupons != null ? coupons.length : 0,
@ -188,103 +189,7 @@ class _RollCenterPage extends State<RollCenterPage> {
showDialog(
context: context,
builder: (BuildContext context) {
return SimpleDialog(
titlePadding: EdgeInsets.all(10),
backgroundColor: Colors.transparent,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(6)),
),
children: <Widget>[
Stack(
alignment: Alignment.topCenter,
children: [
Container(
margin: EdgeInsets.only(top: 40.h),
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(8))),
width: 218.w,
height: 210.h,
child: Column(
children: [
Padding(
padding: EdgeInsets.only(top: 50.h, bottom: 19.h),
child: Text(
"领取成功",
style: TextStyle(
color: Color(0xff353535),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
),
),
Text(
"您已成功领取优惠劵,请在",
style: TextStyle(
color: Color(0xff353535),
fontSize: 14.sp,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
child: Text(
S.of(context).kaquan,
style: TextStyle(
color: Color(0xffFF7A1A),
fontSize: 14.sp,
fontWeight: FontWeight.bold,
),
),
onTap: () {
Navigator.of(context)
.pushNamed('/router/mine_card');
},
),
Text(
"中查看",
style: TextStyle(
color: Color(0xff353535),
fontSize: 14.sp,
),
),
],
),
Padding(
padding: EdgeInsets.only(top: 30.h),
child: RoundButton(
width: 130.w,
height: 34.h,
text: S.of(context).queren,
textColor: Colors.white,
fontSize: 12.sp,
callback: () {
Navigator.of(context).pop();
},
padding: EdgeInsets.only(
top: 2.h,
bottom: 2.h,
left: 8.w,
right: 8.w,
),
backgroup: Color(0xff32A060),
),
)
],
),
),
Image.asset(
"assets/image/icon_order_success.png",
fit: BoxFit.cover,
width: 80.w,
height: 80.h,
),
],
)
],
);
return ReceiveSuccess();
},
);
}

2
lib/mine/vip_card_page.dart

@ -93,7 +93,7 @@ class _VipCardPage extends State<VipCardPage> {
if (storeName.contains("百年川椒")) {
return "assets/image/icon_vip_bj.png";
} else if (storeName.contains("海峡姐妹")) {
return "assets/image/icon_milk_tea_bg.png.png";
return "assets/image/icon_milk_tea_bg.png";
} else if (storeName.contains("前进麦味")) {
return "assets/image/icon_bread_bg.png";
}

25
lib/order/order_detail_page.dart

@ -842,8 +842,20 @@ class _OrderDetailPage extends State<OrderDetailPage> {
.addAll(orderInfo.productList.map((e) => commodityItem(e)).toList());
}
widgets.add(SizedBox(height: 20.h));
if (orderInfo.isTakeOut != 0) { //
widgets.add(discountItem(Color(0xFFFF7A1A), "配送费", "", orderInfo.postFee));
}
if (orderInfo.storeVO != null && orderInfo.storeVO.freePostAge != null) { //
widgets.add(discountItem(Color(0xFF32A060), "配送费", "活动减免3元配送费", orderInfo.storeVO.freePostAge));
}
if (orderInfo.storeVO != null && orderInfo.storeVO.couponVO != null) {
widgets.add(discountItem(Color(0xFF32A060), orderInfo.storeVO.couponVO));
// widgets.add(discountItem(Color(0xFF32A060),
// orderInfo.storeVO.couponVO.storeName,
// S.of(context).huodongjianmianpeisongfei(orderInfo.storeVO.couponVO.discountAmount),
// orderInfo.storeVO.couponVO.f));
// Color(0xFFFF7A1A)
}
widgets.add(Container(
@ -1107,7 +1119,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
);
}
Widget discountItem(Color color, CouponVo couponVo) {
Widget discountItem(Color color, textName, condition, amount) {
return Container(
margin: EdgeInsets.only(top: 9.h, bottom: 9.h),
child: Row(
@ -1123,8 +1135,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
),
),
child: Text(
couponVo.couponName,
// S.of(context).peisongfei,
textName,
style: TextStyle(
fontSize: 10.sp,
color: color,
@ -1136,7 +1147,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
),
Expanded(
child: Text(
S.of(context).huodongjianmianpeisongfei(couponVo.discountAmount),
condition,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
@ -1145,7 +1156,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
flex: 1,
),
Text(
S.of(context).yuan("-${couponVo.fullAmount}"),
S.of(context).yuan("$amount"),
style: TextStyle(
fontSize: 12.sp,
color: color,
@ -1187,7 +1198,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
),
),
Text(
orderInfo != null ? orderInfo.finalPayPrice : "",
orderInfo != null ? "${(double.tryParse(orderInfo.orderSum) + double.tryParse(orderInfo.postFee))}" : "",
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 30.sp,

140
lib/order/order_history_page.dart

@ -319,24 +319,18 @@ class _OrderHistoryList extends State<OrderHistoryList>
height: 8.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Container(
child: Row(
children: [
Expanded(
flex: 1,
child: Row(
children: goodsItem((orderInfo != null &&
orderInfo.productList !=
null)
? orderInfo.productList
: null),
),
),
],
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: goodsItem((orderInfo != null &&
orderInfo.productList != null)
? orderInfo.productList
: null),
),
),
flex: 1,
@ -379,8 +373,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
),
TextSpan(
text: (orderInfo != null &&
orderInfo.productList !=
null)
orderInfo.productList != null)
? "${orderInfo.productList.length}"
: "0",
style: TextStyle(
@ -450,14 +443,15 @@ class _OrderHistoryList extends State<OrderHistoryList>
);
}
String statusText(refundStatus, orderStatus, payStatus, sendStatus, isTakeOut) {
String statusText(
refundStatus, orderStatus, payStatus, sendStatus, isTakeOut) {
String statusText = "";
if(isTakeOut == 0) {
if(payStatus == 0) {
if (isTakeOut == 0) {
if (payStatus == 0) {
statusText = S.of(context).daizhifu;
} else {
statusText = S.of(context).yizhifu;
switch(orderStatus) {
switch (orderStatus) {
case 2:
statusText = S.of(context).shangjiazhengzaipeican;
break;
@ -468,57 +462,63 @@ class _OrderHistoryList extends State<OrderHistoryList>
statusText = S.of(context).yiwancheng;
break;
}
if(refundStatus == 1) {
if (refundStatus == 1) {
statusText = S.of(context).yituikuan;
}
}
} else if(isTakeOut == 1) {
if(payStatus == 0) {
} else if (isTakeOut == 1) {
if (payStatus == 0) {
statusText = S.of(context).daizhifu;
} else {
statusText = S.of(context).yizhifu;
switch(sendStatus) {
case 1:
statusText = S.of(context).zhengzaihujiaoqishou;
break;
case 2:
statusText = S.of(context).quhuozhong;
break;
case 3:
statusText = S.of(context).peisongzhong;
break;
case 4:
statusText = S.of(context).yisongda;
switch(orderStatus) {
case 4:
statusText = S.of(context).yiwancheng;
break;
}
break;
if (orderStatus < 4) {
switch (sendStatus) {
case 1:
statusText = S.of(context).zhengzaihujiaoqishou;
break;
case 2:
statusText = S.of(context).quhuozhong;
break;
case 3:
statusText = S.of(context).peisongzhong;
break;
case 4:
statusText = S.of(context).yisongda;
break;
}
} else {
switch (orderStatus) {
case 4:
statusText = S.of(context).yiwancheng;
break;
}
}
if(refundStatus == 1) {
if (refundStatus == 1) {
statusText = S.of(context).yituikuan;
}
}
} else if(isTakeOut == 2) {
if(payStatus == 0) {
} else if (isTakeOut == 2) {
if (payStatus == 0) {
statusText = S.of(context).daizhifu;
} else {
statusText = S.of(context).yizhifu;
switch(sendStatus) {
case 1:
statusText = S.of(context).yifahuo;
break;
case 4:
statusText = S.of(context).yisongda;
switch(orderStatus) {
case 4:
statusText = S.of(context).yiwancheng;
break;
}
break;
if (orderStatus < 4) {
switch (sendStatus) {
case 1:
statusText = S.of(context).yifahuo;
break;
case 4:
statusText = S.of(context).yisongda;
break;
}
} else {
switch (orderStatus) {
case 4:
statusText = S.of(context).yiwancheng;
break;
}
}
if(refundStatus == 1) {
if (refundStatus == 1) {
statusText = S.of(context).yituikuan;
}
}
@ -650,8 +650,14 @@ class _OrderHistoryList extends State<OrderHistoryList>
List<Widget> goodsItem(List<ProductList> products) {
if (products == null) return [];
if(products.length > 3) {
products = products.sublist(0, 3);
}
return products
.map((e) => Column(
.map(
(e) => Container(
margin: EdgeInsets.symmetric(horizontal: 2.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
@ -667,15 +673,23 @@ class _OrderHistoryList extends State<OrderHistoryList>
height: 4.h,
),
if (isRemake)
Text(
e.productName,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
Container(
width: 75.w,
child: Text(
e.productName,
maxLines: 1,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
),
),
],
))
),
),
)
.toList();
}

147
lib/view_widget/new_coupon_widget.dart

@ -8,8 +8,9 @@ class NewCouponWidget extends StatelessWidget {
final Function(int type) callback;
final GestureTapCallback callbackEx;
final Coupon coupon;
final int type;
NewCouponWidget(this.coupon, this.callback, this.callbackEx);
NewCouponWidget(this.coupon, this.callback, this.callbackEx, {this.type = 1});
@override
Widget build(BuildContext context) {
@ -306,35 +307,13 @@ class NewCouponWidget extends StatelessWidget {
}
Widget rightBtn(context) {
if (coupon != null && coupon.status == 0) {
return Align(
alignment: Alignment.centerRight,
child: InkWell(
onTap: () {
callback(1);
},
child: Container(
padding: EdgeInsets.fromLTRB(16.w, 2.h, 16.w, 2.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.5)),
color: Color(0xFF32A060),
),
child: Text(
S.of(context).lingqu,
style: TextStyle(
fontSize: 12.sp,
color: Colors.white,
),
),
),
),
);
} else if (coupon != null && coupon.status == 1) {
return Align(
if (type == 1) {
if (coupon != null && coupon.status == 0) {
return Align(
alignment: Alignment.centerRight,
child: InkWell(
onTap: () {
callback(2);
callback(type);
},
child: Container(
padding: EdgeInsets.fromLTRB(16.w, 2.h, 16.w, 2.h),
@ -343,54 +322,98 @@ class NewCouponWidget extends StatelessWidget {
color: Color(0xFF32A060),
),
child: Text(
S.of(context).qushiyong,
S.of(context).lingqu,
style: TextStyle(
fontSize: 12.sp,
color: Colors.white,
),
),
),
));
} else if (coupon != null && coupon.status == 2) {
return Align(
alignment: Alignment.centerRight,
child: Container(
padding: EdgeInsets.fromLTRB(16.w, 2.h, 16.w, 2.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.5)),
// border: Border.all(
// width: 1, color: Color(0xFFA0A0A0), style: BorderStyle.solid)
color: Color(0xFFA0A0A0),
),
child: Text(
S.of(context).yishiyong,
style: TextStyle(
fontSize: 12.sp,
color: Colors.white,
);
} else {
return Align(
alignment: Alignment.centerRight,
child: Container(
padding: EdgeInsets.fromLTRB(16.w, 2.h, 16.w, 2.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.5)),
color: Colors.grey,
),
child: Text(
S.of(context).yilingqu,
style: TextStyle(
fontSize: 12.sp,
color: Colors.white,
),
),
),
),
);
);
}
} else {
return Align(
alignment: Alignment.centerRight,
child: Container(
padding: EdgeInsets.fromLTRB(16.w, 2.h, 16.w, 2.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.5)),
// border: Border.all(
// width: 1, color: Color(0xFFA0A0A0), style: BorderStyle.solid)
color: Color(0xFFA0A0A0),
if (coupon != null && coupon.status == 1) {
return Align(
alignment: Alignment.centerRight,
child: InkWell(
onTap: () {
callback(type);
},
child: Container(
padding: EdgeInsets.fromLTRB(16.w, 2.h, 16.w, 2.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.5)),
color: Color(0xFF32A060),
),
child: Text(
S.of(context).qushiyong,
style: TextStyle(
fontSize: 12.sp,
color: Colors.white,
),
),
),
));
} else if (coupon != null && coupon.status == 2) {
return Align(
alignment: Alignment.centerRight,
child: Container(
padding: EdgeInsets.fromLTRB(16.w, 2.h, 16.w, 2.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.5)),
// border: Border.all(
// width: 1, color: Color(0xFFA0A0A0), style: BorderStyle.solid)
color: Color(0xFFA0A0A0),
),
child: Text(
S.of(context).yishiyong,
style: TextStyle(
fontSize: 12.sp,
color: Colors.white,
),
),
),
child: Text(
S.of(context).yishixiao,
style: TextStyle(
fontSize: 12.sp,
color: Colors.white,
);
} else {
return Align(
alignment: Alignment.centerRight,
child: Container(
padding: EdgeInsets.fromLTRB(16.w, 2.h, 16.w, 2.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.5)),
// border: Border.all(
// width: 1, color: Color(0xFFA0A0A0), style: BorderStyle.solid)
color: Color(0xFFA0A0A0),
),
child: Text(
S.of(context).yishixiao,
style: TextStyle(
fontSize: 12.sp,
color: Colors.white,
),
),
),
),
);
);
}
}
}
}

112
lib/view_widget/receive_success.dart

@ -0,0 +1,112 @@
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class ReceiveSuccess extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SimpleDialog(
titlePadding: EdgeInsets.all(10),
backgroundColor: Colors.transparent,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(6)),
),
children: <Widget>[
Stack(
alignment: Alignment.topCenter,
children: [
Container(
margin: EdgeInsets.only(top: 40.h),
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(8))),
width: 218.w,
height: 210.h,
child: Column(
children: [
Padding(
padding: EdgeInsets.only(top: 50.h, bottom: 19.h),
child: Text(
"领取成功",
style: TextStyle(
color: Color(0xff353535),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
),
),
Text(
"您已成功领取优惠劵,请在",
style: TextStyle(
color: Color(0xff353535),
fontSize: 14.sp,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
child: Text(
S.of(context).kaquan,
style: TextStyle(
color: Color(0xffFF7A1A),
fontSize: 14.sp,
fontWeight: FontWeight.bold,
),
),
onTap: () {
Navigator.of(context)
.pushNamed('/router/mine_card');
},
),
Text(
"中查看",
style: TextStyle(
color: Color(0xff353535),
fontSize: 14.sp,
),
),
],
),
Padding(
padding: EdgeInsets.only(top: 30.h),
child: RoundButton(
width: 130.w,
height: 34.h,
text: S.of(context).queren,
textColor: Colors.white,
fontSize: 12.sp,
callback: () {
Navigator.of(context).pop();
},
padding: EdgeInsets.only(
top: 2.h,
bottom: 2.h,
left: 8.w,
right: 8.w,
),
backgroup: Color(0xff32A060),
),
)
],
),
),
Image.asset(
"assets/image/icon_order_success.png",
fit: BoxFit.cover,
width: 80.w,
height: 80.h,
),
],
)
],
);
}
}

2
lib/view_widget/selector_store_dialog.dart

@ -66,7 +66,7 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
child: ListView.builder(
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return storeItem(widget.stores[0], position);
return storeItem(widget.stores[position], position);
},
itemCount: widget.stores != null ? widget.stores.length : 0,
),

275
pubspec.lock

File diff suppressed because it is too large Load Diff

2
pubspec.yaml

@ -71,7 +71,7 @@ dependencies:
cached_network_image: ^2.0.0
flutter_html: ^1.3.0 #2.1.0
# photo_view: ^0.11.1
photo_view: ^0.11.1
chewie: ^0.12.2
video_player: ^1.0.1

Loading…
Cancel
Save