Browse Source

一心回乡商城更改;

课程增加更多;
zyh
w-R 3 years ago
parent
commit
6b86898654
  1. BIN
      assets/image/2x/goods_cart.png
  2. BIN
      assets/image/2x/goods_phone.png
  3. BIN
      assets/image/2x/jg.png
  4. BIN
      assets/image/2x/kan_jia.png
  5. BIN
      assets/image/2x/ms.png
  6. BIN
      assets/image/2x/ms_t.png
  7. BIN
      assets/image/2x/pin_t.png
  8. BIN
      assets/image/2x/pin_tuan.png
  9. BIN
      assets/image/2x/shopping_cart.png
  10. BIN
      assets/image/2x/shopping_cart_h.png
  11. BIN
      assets/image/2x/shopping_home.png
  12. BIN
      assets/image/2x/shopping_home_h.png
  13. BIN
      assets/image/2x/wx.png
  14. BIN
      assets/image/2x/yq_zt.png
  15. BIN
      assets/image/2x/zt_m.png
  16. BIN
      assets/image/2x/zt_zf.png
  17. BIN
      assets/image/2x/zu_tuan.png
  18. BIN
      assets/image/3x/goods_cart.png
  19. BIN
      assets/image/3x/goods_phone.png
  20. BIN
      assets/image/3x/jg.png
  21. BIN
      assets/image/3x/kan_jia.png
  22. BIN
      assets/image/3x/ms.png
  23. BIN
      assets/image/3x/ms_t.png
  24. BIN
      assets/image/3x/pin_t.png
  25. BIN
      assets/image/3x/pin_tuan.png
  26. BIN
      assets/image/3x/shopping_cart.png
  27. BIN
      assets/image/3x/shopping_cart_h.png
  28. BIN
      assets/image/3x/shopping_home.png
  29. BIN
      assets/image/3x/shopping_home_h.png
  30. BIN
      assets/image/3x/wx.png
  31. BIN
      assets/image/3x/yq_zt.png
  32. BIN
      assets/image/3x/zt_m.png
  33. BIN
      assets/image/3x/zt_zf.png
  34. BIN
      assets/image/3x/zu_tuan.png
  35. BIN
      assets/image/goods_cart.png
  36. BIN
      assets/image/goods_phone.png
  37. BIN
      assets/image/jg.png
  38. BIN
      assets/image/kan_jia.png
  39. BIN
      assets/image/ms.png
  40. BIN
      assets/image/ms_t.png
  41. BIN
      assets/image/pin_t.png
  42. BIN
      assets/image/pin_tuan.png
  43. BIN
      assets/image/shopping_cart.png
  44. BIN
      assets/image/shopping_cart_h.png
  45. BIN
      assets/image/shopping_home.png
  46. BIN
      assets/image/shopping_home_h.png
  47. BIN
      assets/image/wx.png
  48. BIN
      assets/image/yq_zt.png
  49. BIN
      assets/image/zt_m.png
  50. BIN
      assets/image/zt_zf.png
  51. BIN
      assets/image/zu_tuan.png
  52. 15
      lib/community/community_course.dart
  53. 41
      lib/community/community_view/class_details.dart
  54. 19
      lib/community/headlines/article_page.dart
  55. 19
      lib/community/headlines/headlines_collection.dart
  56. 2
      lib/generated/intl/messages_en.dart
  57. 2
      lib/generated/intl/messages_zh_CN.dart
  58. 2
      lib/generated/intl/messages_zh_Hans_CN.dart
  59. 2
      lib/generated/intl/messages_zh_Hant_CN.dart
  60. 2
      lib/generated/intl/messages_zh_TW.dart
  61. 20
      lib/generated/l10n.dart
  62. 39
      lib/home/home_view/shortcut_operation.dart
  63. 4
      lib/l10n/intl_en.arb
  64. 2
      lib/l10n/intl_zh_CN.arb
  65. 2
      lib/l10n/intl_zh_Hans_CN.arb
  66. 3
      lib/l10n/intl_zh_Hant_CN.arb
  67. 2
      lib/l10n/intl_zh_TW.arb
  68. 25
      lib/main.dart
  69. 115
      lib/mine/mine_view/mine_item.dart
  70. 4
      lib/mine/mine_view/mine_order.dart
  71. 439
      lib/order/bargain_group_order.dart
  72. 27
      lib/order/order_history_page.dart
  73. 307
      lib/retrofit/data/activity_area_list.dart
  74. 7
      lib/retrofit/min_api.dart
  75. 2
      lib/retrofit/min_api.g.dart
  76. 12
      lib/retrofit/retrofit_api.dart
  77. 26
      lib/retrofit/retrofit_api.g.dart
  78. 683
      lib/store/shopping/activity_prefecture_details.dart
  79. 203
      lib/store/shopping/shopping_cart/cart_goods_list.dart
  80. 241
      lib/store/shopping/shopping_cart/shopping_cart_page.dart
  81. 1235
      lib/store/shopping/shopping_goods_details.dart
  82. 205
      lib/store/shopping/shopping_home/activity_banner.dart
  83. 753
      lib/store/shopping/shopping_home/bargain_details.dart
  84. 97
      lib/store/shopping/shopping_home/classify_list.dart
  85. 888
      lib/store/shopping/shopping_home/group_details.dart
  86. 214
      lib/store/shopping/shopping_home/group_page_details.dart
  87. 214
      lib/store/shopping/shopping_home/recommend_goods_list_view.dart
  88. 607
      lib/store/shopping/shopping_home/search_page.dart
  89. 321
      lib/store/shopping/shopping_home/shopping_acticvity.dart
  90. 120
      lib/store/shopping/shopping_home/shopping_home_banner.dart
  91. 198
      lib/store/shopping/shopping_home/shopping_home_page.dart
  92. 70
      lib/store/shopping/shopping_home/shopping_title_tab.dart
  93. 244
      lib/store/shopping/shopping_mall_home.dart
  94. 1
      lib/store/store_order.dart
  95. 10
      lib/store/store_view/product_sku.dart
  96. 54
      lib/union/union_page.dart
  97. 2
      lib/view_widget/new_people_reward.dart
  98. 8
      lib/web/web_view/comment_list.dart
  99. 13
      pubspec.lock
  100. 5
      pubspec.yaml

BIN
assets/image/2x/goods_cart.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
assets/image/2x/goods_phone.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
assets/image/2x/jg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

BIN
assets/image/2x/kan_jia.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
assets/image/2x/ms.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
assets/image/2x/ms_t.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
assets/image/2x/pin_t.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
assets/image/2x/pin_tuan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/2x/shopping_cart.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/2x/shopping_cart_h.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
assets/image/2x/shopping_home.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/2x/shopping_home_h.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
assets/image/2x/wx.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
assets/image/2x/yq_zt.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
assets/image/2x/zt_m.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
assets/image/2x/zt_zf.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
assets/image/2x/zu_tuan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
assets/image/3x/goods_cart.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
assets/image/3x/goods_phone.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
assets/image/3x/jg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

BIN
assets/image/3x/kan_jia.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
assets/image/3x/ms.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

BIN
assets/image/3x/ms_t.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
assets/image/3x/pin_t.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

BIN
assets/image/3x/pin_tuan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
assets/image/3x/shopping_cart.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
assets/image/3x/shopping_cart_h.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
assets/image/3x/shopping_home.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
assets/image/3x/shopping_home_h.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
assets/image/3x/wx.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
assets/image/3x/yq_zt.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
assets/image/3x/zt_m.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
assets/image/3x/zt_zf.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
assets/image/3x/zu_tuan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
assets/image/goods_cart.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

BIN
assets/image/goods_phone.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

BIN
assets/image/jg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

BIN
assets/image/kan_jia.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 B

BIN
assets/image/ms.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
assets/image/ms_t.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
assets/image/pin_t.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
assets/image/pin_tuan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

BIN
assets/image/shopping_cart.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

BIN
assets/image/shopping_cart_h.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

BIN
assets/image/shopping_home.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

BIN
assets/image/shopping_home_h.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 B

BIN
assets/image/wx.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 763 B

BIN
assets/image/yq_zt.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/zt_m.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
assets/image/zt_zf.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
assets/image/zu_tuan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

15
lib/community/community_course.dart

@ -239,21 +239,6 @@ class _CommunityCourse extends State<CommunityCourse>
left: 0,
right: 0,
),
if (brands != null && brands.length > 0)
Positioned(
child: Container(
color: Colors.white,
child: StoreTitleTab(
brands,
globaKeys,
scrollController,
isScroll: true,
),
),
top: 0,
left: 0,
right: 0,
),
],
);
}

41
lib/community/community_view/class_details.dart

@ -45,6 +45,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
bool isShowImg = true;
int chapterIndex = 0;
double height = 0;
var isShowMore = false;
@override
void initState() {
@ -179,7 +180,6 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
],
),
Container(
height: 123,
margin: EdgeInsets.only(bottom: 16.h),
padding: EdgeInsets.only(left: 16, top: 16, right: 10),
decoration: BoxDecoration(
@ -200,7 +200,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
Row(
children: [
Container(
height: 22.h,
height:26.h,
padding:EdgeInsets.only(left:2,right:2),
alignment: Alignment.center,
decoration: BoxDecoration(
@ -290,14 +290,47 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
),
Text(
course != null ? course.introduce : "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
overflow: isShowMore
? TextOverflow.visible
: TextOverflow.ellipsis,
maxLines: isShowMore ? 10 : 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
),
SizedBox(height: 3.h),
GestureDetector(
onTap: () {
setState(() {
isShowMore = !isShowMore;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Text(
S.of(context).gengduo,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
),
Icon(
(isShowMore != null && !isShowMore)
? Icons.chevron_right
: Icons.keyboard_arrow_up,
color: Colors.black,
size: 18,
),
],
),
),
SizedBox(height: 3.h),
],
),
),

19
lib/community/headlines/article_page.dart

@ -10,11 +10,7 @@ import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/banner.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/brand.dart';
import 'package:huixiang/retrofit/data/category_select_list.dart';
import 'package:huixiang/retrofit/data/collect_class_list.dart';
import 'package:huixiang/retrofit/data/course_list.dart';
import 'package:huixiang/retrofit/data/headlines_list.dart';
import 'package:huixiang/retrofit/data/headlines_list_details.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart';
@ -205,21 +201,6 @@ class _ArticlePage extends State<ArticlePage>
left: 0,
right: 0,
),
if (brands != null && brands.length > 0)
Positioned(
child: Container(
color: Colors.white,
child: StoreTitleTab(
brands,
globaKeys,
scrollController,
isScroll: true,
),
),
top: 0,
left: 0,
right: 0,
),
],
);
}

19
lib/community/headlines/headlines_collection.dart

@ -102,7 +102,8 @@ class _HeadlinesCollection extends State<HeadlinesCollection> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(child: Row(
Expanded(
child: Row(
children: [
Container(
margin: EdgeInsets.only(right: 4),
@ -110,8 +111,7 @@ class _HeadlinesCollection extends State<HeadlinesCollection> {
height: 16.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
borderRadius: BorderRadius.circular(2),
color: Color(0xFF32A060),
),
child: Text(
@ -123,7 +123,8 @@ class _HeadlinesCollection extends State<HeadlinesCollection> {
),
),
),
Expanded(child:Text(
Expanded(
child: Text(
headlines?.name ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
@ -132,8 +133,10 @@ class _HeadlinesCollection extends State<HeadlinesCollection> {
fontWeight: MyFontWeight.semi_bold,
color: Colors.white,
),
),),
],)),
),
),
],
)),
// Row(
// children: [
// Expanded(child:Text(
@ -159,11 +162,11 @@ class _HeadlinesCollection extends State<HeadlinesCollection> {
// height: 14,
// ),
// ],),
],),
],
),
),
],
),
);
}
}

2
lib/generated/intl/messages_en.dart

@ -535,8 +535,10 @@ class MessageLookup extends MessageLookupByLibrary {
"wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"),
"wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的会员等级"),
"wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的积分值"),
"wodekanjia" : MessageLookupByLibrary.simpleMessage("我的砍价"),
"wodekaquan" : MessageLookupByLibrary.simpleMessage("我的卡券"),
"wodenianling" : MessageLookupByLibrary.simpleMessage("我的年龄"),
"wodepintuan" : MessageLookupByLibrary.simpleMessage("我的拼团"),
"wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的钱包"),
"wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"),
"wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"),

2
lib/generated/intl/messages_zh_CN.dart

@ -533,8 +533,10 @@ class MessageLookup extends MessageLookupByLibrary {
"wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"),
"wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的会员等级"),
"wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的积分值"),
"wodekanjia" : MessageLookupByLibrary.simpleMessage("我的砍价"),
"wodekaquan" : MessageLookupByLibrary.simpleMessage("我的卡券"),
"wodenianling" : MessageLookupByLibrary.simpleMessage("我的年龄"),
"wodepintuan" : MessageLookupByLibrary.simpleMessage("我的拼团"),
"wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的钱包"),
"wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"),
"wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"),

2
lib/generated/intl/messages_zh_Hans_CN.dart

@ -533,8 +533,10 @@ class MessageLookup extends MessageLookupByLibrary {
"wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"),
"wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的会员等级"),
"wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的积分值"),
"wodekanjia" : MessageLookupByLibrary.simpleMessage("我的砍价"),
"wodekaquan" : MessageLookupByLibrary.simpleMessage("我的卡券"),
"wodenianling" : MessageLookupByLibrary.simpleMessage("我的年龄"),
"wodepintuan" : MessageLookupByLibrary.simpleMessage("我的拼团"),
"wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的钱包"),
"wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"),
"wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"),

2
lib/generated/intl/messages_zh_Hant_CN.dart

@ -532,8 +532,10 @@ class MessageLookup extends MessageLookupByLibrary {
"wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"),
"wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的會員等級"),
"wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的積分值"),
"wodekanjia" : MessageLookupByLibrary.simpleMessage("我的砍價"),
"wodekaquan" : MessageLookupByLibrary.simpleMessage("我的卡券"),
"wodenianling" : MessageLookupByLibrary.simpleMessage("我的年齡"),
"wodepintuan" : MessageLookupByLibrary.simpleMessage("我的拼團"),
"wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的錢包"),
"wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"),
"wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"),

2
lib/generated/intl/messages_zh_TW.dart

@ -533,8 +533,10 @@ class MessageLookup extends MessageLookupByLibrary {
"wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"),
"wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的會員等級"),
"wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的積分值"),
"wodekanjia" : MessageLookupByLibrary.simpleMessage("我的砍價"),
"wodekaquan" : MessageLookupByLibrary.simpleMessage("我的卡券"),
"wodenianling" : MessageLookupByLibrary.simpleMessage("我的年齡"),
"wodepintuan" : MessageLookupByLibrary.simpleMessage("我的拼團"),
"wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的錢包"),
"wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"),
"wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"),

20
lib/generated/l10n.dart

@ -5635,6 +5635,26 @@ class S {
);
}
/// ``
String get wodekanjia {
return Intl.message(
'我的砍价',
name: 'wodekanjia',
desc: '',
args: [],
);
}
/// ``
String get wodepintuan {
return Intl.message(
'我的拼团',
name: 'wodepintuan',
desc: '',
args: [],
);
}
/// `使`
String get privacy_policy4 {
return Intl.message(

39
lib/home/home_view/shortcut_operation.dart

@ -46,9 +46,20 @@ class _ShortcutOperation extends State<ShortcutOperation> {
},
child: Container(
width: 106,
color: Colors.white,
margin: EdgeInsets.only(right:10),
padding: EdgeInsets.only(top: 8,bottom: 8),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
borderRadius: BorderRadius.circular(4),
),
child: Column(
children: [
Text(
@ -84,9 +95,20 @@ class _ShortcutOperation extends State<ShortcutOperation> {
},
child: Container(
width: 106,
color: Colors.white,
margin: EdgeInsets.only(right:10),
padding: EdgeInsets.only(top: 8,bottom: 8),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
borderRadius: BorderRadius.circular(4),
),
child: Column(
children: [
Text(
@ -122,8 +144,19 @@ class _ShortcutOperation extends State<ShortcutOperation> {
},
child:Container(
width: 106,
color: Colors.white,
padding: EdgeInsets.only(top: 8,bottom: 8),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
borderRadius: BorderRadius.circular(4),
),
child: Column(
children: [
Text(

4
lib/l10n/intl_en.arb

@ -584,6 +584,10 @@
"invite_code_error": "邀请码输入错误",
"yaoqingwancheng": "邀请完成",
"xuanji": "选集",
"wodekanjia": "我的砍价",
"wodepintuan": "我的拼团",

2
lib/l10n/intl_zh_CN.arb

@ -581,6 +581,8 @@
"qingshuruyaoqingma": "请输入邀请码",
"invite_code_error": "邀请码输入错误",
"xuanji": "选集",
"wodekanjia": "我的砍价",
"wodepintuan": "我的拼团",

2
lib/l10n/intl_zh_Hans_CN.arb

@ -581,6 +581,8 @@
"qingshuruyaoqingma": "请输入邀请码",
"invite_code_error": "邀请码输入错误",
"xuanji": "选集",
"wodekanjia": "我的砍价",
"wodepintuan": "我的拼团",

3
lib/l10n/intl_zh_Hant_CN.arb

@ -575,7 +575,8 @@
"qingshuruyaoqingma": "請輸入邀請碼",
"invite_code_error": "邀請碼輸入錯誤",
"xuanji": "選集",
"wodekanjia": "我的砍價",
"wodepintuan": "我的拼團",
"privacy_policy4": "并使用本機號碼登錄"

2
lib/l10n/intl_zh_TW.arb

@ -575,6 +575,8 @@
"qingshuruyaoqingma": "請輸入邀請碼",
"invite_code_error": "邀請碼輸入錯誤",
"xuanji": "選集",
"wodekanjia": "我的砍價",
"wodepintuan": "我的拼團",

25
lib/main.dart

@ -51,6 +51,14 @@ import 'package:huixiang/setting/help_feedback_page.dart';
import 'package:huixiang/setting/permission_setting_page.dart';
import 'package:huixiang/setting/setting_page.dart';
import 'package:huixiang/setting/treaty_page.dart';
import 'package:huixiang/store/shopping/activity_prefecture_details.dart';
import 'package:huixiang/store/shopping/shopping_cart/shopping_cart_page.dart';
import 'package:huixiang/store/shopping/shopping_goods_details.dart';
import 'package:huixiang/store/shopping/shopping_home/bargain_details.dart';
import 'package:huixiang/store/shopping/shopping_home/group_details.dart';
import 'package:huixiang/store/shopping/shopping_home/group_page_details.dart';
import 'package:huixiang/store/shopping/shopping_home/search_page.dart';
import 'package:huixiang/store/shopping/shopping_mall_home.dart';
import 'package:huixiang/store/store_order.dart';
import 'package:huixiang/settlement/settlement.dart';
import 'package:huixiang/test_page.dart';
@ -79,6 +87,7 @@ import 'mine/mine_vip/binding_assistant_card.dart';
import 'mine/mine_vip/legal_right_details.dart';
import 'mine/mine_vip/mine_attainment_page.dart';
import 'mine/mine_vip/mine_vip_core.dart';
import 'order/bargain_group_order.dart';
import 'order/exchange_write_off_page.dart';
import 'mine/release_page.dart';
import 'mine/roll_center_page.dart';
@ -252,6 +261,8 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
BindingAssistantCard(),
'/router/order_history_page': (context, {arguments}) =>
OrderHistoryPage(arguments: arguments),
'/router/bargain_group_order': (context, {arguments}) =>
BargainGroupOrder(),
'/router/union_detail_page': (context, {arguments}) =>
UnionDetailsPage(arguments: arguments),
'/router/address_edit_page': (context, {arguments}) =>
@ -267,6 +278,14 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
HotArticleDetailsPage(),
'/router/store_order': (context, {arguments}) =>
StoreOrderPage(arguments: arguments),
'/router/shopping_mall_home': (context, {arguments}) =>
ShoppingMallHome(arguments: arguments),
'/router/activity_prefecture_details': (context, {arguments}) =>
ActivityPrefectureDetails(),
'/router/shopping_goods_details': (context, {arguments}) =>
ShoppingGoodsDetails(),
'/router/search_page': (context, {arguments}) =>
SearchPage(),
'/router/vip_balance': (context, {arguments}) =>
VipBalancePage(arguments: arguments),
'/router/exchange_order_details': (context, {arguments}) =>
@ -325,4 +344,10 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
MineAttainmentPage(arguments: arguments),
'/router/headlines_column_details': (context, {arguments}) =>
HeadlinesColumnDetails(arguments: arguments),
'/router/group_details': (context, {arguments}) =>
GroupDetails(),
'/router/bargain_details': (context, {arguments}) =>
BargainDetails(),
'/router/group_page_details': (context, {arguments}) =>
GroupPageDetails(),
};

115
lib/mine/mine_view/mine_item.dart

@ -60,7 +60,9 @@ class _MineItem extends State<MineItem> {
),
),
),
InkWell(
Row(
children: [
Expanded(child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
@ -77,8 +79,8 @@ class _MineItem extends State<MineItem> {
S.of(context).wodedongtai,
"assets/image/dynamic.png",
),
),
InkWell(
)),
Expanded(child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
@ -94,8 +96,8 @@ class _MineItem extends State<MineItem> {
S.of(context).duihuanlishi,
"assets/image/icon_mine_records_of_consumption.png",
),
),
InkWell(
),),
Expanded(child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
@ -110,8 +112,8 @@ class _MineItem extends State<MineItem> {
S.of(context).wodekaquan,
"assets/image/icon_mine_card.png",
),
),
InkWell(
),),
Expanded(child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
@ -126,15 +128,49 @@ class _MineItem extends State<MineItem> {
S.of(context).guanlidizhi,
"assets/image/icon_location_address.png",
),
),),
],
),
SizedBox(height: 10.h,),
Row(
children: [
Expanded(child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context)
.pushNamed('/router/bargain_group_order');
});
},
child: mineItem(
S.of(context).wodekanjia,
"assets/image/icon_mine_records_of_consumption.png",
),
),),
Expanded(child: InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/bargain_group_order');
},
child: mineItem(
S.of(context).wodepintuan,
"assets/image/kan_jia.png",
),
InkWell(
),),
Expanded(child: InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/qr_share', arguments: {});
},
child: mineItem(
S.of(context).tuiguangma,
"assets/image/icon_mine_promotion_code.png",
"assets/image/pin_tuan.png",
),
),),
Expanded(child: Text("")),
],
),
// mineItem(
// S.of(context).bangzhuyufankui,
@ -146,40 +182,71 @@ class _MineItem extends State<MineItem> {
}
///
// Widget mineItem(text, icon) {
// return Container(
// color: Colors.white,
// margin: EdgeInsets.symmetric(vertical: 6.h),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Image.asset(
// icon,
// width: 28.w,
// height: 28.h,
// ),
// SizedBox(
// width: 8.w,
// ),
// Expanded(
// flex: 1,
// child: Text(
// text,
// style: TextStyle(
// fontWeight: MyFontWeight.medium,
// fontSize: 16.sp,
// color: Color(0xFF353535),
// ),
// ),
// ),
// Icon(
// Icons.keyboard_arrow_right,
// size: 20,
// color: Colors.black,
// )
// ],
// ),
// );
// }
Widget mineItem(text, icon) {
return Container(
color: Colors.white,
margin: EdgeInsets.symmetric(vertical: 6.h),
child: Row(
margin: EdgeInsets.symmetric(vertical:4.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
icon,
width: 28.w,
height: 28.h,
width: 36.w,
height: 36.w,
fit: BoxFit.contain,
),
SizedBox(
width: 8.w,
height:4.h,
),
Expanded(
flex: 1,
child: Text(
Text(
text,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
fontSize: 12.sp,
color: Color(0xFF353535),
),
),
),
Icon(
Icons.keyboard_arrow_right,
size: 20,
color: Colors.black,
)
],
),
);
}
}

4
lib/mine/mine_view/mine_order.dart

@ -115,8 +115,8 @@ class _MineOrderView extends State<MineOrderView> {
Image.asset(
orderStatusImg[status],
fit: BoxFit.contain,
width: 32.w,
height: 32.w,
width: 36.w,
height: 36.w,
),
SizedBox(height: 4.h,),
Text(

439
lib/order/bargain_group_order.dart

@ -0,0 +1,439 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/exchange_order.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/my_tab.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
class BargainGroupOrder extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _BargainGroupOrder();
}
}
class _BargainGroupOrder extends State<BargainGroupOrder>
with SingleTickerProviderStateMixin {
List<Widget> tabs;
List<Widget> _pages;
TabController tabcontroller;
@override
void initState() {
super.initState();
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (tabcontroller == null)
tabcontroller = TabController(length: 4, vsync: this);
tabs = [
MyTab(
text: S.of(context).quanbu,
),
MyTab(
text: "进行中",
),
MyTab(
text: "成功",
),
MyTab(
text: "失败",
)
];
_pages = [
ExchangeHistoryList(0),
ExchangeHistoryList(1),
ExchangeHistoryList(2),
ExchangeHistoryList(3)
];
}
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 4,
child: Scaffold(
appBar: MyAppBar(
title: S.of(context).wodekanjia,
titleColor: Colors.black,
titleSize: 18.sp,
background: Color(0xFFFFFFFF),
leadingColor: Colors.black,
toolbarHeight: kToolbarHeight + MediaQuery.of(context).padding.top,
bottom: PreferredSize(
preferredSize: Size(double.infinity, 38.h),
child: TabBar(
controller: tabcontroller,
indicatorWeight: 2,
indicatorColor: Color(0xFF39B54A),
indicatorSize: TabBarIndicatorSize.label,
indicatorPadding: EdgeInsets.only(top: 3),
unselectedLabelStyle: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.normal,
),
labelStyle: TextStyle(
color: Colors.black,
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold),
labelColor: Colors.black,
tabs: tabs,
),
),
),
body: TabBarView(
children: _pages,
controller: tabcontroller,
),
),
);
}
}
class ExchangeHistoryList extends StatefulWidget {
final int orderStatus;
ExchangeHistoryList(this.orderStatus);
@override
State<StatefulWidget> createState() {
return _ExchangeHistoryList();
}
}
class _ExchangeHistoryList extends State<ExchangeHistoryList> {
ApiService apiService;
RefreshController _refreshController =
RefreshController(initialRefresh: false);
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
context: context, token: value.getString('token')),
});
}
int pageNum = 1;
_refresh() {
pageNum = 1;
}
@override
Widget build(BuildContext context) {
return SmartRefresher(
enablePullDown: true,
enablePullUp: true,
header: MyHeader(),
footer: CustomFooter(
builder: (BuildContext context, LoadStatus mode) {
return MyFooter(mode);
},
),
controller: _refreshController,
onRefresh: _refresh,
// onLoading: queryHistory,
child:
// orders == null || orders.length == 0
// ? NoDataView(
// isShowBtn: false,
// text: "还没有订单,快去下一单吧~",
// fontSize: 16.sp,
// margin: EdgeInsets.only(top: 120.h),
// )
// :
ListView.builder(
// itemCount: orders == null ? 0 : orders.length,
itemCount: 5,
itemBuilder: (context, position) {
return bargainOrder();
},
),
);
}
String orderStatus(state) {
String orderStatus = "";
switch (state) {
case 1:
orderStatus = S.of(context).weiwancheng;
break;
case 2:
orderStatus = S.of(context).yiwancheng;
break;
case 9:
orderStatus = S.of(context).yiquxiao;
break;
}
return orderStatus;
}
Widget bargainOrder() {
return Container(
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 8.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(25),
offset: Offset(0, 1),
blurRadius: 12,
spreadRadius: 0,
),
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 19.w,
height:21.h,
margin: EdgeInsets.only(left: 12.w, top: 12.h),
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xff32A060),
borderRadius: BorderRadius.circular(2),
),
child: Text(
// (orderInfo != null && orderInfo.isTakeOut == 0) ? "" : "",
"",
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
Expanded(
child: Container(
width: double.infinity,
margin: EdgeInsets.only(left: 6.w, top: 12.h),
alignment: Alignment.centerLeft,
child: Text(
// (orderInfo != null) ? orderInfo.storeName : "",
"一心回乡商城",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
),
flex: 1,
),
Padding(
padding: EdgeInsets.only(top: 12.h, right: 12.w),
child: Text(
// (orderInfo != null &&
// orderInfo.storeVO != null &&
// orderInfo.storeVO.posType != null)
// ? StatusUtils.statusText(
// context,
// orderInfo.refundStatus,
// orderInfo.orderStatus,
// orderInfo.payStatus,
// orderInfo.sendStatus,
// orderInfo.isTakeOut)
// : "",
"还差¥23.4砍价成功",
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.bold,
color:
// (orderInfo == null)
// ? Color(0xFF32A060)
// : (orderInfo.refundStatus == 1 ||
// orderInfo.orderStatus >= 5)
// ? Colors.grey
// : (orderInfo.orderStatus == 4)
// ? Color(0xFF32A060)
// :
Color(0xffFE951E),
),
),
),
],
),
Container(
margin: EdgeInsets.only(left: 37.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).xiadanshijian_("下单时间:2020.01.20 10:50:22"),
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF727272),
),
),
SizedBox(
height: 8.h,
),
Container(
height: 81.h,
margin: EdgeInsets.only(right: 12),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// MImage(
// "",
// width: 81.w,
// height: 81.h,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
Image.asset(
"assets/image/icon_story_td.png",
width: 81,
height: 81,
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"[生态小农]山林放养鸡蛋30枚/盒",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF353535),
),
),
Text(
"套盒装",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF727272),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"x1",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF727272),
),
),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "已砍至:",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF868686),
),
),
TextSpan(
text: "58.2",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF868686),
),
),
],
),
),
],
),
],
)),
],
),
),
],
),
),
SizedBox(
height: 12.h,
),
Container(
margin: EdgeInsets.only(right: 12.w, bottom: 16.h),
child: Directionality(
textDirection: TextDirection.rtl,
child: Row(
children: [
GestureDetector(
onTap: () {},
child: RoundButton(
height: 25.h,
text: "查看详情",
textColor: Colors.white,
fontSize: 12.sp,
backgroup: Color(0xFF32A060),
radius: 2,
padding: EdgeInsets.fromLTRB(17.w,0, 17.w,0),
),
),
// GestureDetector(
// onTap: () {
//
// },
// child:RoundButton(
// height: 25.h,
// padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
// text: S.of(context).chakanxiangqing,
// textColor: Colors.white,
// fontSize: 12,
// backgroup: Color(0xFF32A060),
// radius: 2,
// ),
// ),
],
),
),
),
],
),
);
}
}

27
lib/order/order_history_page.dart

@ -242,10 +242,33 @@ class _OrderHistoryList extends State<OrderHistoryList>
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 19.w,
height: 19.h,
width: 19,
height: 21,
margin: EdgeInsets.only(left: 12.w, top: 12.h),
alignment: Alignment.center,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(2),
border: Border.all(
width: 1,
color: Color(0xFF32A060),
style: BorderStyle.solid,
)
),
child: Text(
"",
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF32A060),
),
),
),
Container(
width: 19,
height:21,
margin: EdgeInsets.only(left:7.w,top: 12.h),
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xff32A060),
borderRadius: BorderRadius.circular(2),

307
lib/retrofit/data/activity_area_list.dart

@ -0,0 +1,307 @@
import 'package:huixiang/retrofit/data/product.dart';
/// actTemplate : {"id":"1473198577613275136","createTime":"2021-12-21 15:48:06","createUser":"1333246101196636160","updateTime":"2021-12-21 15:48:06","updateUser":"1333246101196636160","storeId":"1333246101343436800","type":2,"limitTime":null,"limitNumber":0,"coverImg":"https://pos.upload.gznl.top/1175/2021/12/5bf7a846-768b-4a17-872f-e927988c24c9.jpg","shareImg":"https://pos.upload.gznl.top/1175/2021/12/65f6a0f7-14d1-4393-902e-42e5dc464800.jpg","bannerImg":"https://pos.upload.gznl.top/1175/2021/12/9ee395eb-718c-40c0-bfe0-673dbbade4cf.jpg","state":1,"allDay":false,"startTime":"2021-12-20 00:00:00","endTime":"2021-12-30 00:00:00","isDelete":0}
/// timeProductList : [{"actTime":{"id":"1473198590141661184","createTime":"2021-12-21 15:48:09","createUser":"1333246101196636160","updateTime":"2021-12-21 15:48:09","updateUser":"1333246101196636160","storeId":"1333246101343436800","templateId":"1473198577613275136","allDay":false,"startHour":"09:00:00","endHour":"10:00:00","isDelete":0},"productList":[]},{"actTime":{"id":"1473570616966643712","createTime":"2021-12-22 16:26:27","createUser":"1333246101196636160","updateTime":"2021-12-22 16:26:27","updateUser":"1333246101196636160","storeId":"1333246101343436800","templateId":"1473198577613275136","allDay":false,"startHour":"11:00:00","endHour":"17:00:00","isDelete":0},"productList":[{"id":"1473570776908038144","createTime":"2021-12-22 16:27:05","createUser":"1333246101196636160","updateTime":"2021-12-22 16:27:05","updateUser":"1333246101196636160","storeId":"1333246101343436800","templateId":"1473198577613275136","timeId":"1473570616966643712","productId":"1456500820571848704","productName":"毛毛虫面包","productImg":"https://pos.upload.gznl.top/1175/2021/11/4a6ffabd-0e10-4720-ac93-57ec6855c5cf.jpg","productPrice":"8.00","promotionPrice":"8.00","productStock":-20,"sellCount":0,"skuJson":[{"skuId":"1456500821968551936","skuPrice":8,"skuStock":-20}],"isDelete":0}]}]
class ActivityAreaList {
ActivityAreaList({
ActTemplate actTemplate,
List<TimeProductList> timeProductList,}){
_actTemplate = actTemplate;
_timeProductList = timeProductList;
}
ActivityAreaList.fromJson(dynamic json) {
_actTemplate = json['actTemplate'] != null ? ActTemplate.fromJson(json['actTemplate']) : null;
if (json['timeProductList'] != null) {
_timeProductList = [];
json['timeProductList'].forEach((v) {
_timeProductList.add(TimeProductList.fromJson(v));
});
}
}
ActTemplate _actTemplate;
List<TimeProductList> _timeProductList;
ActTemplate get actTemplate => _actTemplate;
List<TimeProductList> get timeProductList => _timeProductList;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (_actTemplate != null) {
map['actTemplate'] = _actTemplate.toJson();
}
if (_timeProductList != null) {
map['timeProductList'] = _timeProductList.map((v) => v.toJson()).toList();
}
return map;
}
}
/// actTime : {"id":"1473198590141661184","createTime":"2021-12-21 15:48:09","createUser":"1333246101196636160","updateTime":"2021-12-21 15:48:09","updateUser":"1333246101196636160","storeId":"1333246101343436800","templateId":"1473198577613275136","allDay":false,"startHour":"09:00:00","endHour":"10:00:00","isDelete":0}
/// productList : []
class TimeProductList {
TimeProductList({
ActTime actTime,
List<dynamic> productList,}){
_actTime = actTime;
_productList = productList;
}
TimeProductList.fromJson(dynamic json) {
_actTime = json['actTime'] != null ? ActTime.fromJson(json['actTime']) : null;
if (json['productList'] != null) {
_productList = [];
json['productList'].forEach((v) {
_productList.add(ProductList.fromJson(v));
});
}
}
ActTime _actTime;
List<dynamic> _productList;
ActTime get actTime => _actTime;
List<dynamic> get productList => _productList;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (_actTime != null) {
map['actTime'] = _actTime.toJson();
}
if (_productList != null) {
map['productList'] = _productList.map((v) => v.toJson()).toList();
}
return map;
}
}
/// id : "1473198590141661184"
/// createTime : "2021-12-21 15:48:09"
/// createUser : "1333246101196636160"
/// updateTime : "2021-12-21 15:48:09"
/// updateUser : "1333246101196636160"
/// storeId : "1333246101343436800"
/// templateId : "1473198577613275136"
/// allDay : false
/// startHour : "09:00:00"
/// endHour : "10:00:00"
/// isDelete : 0
class ActTime {
ActTime({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String storeId,
String templateId,
bool allDay,
String startHour,
String endHour,
int isDelete,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_storeId = storeId;
_templateId = templateId;
_allDay = allDay;
_startHour = startHour;
_endHour = endHour;
_isDelete = isDelete;
}
ActTime.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_storeId = json['storeId'];
_templateId = json['templateId'];
_allDay = json['allDay'];
_startHour = json['startHour'];
_endHour = json['endHour'];
_isDelete = json['isDelete'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _storeId;
String _templateId;
bool _allDay;
String _startHour;
String _endHour;
int _isDelete;
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get storeId => _storeId;
String get templateId => _templateId;
bool get allDay => _allDay;
String get startHour => _startHour;
String get endHour => _endHour;
int get isDelete => _isDelete;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['storeId'] = _storeId;
map['templateId'] = _templateId;
map['allDay'] = _allDay;
map['startHour'] = _startHour;
map['endHour'] = _endHour;
map['isDelete'] = _isDelete;
return map;
}
}
/// id : "1473198577613275136"
/// createTime : "2021-12-21 15:48:06"
/// createUser : "1333246101196636160"
/// updateTime : "2021-12-21 15:48:06"
/// updateUser : "1333246101196636160"
/// storeId : "1333246101343436800"
/// type : 2
/// limitTime : null
/// limitNumber : 0
/// coverImg : "https://pos.upload.gznl.top/1175/2021/12/5bf7a846-768b-4a17-872f-e927988c24c9.jpg"
/// shareImg : "https://pos.upload.gznl.top/1175/2021/12/65f6a0f7-14d1-4393-902e-42e5dc464800.jpg"
/// bannerImg : "https://pos.upload.gznl.top/1175/2021/12/9ee395eb-718c-40c0-bfe0-673dbbade4cf.jpg"
/// state : 1
/// allDay : false
/// startTime : "2021-12-20 00:00:00"
/// endTime : "2021-12-30 00:00:00"
/// isDelete : 0
class ActTemplate {
ActTemplate({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String storeId,
int type,
dynamic limitTime,
int limitNumber,
String coverImg,
String shareImg,
String bannerImg,
int state,
bool allDay,
String startTime,
String endTime,
int isDelete,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_storeId = storeId;
_type = type;
_limitTime = limitTime;
_limitNumber = limitNumber;
_coverImg = coverImg;
_shareImg = shareImg;
_bannerImg = bannerImg;
_state = state;
_allDay = allDay;
_startTime = startTime;
_endTime = endTime;
_isDelete = isDelete;
}
ActTemplate.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_storeId = json['storeId'];
_type = json['type'];
_limitTime = json['limitTime'];
_limitNumber = json['limitNumber'];
_coverImg = json['coverImg'];
_shareImg = json['shareImg'];
_bannerImg = json['bannerImg'];
_state = json['state'];
_allDay = json['allDay'];
_startTime = json['startTime'];
_endTime = json['endTime'];
_isDelete = json['isDelete'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _storeId;
int _type;
dynamic _limitTime;
int _limitNumber;
String _coverImg;
String _shareImg;
String _bannerImg;
int _state;
bool _allDay;
String _startTime;
String _endTime;
int _isDelete;
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get storeId => _storeId;
int get type => _type;
dynamic get limitTime => _limitTime;
int get limitNumber => _limitNumber;
String get coverImg => _coverImg;
String get shareImg => _shareImg;
String get bannerImg => _bannerImg;
int get state => _state;
bool get allDay => _allDay;
String get startTime => _startTime;
String get endTime => _endTime;
int get isDelete => _isDelete;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['storeId'] = _storeId;
map['type'] = _type;
map['limitTime'] = _limitTime;
map['limitNumber'] = _limitNumber;
map['coverImg'] = _coverImg;
map['shareImg'] = _shareImg;
map['bannerImg'] = _bannerImg;
map['state'] = _state;
map['allDay'] = _allDay;
map['startTime'] = _startTime;
map['endTime'] = _endTime;
map['isDelete'] = _isDelete;
return map;
}
}

7
lib/retrofit/min_api.dart

@ -21,8 +21,8 @@ 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
@ -35,6 +35,9 @@ const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式
// const base_url = "http://192.168.10.37:8766/app/";
// const baseUrl = "http://192.168.10.37:8766/app/";
const base_url = "http://192.168.10.142:8765/app/";///
const baseUrl = "http://192.168.10.142:8765/app/";///
///
@RestApi(baseUrl: baseUrl)
abstract class MinApiService {

2
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 ??= 'https://pos.api.lotus-wallet.com/app/';
baseUrl ??= 'http://192.168.10.142:8765/app/';
}
final Dio _dio;

12
lib/retrofit/retrofit_api.dart

@ -19,6 +19,7 @@ import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:retrofit/retrofit.dart';
import 'data/achievement_detail_list.dart';
import 'data/activity_area_list.dart';
import 'data/address.dart';
import 'data/banner.dart';
import 'data/brand_data.dart';
@ -53,8 +54,8 @@ 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
@ -66,8 +67,8 @@ const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式
// const baseUrl = "http://192.168.10.37:8766/app/";
// const base_url = "http://192.168.10.142:8766/app/";///
// const baseUrl = "http://192.168.10.142:8766/app/";///
const base_url = "http://192.168.10.142:8766/app/";///
const baseUrl = "http://192.168.10.142:8766/app/";///
@RestApi(baseUrl: baseUrl)
abstract class ApiService {
@ -481,5 +482,8 @@ abstract class ApiService {
@GET("/information/category/{id}")
Future<BaseData<HeadlinesListDetails>> headlinesDetails(@Path("id") String id);
///,,,
@GET("/actTemplate/findActListByType?allDay={allDay}&type={type}")
Future<BaseData<List<ActivityAreaList>>> findActListByType(@Path("allDay") bool allDay, @Path("type") int type);
}

26
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 ??= 'https://pos.platform.lotus-wallet.com/app/';
baseUrl ??= 'http://192.168.10.142:8766/app/';
}
final Dio _dio;
@ -1773,4 +1773,28 @@ class _ApiService implements ApiService {
return value;
}
@override
Future<BaseData<List<ActivityAreaList>>> findActListByType(allDay,type) async {
ArgumentError.checkNotNull(allDay, 'allDay');
ArgumentError.checkNotNull(type, 'type');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/actTemplate/findActListByType?allDay=$allDay&type=$type',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<ActivityAreaList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<ActivityAreaList>((i) => ActivityAreaList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
}

683
lib/store/shopping/activity_prefecture_details.dart

@ -0,0 +1,683 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/retrofit/data/activity_area_list.dart';
import 'package:huixiang/retrofit/data/base_data.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:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class ActivityPrefectureDetails extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _ActivityPrefectureDetails();
}
}
class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
ApiService apiService;
int seckillIndex = 0;
RefreshController refreshController = RefreshController();
List<ActivityAreaList> activityAreaList = [];
ScrollController _scrollController;
ScrollPhysics _scrollPhysics = NeverScrollableScrollPhysics();
bool scrollFlag = false;
@override
void initState() {
super.initState();
_scrollController = ScrollController();
_scrollController.addListener(() {
setState(() {
if(_scrollController.offset < (325.h-MediaQuery.of(context).padding.top)){
_scrollPhysics = NeverScrollableScrollPhysics();
}
else{
_scrollPhysics = BouncingScrollPhysics();
}
});
});
SharedPreferences.getInstance().then((value) {
apiService =
ApiService(Dio(), context: context, token: value.getString("token"));
queryFindActListByType(false,2);
});
}
/////
queryFindActListByType(allDay,type) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<List<ActivityAreaList>> baseData =
await apiService.findActListByType(allDay,type).catchError((error) {
refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
activityAreaList.clear();
activityAreaList.addAll(baseData.data);
setState(() {
refreshController.refreshCompleted();
});
} else {
refreshController.refreshFailed();
}
}
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
physics: BouncingScrollPhysics(),
controller: _scrollController,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
seckillProduct(),
seckilList(),
],
),
);
}
Widget seckillProduct() {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(8.h),
),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Colors.white),
child: Column(
children: [
swiper(),
seckillIndex == 0 ?
Container(
width: double.infinity,
alignment: Alignment.center,
height: 62.h,
padding: EdgeInsets.only(left: 16.w,right: 16.w),
decoration: BoxDecoration(
color: Color(0xFFFFEED9)),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/ms.png",
width:38,
height:38,
fit: BoxFit.contain,
),
SizedBox(width: 14.w,),
Expanded(child:ListView.builder(
scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(),
itemCount:activityAreaList != null ? activityAreaList.length : 0,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
setState(() {
});
},
child: timeItem(activityAreaList[position],position),
);
},
))
,
],
),
)
: Container(
width: double.infinity,
alignment: Alignment.center,
height: 62.h,
padding: EdgeInsets.only(left: 16.w,right: 16.w),
decoration: BoxDecoration(
color: Color(0xFFFFEED9)),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/ms_t.png",
width:38,
height:38,
fit: BoxFit.contain,
),
Spacer(),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "距秒杀结束还有",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
),
TextSpan(
text: "0",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFFB312B),
),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
),
],
),
),
SizedBox(width: 4.w),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,children: [
InkWell(
onTap: () {
setState(() {
});
},
child:Container(
width: 20,
height: 20,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFFB312B),
borderRadius: BorderRadius.circular(1)),
child: Text(
"22",
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
),
),
Padding(padding:EdgeInsets.only(left: 2.w,right: 2.w),
child:Text(
":",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
color: Color(0xFFFB312B),
),
),),
Container(
width: 20,
height: 20,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFFB312B),
borderRadius: BorderRadius.circular(1)),
child: Text(
"22",
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
),
Padding(padding:EdgeInsets.only(left: 2.w,right: 2.w),
child:Text(
":",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
color: Color(0xFFFB312B),
),
),),
InkWell(
onTap: () {
},
child: Container(
width: 20,
height: 20,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFFB312B),
borderRadius: BorderRadius.circular(1)),
child: Text(
"22",
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
),
),
],)
],
),
)
],
),
);
}
Widget swiper() {
return Container(
child: AspectRatio(
aspectRatio: 1.3698,
child: Stack(
children: [
MImage(
"",
width:double.infinity,
height: 330.h,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Container(
margin: EdgeInsets.only(left: 16, top: 52),
padding: EdgeInsets.all(5),
child: Icon(
Icons.arrow_back_ios,
size: 24,
color: Colors.black,
),
),
),
Align(
alignment: Alignment.topCenter,
child:Container(
margin: EdgeInsets.only(top: 52),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Color.fromRGBO(0, 0, 0, 69000000),
),
width:160.w,
height: 30.h,
child: Row(
children: [
GestureDetector(
onTap: (){
setState(() {
seckillIndex =0;
});
},
child: Container(
alignment: Alignment.center,
width: 72.w,
height:22.h,
margin: EdgeInsets.only(left:6.w),
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.centerRight,
end: Alignment.centerLeft,
colors: [
seckillIndex == 0 ? Color(0xFFF67E5F):Colors.transparent,
seckillIndex == 0 ? Color(0xFFFC5237):Colors.transparent,
]),
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Opacity(
opacity: seckillIndex == 0 ? 1 :0.5,
child: Text(
"限时秒杀",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
)
)
),
GestureDetector(
onTap: (){
setState(() {
seckillIndex = 1;
});
},
child: Container(
alignment: Alignment.center,
width: 72.w,
height:22.h,
margin: EdgeInsets.only(left:6.w),
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.centerRight,
end: Alignment.centerLeft,
colors: [
seckillIndex == 1 ? Color(0xFFF67E5F):Colors.transparent,
seckillIndex == 1 ? Color(0xFFFC5237):Colors.transparent,
]),
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child:Opacity(
opacity: seckillIndex == 1 ? 1 :0.5,
child: Text(
"限天秒杀",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
)
)
),
],
),
),
),
],
),
),
);
}
///
Widget seckilList() {
return Container(
height: MediaQuery.of(context).size.height-62.h-MediaQuery.of(context).padding.top,
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount:10,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: _scrollPhysics,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
setState(() {});
},
child: seckilItem(),
);
},
),
);
}
Widget timeItem(ActivityAreaList activityAreaList,position) {
return Container(
margin: EdgeInsets.only(right:12.w,top:8.h,bottom:8.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
activityAreaList.timeProductList[position].actTime.startHour,
style: TextStyle(
fontSize: 17.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFFC3127),
),
),
Expanded(child: Container(
alignment: Alignment.center,
width:48.w,
height:15.h,
decoration: BoxDecoration(
color: Color(0xFFFB312B),
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Text(
"已结束",
style: TextStyle(
fontSize:10.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
))
],
),
);
}
Widget seckilItem() {
return Container(
margin: EdgeInsets.only(right:12.w,top: 12.h,bottom: 12.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// MImage(
// "",
// width: 94.w,
// height: 94.h,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
Image.asset(
"assets/image/icon_story_td.png",
width: 94,
height: 94,
fit: BoxFit.cover,
),
SizedBox(width:12.w,),
Expanded(child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"[生态小农]山林放养鸡蛋30枚/盒",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF353535),
),
),
Text(
"限量45件",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF4D4D4D),
),
),
Row(
children: [
ClipRRect(
borderRadius: BorderRadius.circular(6.5),
child:
Stack(
children: [
Container(
width: 180.w,
height: 8.h,
color: Color(0xFFF5F5F5),
),
Container(
width: 100.w,
height: 8.h,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [Color(0xFFFDBA56), Color(0xFFFB2B2B)])),
)
],
)),
SizedBox(width: 5,),
Text(
"已售67%",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
),
),
],
),
Row(
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFFB2E2C),
),
),
TextSpan(
text: "123.00",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFFB2E2C),
),
),
],
),
),
Expanded(child: Text(
"¥234.00",
style: TextStyle(
fontSize: 10.sp,
decoration: TextDecoration.lineThrough,
decorationColor: Color(0xFF585858),
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
),
),),
Container(
alignment: Alignment.center,
width:60.w,
height:24.h,
decoration: BoxDecoration(
color: Color(0xFFFB312B),
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Text(
"马上抢",
style: TextStyle(
fontSize:12.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
),
// Container(
// alignment: Alignment.center,
// width:60.w,
// height:24.h,
// decoration: BoxDecoration(
// color: Color(0xFFE2F6EA),
// borderRadius: BorderRadius.circular(12),
// boxShadow: [
// BoxShadow(
// color: Colors.black.withAlpha(12),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0,
// ),
// ],
// ),
// child: Text(
// "即将开始",
// style: TextStyle(
// fontSize:12.sp,
// fontWeight: MyFontWeight.medium,
// color: Color(0xFF52AF79),
// ),
// ),
// ),
// Container(
// alignment: Alignment.center,
// width:60.w,
// height:24.h,
// decoration: BoxDecoration(
// color: Colors.transparent,
// borderRadius: BorderRadius.circular(12),
// boxShadow: [
// BoxShadow(
// color: Colors.black.withAlpha(12),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0,
// ),
// ],
// ),
// child: Text(
// "已结束",
// style: TextStyle(
// fontSize:12.sp,
// fontWeight: MyFontWeight.medium,
// color: Color(0xFFADADAD),
// ),
// ),
// ),
],
),
],
),)
],
),
);
}
}

203
lib/store/shopping/shopping_cart/cart_goods_list.dart

@ -0,0 +1,203 @@
import 'package:flutter/material.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class CartGoodsList extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _CartGoodsList();
}
}
class _CartGoodsList extends State<CartGoodsList> {
RefreshController refreshController = RefreshController();
ApiService apiService;
int pageNum = 0;
@override
void initState() {
super.initState();
_onRefresh();
}
_onRefresh() async {
pageNum = 0;
setState(() {});
}
@override
Widget build(BuildContext context) {
return Container(
height: MediaQuery.of(context).size.height -
103.h -
MediaQuery.of(context).padding.top,
child: SmartRefresher(
controller: refreshController,
enablePullUp: false,
enablePullDown: true,
physics: BouncingScrollPhysics(),
header: MyHeader(),
onRefresh: () {
},
child: ListView.builder(
itemCount:6,
padding: EdgeInsets.only(
top: 8.h,
bottom: 84.h, /* + (375.h - 88.h) + 4.h*/
),
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return InkWell(
onTap: () {
},
child: cartGoodsItem(),
);
}),
),
);
}
Widget cartGoodsItem() {
return Container(
margin: EdgeInsets.all(16),
padding: EdgeInsets.all(16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
// ? "assets/image/icon_radio_selected.png" :
"assets/image/icon_radio_unselected.png",
width:16,
height:16,
),
SizedBox(width: 16.w),
// MImage(
// "assets/image/icon_story_td.png",
// isCircle: true,
// width:81,
// height:81,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
Image.asset(
"assets/image/icon_story_td.png",
width: 81,
height: 81,
fit: BoxFit.cover,
),
SizedBox(width: 10.w),
Expanded(child:
Container(
height:81.h,child:Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"[生态小农]山林放养鸡蛋30枚/盒",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF353535),
),
),
// SizedBox(height: 5.h),
Text(
"套盒装",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF727272),
),
),
// SizedBox(height: 5.h),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(child:Text.rich(
TextSpan(
children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
TextSpan(
text: "58.2",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
],
),
)),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,children: [
InkWell(
onTap: () {
setState(() {
});
},
child: Image.asset(
"assets/image/reduce.png",
width: 22,
height: 22,
),
),
Container(
width: 30,
alignment: Alignment.center,
child: Text(
"1",
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
),
InkWell(
onTap: () {
},
child: Image.asset(
"assets/image/add.png",
width: 22,
height: 22,
),
),
],)
],
),
],
)),),
],
),
);
}
}

241
lib/store/shopping/shopping_cart/shopping_cart_page.dart

@ -0,0 +1,241 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/shopping/shopping_home/recommend_goods_list_view.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'cart_goods_list.dart';
class ShoppingCartPage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _ShoppingCartPage();
}
}
class _ShoppingCartPage extends State<ShoppingCartPage>
with AutomaticKeepAliveClientMixin {
ApiService apiService;
@override
void initState() {
super.initState();
}
final SwiperController controller = SwiperController();
@override
void dispose() {
super.dispose();
if (refreshController != null) refreshController.dispose();
}
final RefreshController refreshController = RefreshController();
@override
Widget build(BuildContext context) {
super.build(context);
return Stack(
children: [
Column(
children: [
MyAppBar(
title: "购物车",
titleColor: Colors.black,
leadingColor: Colors.black,
background: Colors.transparent,
actions: [
Container(
alignment: Alignment.center,
margin: EdgeInsets.only(right: 12.w),
child: GestureDetector(
onTap: () {
},
child: Text("管理",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold,
color:Colors.black,
),
),
),
),
// Container(
// alignment: Alignment.center,
// margin: EdgeInsets.only(right: 12.w),
// child: GestureDetector(
// onTap: () {
//
// },
// child: Text(S.of(context).quxiao,
// style: TextStyle(
// fontSize: 18.sp,
// fontWeight: MyFontWeight.semi_bold,
// color:Colors.black,
// ),
// ),
// ),
// ),
],
),
Expanded(
child: Container(
child: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
onRefresh: () {
setState(() {});
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: FutureBuilder(
// future: queryHome(),
builder: (context, snapshot) {
return Column(
children: [
///
CartGoodsList(),
],
);
},
),
),
),
),
),
],
),
Align(
alignment: Alignment(0.8,0.8),
child: Container(
height:70.h,
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
color: Color(0xFFFAFAFA),
),
padding: EdgeInsets.only(left: 16.w,right: 16.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/icon_radio_unselected.png",
width: 16,
height: 16,
),
SizedBox(width: 5.w),
Expanded(child: Text(
"全选",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFA29E9E),
),
),),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "合计:",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
),
TextSpan(
text: "¥20.4",
style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
],
),
),
Container(
alignment: Alignment.center,
width: 70.w,
height: 32.h,
margin: EdgeInsets.only(left:6.w),
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Text(
"结算",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
),
// Container(
// alignment: Alignment.center,
// width: 70.w,
// height: 32.h,
// margin: EdgeInsets.only(left:6.w),
// decoration: BoxDecoration(
// color: Color(0xFFFB312B),
// borderRadius: BorderRadius.circular(16),
// boxShadow: [
// BoxShadow(
// color: Colors.black.withAlpha(12),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0,
// ),
// ],
// ),
// child: Text(
// "删除",
// style: TextStyle(
// fontSize: 16.sp,
// fontWeight: MyFontWeight.regular,
// color: Colors.white,
// ),
// ),
// ),
],
),
),
),
],
);
}
@override
bool get wantKeepAlive => true;
}

1235
lib/store/shopping/shopping_goods_details.dart

File diff suppressed because it is too large Load Diff

205
lib/store/shopping/shopping_home/activity_banner.dart

@ -0,0 +1,205 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/retrofit/data/banner.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class ActivityBanner extends StatefulWidget {
final List<BannerData> bannerData;
final SwiperController controller;
ActivityBanner(this.bannerData, this.controller);
@override
State<StatefulWidget> createState() {
return _ActivityBanner();
}
}
class _ActivityBanner extends State<ActivityBanner> {
ApiService apiService;
final RefreshController refreshController = RefreshController();
List<BannerData> bannerData = [];
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(bottom:10),
child: AspectRatio(
aspectRatio: 1.23,
child: Swiper(
viewportFraction: 0.9,
scale: 0.73,
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
builder: DotSwiperPaginationBuilder(
size: 8,
activeSize: 8,
space: 5,
activeColor: Colors.black,
color: Colors.black.withAlpha(76),
),
),
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return Column(
children: [
InkWell(
onTap: () {
bannerClick(widget.bannerData[position]);
},
child:
// MImage(
// (widget.bannerData != null &&
// position < widget.bannerData.length)
// ? widget.bannerData[position].imgUrl
// : "",
// width:double.infinity,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_2_1.png",
// fadeSrc: "assets/image/default_2_1.png",
// ),
Image.asset(
"assets/image/icon_story_td.png",
height:185,
width:double.infinity,
fit: BoxFit.cover,
),
),
// Expanded(child: child)
Container(
height: 138,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.vertical(bottom: Radius.circular(8)),
),
child: ListView.builder(
scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.symmetric(horizontal: 12),
itemCount: 4,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
'/router/shopping_goods_details',
arguments: {},
);
},
child: activityBannerItem(),
);
},
),
),
],
);
},
itemCount:
(widget.bannerData != null && widget.bannerData.length > 0)
? widget.bannerData.length
: 1),
),
);
}
Widget activityBannerItem() {
return Container(
margin: EdgeInsets.only(right:7.w,left:7.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// MImage(
// "assets/image/icon_story_td.png",
// isCircle: true,
// width: 70.w,
// height: 70.h,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
Image.asset(
"assets/image/icon_story_td.png",
width: 70,
height: 70,
fit: BoxFit.cover,
),
SizedBox(
height: 4,
),
Text(
"[一心回乡]甄果",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
),
),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF32A060),
),
),
TextSpan(
text: "12.60",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
],
),
),
],
),
);
}
/// contentType 0123,4:,5:
bannerClick(BannerData bannerData) async {
switch (bannerData.contentType) {
case 1:
Navigator.of(context).pushNamed('/router/integral_store_page',
arguments: {"goodsId": bannerData.content});
break;
case 2:
Navigator.of(context).pushNamed('/router/web_page', arguments: {
"activityId": bannerData.content,
});
break;
case 3:
Navigator.of(context).pushNamed('/router/web_page', arguments: {
"articleId": bannerData.content,
});
break;
case 4:
String router = bannerData.content;
if (router.contains("?")) {
String params = router.substring(router.indexOf("?"));
params = params.replaceAll("?", "");
Map map = jsonDecode(params);
Navigator.of(context).pushNamed(router, arguments: map);
} else {
Navigator.of(context).pushNamed(router);
}
break;
case 5:
Navigator.of(context).pushNamed('/router/class_details', arguments: {
"id": bannerData.content,
});
break;
}
}
}

753
lib/store/shopping/shopping_home/bargain_details.dart

@ -0,0 +1,753 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class BargainDetails extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _BargainDetails();
}
}
class _BargainDetails extends State<BargainDetails> {
ApiService apiService;
@override
void initState() {
super.initState();
}
final SwiperController controller = SwiperController();
@override
void dispose() {
super.dispose();
if (refreshController != null) refreshController.dispose();
}
final RefreshController refreshController = RefreshController();
@override
Widget build(BuildContext context) {
return Stack(
children: [
Container(
color: Color(0xFFF7F7F7),
),
Stack(
children: [
Container(
height: 330.h,
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.centerRight,
end: Alignment.centerLeft,
colors: [
Color(0xFFE8F5E9),
Color(0xFFE5F7FF),
]),
),
),
Column(
children: [
MyAppBar(
title: "砍价详情",
titleColor: Colors.black,
leadingColor: Colors.black,
background: Colors.transparent,
),
Expanded(
child: Container(
child: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
onRefresh: () {
setState(() {});
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: FutureBuilder(
// future: queryHome(),
builder: (context, snapshot) {
return Column(
children: [
bargainGoodsInfo(),
bargainProgress(),
bargainRule(),
bargainFriendsList(),
],
);
},
),
),
),
),
),
],
)
],
),
],
);
}
///b
Widget bargainGoodsInfo() {
return Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Colors.white),
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 24.h),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ClipRRect(
borderRadius: BorderRadius.circular(2),
child: Image.asset(
"assets/image/icon_story_td.png",
width: 85,
height: 85,
fit: BoxFit.cover,
),
),
// MImage(
// "",
// width: double.infinity,
// height: 166,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
SizedBox(
width: 10,
),
Expanded(
child: Container(
height: 85,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"[生态小农]山林放养鸡蛋30枚/盒备份 2",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF353535),
),
),
Text(
"套盒装",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF9476F7),
),
),
TextSpan(
text: "284.00",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF9476F7),
),
),
],
),
),
],
),
))
],
),
);
}
///
Widget bargainProgress() {
return Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Colors.white),
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 24.h),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(margin: EdgeInsets.only(left: 10),child:
Stack(
alignment: Alignment.bottomLeft,
children: [
Container(
alignment: Alignment.center,
width:67,
height:23.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: Color(0xFF9476F7),
),
child: Text(
"砍价成功",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
),
Align(
alignment: Alignment.bottomLeft,
child:
Container(height:8,child: Icon(
Icons.arrow_drop_down,
color: Color(0xFF9476F7),
size: 18,
),),
),
],
),),
SizedBox(height:10),
ClipRRect(
borderRadius: BorderRadius.circular(6.5),
child:
Stack(
children: [
Container(
width:double.infinity,
height: 8.h,
color: Color(0xFFF5F5F5),
),
Container(
width: 100.w,
height: 8.h,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [Color(0xFFFEC401), Color(0xFF9274F7)])),
)
],
)),
SizedBox(height: 3,),
Row(
children: [
Expanded(child:Text(
"原价¥284.00",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF8D8D8D),
),
),),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "最低价¥",
style: TextStyle(
fontSize:9.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF9476F7),
),
),
TextSpan(
text: "284.00",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF9476F7),
),
),
],
),
),
],
),
SizedBox(height:16),
Row(children: [
Expanded(child: GestureDetector(
child:Container(
alignment: Alignment.center,
width:double.infinity,
height:54.h,
margin: EdgeInsets.only(left:6.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(27),
border: Border.all(
width: 1,
color: Color(0xFF9476F7),
style: BorderStyle.solid,
),
),
child: Text(
"我也要砍",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF9476F7),
),
),
),
)),
// Expanded(child:GestureDetector(
// child: Container(
// alignment: Alignment.center,
// width:double.infinity,
// height:54.h,
// margin: EdgeInsets.only(left:6.w),
// decoration: BoxDecoration(
// color: Color(0xFF9476F7),
// borderRadius: BorderRadius.circular(27),
// boxShadow: [
// BoxShadow(
// color: Colors.black.withAlpha(12),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0,
// ),
// ],
// ),
// child: Text(
// "帮他砍价",
// style: TextStyle(
// fontSize: 16.sp,
// fontWeight: MyFontWeight.medium,
// color: Colors.white,
// ),
// ),
// )
// ),),
Expanded(child:GestureDetector(
child: Container(
alignment: Alignment.center,
width:double.infinity,
height:54.h,
margin: EdgeInsets.only(left:6.w),
decoration: BoxDecoration(
color: Color(0xFFE5E5E5),
borderRadius: BorderRadius.circular(27),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Text(
"已帮TA砍价",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF858585),
),
),
)
),),
],),
// Container(
// alignment: Alignment.center,
// width:double.infinity,
// height:54.h,
// margin: EdgeInsets.only(left:6.w),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(27),
// color: Color(0xFF9476F7),
// ),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Image.asset(
// "assets/image/wx.png",
// width:24,
// height:24,
// fit: BoxFit.cover,
// ),
// SizedBox(
// width:8,
// ),
// Text(
// "邀请微信好友一起拼团",
// style: TextStyle(
// fontSize: 16.sp,
// fontWeight: MyFontWeight.medium,
// color: Colors.white,
// ),
// )
// ],
// )
// )
],
),
);
}
///
Widget bargainRule() {
return Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Colors.white),
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 24.h),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 3,
height: 3,
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(
color: Color(0xFF9476F7),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
Container(
width: 5,
height: 5,
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(
color: Color(0xFF9476F7),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
Container(
width: 8,
height: 8,
margin: EdgeInsets.only(right: 4),
decoration: BoxDecoration(
color: Color(0xFF9476F7),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
Text(
"砍价规则",
style: TextStyle(
fontSize:15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
),
Container(
width: 8,
height: 8,
margin: EdgeInsets.only(right: 10, left: 4),
decoration: BoxDecoration(
color: Color(0xFF9476F7),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
Container(
width: 5,
height: 5,
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(
color: Color(0xFF9476F7),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
Container(
width: 3,
height: 3,
decoration: BoxDecoration(
color: Color(0xFF9476F7),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
],
),
SizedBox(
height: 12,
),
Text(
"1.选择自己喜欢的商品,邀请好友砍价,每次砍价金额以页面显示为主,邀请的越多,砍价成功的几率越高。",
style: TextStyle(
color: Color(0xFF4C4C4C),
fontSize:12.sp,
height: 1.5,
fontWeight: MyFontWeight.medium,
),
),
Text(
"2.砍价成功后,点击立即购买,将以最终价格进行结算。",
style: TextStyle(
color: Color(0xFF4C4C4C),
fontSize:12.sp,
height: 1.5,
fontWeight: MyFontWeight.medium,
),
),
Text(
"3.砍价商品不享受平台活动,优惠券以及会员折扣。",
style: TextStyle(
color: Color(0xFF4C4C4C),
fontSize:12.sp,
height: 1.5,
fontWeight: MyFontWeight.medium,
),
),
],
),
);
}
///
Widget bargainFriendsList() {
return Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Colors.white),
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 24.h),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 3,
height: 3,
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(
color: Color(0xFF9476F7),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
Container(
width: 5,
height: 5,
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(
color: Color(0xFF9476F7),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
Container(
width: 8,
height: 8,
margin: EdgeInsets.only(right: 4),
decoration: BoxDecoration(
color: Color(0xFF9476F7),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
Text(
"好友砍价榜",
style: TextStyle(
fontSize:15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
),
Container(
width: 8,
height: 8,
margin: EdgeInsets.only(right: 10, left: 4),
decoration: BoxDecoration(
color: Color(0xFF9476F7),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
Container(
width: 5,
height: 5,
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(
color: Color(0xFF9476F7),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
Container(
width: 3,
height: 3,
decoration: BoxDecoration(
color: Color(0xFF9476F7),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
],
),
SizedBox(
height:20,
),
Container(
alignment: Alignment.center,
width: double.infinity,
child: ListView.builder(
shrinkWrap: true,
padding: EdgeInsets.zero,
scrollDirection: Axis.vertical,
physics: BouncingScrollPhysics(),
itemCount: 3,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: bargainFriendsItem(),
);
},
),
// (coupons != null && coupons.length > 0)
// ? ListView.builder(
// padding: EdgeInsets.symmetric(vertical: 8.h),
// itemBuilder: (context, position) {
// return GestureDetector(
// onTap: () {
// Navigator.of(context).pushNamed(
// '/router/vip_details_page',
// arguments: {"id": coupons[position].id});
// },
// child: vipCardItem(coupons[position]),
// );
// },
// itemCount: coupons != null ? coupons.length : 0,
// )
// : NoDataView(
// isShowBtn: false,
// text: "暂无好友帮忙砍价~",
// fontSize: 16.sp,
// margin: EdgeInsets.only(top: 120.h),
// ),
),
SizedBox(
height:20,
),
],
),
);
}
Widget bargainFriendsItem() {
return Container(
height: 36.h,
margin: EdgeInsets.only(bottom:10),
child:Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
// MImage(
// "",
// width:34,
// height:34,
// fit: BoxFit.cover,
// isCircle: true,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
Image.asset(
"assets/image/icon_story_td.png",
width: 34,
height: 34,
fit: BoxFit.cover,
),
SizedBox(width: 4,),
Expanded(child:Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"张三",
style: TextStyle(
fontSize:12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF353535),
),
),
Text(
"3分钟前",
style: TextStyle(
fontSize:10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFACACAC),
),
),
],
)),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "已砍",
style: TextStyle(
fontSize: 11.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
),
),
TextSpan(
text: "23.00元",
style: TextStyle(
fontSize:11.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF9476F7),
),
),
],
),
),
],
)
);
}
}

97
lib/store/shopping/shopping_home/classify_list.dart

@ -0,0 +1,97 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class ClassifyList extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _ClassifyList();
}
}
class _ClassifyList extends State<ClassifyList> {
ApiService apiService;
BMFCoordinate latLng;
final TextEditingController editingController = TextEditingController();
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
height: 100.h,
margin: EdgeInsets.only(top:12.h,left: 16.w,right: 16.w),
padding: EdgeInsets.only(bottom: 3.h, top: 16.h,),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
color: Colors.white,
),
child: ListView.builder(
scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.symmetric(horizontal: 14),
itemCount:15,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
Navigator.of(context)
.pushNamed('/router/search_page');
},
child: classifyItem(),
);
},
),
);
}
Widget classifyItem() {
return Container(
// height:94.h,
margin: EdgeInsets.only(right: 19.w),
child: Column(
children: [
// MImage(
// "assets/image/icon_story_td.png",
// isCircle: true,
// width: 48.w,
// height: 48.h,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
Image.asset(
"assets/image/icon_story_td.png",
width: 48,
height: 48,
fit: BoxFit.cover,
),
SizedBox(height: 4,),
Text(
"时令水果",
style: TextStyle(
fontSize: 11.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF1A1A1A),
),
),
],
),
);
}
}

888
lib/store/shopping/shopping_home/group_details.dart

@ -0,0 +1,888 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class GroupDetails extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _GroupDetails();
}
}
class _GroupDetails extends State<GroupDetails> {
ApiService apiService;
@override
void initState() {
super.initState();
}
final SwiperController controller = SwiperController();
@override
void dispose() {
super.dispose();
if (refreshController != null) refreshController.dispose();
}
final RefreshController refreshController = RefreshController();
@override
Widget build(BuildContext context) {
return Stack(
children: [
Container(
color: Color(0xFFF7F7F7),
),
Stack(
children: [
Container(
height: 330.h,
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.centerRight,
end: Alignment.centerLeft,
colors: [
Color(0xFFE8F5E9),
Color(0xFFE5F7FF),
]),
),
),
Column(
children: [
MyAppBar(
title: "拼团详情",
titleColor: Colors.black,
leadingColor: Colors.black,
background: Colors.transparent,
),
Expanded(
child: Container(
child: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
onRefresh: () {
setState(() {});
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: FutureBuilder(
// future: queryHome(),
builder: (context, snapshot) {
return Column(
children: [
goodsInfo(),
inviteGroup(),
groupRule(),
],
);
},
),
),
),
),
),
],
)
],
),
],
);
}
///
Widget goodsInfo() {
return Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Colors.white),
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 24.h),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ClipRRect(
borderRadius: BorderRadius.circular(2),
child: Image.asset(
"assets/image/icon_story_td.png",
width: 85,
height: 85,
fit: BoxFit.cover,
),
),
// MImage(
// "",
// width: double.infinity,
// height: 166,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
SizedBox(
width: 10,
),
Expanded(
child: Container(
height: 85,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"[生态小农]山林放养鸡蛋30枚/盒备份 2",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF353535),
),
),
Text(
"套盒装",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
TextSpan(
text: "284.00",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
],
),
),
],
),
))
],
),
);
}
///
Widget inviteGroup() {
return Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Colors.white),
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 24.h),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 3,
height: 3,
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(
color: Color(0xFFB8BAC1),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
Container(
width: 5,
height: 5,
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(
color: Color(0xFFB8BAC1),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
Container(
width: 8,
height: 8,
margin: EdgeInsets.only(right: 4),
decoration: BoxDecoration(
color: Color(0xFFB8BAC1),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
Text(
"拼团剩余时间",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
),
Container(
width: 8,
height: 8,
margin: EdgeInsets.only(right: 10, left: 4),
decoration: BoxDecoration(
color: Color(0xFFB8BAC1),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
Container(
width: 5,
height: 5,
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(
color: Color(0xFFB8BAC1),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
Container(
width: 3,
height: 3,
decoration: BoxDecoration(
color: Color(0xFFB8BAC1),
borderRadius: BorderRadius.all(Radius.circular(5))),
),
],
),
SizedBox(
height: 12,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
InkWell(
onTap: () {},
child: Container(
width: 27,
height: 28,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFD2D2D2),
borderRadius: BorderRadius.circular(4)),
child: Text(
"22",
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
),
),
Padding(
padding: EdgeInsets.only(left: 10, right: 10),
child: Text(
":",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFFD2D2D2),
),
)),
InkWell(
onTap: () {},
child: Container(
width: 27,
height: 28,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFD2D2D2),
borderRadius: BorderRadius.circular(4)),
child: Text(
"59",
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
),
),
Padding(
padding: EdgeInsets.only(left: 10, right: 10),
child: Text(
":",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFFD2D2D2),
),
)),
InkWell(
onTap: () {},
child: Container(
width: 27,
height: 28,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFD2D2D2),
borderRadius: BorderRadius.circular(4)),
child: Text(
"59",
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
),
),
],
),
SizedBox(
height: 24,
),
// Text(
// "恭喜您拼团成功",
// style: TextStyle(
// fontSize: 18.sp,
// fontWeight: MyFontWeight.semi_bold,
// color: Colors.black,
// ),
// ),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "距离拼团成功还差",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
),
TextSpan(
text: "2",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFF8961E),
),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
),
],
),
),
// Text(
// "很遗憾,拼团失败",
// style: TextStyle(
// fontSize: 18.sp,
// fontWeight: MyFontWeight.semi_bold,
// color: Colors.black,
// ),
// ),
SizedBox(
height: 32,
),
Container(
alignment: Alignment.center,
width: double.infinity,
height: 75.h,
child: ListView.builder(
shrinkWrap: true,
padding: EdgeInsets.zero,
scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(),
itemCount: 3,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: groupItem(),
);
},
),
),
SizedBox(
height:54.h,
),
InkWell(
onTap: () {
setState(() {
});
},
child:Container(
width:double.infinity,
height:54.h,
margin: EdgeInsets.only(bottom: 28),
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF00A359),
borderRadius: BorderRadius.circular(27)),
child: Text(
"查看拼团订单",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
)),
),
// InkWell(
// onTap: () {
// setState(() {
// });
// },
// child:Container(
// width:double.infinity,
// height:54.h,
// margin: EdgeInsets.only(bottom: 28),
// alignment: Alignment.center,
// decoration: BoxDecoration(
// color: Color(0xFF00A359),
// borderRadius: BorderRadius.circular(27)),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Image.asset(
// "assets/image/wx.png",
// width:24,
// height:24,
// fit: BoxFit.cover,
// ),
// SizedBox(
// width:8,
// ),
// Text(
// "邀请微信好友一起拼团",
// style: TextStyle(
// fontSize: 16.sp,
// fontWeight: MyFontWeight.medium,
// color: Colors.white,
// ),
// )
// ],
// )),
// ),
// InkWell(
// onTap: () {
// setState(() {
// });
// },
// child:Container(
// width:double.infinity,
// height:54.h,
// margin: EdgeInsets.only(bottom: 28),
// alignment: Alignment.center,
// decoration: BoxDecoration(
// color: Color(0xFF00A359),
// borderRadius: BorderRadius.circular(27)),
// child: Text(
// "联系客服退款",
// style: TextStyle(
// fontSize: 16.sp,
// fontWeight: MyFontWeight.medium,
// color: Colors.white,
// ),
// )),
// ),
],
),
);
}
Widget groupItem() {
return Container(
margin: EdgeInsets.only(right:25),
child:Row(
children: [
Stack(
children: [
Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(60),
border: Border.all(
width: 1,
color: Color(0xFFF8961E),
// style: BorderStyle.solid,
),
),
child:MImage(
"",
width:60.w,
height:60.h,
fit: BoxFit.cover,
isCircle: true,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
),
Align(
alignment: Alignment.bottomCenter,
child:Container(
width: 60.w,
child: Container(
width: 34.w,
height:14.h,
alignment: Alignment.center,
margin: EdgeInsets.only(left:10,right:10),
decoration: BoxDecoration(
color: Color(0xFFF8961E),
borderRadius: BorderRadius.circular(7)),
child: Text(
"团长",
style: TextStyle(
fontSize:8.sp,
fontWeight: MyFontWeight.light,
color: Colors.white,
),
)),
),
)
],
),
// Container(
// width: 60.w,
// height: 67.h,
// child:Image.asset(
// "assets/image/pin_t.png",
// width: 60.w,
// height: 60.h,
// fit: BoxFit.cover,
// ),
// ),
],
)
);
}
///
Widget groupRule() {
return Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Colors.white),
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 24.h,bottom:40.h),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"拼团规则",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF353535),
),
),
SizedBox(height: 12.h),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/zu_tuan.png",
width: 42,
height: 42,
fit: BoxFit.cover,
),
Container(
width:45,
child: Flex(
children: List.generate(8, (_) {
return SizedBox(
width: 3,
height: 1,
child: DecoratedBox(
decoration:
BoxDecoration(color: Color(0xFF32A060)),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
),
),
],
),
SizedBox(height: 8.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Column(
children: [
Text(
"开团/参团",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF181818),
),
),
Text(
"拼团享低价",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF5F5F5F),
),
),
],
),
Container(
width:35,
child: Flex(
children: List.generate(0, (_) {
return SizedBox(
width: 3,
height: 1,
child: DecoratedBox(
decoration: BoxDecoration(color: Colors.white),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
),
),
],
),
],
),
Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/zt_zf.png",
width: 42,
height: 42,
fit: BoxFit.cover,
),
Container(
width: 45,
child: Flex(
children: List.generate(8, (_) {
return SizedBox(
width: 3,
height: 1,
child: DecoratedBox(
decoration:
BoxDecoration(color: Color(0xFF32A060)),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
),
),
],
),
SizedBox(height: 8.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Column(
children: [
Text(
"成功支付",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF181818),
),
),
Text(
"下单可开团",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF5F5F5F),
),
),
],
),
Container(
width: 35,
child: Flex(
children: List.generate(0, (_) {
return SizedBox(
width: 3,
height: 1,
child: DecoratedBox(
decoration: BoxDecoration(color: Colors.white),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
),
),
],
),
],
),
Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/yq_zt.png",
width: 42,
height: 42,
fit: BoxFit.cover,
),
Container(
width: 45,
child: Flex(
children: List.generate(8, (_) {
return SizedBox(
width: 3,
height: 1,
child: DecoratedBox(
decoration:
BoxDecoration(color: Color(0xFF32A060)),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
),
),
],
),
SizedBox(height: 8.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Column(
children: [
Text(
"邀请参团",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF181818),
),
),
Text(
"一起享优惠",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF5F5F5F),
),
),
],
),
Container(
width: 35,
child: Flex(
children: List.generate(0, (_) {
return SizedBox(
width: 3,
height: 1,
child: DecoratedBox(
decoration: BoxDecoration(color: Colors.white),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
),
),
],
)
],
),
Column(
children: [
Image.asset(
"assets/image/zt_m.png",
width: 42,
height: 42,
fit: BoxFit.cover,
),
SizedBox(height: 8.h),
Text(
"人满成团",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF181818),
),
),
Text(
"人不满退款",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF5F5F5F),
),
),
],
),
],
),
],
)
);
}
}

214
lib/store/shopping/shopping_home/group_page_details.dart

@ -0,0 +1,214 @@
import 'package:flutter/material.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class GroupPageDetails extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _GroupPageDetails();
}
}
class _GroupPageDetails extends State<GroupPageDetails> {
RefreshController refreshController = RefreshController();
ApiService apiService;
int pageNum = 0;
@override
void initState() {
super.initState();
_onRefresh();
}
_onRefresh() async {
pageNum = 0;
setState(() {});
}
@override
Widget build(BuildContext context) {
return Container(
color: Colors.white,
child: Column(
children: [
MyAppBar(
title:"可参加的团",
titleColor: Colors.black,
leadingColor: Colors.black,
background: Colors.transparent,
),
Expanded(
child: Container(
child: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: true,
header: MyHeader(),
physics: BouncingScrollPhysics(),
onRefresh: () {
setState(() {});
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: FutureBuilder(
// future: queryHome(),
builder: (context, snapshot) {
return Column(
children: [
groupList(),
],
);
},
),
),
),
),
),
],
),
);
}
///
Widget groupList() {
return Container(
height: MediaQuery.of(context).size.height-62.h-MediaQuery.of(context).padding.top,
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount:10,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
setState(() {});
},
child: groupItem(),
);
},
),
);
}
Widget groupItem() {
return Container(
height: 44.h,
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// MImage(
// "",
// width:44,
// height:44,
// fit: BoxFit.cover,
// isCircle: true,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
Image.asset(
"assets/image/icon_story_td.png",
width: 44,
height: 44,
fit: BoxFit.cover,
),
SizedBox(width: 4.w),
Expanded(
child: Text(
"团长名称",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF4D4D4D),
),
)),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: "还差:",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
),
),
TextSpan(
text: "1",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF32A060),
),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
),
),
],
),
),
Text(
"剩余23:12:12",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
),
),
],
),
Container(
alignment: Alignment.center,
width: 53.w,
height: 22.h,
margin: EdgeInsets.only(left: 4.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(13),
gradient: new LinearGradient(
begin: Alignment.centerRight,
end: Alignment.centerLeft,
colors: [
Color(0xFF61CE6B),
Color(0xFF32A057),
]),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Text(
"去参团",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
)
],
),
);
}
}

214
lib/store/shopping/shopping_home/recommend_goods_list_view.dart

@ -0,0 +1,214 @@
import 'package:flutter/material.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class RecommendGoodsListView extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _RecommendGoodsListView();
}
}
class _RecommendGoodsListView extends State<RecommendGoodsListView> {
@override
Widget build(BuildContext context) {
return Column(
children: [
Text(
"为你推荐",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF1A1A1A),
),
),
Container(
color: Color(0xFF32A060),
width: 35.w,
height: 5.h,
),
GridView.builder(
itemCount: 6,
padding: EdgeInsets.only(
left: 16.w,
right: 16.w,
top: 13.h,
bottom: 16.h,
),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
//Widget数量
crossAxisCount: 2,
//Widget之间间距
crossAxisSpacing: 11.w,
//Widget之间间距
mainAxisSpacing: 16.w,
//Widget宽高比例 0.59
childAspectRatio:
185 / (281 / 2 + (281 / 2) * AppUtils.textScale(context)),
),
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
'/router/shopping_goods_details',
arguments: {},
);
},
child: goodsListItem(),
);
},
)
],
);
}
Widget goodsListItem() {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.vertical(
top: Radius.circular(8),
),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(10),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Colors.white,
),
margin: EdgeInsets.symmetric(
vertical: 3,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(10),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child:
// MImage(
// "",
// width: double.infinity,
// height: 166,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
Image.asset(
"assets/image/icon_story_td.png",
width: double.infinity,
fit: BoxFit.cover,
),
),
Expanded(
child: Container(
padding: EdgeInsets.only(left: 12.w, right: 12.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
margin: EdgeInsets.only(top: 8, right: 8),
padding: EdgeInsets.only(left: 2, right: 2),
height: 17.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: Color(0xFF5A5A5A),
),
child: Text(
"中国大陆5仓",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
),
Text(
"已售12件",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF5D5D5D),
),
),
],
),
Text(
"SWISSGEAR瑞士军刀联名款马克杯",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF353535),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
TextSpan(
text: "284.00",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
],
),
),
Text(
"¥283.00",
style: TextStyle(
fontSize: 14.sp,
decoration: TextDecoration.lineThrough,
decorationColor: Color(0xFF585858),
fontWeight: MyFontWeight.regular,
color: Color(0xFFA2A2A2),
),
),
],
),
],
),
),
)
],
),
);
}
}

607
lib/store/shopping/shopping_home/search_page.dart

@ -0,0 +1,607 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluwx/fluwx.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/vip_benefit_list.dart';
import 'package:huixiang/retrofit/data/vip_rule_details.dart';
import 'package:huixiang/retrofit/data/wx_pay.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/min.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/item_input_widget.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
class SearchPage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _SearchPage();
}
}
class _SearchPage extends State<SearchPage> {
ApiService apiService;
TextEditingController controller = TextEditingController();
final RefreshController refreshController = RefreshController();
int optionIndex = 0;
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) {
apiService = ApiService(Dio(),
context: context, token: value.getString("token"), pay: true);
});
}
@override
Widget build(BuildContext context) {
return Stack(
children: [
Container(
decoration: BoxDecoration(
border: Border.all(
color: Colors.transparent,
),
color: Colors.transparent,
borderRadius: new BorderRadius.only(
topLeft: Radius.circular(16),
topRight: Radius.circular(16),
),
),
),
Stack(
children: [
Container(
// padding: EdgeInsets.only(top: 40.h),
height: 140.h,
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.centerRight,
end: Alignment.centerLeft,
colors: [
Color(0xFFE8F5E9),
Color(0xFFE5F7FF),
]),
),
),
Column(
children: [
Container(
height: 100.h,
color: Colors.transparent,
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 15.h),
child: Row(
children: [
GestureDetector(
onTap: (){
Navigator.of(context).pop();
},
child: Icon(
Icons.arrow_back_ios,
size: 24,
color: Colors.black,
),
),
Expanded(
child: Container(
height: 30.h,
margin: EdgeInsets.fromLTRB(0.w, 0, 8.w, 0.h),
padding: EdgeInsets.fromLTRB(12.w, 7.h, 0, 7.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(18),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: GestureDetector(
onTap: () {},
child: Row(
children: [
Icon(
Icons.search,
size: 16,
color: Color(0xFFABACAB),
),
SizedBox(
width: 3.w,
),
Text(
"前进麦味",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
),
],
),
),
)),
Container(
alignment: Alignment.center,
child: GestureDetector(
onTap: () {},
child: Text(
"搜索",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
),
),
),
],
)),
Expanded(
child: Container(
decoration: BoxDecoration(
border: Border.all(
width: 0,
color: Colors.white,
),
color: Colors.white,
borderRadius: new BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
padding: EdgeInsets.only(left: 17.w, top: 16.h,right: 17.w),
child: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
onRefresh: () {
setState(() {});
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: FutureBuilder(
// future: queryHome(),
builder: (context, snapshot) {
return Column(
children: [
// hotSearch(),
// historySearch(),
searchList()
],
);
},
),
),
),
),
),
],
)
],
),
],
);
}
///
Widget hotSearch() {
return Container(
width: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"热门搜索",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF181818),
),
),
SizedBox(height: 16.h),
GridView.builder(
itemCount: 6,
shrinkWrap: true,
padding: EdgeInsets.zero,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
//Widget数量
crossAxisCount: 4,
//Widget之间间距
crossAxisSpacing: 6.w,
//Widget之间间距
mainAxisSpacing: 12.w,
//Widget之间间距
childAspectRatio: 3 / 1,
),
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {},
child: hotSearchItem(),
);
},
),
],
),
);
}
Widget hotSearchItem() {
return Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RoundButton(
width: 68.w,
height: 29.h,
text: "稻田里的书店",
textColor: Color(0xFF181818),
fontWeight: MyFontWeight.regular,
radius: 4,
backgroup: Color(0xFFF5F5F5),
fontSize: 12.sp,
),
],
),
);
}
///
Widget historySearch() {
return Container(
width: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(child:Text(
"历史搜索",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF181818),
),
)),
Image.asset(
"assets/image/icon_delete.png",
width: 22.w,
height:20.h,
),
Text(
"删除",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF181818),
),
),
],
),
SizedBox(height: 16.h),
GridView.builder(
itemCount: 6,
shrinkWrap: true,
padding: EdgeInsets.zero,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
//Widget数量
crossAxisCount: 4,
//Widget之间间距
crossAxisSpacing: 6.w,
//Widget之间间距
mainAxisSpacing: 12.w,
//Widget之间间距
childAspectRatio: 3 / 1,
),
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
},
child: historySearchItem(),
);
},
),
],
),
);
}
Widget historySearchItem() {
return Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RoundButton(
width: 68.w,
height: 29.h,
text: "稻田里的书店",
textColor: Color(0xFF181818),
fontWeight: MyFontWeight.regular,
radius: 4,
backgroup: Color(0xFFF5F5F5),
fontSize: 12.sp,
),
],
),
);
}
///
Widget searchList() {
return Container(
width: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureDetector(
onTap: (){
setState(() {
optionIndex = 0 ;
});
},
child: Text(
"默认推荐",
style: TextStyle(
fontSize: optionIndex == 0 ? 15.sp :14.sp,
fontWeight: optionIndex == 0 ? MyFontWeight.semi_bold : MyFontWeight.regular,
color: optionIndex == 0 ? Color(0xFF181818) : Color(0xFF4D4D4D),
),
),
),
GestureDetector(
onTap: (){
setState(() {
optionIndex = 1 ;
});
},
child:Text(
"销量",
style: TextStyle(
fontSize: optionIndex == 1 ? 15.sp :14.sp,
fontWeight: optionIndex == 1 ? MyFontWeight.semi_bold : MyFontWeight.regular,
color: optionIndex == 1 ? Color(0xFF181818) : Color(0xFF4D4D4D),
),
),
),
GestureDetector(
onTap: (){
setState(() {
optionIndex = 2 ;
});
},
child:Row(children: [
Text(
"价格",
style: TextStyle(
fontSize: optionIndex == 2 ? 15.sp :14.sp,
fontWeight: optionIndex == 2 ? MyFontWeight.semi_bold : MyFontWeight.regular,
color: optionIndex == 2 ? Color(0xFF181818) : Color(0xFF4D4D4D),
),
),
Image.asset(
"assets/image/jg.png",
width:16,
height:16,
),
],),
),
GestureDetector(
onTap: (){
setState(() {
optionIndex = 3 ;
});
},
child: Text(
"专区",
style: TextStyle(
fontSize: optionIndex == 3 ? 15.sp :14.sp,
fontWeight: optionIndex == 3 ? MyFontWeight.semi_bold : MyFontWeight.regular,
color: optionIndex == 3 ? Color(0xFF181818) : Color(0xFF4D4D4D),
),
),
),
],
),
SizedBox(height: 16.h),
GridView.builder(
itemCount:6,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
//Widget数量
crossAxisCount:2,
//Widget之间间距
crossAxisSpacing: 11.w,
//Widget之间间距
mainAxisSpacing: 16.w,
//Widget宽高比例 0.59
childAspectRatio:
185 / (281 / 2 + (281 / 2) * AppUtils.textScale(context)),
),
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/shopping_mall_home',arguments: {
"type" : 1,
});
},
child: searchListItem(),
);
},
)
],
),
);
}
Widget searchListItem() {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(10),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Colors.white,
),
margin: EdgeInsets.symmetric(
vertical: 3,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(10),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child:
// MImage(
// "",
// width: double.infinity,
// height: 166,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
Image.asset(
"assets/image/icon_story_td.png",
width:double.infinity,
fit: BoxFit.cover,
),
),
Expanded(child:Container(
padding: EdgeInsets.only(left:8.w,right:8.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
margin: EdgeInsets.only(top: 8, right: 8),
padding: EdgeInsets.only(left: 2, right: 2),
height: 17.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: Color(0xFF5A5A5A),
),
child: Text(
"中国大陆5仓",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
),
Text(
"已售12件",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF5D5D5D),
),
),
],
),
Text(
"SWISSGEAR瑞士军刀联名款马克杯",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF353535),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
TextSpan(
text: "284.00",
style: TextStyle(
fontSize:18.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
],
),
),
Text(
"¥283.00",
style: TextStyle(
fontSize:14.sp,
decoration: TextDecoration.lineThrough,
decorationColor: Color(0xFF585858),
fontWeight: MyFontWeight.regular,
color: Color(0xFFA2A2A2),
),
),
],
),
],
),
),)
],
),
);
}
}

321
lib/store/shopping/shopping_home/shopping_acticvity.dart

@ -0,0 +1,321 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/item_title.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
class ShoppingActivity extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _ShoppingActivity();
}
}
class _ShoppingActivity extends State<ShoppingActivity> {
ApiService apiService;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Column(
children: [
SizedBox(
height: 10.h,
),
Container(
margin: EdgeInsets.symmetric(horizontal: 9.w),
child: Row(
children: [
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/activity_prefecture_details');
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 5.w ),
padding: EdgeInsets.only(left: 12.w),
width: (MediaQuery.of(context).size.width - 42) / 2,
height: 195.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Colors.white,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"回乡秒杀",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
color: Colors.black,
),
),
Text(
"超多好物,等你来秒",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF7B7B7B),
),
),
GestureDetector(
onTap: (){
},
child: Container(
height:20.h,
width: 60.w,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(11.5),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"10点场",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
Icon(
Icons.keyboard_arrow_right,
size: 16,
color: Colors.white,
),
],
),
),
),
Padding(padding: EdgeInsets.only(bottom: 10.h),child:
Image.asset(
"assets/image/icon_story_td.png",
width: 87,
height: 87,
fit: BoxFit.cover,
),)
],
),
),
),
Expanded(
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
GestureDetector(
onTap: () {
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 5.w),
padding: EdgeInsets.only(left: 12.w,right: 11.w),
width: (MediaQuery.of(context).size.width - 42) / 2,
height: 195.h / 2,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"好价我砍",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
color: Colors.black,
),
),
Text(
"拉友同优",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF7B7B7B),
),
),
GestureDetector(
onTap: (){
},
child: Container(
height: 18.h,
width: 48.w,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(11.5),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"GO",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
Icon(
Icons.keyboard_arrow_right,
size: 16,
color: Colors.white,
),
],
),
),
),
],
),),
Padding(padding: EdgeInsets.only(bottom: 10.h),child:
Image.asset(
"assets/image/icon_story_td.png",
width: 44,
height: 44,
fit: BoxFit.cover,
),)
],
),
),
),
SizedBox(
height: 5,
),
GestureDetector(
onTap: () {
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 5.w),
padding: EdgeInsets.only(left: 12.w,right: 11.w),
width: (MediaQuery.of(context).size.width - 42) / 2,
height: 195.h / 2,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"拼团专场",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
color: Colors.black,
),
),
Text(
"优惠齐享",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF7B7B7B),
),
),
GestureDetector(
onTap: (){
},
child: Container(
height: 18.h,
width: 48.w,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(11.5),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"GO",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
Icon(
Icons.keyboard_arrow_right,
size: 16,
color: Colors.white,
),
],
),
),
),
],
),),
Padding(padding: EdgeInsets.only(bottom: 10.h),child:
Image.asset(
"assets/image/icon_story_td.png",
width: 44,
height: 44,
fit: BoxFit.cover,
),)
],
),
),
),
],
),
),
),
],
),
),
SizedBox(
height: 28.h,
),
],
);
}
}

120
lib/store/shopping/shopping_home/shopping_home_banner.dart

@ -0,0 +1,120 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/retrofit/data/banner.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
class ShoppingHomeBanner extends StatefulWidget {
final List<BannerData> bannerData;
final SwiperController controller;
ShoppingHomeBanner(this.bannerData,this.controller);
@override
State<StatefulWidget> createState() {
return _ShoppingHomeBanner();
}
}
class _ShoppingHomeBanner extends State<ShoppingHomeBanner> {
ApiService apiService;
final RefreshController refreshController = RefreshController();
List<BannerData> bannerData = [];
@override
Widget build(BuildContext context) {
return Container(
child: AspectRatio(
aspectRatio: 2.08,
child: Swiper(
viewportFraction: 0.88,
scale: 0.93,
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
builder: DotSwiperPaginationBuilder(
size: 8,
activeSize: 8,
space: 5,
activeColor: Colors.black,
color: Colors.black.withAlpha(76),
),
),
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return InkWell(
onTap: () {
bannerClick(widget.bannerData[position]);
},
child: MImage(
(widget.bannerData != null && position < widget.bannerData.length)
? widget.bannerData[position].imgUrl
: "",
fit: BoxFit.cover,
radius: BorderRadius.circular(8),
errorSrc: "assets/image/default_2_1.png",
fadeSrc: "assets/image/default_2_1.png",
),
);
},
itemCount: (widget.bannerData != null && widget.bannerData.length > 0)
? widget.bannerData.length
: 1),
),
);
}
/// contentType 0123,4:,5:
bannerClick(BannerData bannerData) async {
switch (bannerData.contentType) {
case 1:
Navigator.of(context).pushNamed('/router/integral_store_page',
arguments: {"goodsId": bannerData.content});
break;
case 2:
Navigator.of(context)
.pushNamed('/router/web_page', arguments: {
"activityId": bannerData.content,
});
break;
case 3:
Navigator.of(context)
.pushNamed('/router/web_page', arguments: {
"articleId": bannerData.content,
});
break;
case 4:
String router = bannerData.content;
if (router.contains("?")) {
String params = router.substring(router.indexOf("?"));
params = params.replaceAll("?", "");
Map map = jsonDecode(params);
Navigator.of(context).pushNamed(router, arguments: map);
} else {
Navigator.of(context).pushNamed(router);
}
break;
case 5:
Navigator.of(context)
.pushNamed('/router/class_details', arguments: {
"id": bannerData.content,
});
break;
}
}
}

198
lib/store/shopping/shopping_home/shopping_home_page.dart

@ -0,0 +1,198 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/main.dart';
import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/shopping/shopping_home/recommend_goods_list_view.dart';
import 'package:huixiang/store/shopping/shopping_home/shopping_acticvity.dart';
import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'classify_list.dart';
class ShoppingHomePage extends StatefulWidget {
final StoreInfo storeInfo;
ShoppingHomePage(this.storeInfo);
@override
State<StatefulWidget> createState() {
return _ShoppingHomePage();
}
}
class _ShoppingHomePage extends State<ShoppingHomePage>
with AutomaticKeepAliveClientMixin {
ApiService apiService;
@override
void initState() {
super.initState();
}
final SwiperController controller = SwiperController();
@override
void dispose() {
super.dispose();
if (refreshController != null) refreshController.dispose();
}
final RefreshController refreshController = RefreshController();
@override
Widget build(BuildContext context) {
super.build(context);
return Column(
children: [
MyAppBar(
title: widget?.storeInfo?.storeName ?? "一心回乡商城",
titleColor: Colors.black,
leadingColor: Colors.black,
background: Colors.transparent,
),
Expanded(
child: Container(
child: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
onRefresh: () {
setState(() {});
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: FutureBuilder(
// future: queryHome(),
builder: (context, snapshot) {
return Column(
children: [
buildSearchItem(),
buildSwiper(),
///
// ShoppingTitleTab(),
///
ClassifyList(),
///
ShoppingActivity(),
///
// ActivityBanner(),
///
RecommendGoodsListView(),
],
);
},
),
),
),
),
),
SizedBox(
height: 76.h,
),
],
);
}
Widget buildSearchItem() {
return Container(
height: 36.h,
margin: EdgeInsets.fromLTRB(16.w, 0, 16.w, 16.h),
padding: EdgeInsets.fromLTRB(12.w, 6.h, 0, 6.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(18),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/search_page');
},
child: Row(
children: [
Icon(
Icons.search,
size: 24,
color: Color(0xFFABACAB),
),
SizedBox(
width: 3.w,
),
Text(
"前进麦味",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
),
],
),
),
);
}
Widget buildSwiper() {
return Container(
width: double.infinity,
height: 160.h,
margin: EdgeInsets.only(left: 16,right: 16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
),
child: Swiper(
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
builder: DotSwiperPaginationBuilder(
size: 8.w,
activeSize: 8.w,
space: 5.w,
activeColor: Colors.white,
color: Colors.white.withAlpha(76),
),
),
itemBuilder: (context, position) {
return Container(
child: MImage(
(widget.storeInfo != null &&
widget.storeInfo.bannerList != null &&
position < widget.storeInfo.bannerList.length)
? widget.storeInfo.bannerList[position].imgUrl
: "",
fit: BoxFit.cover,
radius: BorderRadius.circular(8),
errorSrc: "assets/image/default_2_1.png",
fadeSrc: "assets/image/default_2_1.png",
),
);
},
itemCount: (widget.storeInfo != null && widget.storeInfo.bannerList != null)
? widget.storeInfo.bannerList.length
: 1,
),
);
}
@override
bool get wantKeepAlive => true;
}

70
lib/store/shopping/shopping_home/shopping_title_tab.dart

@ -0,0 +1,70 @@
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/category_select_list.dart';
import 'package:huixiang/retrofit/data/goods_category.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_tab.dart';
class ShoppingTitleTab extends StatefulWidget {
final List<CategorySelectList> classSelectList;
final Function notifyClassSelectList;
ShoppingTitleTab(this.classSelectList,this.notifyClassSelectList);
@override
State<StatefulWidget> createState() {
return _ClassTitleTab();
}
}
class _ClassTitleTab extends State<ShoppingTitleTab>
with SingleTickerProviderStateMixin {
TabController tabController;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
alignment: Alignment.centerLeft,
child: DefaultTabController(
length:widget.classSelectList == null
? 0
: widget.classSelectList.length,
child: TabBar(
isScrollable: true,
//
indicatorColor: Color(0xff39B54A),
labelColor: Color(0xff32A060),
labelStyle: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.bold,
),
unselectedLabelStyle: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
controller: tabController,
//
unselectedLabelColor: Color(0xff4D4D4D),
indicatorSize: TabBarIndicatorSize.label,
onTap: (index){
widget.notifyClassSelectList(index);
},
//
tabs:widget.classSelectList == null
? []
: widget.classSelectList
.map((e) => MyTab(text: e.name))
.toList(),
),
),
);
}
}

244
lib/store/shopping/shopping_mall_home.dart

@ -0,0 +1,244 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/main.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/banner.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/brand.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/shopping/shopping_cart/shopping_cart_page.dart';
import 'package:huixiang/store/shopping/shopping_home/shopping_home_page.dart';
import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
class ShoppingMallHome extends StatefulWidget {
final arguments;
ShoppingMallHome({this.arguments});
@override
State<StatefulWidget> createState() {
return _ShoppingMallHome();
}
}
class _ShoppingMallHome extends State<ShoppingMallHome>
with AutomaticKeepAliveClientMixin {
ApiService apiService;
MinApiService minService;
List<Brand> brands = [];
List<BannerData> bannerData = [];
int choiceIndex = 0;
bool dialogShowing = false;
final RefreshController refreshController = RefreshController();
final SwiperController controller = SwiperController();
String storeId = "";
String tenant = "";
///token
String minToken;
StoreInfo storeInfo;
List<Activity> activitys;
@override
void initState() {
super.initState();
if (widget.arguments != null) choiceIndex = widget.arguments["type"];
tenant = widget.arguments["tenant"];
storeId = widget.arguments["id"];
SharedPreferences.getInstance().then((value) {
minLogin(value);
queryStoreInfo();
});
}
///
minLogin(SharedPreferences shared) async {
EasyLoading.show(status: S.of(context).zhengzaijiazai);
apiService = ApiService(
Dio(),
context: context,
token: shared.getString('token'),
showLoading: false,
);
apiService.minLogin(storeId).catchError((onError) {
debugPrint(onError);
}).then((baseData) {
if (baseData != null && baseData.isSuccess) {
Map<String, dynamic> minStoreInfo = baseData.data;
minToken = minStoreInfo["token"];
queryStoreInfo();
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
value.setString('tenant', tenant),
value.setString('storeId', storeId),
},
);
minService = MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
showLoading: false,
);
// queryShopCar().then((value) {
// this.shopCarGoods = value;
// setState(() {});
// });
// if (tableId > 0) {
// getParentInfo();
// }
EasyLoading.dismiss();
}
});
}
///
queryStoreInfo() async {
BaseData baseData =
await apiService.queryStoreInfo(storeId).catchError((error) {
debugPrint(error);
});
if (baseData != null && baseData.isSuccess) {
storeInfo = StoreInfo.fromJson(baseData.data);
activitys = storeInfo.informationVOPageVO.list
.map((e) => Activity.fromJson(e))
.toList();
if (mounted) {
setState(() {});
}
}
EasyLoading.dismiss();
}
@override
void dispose() {
super.dispose();
if (refreshController != null) refreshController.dispose();
}
@override
Widget build(BuildContext context) {
super.build(context);
return Stack(
children: [
Container(
color: Color(0xFFF7F7F7),
),
Stack(
children: [
Container(
// padding: EdgeInsets.only(top: 40.h),
height: 260.h,
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.centerRight,
end: Alignment.centerLeft,
colors: [
Color(0xFFE8F5E9),
Color(0xFFE5F7FF),
]),
),
),
if (choiceIndex == 0)
ShoppingHomePage(
storeInfo,
),
if (choiceIndex == 1) ShoppingCartPage(),
Align(
alignment: Alignment.bottomCenter,
child: Container(
color: Colors.white,
height: 83.h,
width: double.infinity,
padding: EdgeInsets.only(top: 10.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
choiceIndex = 0;
});
},
child: Column(
children: [
Image.asset(
choiceIndex == 0
? "assets/image/shopping_home.png"
: "assets/image/shopping_home_h.png",
width: 30,
height: 30,
),
Text(
"首页",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.semi_bold,
color: choiceIndex == 0
? Color(0xFF4C4C4C)
: Color(0xFFC6C6C6),
),
),
],
)),
),
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
choiceIndex = 1;
});
},
child: Column(
children: [
Image.asset(
choiceIndex == 0
? "assets/image/shopping_cart_h.png"
: "assets/image/shopping_cart.png",
width: 30,
height: 30,
),
Text(
"购物车",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.semi_bold,
color: choiceIndex == 0
? Color(0xFFC6C6C6)
: Color(0xFF4C4C4C),
),
),
],
),
))
],
),
),
),
],
),
],
);
}
@override
bool get wantKeepAlive => true;
}

1
lib/store/store_order.dart

@ -136,6 +136,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
});
}
///
queryMemberInfo() async {
BaseData baseData = await minService.memberInfo()
.catchError((error){debugPrint(error);});

10
lib/store/store_view/product_sku.dart

@ -114,8 +114,8 @@ class _ProductSku extends State<ProductSku> {
children: [
MImage(
widget.miNiDetail.imgs[0],
width: 70,
height: 70,
width: 75,
height: 75,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
@ -123,7 +123,7 @@ class _ProductSku extends State<ProductSku> {
SizedBox(
width: 10,
),
Column(
Expanded(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
@ -139,6 +139,8 @@ class _ProductSku extends State<ProductSku> {
child: Text(
": " +
(selectSkus.map((e) => "$e").toList().toString()),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF727272),
fontSize: 11.sp,
@ -167,7 +169,7 @@ class _ProductSku extends State<ProductSku> {
],
),
],
),
)),
Spacer(),
InkWell(
onTap: () {

54
lib/union/union_page.dart

@ -13,6 +13,7 @@ import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/store.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/location.dart';
import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/classic_header.dart';
@ -231,7 +232,11 @@ class _UnionPage extends State<UnionPage>
),
body: Column(
children: [
PreferredSize(
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(child:PreferredSize(
preferredSize: Size(double.infinity, 52.h),
child: Container(
padding: EdgeInsets.only(top:15.h),
@ -241,6 +246,50 @@ class _UnionPage extends State<UnionPage>
imgPath: "assets/image/icon_union_store.png",
),
),
)),
GestureDetector(
onTap: (){
setState(() {
var storeName = storeList.firstWhere((x)=>x.storeName == "一心回乡商城");
if(storeName == null)
return;
Navigator.of(context).pushNamed(
'/router/shopping_mall_home',
arguments: {
"type":0,
"id": storeName.id,
"tenant": storeName.tenantCode,
"storeName":storeName.storeName
},
);
});
},
child:Container(
margin: EdgeInsets.only(right: 18),
height: 25.h,
width: 102.w,
color: Colors.white,
child:Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"一心回乡商城",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
),
Icon(
Icons.keyboard_arrow_right,
size: 16,
),
],
),
),
),
],
),
buildItem(),
],
@ -525,9 +574,6 @@ class _UnionPage extends State<UnionPage>
),
],
),
SizedBox(
height: 4.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,

2
lib/view_widget/new_people_reward.dart

@ -154,7 +154,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
),
Expanded(
child: Padding(
padding: EdgeInsets.only(top: 4, bottom: 4),
padding: EdgeInsets.only(top: 4, bottom: 4,left: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,

8
lib/web/web_view/comment_list.dart

@ -79,14 +79,6 @@ class CommentListState extends State<CommentList> {
Container(
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 2),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,

13
pubspec.lock

@ -229,7 +229,7 @@ packages:
name: flutter_html
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.2.0"
version: "2.2.1"
flutter_layout_grid:
dependency: transitive
description:
@ -269,7 +269,7 @@ packages:
name: flutter_screenutil
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.0.1"
version: "5.0.1+2"
flutter_smart_dialog:
dependency: "direct main"
description:
@ -329,6 +329,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "9.2.0"
gradient_widgets:
dependency: "direct main"
description:
name: gradient_widgets
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.0"
graphs:
dependency: transitive
description:
@ -475,7 +482,7 @@ packages:
name: path_provider_linux
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.2"
version: "2.1.4"
path_provider_platform_interface:
dependency: transitive
description:

5
pubspec.yaml

@ -15,6 +15,8 @@ dependencies:
sdk: flutter
fluwx: ^3.5.0
gradient_widgets: ^0.6.0
keframe: ^2.0.2 #滑动组件卡顿优化
tpns_flutter_plugin:
@ -89,6 +91,9 @@ dependencies:
ai_decimal_accuracy: ^1.1.0
dev_dependencies:
flutter_test:
sdk: flutter

Loading…
Cancel
Save