Browse Source

积分商城更改,会员体系更改;

ff_new
w-R 3 years ago
parent
commit
b88434f7fb
  1. BIN
      assets/image/2x/bianhao.png
  2. BIN
      assets/image/3x/bianhao.png
  3. BIN
      assets/image/bianhao.png
  4. 3
      lib/generated/intl/messages_en.dart
  5. 3
      lib/generated/intl/messages_zh_CN.dart
  6. 3
      lib/generated/intl/messages_zh_Hans_CN.dart
  7. 2
      lib/generated/intl/messages_zh_Hant_CN.dart
  8. 3
      lib/generated/intl/messages_zh_TW.dart
  9. 30
      lib/generated/l10n.dart
  10. 4
      lib/l10n/intl_en.arb
  11. 5
      lib/l10n/intl_zh_CN.arb
  12. 5
      lib/l10n/intl_zh_Hans_CN.arb
  13. 3
      lib/l10n/intl_zh_Hant_CN.arb
  14. 5
      lib/l10n/intl_zh_TW.arb
  15. 5
      lib/main.dart
  16. 85
      lib/mine/mine_vip/binding_assistant_card.dart
  17. 659
      lib/mine/mine_vip/legal_right_details.dart
  18. 506
      lib/mine/mine_vip/mine_attainment_page.dart
  19. 173
      lib/mine/mine_vip/mine_vip_core.dart
  20. 159
      lib/order/exchange_history_page.dart
  21. 152
      lib/order/exchange_order_page.dart
  22. 290
      lib/order/exchange_write_off_page.dart
  23. 4
      lib/order/write_off_page.dart
  24. 191
      lib/retrofit/data/achievement_detail_list.dart
  25. 12
      lib/retrofit/data/exchange_order.dart
  26. 73
      lib/retrofit/data/second_card_list.dart
  27. 147
      lib/retrofit/data/vip_badges_list.dart
  28. 180
      lib/retrofit/data/vip_benefit_list.dart
  29. 48
      lib/retrofit/data/vip_rule_details.dart
  30. 33
      lib/retrofit/retrofit_api.dart
  31. 157
      lib/retrofit/retrofit_api.g.dart
  32. 5
      lib/store/store_order.dart
  33. 44
      lib/view_widget/mine_vip_view.dart
  34. 96
      lib/view_widget/vip_dialog.dart

BIN
assets/image/2x/bianhao.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

BIN
assets/image/3x/bianhao.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/bianhao.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

3
lib/generated/intl/messages_en.dart

@ -121,6 +121,7 @@ class MessageLookup extends MessageLookupByLibrary {
"buzhichikaipiao" : MessageLookupByLibrary.simpleMessage("不支持开票"), "buzhichikaipiao" : MessageLookupByLibrary.simpleMessage("不支持开票"),
"chakan" : MessageLookupByLibrary.simpleMessage("查看"), "chakan" : MessageLookupByLibrary.simpleMessage("查看"),
"chakangengduo" : MessageLookupByLibrary.simpleMessage("查看更多"), "chakangengduo" : MessageLookupByLibrary.simpleMessage("查看更多"),
"chakanhexiaoma" : MessageLookupByLibrary.simpleMessage("查看核销码"),
"chakanquanyi" : MessageLookupByLibrary.simpleMessage("查看权益"), "chakanquanyi" : MessageLookupByLibrary.simpleMessage("查看权益"),
"chakanshixiaoquan" : MessageLookupByLibrary.simpleMessage("查看失效券"), "chakanshixiaoquan" : MessageLookupByLibrary.simpleMessage("查看失效券"),
"chakanwodekabao" : MessageLookupByLibrary.simpleMessage("查看我的卡包"), "chakanwodekabao" : MessageLookupByLibrary.simpleMessage("查看我的卡包"),
@ -171,6 +172,7 @@ class MessageLookup extends MessageLookupByLibrary {
"dianwolingqu" : MessageLookupByLibrary.simpleMessage("点我领取"), "dianwolingqu" : MessageLookupByLibrary.simpleMessage("点我领取"),
"dianzanxihuan_" : m3, "dianzanxihuan_" : m3,
"dingdan" : MessageLookupByLibrary.simpleMessage("订单"), "dingdan" : MessageLookupByLibrary.simpleMessage("订单"),
"dingdanbianhao" : MessageLookupByLibrary.simpleMessage("订单编号"),
"dingdandaifahuo" : MessageLookupByLibrary.simpleMessage("订单待发货"), "dingdandaifahuo" : MessageLookupByLibrary.simpleMessage("订单待发货"),
"dingdandaizhifu" : MessageLookupByLibrary.simpleMessage("订单待支付"), "dingdandaizhifu" : MessageLookupByLibrary.simpleMessage("订单待支付"),
"dingdangenzong" : MessageLookupByLibrary.simpleMessage("订单跟踪"), "dingdangenzong" : MessageLookupByLibrary.simpleMessage("订单跟踪"),
@ -469,6 +471,7 @@ class MessageLookup extends MessageLookupByLibrary {
"shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"),
"shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"),
"shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"),
"shouhuodi" : MessageLookupByLibrary.simpleMessage("收货地址"),
"shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"),
"shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"),
"shouhuorenshoujihao" : MessageLookupByLibrary.simpleMessage("请输入收货人手机号"), "shouhuorenshoujihao" : MessageLookupByLibrary.simpleMessage("请输入收货人手机号"),

3
lib/generated/intl/messages_zh_CN.dart

@ -121,6 +121,7 @@ class MessageLookup extends MessageLookupByLibrary {
"buzhichikaipiao" : MessageLookupByLibrary.simpleMessage("不支持开票"), "buzhichikaipiao" : MessageLookupByLibrary.simpleMessage("不支持开票"),
"chakan" : MessageLookupByLibrary.simpleMessage("查看"), "chakan" : MessageLookupByLibrary.simpleMessage("查看"),
"chakangengduo" : MessageLookupByLibrary.simpleMessage("查看更多"), "chakangengduo" : MessageLookupByLibrary.simpleMessage("查看更多"),
"chakanhexiaoma" : MessageLookupByLibrary.simpleMessage("查看核销码"),
"chakanquanyi" : MessageLookupByLibrary.simpleMessage("查看权益"), "chakanquanyi" : MessageLookupByLibrary.simpleMessage("查看权益"),
"chakanshixiaoquan" : MessageLookupByLibrary.simpleMessage("查看失效券"), "chakanshixiaoquan" : MessageLookupByLibrary.simpleMessage("查看失效券"),
"chakanwodekabao" : MessageLookupByLibrary.simpleMessage("查看我的卡包"), "chakanwodekabao" : MessageLookupByLibrary.simpleMessage("查看我的卡包"),
@ -171,6 +172,7 @@ class MessageLookup extends MessageLookupByLibrary {
"dianwolingqu" : MessageLookupByLibrary.simpleMessage("点我领取"), "dianwolingqu" : MessageLookupByLibrary.simpleMessage("点我领取"),
"dianzanxihuan_" : m3, "dianzanxihuan_" : m3,
"dingdan" : MessageLookupByLibrary.simpleMessage("订单"), "dingdan" : MessageLookupByLibrary.simpleMessage("订单"),
"dingdanbianhao" : MessageLookupByLibrary.simpleMessage("订单编号"),
"dingdandaifahuo" : MessageLookupByLibrary.simpleMessage("订单待发货"), "dingdandaifahuo" : MessageLookupByLibrary.simpleMessage("订单待发货"),
"dingdandaizhifu" : MessageLookupByLibrary.simpleMessage("订单待支付"), "dingdandaizhifu" : MessageLookupByLibrary.simpleMessage("订单待支付"),
"dingdangenzong" : MessageLookupByLibrary.simpleMessage("订单跟踪"), "dingdangenzong" : MessageLookupByLibrary.simpleMessage("订单跟踪"),
@ -467,6 +469,7 @@ class MessageLookup extends MessageLookupByLibrary {
"shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"),
"shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"),
"shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"),
"shouhuodi" : MessageLookupByLibrary.simpleMessage("收货地址"),
"shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"),
"shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"),
"shouhuorenshoujihao" : MessageLookupByLibrary.simpleMessage("请输入收货人手机号"), "shouhuorenshoujihao" : MessageLookupByLibrary.simpleMessage("请输入收货人手机号"),

3
lib/generated/intl/messages_zh_Hans_CN.dart

@ -121,6 +121,7 @@ class MessageLookup extends MessageLookupByLibrary {
"buzhichikaipiao" : MessageLookupByLibrary.simpleMessage("不支持开票"), "buzhichikaipiao" : MessageLookupByLibrary.simpleMessage("不支持开票"),
"chakan" : MessageLookupByLibrary.simpleMessage("查看"), "chakan" : MessageLookupByLibrary.simpleMessage("查看"),
"chakangengduo" : MessageLookupByLibrary.simpleMessage("查看更多"), "chakangengduo" : MessageLookupByLibrary.simpleMessage("查看更多"),
"chakanhexiaoma" : MessageLookupByLibrary.simpleMessage("查看核销码"),
"chakanquanyi" : MessageLookupByLibrary.simpleMessage("查看权益"), "chakanquanyi" : MessageLookupByLibrary.simpleMessage("查看权益"),
"chakanshixiaoquan" : MessageLookupByLibrary.simpleMessage("查看失效券"), "chakanshixiaoquan" : MessageLookupByLibrary.simpleMessage("查看失效券"),
"chakanwodekabao" : MessageLookupByLibrary.simpleMessage("查看我的卡包"), "chakanwodekabao" : MessageLookupByLibrary.simpleMessage("查看我的卡包"),
@ -171,6 +172,7 @@ class MessageLookup extends MessageLookupByLibrary {
"dianwolingqu" : MessageLookupByLibrary.simpleMessage("点我领取"), "dianwolingqu" : MessageLookupByLibrary.simpleMessage("点我领取"),
"dianzanxihuan_" : m3, "dianzanxihuan_" : m3,
"dingdan" : MessageLookupByLibrary.simpleMessage("订单"), "dingdan" : MessageLookupByLibrary.simpleMessage("订单"),
"dingdanbianhao" : MessageLookupByLibrary.simpleMessage("订单编号"),
"dingdandaifahuo" : MessageLookupByLibrary.simpleMessage("订单待发货"), "dingdandaifahuo" : MessageLookupByLibrary.simpleMessage("订单待发货"),
"dingdandaizhifu" : MessageLookupByLibrary.simpleMessage("订单待支付"), "dingdandaizhifu" : MessageLookupByLibrary.simpleMessage("订单待支付"),
"dingdangenzong" : MessageLookupByLibrary.simpleMessage("订单跟踪"), "dingdangenzong" : MessageLookupByLibrary.simpleMessage("订单跟踪"),
@ -467,6 +469,7 @@ class MessageLookup extends MessageLookupByLibrary {
"shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"),
"shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"),
"shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"),
"shouhuodi" : MessageLookupByLibrary.simpleMessage("收货地址"),
"shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"),
"shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"),
"shouhuorenshoujihao" : MessageLookupByLibrary.simpleMessage("请输入收货人手机号"), "shouhuorenshoujihao" : MessageLookupByLibrary.simpleMessage("请输入收货人手机号"),

2
lib/generated/intl/messages_zh_Hant_CN.dart

@ -121,6 +121,7 @@ class MessageLookup extends MessageLookupByLibrary {
"buzhichikaipiao" : MessageLookupByLibrary.simpleMessage("不支持開票"), "buzhichikaipiao" : MessageLookupByLibrary.simpleMessage("不支持開票"),
"chakan" : MessageLookupByLibrary.simpleMessage("查看"), "chakan" : MessageLookupByLibrary.simpleMessage("查看"),
"chakangengduo" : MessageLookupByLibrary.simpleMessage("查看更多"), "chakangengduo" : MessageLookupByLibrary.simpleMessage("查看更多"),
"chakanhexiaoma" : MessageLookupByLibrary.simpleMessage("查看核銷碼"),
"chakanquanyi" : MessageLookupByLibrary.simpleMessage("查看權益"), "chakanquanyi" : MessageLookupByLibrary.simpleMessage("查看權益"),
"chakanshixiaoquan" : MessageLookupByLibrary.simpleMessage("查看失效券"), "chakanshixiaoquan" : MessageLookupByLibrary.simpleMessage("查看失效券"),
"chakanwodekabao" : MessageLookupByLibrary.simpleMessage("查看我的卡包"), "chakanwodekabao" : MessageLookupByLibrary.simpleMessage("查看我的卡包"),
@ -171,6 +172,7 @@ class MessageLookup extends MessageLookupByLibrary {
"dianwolingqu" : MessageLookupByLibrary.simpleMessage("點我領取"), "dianwolingqu" : MessageLookupByLibrary.simpleMessage("點我領取"),
"dianzanxihuan_" : m3, "dianzanxihuan_" : m3,
"dingdan" : MessageLookupByLibrary.simpleMessage("訂單"), "dingdan" : MessageLookupByLibrary.simpleMessage("訂單"),
"dingdanbianhao" : MessageLookupByLibrary.simpleMessage("訂單編號"),
"dingdandaifahuo" : MessageLookupByLibrary.simpleMessage("訂單待發貨"), "dingdandaifahuo" : MessageLookupByLibrary.simpleMessage("訂單待發貨"),
"dingdandaizhifu" : MessageLookupByLibrary.simpleMessage("訂單待支付"), "dingdandaizhifu" : MessageLookupByLibrary.simpleMessage("訂單待支付"),
"dingdangenzong" : MessageLookupByLibrary.simpleMessage("訂單跟蹤"), "dingdangenzong" : MessageLookupByLibrary.simpleMessage("訂單跟蹤"),

3
lib/generated/intl/messages_zh_TW.dart

@ -121,6 +121,7 @@ class MessageLookup extends MessageLookupByLibrary {
"buzhichikaipiao" : MessageLookupByLibrary.simpleMessage("不支持開票"), "buzhichikaipiao" : MessageLookupByLibrary.simpleMessage("不支持開票"),
"chakan" : MessageLookupByLibrary.simpleMessage("查看"), "chakan" : MessageLookupByLibrary.simpleMessage("查看"),
"chakangengduo" : MessageLookupByLibrary.simpleMessage("查看更多"), "chakangengduo" : MessageLookupByLibrary.simpleMessage("查看更多"),
"chakanhexiaoma" : MessageLookupByLibrary.simpleMessage("查看核銷碼"),
"chakanquanyi" : MessageLookupByLibrary.simpleMessage("查看權益"), "chakanquanyi" : MessageLookupByLibrary.simpleMessage("查看權益"),
"chakanshixiaoquan" : MessageLookupByLibrary.simpleMessage("查看失效券"), "chakanshixiaoquan" : MessageLookupByLibrary.simpleMessage("查看失效券"),
"chakanwodekabao" : MessageLookupByLibrary.simpleMessage("查看我的卡包"), "chakanwodekabao" : MessageLookupByLibrary.simpleMessage("查看我的卡包"),
@ -171,6 +172,7 @@ class MessageLookup extends MessageLookupByLibrary {
"dianwolingqu" : MessageLookupByLibrary.simpleMessage("點我領取"), "dianwolingqu" : MessageLookupByLibrary.simpleMessage("點我領取"),
"dianzanxihuan_" : m3, "dianzanxihuan_" : m3,
"dingdan" : MessageLookupByLibrary.simpleMessage("訂單"), "dingdan" : MessageLookupByLibrary.simpleMessage("訂單"),
"dingdanbianhao" : MessageLookupByLibrary.simpleMessage("訂單編號"),
"dingdandaifahuo" : MessageLookupByLibrary.simpleMessage("訂單待發貨"), "dingdandaifahuo" : MessageLookupByLibrary.simpleMessage("訂單待發貨"),
"dingdandaizhifu" : MessageLookupByLibrary.simpleMessage("訂單待支付"), "dingdandaizhifu" : MessageLookupByLibrary.simpleMessage("訂單待支付"),
"dingdangenzong" : MessageLookupByLibrary.simpleMessage("訂單跟蹤"), "dingdangenzong" : MessageLookupByLibrary.simpleMessage("訂單跟蹤"),
@ -467,6 +469,7 @@ class MessageLookup extends MessageLookupByLibrary {
"shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"),
"shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"),
"shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"),
"shouhuodi" : MessageLookupByLibrary.simpleMessage("收貨地址"),
"shouhuodizhi" : MessageLookupByLibrary.simpleMessage("請輸入詳細收貨地址"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("請輸入詳細收貨地址"),
"shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收貨地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收貨地址"),
"shouhuorenshoujihao" : MessageLookupByLibrary.simpleMessage("請輸入收貨人手機號"), "shouhuorenshoujihao" : MessageLookupByLibrary.simpleMessage("請輸入收貨人手機號"),

30
lib/generated/l10n.dart

@ -5495,6 +5495,36 @@ class S {
); );
} }
/// ``
String get dingdanbianhao {
return Intl.message(
'订单编号',
name: 'dingdanbianhao',
desc: '',
args: [],
);
}
/// ``
String get shouhuodi {
return Intl.message(
'收货地址',
name: 'shouhuodi',
desc: '',
args: [],
);
}
/// ``
String get chakanhexiaoma {
return Intl.message(
'查看核销码',
name: 'chakanhexiaoma',
desc: '',
args: [],
);
}
/// `使` /// `使`
String get privacy_policy4 { String get privacy_policy4 {
return Intl.message( return Intl.message(

4
lib/l10n/intl_en.arb

@ -569,6 +569,10 @@
"querenbangding": "确认绑定", "querenbangding": "确认绑定",
"zanweikaitong": "暂未开通", "zanweikaitong": "暂未开通",
"huiyuanquanyi": "会员权益", "huiyuanquanyi": "会员权益",
"dingdanbianhao": "订单编号",
"shouhuodi": "收货地址",
"chakanhexiaoma": "查看核销码",
"chakanwuliu": "查看物流",

5
lib/l10n/intl_zh_CN.arb

@ -567,7 +567,10 @@
"jinxingbangdingfuka": "进行绑定副卡", "jinxingbangdingfuka": "进行绑定副卡",
"fukashoujihao": "副卡手机号", "fukashoujihao": "副卡手机号",
"querenbangding": "确认绑定", "querenbangding": "确认绑定",
"dingdanbianhao": "订单编号",
"shouhuodi": "收货地址",
"chakanhexiaoma": "查看核销码",
"chakanwuliu": "查看物流",

5
lib/l10n/intl_zh_Hans_CN.arb

@ -567,7 +567,10 @@
"jinxingbangdingfuka": "进行绑定副卡", "jinxingbangdingfuka": "进行绑定副卡",
"fukashoujihao": "副卡手机号", "fukashoujihao": "副卡手机号",
"querenbangding": "确认绑定", "querenbangding": "确认绑定",
"dingdanbianhao": "订单编号",
"shouhuodi": "收货地址",
"chakanhexiaoma": "查看核销码",
"chakanwuliu": "查看物流",

3
lib/l10n/intl_zh_Hant_CN.arb

@ -562,6 +562,9 @@
"jinxingbangdingfuka": "進行綁定副卡", "jinxingbangdingfuka": "進行綁定副卡",
"fukashoujihao": "副卡手機號", "fukashoujihao": "副卡手機號",
"querenbangding": "確認綁定", "querenbangding": "確認綁定",
"dingdanbianhao": "訂單編號",
"chakanhexiaoma": "查看核銷碼",
"chakanwuliu": "查看物流",

5
lib/l10n/intl_zh_TW.arb

@ -561,6 +561,11 @@
"jinxingbangdingfuka": "進行綁定副卡", "jinxingbangdingfuka": "進行綁定副卡",
"fukashoujihao": "副卡手機號", "fukashoujihao": "副卡手機號",
"querenbangding": "確認綁定", "querenbangding": "確認綁定",
"dingdanbianhao": "訂單編號",
"shouhuodi": "收貨地址",
"chakanhexiaoma": "查看核銷碼",
"chakanwuliu": "查看物流",

5
lib/main.dart

@ -82,6 +82,7 @@ import 'mine/mine_vip/binding_assistant_card.dart';
import 'mine/mine_vip/legal_right_details.dart'; import 'mine/mine_vip/legal_right_details.dart';
import 'mine/mine_vip/mine_attainment_page.dart'; import 'mine/mine_vip/mine_attainment_page.dart';
import 'mine/mine_vip/mine_vip_core.dart'; import 'mine/mine_vip/mine_vip_core.dart';
import 'order/exchange_write_off_page.dart';
import 'view_widget/vip_dialog.dart'; import 'view_widget/vip_dialog.dart';
import 'mine/release_page.dart'; import 'mine/release_page.dart';
import 'mine/roll_center_page.dart'; import 'mine/roll_center_page.dart';
@ -237,6 +238,8 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
ExchangeOrderSuccessPage(arguments: arguments), ExchangeOrderSuccessPage(arguments: arguments),
'/router/logistics_information_page': (context, {arguments}) => '/router/logistics_information_page': (context, {arguments}) =>
LogisticsInformationPage(arguments: arguments), LogisticsInformationPage(arguments: arguments),
'/router/exchange_write_offPage': (context, {arguments}) =>
ExchangeWriteOffPage(arguments: arguments),
'/router/integral_store_page': (context, {arguments}) => '/router/integral_store_page': (context, {arguments}) =>
IntegralStoreDetailsPage(arguments: arguments), IntegralStoreDetailsPage(arguments: arguments),
'/router/manage_address_page': (context, {arguments}) => '/router/manage_address_page': (context, {arguments}) =>
@ -248,7 +251,7 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/mine_vip_core': (context, {arguments}) => '/router/mine_vip_core': (context, {arguments}) =>
MineVipCore(arguments: arguments), MineVipCore(arguments: arguments),
'/router/legal_right_details': (context, {arguments}) => '/router/legal_right_details': (context, {arguments}) =>
LegalRightDetails(), LegalRightDetails(arguments: arguments),
'/router/binding_assistant_card': (context, {arguments}) => '/router/binding_assistant_card': (context, {arguments}) =>
BindingAssistantCard(), BindingAssistantCard(),
'/router/order_history_page': (context, {arguments}) => '/router/order_history_page': (context, {arguments}) =>

85
lib/mine/mine_vip/binding_assistant_card.dart

@ -35,6 +35,25 @@ class _BindingAssistantCard extends State<BindingAssistantCard> {
}); });
} }
///
queryBindSecondCard(phone) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData baseData = await apiService.bindSecondCard(phone);
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("绑定成功", alignment: Alignment.center);
Navigator.of(context).pop(true);
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -46,8 +65,7 @@ class _BindingAssistantCard extends State<BindingAssistantCard> {
), ),
body: Stack( body: Stack(
children: [ children: [
Expanded( Column(
child: Column(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(bottom: 26.h), margin: EdgeInsets.only(bottom: 26.h),
@ -92,35 +110,35 @@ class _BindingAssistantCard extends State<BindingAssistantCard> {
height: 1, height: 1,
color: Color(0xFFF4F4F4), color: Color(0xFFF4F4F4),
), ),
Row( // Row(
crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start, // mainAxisAlignment: MainAxisAlignment.start,
children: [ // children: [
Expanded( // Expanded(
child: InkWell( // child: InkWell(
onTap: () {}, // onTap: () {},
child: editItem( // child: editItem(
"验证码", // "验证码",
"", // "",
S.of(context).qingshuruyanzhengma, // S.of(context).qingshuruyanzhengma,
addressController, // addressController,
false), // false),
)), // )),
Padding( // Padding(
padding: EdgeInsets.only(right: 16, top: 10), // padding: EdgeInsets.only(right: 16, top: 10),
child: GestureDetector( // child: GestureDetector(
onTap: () {}, // onTap: () {},
child: Text( // child: Text(
"发送验证", // "发送验证",
style: TextStyle( // style: TextStyle(
fontSize: 14.sp, // fontSize: 14.sp,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
color: Color(0xFF32A060), // color: Color(0xFF32A060),
), // ),
), // ),
)), // )),
], // ],
), // ),
Container( Container(
margin: margin:
EdgeInsets.symmetric(horizontal: 16, vertical: 5), EdgeInsets.symmetric(horizontal: 16, vertical: 5),
@ -133,12 +151,13 @@ class _BindingAssistantCard extends State<BindingAssistantCard> {
), ),
], ],
), ),
),
Align( Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
setState(() {
queryBindSecondCard(mobileController.text);
});
}, },
child: Container( child: Container(
color: Color(0xFF32A060), color: Color(0xFF32A060),

659
lib/mine/mine_vip/legal_right_details.dart

@ -1,22 +1,28 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.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:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/rank.dart'; import 'package:huixiang/retrofit/data/second_card_list.dart';
import 'package:huixiang/retrofit/data/vip_benefit_list.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/border_text.dart'; import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/mine_vip_view.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
class LegalRightDetails extends StatefulWidget { class LegalRightDetails extends StatefulWidget {
final Map<String, dynamic> arguments;
LegalRightDetails({this.arguments});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _LegalRightDetails(); return _LegalRightDetails();
@ -25,17 +31,66 @@ class LegalRightDetails extends StatefulWidget {
class _LegalRightDetails extends State<LegalRightDetails> { class _LegalRightDetails extends State<LegalRightDetails> {
ApiService apiService; ApiService apiService;
List<VipBenefitList> vipBenefitList = [];
final SwiperController controller = SwiperController(); final SwiperController controller = SwiperController();
int checkIndex = 0;
ScrollController _scrollController = ScrollController();
List<SecondCardList> secondCardList = [];
@override @override
void initState() { void initState() {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
apiService = apiService =
ApiService(Dio(), context: context, token: value.getString("token")); ApiService(Dio(), context: context, token: value.getString("token"));
}); });
vipBenefitList = widget.arguments["vipBenefitList"];
querySecondCardList();
}
///
querySecondCardList() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<List<SecondCardList>> baseData = await apiService.secondCardList().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
secondCardList.clear();
secondCardList.addAll(baseData.data);
if(secondCardList.length < 5){
var isSecondCard = SecondCardList();
isSecondCard.isAdd = true;
secondCardList.add(isSecondCard);
}
});
}
EasyLoading.dismiss();
}
///
queryUnbindSecondCard(phone) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData baseData = await apiService.unbindSecondCard(phone);
if (baseData != null && baseData.isSuccess) {
querySecondCardList();
SmartDialog.showToast("解绑成功", alignment: Alignment.center);
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
} }
@override @override
@ -49,299 +104,245 @@ class _LegalRightDetails extends State<LegalRightDetails> {
background: Colors.transparent, background: Colors.transparent,
leadingColor: Colors.white, leadingColor: Colors.white,
), ),
body: SingleChildScrollView( body: Column(
physics: BouncingScrollPhysics(), children: [
child: Column( Container(
children: [ height: 130,
Container( padding: EdgeInsets.only(top: 24),
height: 130, margin: EdgeInsets.only(
margin: EdgeInsets.only(top: 24), left: (MediaQuery.of(context).size.width / 2 -
child: ListView.builder( 48 -
scrollDirection: Axis.horizontal, checkIndex * 85) <
physics: BouncingScrollPhysics(), 0
padding: EdgeInsets.symmetric(horizontal: 10), ? 0
itemCount: 15, : (MediaQuery.of(context).size.width / 2 -
itemBuilder: (context, position) { 48 -
return GestureDetector( checkIndex * 85)),
onTap: () { child: ListView.builder(
setState(() {}); scrollDirection: Axis.horizontal,
}, physics: BouncingScrollPhysics(),
child: legalRightItem(), controller: _scrollController,
); shrinkWrap: true,
}, padding: EdgeInsets.symmetric(horizontal: 10),
itemCount: vipBenefitList == null ? 0 : vipBenefitList.length,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
setState(() {
checkIndex = position;
// _scrollController.animateTo((MediaQuery.of(context).size.width/2-48-checkIndex*85)
// >0?0:checkIndex*85, duration: new Duration(seconds: 1), curve: Curves.ease);
});
},
child: legalRightItem(vipBenefitList[position], position),
);
},
),
),
Container(
alignment: Alignment.center,
width: 33,
height: 16,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0,
color: Color(0xFFFFF6E9),
),
), ),
), ),
Container( child: Image.asset(
alignment: Alignment.center, "assets/image/jian_j.png",
width: 33, width: 33,
height: 16, height: 16,
decoration: BoxDecoration( color: Color(0xFFFFF6E9),
border: Border( fit: BoxFit.fill,
bottom: BorderSide(
width: 0,
color: Color(0xFFFFF6E9),
),
),
),
child: Image.asset(
"assets/image/jian_j.png",
width: 33,
height: 16,
color: Color(0xFFFFF6E9),
fit: BoxFit.fill,
),
), ),
Container( ),
padding: EdgeInsets.only(left: 16, right: 49), Expanded(child: Container(
decoration: BoxDecoration( padding: EdgeInsets.only(left: 16, right: 49),
border: Border.all( decoration: BoxDecoration(
width: 0, border: Border.all(
color: Color(0xFFFFF6E9), width: 0,
),
color: Color(0xFFFFF6E9), color: Color(0xFFFFF6E9),
borderRadius: new BorderRadius.only(
topLeft: Radius.circular(8.0),
topRight: Radius.circular(8.0),
),
), ),
child: SingleChildScrollView( color: Color(0xFFFFF6E9),
physics: BouncingScrollPhysics(), borderRadius: new BorderRadius.only(
child: Column( topLeft: Radius.circular(8.0),
mainAxisAlignment: MainAxisAlignment.start, topRight: Radius.circular(8.0),
crossAxisAlignment: CrossAxisAlignment.start, ),
children: [ ),
SizedBox( child: SingleChildScrollView(
height: 20, physics: BouncingScrollPhysics(),
), child: Column(
Row( mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, children: [
children: [ SizedBox(
Column( height: 20,
mainAxisAlignment: MainAxisAlignment.start, ),
crossAxisAlignment: CrossAxisAlignment.end, Row(
children: [ mainAxisAlignment: MainAxisAlignment.center,
Container( crossAxisAlignment: CrossAxisAlignment.center,
width: 13.w, children: [
height: 2.h, Column(
color: Color(0xFF674119), mainAxisAlignment: MainAxisAlignment.start,
), crossAxisAlignment: CrossAxisAlignment.end,
SizedBox(height: 5.h), children: [
Container( Container(
width: 9.w, width: 13.w,
height: 2.h, height: 2.h,
color: Color(0xFF674119),
),
SizedBox(height: 5.h),
Container(
width: 6.5.w,
height: 2.h,
color: Color(0xFF674119),
),
],
),
SizedBox(width: 6.w),
Text(
"可绑定5位副卡",
style: TextStyle(
fontSize: 17.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF674119), color: Color(0xFF674119),
), ),
), SizedBox(height: 5.h),
SizedBox(width: 6.w), Container(
Column( width: 9.w,
mainAxisAlignment: MainAxisAlignment.start, height: 2.h,
crossAxisAlignment: CrossAxisAlignment.start, color: Color(0xFF674119),
children: [ ),
Container( SizedBox(height: 5.h),
width: 13.w, Container(
height: 2.h, width: 6.5.w,
color: Color(0xFF674119), height: 2.h,
), color: Color(0xFF674119),
SizedBox(height: 5.h), ),
Container( ],
width: 9.w,
height: 2.h,
color: Color(0xFF674119),
),
SizedBox(height: 5.h),
Container(
width: 6.5.w,
height: 2.h,
color: Color(0xFF674119),
),
],
),
],
),
Text(
S.of(context).quanyijishao,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp,
color: Color(0xFF674119),
),
),
SizedBox(
height: 8.h,
),
Text(
"用户在成为金卡会员/共创会员之后,即可进行副卡绑定。点击添加新副卡,输入需要绑定用户的手机号,输入验证码,"
"验证通过后,即可绑定成功。点击头像右下方的解除,出现提示弹窗,点击确认即可解除绑定。",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
height: 1.5,
color: Color(0xFF674119),
), ),
), SizedBox(width: 6.w),
SizedBox( Text(
height: 20, vipBenefitList[checkIndex].name,
), style: TextStyle(
Text( fontSize: 17.sp,
S.of(context).quanyishuoming, fontWeight: FontWeight.bold,
style: TextStyle( color: Color(0xFF674119),
fontWeight: MyFontWeight.semi_bold, ),
fontSize: 14.sp,
color: Color(0xFF674119),
), ),
), SizedBox(width: 6.w),
SizedBox( Column(
height: 8, mainAxisAlignment: MainAxisAlignment.start,
), crossAxisAlignment: CrossAxisAlignment.start,
Row( children: [
mainAxisAlignment: MainAxisAlignment.start, Container(
crossAxisAlignment: CrossAxisAlignment.center, width: 13.w,
children: [ height: 2.h,
Container( color: Color(0xFF674119),
width: 6.w,
height: 6.h,
margin: EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(3),
color: Color(0xFF79572D),
), ),
), SizedBox(height: 5.h),
Text( Container(
"副卡用户必须为平台注册用户", width: 9.w,
style: TextStyle( height: 2.h,
textBaseline: TextBaseline.alphabetic,
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF674119), color: Color(0xFF674119),
), ),
), SizedBox(height: 5.h),
], Container(
), width: 6.5.w,
SizedBox( height: 2.h,
height: 6, color: Color(0xFF674119),
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 6.w,
height: 6.h,
margin: EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(3),
color: Color(0xFF79572D),
), ),
), ],
Text( ),
"每位主卡用户只可绑定5位副卡用户,同时,只能解绑3次", ],
style: TextStyle( ),
textBaseline: TextBaseline.alphabetic, Text(
fontSize: 12.sp, S.of(context).quanyijishao,
fontWeight: MyFontWeight.regular, style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp,
color: Color(0xFF674119),
),
),
SizedBox(
height: 8.h,
),
if (vipBenefitList[checkIndex]?.introduce != null &&
vipBenefitList[checkIndex].introduce != "")
Container(
color: Color(0xFFFFF6E9),
child: Html(
data: vipBenefitList[checkIndex]?.describes ?? "",
style: {
"html": Style(
color: Color(0xFF674119), color: Color(0xFF674119),
), ),
), },
], customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),
), ),
SizedBox( SizedBox(
height: 6, height: 20,
),
Text(
S.of(context).quanyishuoming,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp,
color: Color(0xFF674119),
), ),
Row( ),
mainAxisAlignment: MainAxisAlignment.start, SizedBox(
crossAxisAlignment: CrossAxisAlignment.center, height: 8,
children: [ ),
Container( if (vipBenefitList[checkIndex]?.describes != null &&
width: 6.w, vipBenefitList[checkIndex].describes != "")
height: 6.h, Container(
margin: EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h), color: Color(0xFFFFF6E9),
decoration: BoxDecoration( child: Html(
borderRadius: BorderRadius.circular(3), data: vipBenefitList[checkIndex]?.describes ?? "",
color: Color(0xFF79572D), style: {
), "html": Style(
),
Text(
"副卡享受主卡的部分权益,主卡会员失效后,副卡也失效",
style: TextStyle(
textBaseline: TextBaseline.alphabetic,
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF674119), color: Color(0xFF674119),
), ),
), },
], customImageRenders: {
), networkSourceMatcher(): networkImageRender(
SizedBox( loadingWidget: () {
height: 6, return Container();
},
),
},
),
), ),
Row( SizedBox(
height: 20,
),
if(vipBenefitList[checkIndex].name == "副卡")
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container(
width: 6.w,
height: 6.h,
margin: EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(3),
color: Color(0xFF79572D),
),
),
Text( Text(
"副卡成为金卡会员后,自动与主卡解绑", "${S.of(context).yibangfuka}(${secondCardList.length - (secondCardList.length >= 5 && !(secondCardList.last.isAdd ?? false) ? 0 :1 )}/5)",
style: TextStyle( style: TextStyle(
textBaseline: TextBaseline.alphabetic, fontWeight: MyFontWeight.semi_bold,
fontSize: 12.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF674119), color: Color(0xFF674119),
), ),
), ),
SizedBox(
height: 8,
),
assistant(),
], ],
), ),
SizedBox( ),
height: 20, ],
),
Text(
"${S.of(context).yibangfuka}(0/5)",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp,
color: Color(0xFF674119),
),
),
SizedBox(
height: 8,
),
assistant(),
],
),
), ),
) ),
], ))
), ],
), ),
); );
} }
/// ///
unbindShowDeleteDialog() { unbindShowDeleteDialog(phone) {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
@ -410,7 +411,10 @@ class _LegalRightDetails extends State<LegalRightDetails> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
onTap: () { onTap: () {
Navigator.of(context).pop(); setState(() {
queryUnbindSecondCard(phone);
Navigator.of(context).pop();
});
}, },
), ),
flex: 1, flex: 1,
@ -426,44 +430,38 @@ class _LegalRightDetails extends State<LegalRightDetails> {
} }
/// ///
Widget legalRightItem() { Widget legalRightItem(VipBenefitList vipBenefitList, index) {
return Container( return Opacity(
margin: EdgeInsets.only(left: 20), opacity: index == checkIndex ? 1 : 0.6,
alignment: Alignment.center, child: Container(
child: Column( width: 80,
children: [ alignment: Alignment.center,
Opacity( child: Column(
opacity: 1, children: [
// MImage( MImage(
// "assets/image/badge_img.png", vipBenefitList.icon,
// width: 80,
// height: 80,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
child: Image.asset(
"assets/image/vip_qy.png",
width: 50, width: 50,
height: 50, height: 50,
fit: BoxFit.cover, fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
), ),
), SizedBox(
SizedBox( height: 8.h,
height: 8.h,
),
Text(
"储值优惠",
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
), ),
), Text(
], vipBenefitList.name,
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
),
),
],
),
), ),
); );
} }
@ -473,7 +471,7 @@ class _LegalRightDetails extends State<LegalRightDetails> {
return Column( return Column(
children: [ children: [
GridView.builder( GridView.builder(
itemCount: 4, itemCount:secondCardList == null ? 0 : secondCardList.length,
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
@ -484,14 +482,12 @@ class _LegalRightDetails extends State<LegalRightDetails> {
//Widget之间间距 //Widget之间间距
mainAxisSpacing: 5, mainAxisSpacing: 5,
//Widget宽高比例 //Widget宽高比例
// childAspectRatio: AppUtils.textScale(context) > 1 childAspectRatio: 1.2,
// ? (1 - ((AppUtils.textScale(context) - 1)))
// : 0.48,
), ),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return GestureDetector( return GestureDetector(
onTap: () {}, onTap: () {},
child: assistantItem(), child: assistantItem(secondCardList[index]),
); );
}, },
), ),
@ -499,25 +495,26 @@ class _LegalRightDetails extends State<LegalRightDetails> {
); );
} }
Widget assistantItem() { Widget assistantItem(SecondCardList secondCardList) {
return Container( return Container(
alignment: Alignment.center, alignment: Alignment.center,
child: child: !(secondCardList.isAdd ?? false) ? Column(
Column(
children: [ children: [
Stack( Stack(
alignment: Alignment.bottomRight, alignment: Alignment.bottomRight,
children: [ children: [
Image.asset( MImage(
"assets/image/icon_idea_ya.png", secondCardList?.headimg ?? "",
width: 50, width: 50,
height: 50, height: 50,
fit: BoxFit.cover, fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
unbindShowDeleteDialog(); unbindShowDeleteDialog(secondCardList.phone);
}); });
}, },
child: Image.asset( child: Image.asset(
@ -533,7 +530,7 @@ class _LegalRightDetails extends State<LegalRightDetails> {
height: 5.h, height: 5.h,
), ),
Text( Text(
"123****6789", secondCardList?.phone ?? "",
style: TextStyle( style: TextStyle(
color: Color(0xFF79572D), color: Color(0xFF79572D),
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -541,30 +538,32 @@ class _LegalRightDetails extends State<LegalRightDetails> {
), ),
), ),
], ],
):
GestureDetector(
onTap: (){
Navigator.of(context).pushNamed('/router/binding_assistant_card').then((value) =>{
querySecondCardList()
});
},
child:Column(
children: [
Image.asset(
"assets/image/fuka_zj.png",
width:50,
height:50,
fit: BoxFit.cover,
),
Text(
"添加新副卡",
style: TextStyle(
color: Color(0xFF79572D),
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
),
),
],
),
), ),
// GestureDetector(
// onTap: (){
// Navigator.of(context).pushNamed('/router/binding_assistant_card');
// },
// child:Column(
// children: [
// Image.asset(
// "assets/image/fuka_zj.png",
// width:50,
// height:50,
// fit: BoxFit.cover,
// ),
// Text(
// "添加新副卡",
// style: TextStyle(
// color: Color(0xFF79572D),
// fontWeight: MyFontWeight.regular,
// fontSize: 12.sp,
// ),
// ),
// ],
// ),
// ),
); );
} }
} }

506
lib/mine/mine_vip/mine_attainment_page.dart

@ -1,17 +1,20 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/achievement_detail_list.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/data/vip_badges_list.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
class MineAttainmentPage extends StatefulWidget { class MineAttainmentPage extends StatefulWidget {
final Map<String, dynamic> arguments; final Map<String, dynamic> arguments;
@ -28,7 +31,10 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
ApiService apiService; ApiService apiService;
final RefreshController _refreshController = RefreshController(); final RefreshController _refreshController = RefreshController();
UserInfo userInfo; UserInfo userInfo;
var checkIndex = 1; List<VipBadgesList> vipBadgesList = [];
List<AchievementDetailList> achievementDetail = [];
int checkPosition = 0;
int attainmentPoint = 0;
@override @override
void dispose() { void dispose() {
@ -40,115 +46,172 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
void initState() { void initState() {
super.initState(); super.initState();
userInfo = widget.arguments["userInfo"]; userInfo = widget.arguments["userInfo"];
queryAttainmentBadges();
queryAchievementDetail("1460164746211753984");
}
///
queryAttainmentBadges() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<List<VipBadgesList>> baseData =
await apiService.findBadges({}).catchError((error) {
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
vipBadgesList.clear();
vipBadgesList.addAll(baseData.data);
setState(() {
_refreshController.refreshCompleted();
});
} else {
_refreshController.refreshFailed();
}
}
///
queryAchievementDetail(achievementCategoryId) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<List<AchievementDetailList>> baseData = await apiService
.getAchievementDetail(achievementCategoryId)
.catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
achievementDetail.clear();
attainmentPoint = 0;
achievementDetail.addAll(baseData.data);
achievementDetail.forEach((element) {
if(element.actived)
attainmentPoint += 1;
});
});
}
EasyLoading.dismiss();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container(decoration: BoxDecoration( return Container(
image: DecorationImage( decoration: BoxDecoration(
fit: BoxFit.fill, image: DecorationImage(
image: AssetImage("assets/image/attainment_bj.png"), fit: BoxFit.fill,
), image: AssetImage("assets/image/attainment_bj.png"),
),child:Scaffold( ),
backgroundColor: Colors.transparent,
appBar: MyAppBar(
title: "我的成就",
titleColor: Colors.black,
titleSize: 18.sp,
background: Colors.transparent,
leadingColor: Colors.black,
), ),
body: SingleChildScrollView( child: Scaffold(
physics: BouncingScrollPhysics(), backgroundColor: Colors.transparent,
child: Column( appBar: MyAppBar(
children: [ title: "我的成就",
SizedBox(height: 24), titleColor: Colors.black,
MImage( titleSize: 18.sp,
userInfo?.headimg ?? "", background: Colors.transparent,
isCircle: true, leadingColor: Colors.black,
width: 58, ),
height: 58, body: SingleChildScrollView(
fit: BoxFit.cover, physics: BouncingScrollPhysics(),
errorSrc: "assets/image/default_user.png", child: Column(
fadeSrc: "assets/image/default_user.png", children: [
), SizedBox(height: 24),
SizedBox(height: 8), MImage(
Text( userInfo?.headimg ?? "",
userInfo?.nickname ?? S.of(context).denglu, isCircle: true,
style: TextStyle( width: 58,
fontSize: 16.sp, height: 58,
fontWeight: FontWeight.bold, fit: BoxFit.cover,
color: Color(0xFF353535), errorSrc: "assets/image/default_user.png",
), fadeSrc: "assets/image/default_user.png",
), ),
SizedBox(height: 28), SizedBox(height: 8),
Container( Text(
margin: EdgeInsets.only(left: 16, right: 16, top: 26, bottom: 8), userInfo?.nickname ?? S.of(context).denglu,
padding: EdgeInsets.all(20), style: TextStyle(
decoration: BoxDecoration( fontSize: 16.sp,
color: Colors.white, fontWeight: FontWeight.bold,
boxShadow: [ color: Color(0xFF353535),
BoxShadow( ),
color: Colors.black.withAlpha(12), ),
offset: Offset(0, 3), SizedBox(height: 28),
blurRadius: 14, Container(
spreadRadius: 0, margin:
) EdgeInsets.only(left: 16, right: 16, top: 26, bottom: 8),
], padding: EdgeInsets.all(20),
borderRadius: BorderRadius.all(Radius.circular(8)), decoration: BoxDecoration(
), color: Colors.white,
child: Column( boxShadow: [
mainAxisAlignment: MainAxisAlignment.spaceAround, BoxShadow(
crossAxisAlignment: CrossAxisAlignment.start, color: Colors.black.withAlpha(12),
children: [ offset: Offset(0, 3),
Row( blurRadius: 14,
spreadRadius: 0,
)
],
borderRadius: BorderRadius.all(Radius.circular(8)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Row(
"成就徽章", children: [
style: TextStyle( Text(
fontWeight: MyFontWeight.medium, "成就徽章",
fontSize: 14.sp, style: TextStyle(
color: Color(0xFF353535)), fontWeight: MyFontWeight.medium,
), fontSize: 14.sp,
SizedBox(width: 4), color: Color(0xFF353535)),
Text( ),
"(", SizedBox(width: 4),
style: TextStyle( Text(
fontWeight: MyFontWeight.medium, "(",
fontSize: 14, style: TextStyle(
color: Color(0xFF353535)), fontWeight: MyFontWeight.medium,
), fontSize: 14,
Text( color: Color(0xFF353535)),
"0", ),
style: TextStyle( Text(
fontWeight: MyFontWeight.medium, attainmentPoint.toString(),
fontSize: 14, style: TextStyle(
color: Color(0xFF32A060)), fontWeight: MyFontWeight.medium,
), fontSize: 14,
Text( color: Color(0xFF32A060)),
"/8)", ),
style: TextStyle( Text(
fontWeight: MyFontWeight.medium, "/${vipBadgesList.length})",
fontSize: 14, style: TextStyle(
color: Color(0xFF353535)), fontWeight: MyFontWeight.medium,
fontSize: 14,
color: Color(0xFF353535)),
),
],
), ),
SizedBox(height: 12),
attainmentBadge(),
], ],
), ),
SizedBox(height: 12), ),
attainmentBadge(), ],
],
),
), ),
], )),
),
)),
); );
} }
/// ///
Widget attainmentBadge() { Widget attainmentBadge() {
return GridView.builder( return GridView.builder(
itemCount: 8, itemCount: vipBadgesList == null ? 0 : vipBadgesList.length,
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
@ -166,38 +229,34 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
showDeleteDialog(); setState(() {
showDeleteDialog(index);
});
}, },
child: badgeItem(), child: badgeItem(vipBadgesList[index]),
); );
}, },
); );
} }
Widget badgeItem() { Widget badgeItem(VipBadgesList vipBadgesList) {
return Container( return Container(
alignment: Alignment.center, alignment: Alignment.center,
child: Column( child: Column(
children: [ children: [
// MImage( MImage(
// "assets/image/badge_img.png", vipBadgesList?.icon ?? "",
// width: 80,
// height: 80,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
Image.asset(
"assets/image/badge_img.png",
width: 80, width: 80,
height: 80, height: 80,
fit: BoxFit.cover, fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
), ),
SizedBox( SizedBox(
height: 4.h, height: 4.h,
), ),
Text( Text(
"签到", vipBadgesList?.name ?? "",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: Color(0xFF181818), color: Color(0xFF181818),
@ -211,18 +270,19 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
} }
/// ///
showDeleteDialog() { showDeleteDialog(index) {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return StatefulBuilder(builder: (context, state) { return StatefulBuilder(builder: (
context,
state,
) {
return AlertDialog( return AlertDialog(
content: Container( content: Container(
width: MediaQuery.of(context).size.width - 84, width: MediaQuery.of(context).size.width - 84,
height: 385.h, height: 410.h,
child: Column( child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
@ -239,14 +299,17 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
], ],
), ),
), ),
Image.asset( MImage(
"assets/image/badge_img.png", this.vipBadgesList[index].icon,
width: 150, width: 150,
height: 150, height: 150,
fit: BoxFit.cover, fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
), ),
SizedBox(height: 10),
Text( Text(
"消费白银徽章", "${vipBadgesList.length >index ?vipBadgesList[index].name :""}${achievementDetail.length > checkPosition ?achievementDetail[checkPosition].name:""}徽章",
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
@ -257,7 +320,7 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
height: 6.h, height: 6.h,
), ),
Text( Text(
"消费268.4元即可升级", "${vipBadgesList.length >index ? vipBadgesList[index].name :""} ${achievementDetail.length > checkPosition ?achievementDetail[checkPosition].lessScore :""} 即可升级",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -287,7 +350,7 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
), ),
SizedBox(width: 4), SizedBox(width: 4),
Text( Text(
"+ 10", vipBadgesList[index].eachReward.toString(),
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
fontSize: 12.sp, fontSize: 12.sp,
@ -296,137 +359,31 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
], ],
), ),
SizedBox(height: 5), SizedBox(height: 5),
Row( Expanded(
mainAxisAlignment: MainAxisAlignment.center, child: Container(
crossAxisAlignment: CrossAxisAlignment.center, height: double.maxFinite,
children: [ margin: EdgeInsets.only(top: 24),
GestureDetector( child: ListView.builder(
onTap: () { shrinkWrap: true,
state(() { scrollDirection: Axis.horizontal,
checkIndex = 1; physics: BouncingScrollPhysics(),
}); itemCount: achievementDetail == null
}, ? 0
child: Column( : achievementDetail.length,
children: [ itemBuilder: (context, position) {
Image.asset( return GestureDetector(
"assets/image/qt_badge.png", onTap: () {
width: checkIndex != 1 ? 30 : 55, state(() {
height: checkIndex != 1 ? 30 : 55, checkPosition = position;
fit: BoxFit.cover, });
), },
SizedBox(height: 10), child: badgeGradeItem(achievementDetail[position],
Text( position, achievementDetail.length),
"青铜", );
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFA3A3A3),
),
),
],
),
),
Container(
width: 35.w,
height: 2.h,
decoration: new BoxDecoration(
color: Color(0xFFE1F2F7),
),
),
GestureDetector(
onTap: () {
state(() {
checkIndex = 2;
});
},
child: Column(
children: [
Image.asset(
"assets/image/by_badge.png",
width: checkIndex != 2 ? 35 : 65,
height: checkIndex != 2 ? 35 : 65,
fit: BoxFit.cover,
),
SizedBox(height: 10),
Text(
"白银",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFA3A3A3),
),
),
],
),
),
Container(
width: 35.w,
height: 2.h,
decoration: new BoxDecoration(
color: Color(0xFFE1F2F7),
),
),
GestureDetector(
onTap: () {
state(() {
checkIndex = 3;
});
},
child: Column(
children: [
Image.asset(
"assets/image/hj_badge.png",
width: checkIndex != 3 ? 35 : 65,
height: checkIndex != 3 ? 35 : 65,
fit: BoxFit.cover,
),
SizedBox(height: 10),
Text(
"黄金",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFA3A3A3),
),
),
],
),
),
Container(
width: 35.w,
height: 2.h,
decoration: new BoxDecoration(
color: Color(0xFFE1F2F7),
),
),
GestureDetector(
onTap: () {
state(() {
checkIndex = 4;
});
}, },
child: Column(
children: [
Image.asset(
"assets/image/qt_badge.png",
width: checkIndex != 4 ? 35 : 65,
height: checkIndex != 4 ? 35 : 65,
fit: BoxFit.cover,
),
SizedBox(height: 10),
Text(
"铂金",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFA3A3A3),
),
),
],
),
), ),
], ),
), )
], ],
), ),
), ),
@ -435,4 +392,53 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
}, },
); );
} }
///
Widget badgeGradeItem(
AchievementDetailList achievementDetail, var position, var size) {
return Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
MImage(
achievementDetail?.icon ?? "",
width: checkPosition == position ? 50 : 30,
height: checkPosition == position ? 50 : 30,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
SizedBox(height: 10),
Text(
achievementDetail?.name ?? "",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFA3A3A3),
),
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (position != size - 1)
Container(
width: 35.w,
height: 2.h,
// margin: EdgeInsets.only(top: 25),
decoration: new BoxDecoration(
color: Color(0xFFE1F2F7),
),
),
SizedBox(height: 20),
])
],
);
}
} }

173
lib/mine/mine_vip/mine_vip_core.dart

@ -1,14 +1,19 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.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:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/rank.dart'; import 'package:huixiang/retrofit/data/rank.dart';
import 'package:huixiang/retrofit/data/vip_benefit_list.dart';
import 'package:huixiang/retrofit/data/vip_rule_details.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/mine_vip_view.dart'; import 'package:huixiang/view_widget/mine_vip_view.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
@ -29,6 +34,8 @@ class MineVipCore extends StatefulWidget {
class _MineVipCore extends State<MineVipCore> { class _MineVipCore extends State<MineVipCore> {
ApiService apiService; ApiService apiService;
List<Rank> ranks = []; List<Rank> ranks = [];
List<VipBenefitList> vipBenefitList = [];
VipRuleDetails vipRuleDetails;
final SwiperController controller = SwiperController(); final SwiperController controller = SwiperController();
@ -40,6 +47,8 @@ class _MineVipCore extends State<MineVipCore> {
apiService = apiService =
ApiService(Dio(), context: context, token: value.getString("token")); ApiService(Dio(), context: context, token: value.getString("token"));
queryVipLevel(); queryVipLevel();
queryBenefitList();
queryRuleDetails();
}); });
} }
@ -56,6 +65,31 @@ class _MineVipCore extends State<MineVipCore> {
} }
} }
///
queryBenefitList() async {
BaseData<List<VipBenefitList>> baseData = await apiService.benefitList().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
vipBenefitList.clear();
vipBenefitList.addAll(baseData.data);
vipBenefitList.sort((a,b)=>(a.sort).compareTo(b.sort));
});
}
EasyLoading.dismiss();
}
/////
queryRuleDetails() async {
BaseData<VipRuleDetails> baseData =
await apiService.vipBenefit().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
vipRuleDetails = baseData.data;
});
}
EasyLoading.dismiss();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -204,19 +238,22 @@ class _MineVipCore extends State<MineVipCore> {
SizedBox( SizedBox(
height: 12.h, height: 12.h,
), ),
Padding( if (vipRuleDetails?.qa != null &&
padding: EdgeInsets.only(left: 8), vipRuleDetails.qa != "")
child: Text( Container(
"会员共分为3个等级,分别是银卡会员、金卡会员、共创会员。其中,银卡会员和金卡会员由用户的消费金额决定," color: Colors.white,
"消费金额越高,会员等级越高,享受到的会员权益也越多。而共创会员需要直接购买,但是它的权益包含银卡和金卡的,属于最高等级会员。", padding: EdgeInsets.only(left: 8),
style: TextStyle( child: Html(
fontWeight: MyFontWeight.regular, data: vipRuleDetails?.qa??"",
fontSize: 12.sp, customImageRenders: {
height: 1.5, networkSourceMatcher(): networkImageRender(
color: Color(0xFF4C4C4C), loadingWidget: () {
return Container();
},
),
},
), ),
), ),
),
], ],
), ),
), ),
@ -267,10 +304,12 @@ class _MineVipCore extends State<MineVipCore> {
SizedBox( SizedBox(
height: 12.h, height: 12.h,
), ),
Image.asset( MImage(
"assets/image/vip_contrastive_table.png", vipRuleDetails?.contrast ?? "",
width: double.infinity, width: double.infinity,
height: 281, height: 281,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
), ),
SizedBox( SizedBox(
height: 16.h, height: 16.h,
@ -330,40 +369,21 @@ class _MineVipCore extends State<MineVipCore> {
SizedBox( SizedBox(
height: 12.h, height: 12.h,
), ),
Text( if (vipRuleDetails?.rule != null &&
"1.用户每消费1元可获得1个积分。", vipRuleDetails.rule != "")
style: TextStyle( Container(
fontWeight: MyFontWeight.regular, color: Colors.white,
fontSize: 12.sp, child: Html(
color: Color(0xFF4C4C4C), data: vipRuleDetails?.rule??"",
), customImageRenders: {
), networkSourceMatcher(): networkImageRender(
SizedBox( loadingWidget: () {
height: 8.h, return Container();
), },
Text( ),
"2.通过完成积分详情-做任务得积分来获得积分。", },
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Color(0xFF4C4C4C),
),
),
SizedBox(
height: 8.h,
),
Text(
"3.优惠金额无法累积积分,订单撤销或其他原因造成的未成功支付的订单,无法获得对应的积分。",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
height: 1.5,
color: Color(0xFF4C4C4C),
), ),
), ),
SizedBox(
height: 8.h,
),
], ],
), ),
), ),
@ -406,6 +426,7 @@ class _MineVipCore extends State<MineVipCore> {
); );
} }
///vip
Widget levelItem(Rank rank, rankOrigin, rankOriginMax) { Widget levelItem(Rank rank, rankOrigin, rankOriginMax) {
return Container( return Container(
margin: EdgeInsets.symmetric(vertical: 8.h), margin: EdgeInsets.symmetric(vertical: 8.h),
@ -445,7 +466,7 @@ class _MineVipCore extends State<MineVipCore> {
/// ///
Widget vipLegalRight() { Widget vipLegalRight() {
return GridView.builder( return GridView.builder(
itemCount: 13, itemCount:vipBenefitList == null ? 0 : vipBenefitList.length,
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
@ -464,15 +485,15 @@ class _MineVipCore extends State<MineVipCore> {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/legal_right_details', arguments: {}); .pushNamed('/router/legal_right_details', arguments: {"vipBenefitList": vipBenefitList,});
}, },
child: vipLegalRightItem(), child: vipLegalRightItem(vipBenefitList[index]),
); );
}, },
); );
} }
Widget vipLegalRightItem() { Widget vipLegalRightItem(VipBenefitList vipBenefitList) {
return Container( return Container(
alignment: Alignment.center, alignment: Alignment.center,
child: Column( child: Column(
@ -480,23 +501,15 @@ class _MineVipCore extends State<MineVipCore> {
Stack( Stack(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
children: [ children: [
Opacity( MImage(
opacity: 0.3, vipBenefitList?.icon ?? "",
// MImage(
// "assets/image/badge_img.png",
// width: 80,
// height: 80,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
child: Image.asset(
"assets/image/vip_qy.png",
width: 36, width: 36,
height: 36, height: 36,
fit: BoxFit.cover, // fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
), ),
), if(!vipBenefitList.actived)
Container( Container(
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: Color(0xFFA29E9E), color: Color(0xFFA29E9E),
@ -516,21 +529,49 @@ class _MineVipCore extends State<MineVipCore> {
Text( Text(
"暂未开放", "暂未开放",
style: TextStyle( style: TextStyle(
color: Color(0xFF181818), color: Color(0xFFFFDCA1),
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
fontSize: 9.sp, fontSize: 9.sp,
), ),
), ),
], ],
), ),
) ),
if(!vipBenefitList.actived && !vipBenefitList.have)
Container(
decoration: new BoxDecoration(
color: Color(0xFFA29E9E),
borderRadius: BorderRadius.circular(7.0),
),
width: 52.w,
height: 15.h,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.lock,
color: Color(0xFFFFDCA1),
size: 10,
),
Text(
"暂未解锁",
style: TextStyle(
color: Color(0xFFFFDCA1),
fontWeight: MyFontWeight.regular,
fontSize: 9.sp,
),
),
],
),
),
], ],
), ),
SizedBox( SizedBox(
height: 5.h, height: 5.h,
), ),
Text( Text(
"储值优惠", vipBenefitList?.name ?? "",
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center, textAlign: TextAlign.center,

159
lib/order/exchange_history_page.dart

@ -263,12 +263,74 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
SizedBox( SizedBox(
height: 16.h, height: 16.h,
), ),
exchangeOrder.useTyped == 1 ?
Container(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).zitidizhi + " :",
style: TextStyle(
color: Color(0xFF353535),
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
),
),
SizedBox(
width: 8.w,
),
Expanded(
child: Text(
exchangeOrder.address ?? "",
style: TextStyle(
color: Colors.black,
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
),
),
)
],
),
SizedBox(
height: 8.h,
),
Row(
children: [
Text(
S.of(context).zitishijian + " :",
style: TextStyle(
color: Color(0xFF353535),
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
),
),
SizedBox(
width: 8.h,
),
Expanded(
child: Text(
S.of(context).duihuanhouwugegongzuori,
style: TextStyle(
color: Colors.black,
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
),
),
)
],
),
],
),
):
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
S.of(context).zitidizhi + " :", S.of(context).shouhuodi + " :",
style: TextStyle( style: TextStyle(
color: Color(0xFF353535), color: Color(0xFF353535),
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -280,35 +342,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
), ),
Expanded( Expanded(
child: Text( child: Text(
exchangeOrder.address ?? "", exchangeOrder.recAddress ?? "",
style: TextStyle(
color: Colors.black,
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
),
),
)
],
),
SizedBox(
height: 8.h,
),
Row(
children: [
Text(
S.of(context).zitishijian + " :",
style: TextStyle(
color: Color(0xFF353535),
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
),
),
SizedBox(
width: 8.h,
),
Expanded(
child: Text(
S.of(context).duihuanhouwugegongzuori,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -423,8 +457,8 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
IconText( IconText(
S.of(context).youxiaoqizhi(exchangeOrder.updateTime), "${S.of(context).dingdanbianhao}: ${exchangeOrder.orderCode}",
leftImage: "assets/image/icon_order_time.png", leftImage: "assets/image/bianhao.png",
iconSize: 16, iconSize: 16,
textStyle: TextStyle( textStyle: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
@ -432,16 +466,40 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
), ),
exchangeOrder.useTyped == 1 ?
GestureDetector( GestureDetector(
onTap: () { onTap: () {
if (exchangeOrder.state == 1) { // if (exchangeOrder.state == 1) {
receive2Card(exchangeOrder.id); // receive2Card(exchangeOrder.id);
} else { // } else {
Navigator.of(context) // Navigator.of(context)
.pushNamed('/router/write_off_page', arguments: {}); // .pushNamed('/router/write_off_page', arguments: {});
} // }
Navigator.of(context).pushNamed(
'/router/exchange_write_offPage',
arguments: {
"exchangeOrder": exchangeOrder.toJson(),
});
}, },
child: buildBtnStatus(exchangeOrder.state), child: buildBtnStatus(exchangeOrder.state),
):
GestureDetector(
onTap: () {
setState(() {
// Navigator.of(context).pushNamed(
// '/router/logistics_information_page',
// arguments: {
// "logisticsNum": orderInfo.logisticsNum,
// "logisticsName": orderInfo.logisticsName,
// "shipperCode": orderInfo.shipperCode,
// "productNum": orderInfo.productList.length,
// "skuImg": orderInfo.productList.length > 0
// ? orderInfo.productList[0].skuImg
// : ""
// });
});
},
child: buildBtnStatusTow(exchangeOrder.state),
), ),
], ],
) )
@ -461,7 +519,30 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
if (state == 1) { if (state == 1) {
return RoundButton( return RoundButton(
padding: EdgeInsets.fromLTRB(8, 4, 8, 4), padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
text: S.of(context).lingqudaokabao, text: S.of(context).chakanhexiaoma,
textColor: Colors.white,
fontSize: 12,
backgroup: Color(0xFF32A060),
radius: 2,
);
} else {
return Container();
// return BorderText(
// text: S.of(context).shanchudingdan,
// textColor: Color(0xFF32A060),
// borderWidth: 1,
// borderColor: Color(0xFF32A060),
// fontSize: 12,
// padding: EdgeInsets.fromLTRB(14, 4, 14, 4),
// );
}
}
Widget buildBtnStatusTow(state) {
if (state == 1) {
return RoundButton(
padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
text: S.of(context).chakanwuliu,
textColor: Colors.white, textColor: Colors.white,
fontSize: 12, fontSize: 12,
backgroup: Color(0xFF32A060), backgroup: Color(0xFF32A060),

152
lib/order/exchange_order_page.dart

@ -227,6 +227,85 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
], ],
), ),
): ):
// Container(
// margin:
// EdgeInsets.only(left: 16, right: 16, top: 26, bottom: 8),
// padding: EdgeInsets.all(20),
// decoration: BoxDecoration(
// color: Colors.white,
// boxShadow: [
// BoxShadow(
// color: Colors.black.withAlpha(12),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0,
// )
// ],
// borderRadius: BorderRadius.all(Radius.circular(8)),
// ),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// children: [
// Image.asset(
// "assets/image/icon_order_exchange_info.png",
// width: 24,
// height: 24,
// ),
// SizedBox(width: 4),
// Text(
// S.of(context).duihuanxinxi,
// style: TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: 16,
// color: Color(0xFF353535)),
// ),
// ],
// ),
// SizedBox(
// height: 18.h,
// ),
// Row(
// children: [
// Text(
// S.of(context).lingqufangshi,
// style: TextStyle(
// fontSize: 14.sp,
// color: Color(0xFF353535),
// ),
// ),
// SizedBox(
// width: 12.w,
// ),
// Text(
// widget.arguments["useTyped"] == 1
// ? S.of(context).ziti
// : widget.arguments["useTyped"] == 2
// ? S.of(context).peisong
// : S.of(context).xianshangfafang,
// style: TextStyle(
// fontSize: 14.sp,
// color: Color(0xFF353535),
// ),
// ),
// ],
// ),
// SizedBox(
// height: 12.h,
// ),
// Text(
// "非实物商品兑换后领取到卡包即可使用!",
// style: TextStyle(
// fontSize: 14.sp,
// color: Color(0xFF32A060),
// fontWeight: MyFontWeight.medium
// ),
// ),
// ],
// ),
// ),
Container( Container(
margin: margin:
EdgeInsets.only(left: 16, right: 16, top: 26, bottom: 8), EdgeInsets.only(left: 16, right: 16, top: 26, bottom: 8),
@ -244,8 +323,6 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
borderRadius: BorderRadius.all(Radius.circular(8)), borderRadius: BorderRadius.all(Radius.circular(8)),
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
@ -292,16 +369,71 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
), ),
], ],
), ),
SizedBox( Visibility(
height: 12.h, child: SizedBox(
height: 13.h,
),
visible: widget.arguments["useTyped"] != 3,
), ),
Text( Visibility(
"非实物商品兑换后领取到卡包即可使用!", child: Row(
style: TextStyle( children: [
fontSize: 14.sp, Text(
color: Color(0xFF32A060), "收货地址",
fontWeight: MyFontWeight.medium style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
SizedBox(
width: 12.w,
),
Expanded(
child: GestureDetector(
onTap: () {
toAddressPicker();
},
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: Text(
(address != null && address != "")
? address
: widget.arguments["useTyped"] == 1
? S.of(context).qingxuanzhemendian
: widget.arguments["useTyped"] ==
2
? S
.of(context)
.qingxuanzeshouhuodizhi
: S.of(context).xuni,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF32A060),
),
),
flex: 1,
),
Icon(
Icons.keyboard_arrow_right,
size: 16,
color: Color(0xFF32A060),
),
],
),
),
flex: 1,
),
],
), ),
visible: widget.arguments["useTyped"] != 3,
),
SizedBox(
height: 12.h,
), ),
], ],
), ),

290
lib/order/exchange_write_off_page.dart

@ -0,0 +1,290 @@
import 'package:barcode_widget/barcode_widget.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/exchange_order.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/separator.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:qr_flutter/qr_flutter.dart';
class ExchangeWriteOffPage extends StatefulWidget {
final arguments;
ExchangeWriteOffPage({this.arguments});
@override
State<StatefulWidget> createState() {
return _ExchangeWriteOffPage();
}
}
class _ExchangeWriteOffPage extends State<ExchangeWriteOffPage> {
ExchangeOrder exchangeOrder;
@override
void initState() {
super.initState();
exchangeOrder = ExchangeOrder.fromJson(widget.arguments["exchangeOrder"]);
if (mounted) setState(() {});
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFF32A060),
appBar: MyAppBar(
title: S.of(context).hexiaomaxiangqing,
titleSize: 18.sp,
titleColor: Colors.white,
background: Color(0xFF32A060),
leadingColor: Colors.white,
),
body: Container(
alignment: Alignment.topCenter,
child: Stack(
alignment: Alignment.topCenter,
children: [
Image.asset(
"assets/image/icon_write_off_bg.png",
width: MediaQuery.of(context).size.width * 0.912,
fit: BoxFit.fill,
),
LayoutBuilder(builder: (context, constraints) {
return Container(
width: constraints.constrainWidth() * 0.912,
child: Column(
children: [
Expanded(
child: Container(
child: Column(
children: [
Text(
exchangeOrder != null ? exchangeOrder.creditOrderDetailList[0].name : "",
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF353535)),
),
SizedBox(
height: 8.h,
),
Text(
(exchangeOrder.updateTime == null) ? "" : S.of(context).youxiaoqi(
"${exchangeOrder.updateTime}"),
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF353535),
),
),
],
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
),
alignment: Alignment.center,
),
flex: 6,
),
Container(
margin: EdgeInsets.only(left: 20.w, right: 20.w),
child: MySeparator(
width: 5.w,
height: 1.h,
color: Color(0xFFA29E9E),
),
),
Expanded(
child: Container(
alignment: Alignment.center,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
exchangeOrder != null
? "${exchangeOrder.id.substring(0, 4)} "
"${exchangeOrder.id.substring(4, 8)} "
"${exchangeOrder.id.substring(8, 12)} "
"${exchangeOrder.id.substring(12, 16)} "
"${exchangeOrder.id.substring(16, exchangeOrder.id.length)}"
: "",
style: TextStyle(
fontSize: 14.sp,
wordSpacing: exchangeOrder == null
? 10
: (MediaQuery.of(context).size.width -
64.w) /
(((exchangeOrder.id.length) * 4)),
letterSpacing: exchangeOrder == null
? 8
: (MediaQuery.of(context).size.width -
64.w) /
(((exchangeOrder.id.length) * 4)),
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF353535),
),
),
SizedBox(
height: 12.h,
),
BarcodeWidget(
barcode: Barcode.code128(useCode128C: true),
data: exchangeOrder != null ? exchangeOrder.id : "",
height: 72.h,
color: Colors.black,
drawText: false,
),
SizedBox(
height: 16.h,
),
Expanded(child: QrImage(
data: exchangeOrder != null ? exchangeOrder.id : "",
version: QrVersions.auto,
size: 200.w,
gapless: true,
),),
SizedBox(
height: 35.h,
),
],
),
margin: EdgeInsets.symmetric(horizontal: 20.w),
),
flex: 27,
),
Container(
child: MySeparator(
width: 5.w,
height: 1.h,
color: Color(0xFFA29E9E),
),
margin: EdgeInsets.only(left: 20.w, right: 20.w),
),
Expanded(
child: Container(
padding: EdgeInsets.fromLTRB(20.w, 15.h, 20.w, 24.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 3.w,
height: 15.h,
margin:
EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(3),
color: Color(0xFF20662A),
),
),
Text(
S.of(context).shiyongtiaojian,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 11.w,
),
Expanded(
child: Text(
S
.of(context)
.qianwanghuixiangmendianduihuanhexiao,
style: TextStyle(
textBaseline: TextBaseline.alphabetic,
fontSize: 14.sp,
color: Color(0xFF353535)),
),
flex: 1,
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 3.w,
height: 15.h,
margin: EdgeInsets.fromLTRB(4, 7, 4, 7),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(3),
color: Color(0xFF20662A),
),
),
Text(
S.of(context).shiyongshuoming,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.sp,
color: Color(0xFF353535)),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 11.w,
),
Text(
S.of(context).zitiduihuanquan,
style: TextStyle(
textBaseline: TextBaseline.alphabetic,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 11.w,
),
Text(
S.of(context).huixiangrenyimendian,
style: TextStyle(
textBaseline: TextBaseline.alphabetic,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
],
),
],
),
),
flex: 13,
),
Expanded(
child: Container(),
flex: 3,
),
],
),
);
})
],
),
),
);
}
}

4
lib/order/write_off_page.dart

@ -138,12 +138,12 @@ class _WriteOffPage extends State<WriteOffPage> {
SizedBox( SizedBox(
height: 16.h, height: 16.h,
), ),
QrImage( Expanded(child: QrImage(
data: coupon != null ? coupon.id : "", data: coupon != null ? coupon.id : "",
version: QrVersions.auto, version: QrVersions.auto,
size: 200.w, size: 200.w,
gapless: true, gapless: true,
), ),),
SizedBox( SizedBox(
height: 35.h, height: 35.h,
), ),

191
lib/retrofit/data/achievement_detail_list.dart

@ -0,0 +1,191 @@
/// id : "1460450874352310812"
/// createTime : "2021-11-12 11:42:08"
/// createUser : "123"
/// updateTime : "2021-11-17 17:49:17"
/// updateUser : "1"
/// categoryId : "1460164746211753984"
/// name : "青铜"
/// level : 0
/// icon : "https://pos.upload.gznl.top/admin/2021/11/a83f895b-8159-455e-a54d-ac67068b28b7.jpg"
/// score : 10
/// actived : true
/// sort : 0
/// isDelete : 0
/// lessScore : 0
/// get : true
/// max : false
class AchievementDetailList {
AchievementDetailList({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String categoryId,
String name,
int level,
String icon,
int score,
bool actived,
int sort,
int isDelete,
int lessScore,
bool get,
bool max,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_categoryId = categoryId;
_name = name;
_level = level;
_icon = icon;
_score = score;
_actived = actived;
_sort = sort;
_isDelete = isDelete;
_lessScore = lessScore;
_get = get;
_max = max;
}
AchievementDetailList.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_categoryId = json['categoryId'];
_name = json['name'];
_level = json['level'];
_icon = json['icon'];
_score = json['score'];
_actived = json['actived'];
_sort = json['sort'];
_isDelete = json['isDelete'];
_lessScore = json['lessScore'];
_get = json['get'];
_max = json['max'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _categoryId;
String _name;
int _level;
String _icon;
int _score;
bool _actived;
int _sort;
int _isDelete;
int _lessScore;
bool _get;
bool _max;
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get categoryId => _categoryId;
String get name => _name;
int get level => _level;
String get icon => _icon;
int get score => _score;
bool get actived => _actived;
int get sort => _sort;
int get isDelete => _isDelete;
int get lessScore => _lessScore;
bool get get => _get;
bool get max => _max;
set id(String value) {
_id = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['categoryId'] = _categoryId;
map['name'] = _name;
map['level'] = _level;
map['icon'] = _icon;
map['score'] = _score;
map['actived'] = _actived;
map['sort'] = _sort;
map['isDelete'] = _isDelete;
map['lessScore'] = _lessScore;
map['get'] = _get;
map['max'] = _max;
return map;
}
set createTime(String value) {
_createTime = value;
}
set createUser(String value) {
_createUser = value;
}
set updateTime(String value) {
_updateTime = value;
}
set updateUser(String value) {
_updateUser = value;
}
set categoryId(String value) {
_categoryId = value;
}
set name(String value) {
_name = value;
}
set level(int value) {
_level = value;
}
set icon(String value) {
_icon = value;
}
set score(int value) {
_score = value;
}
set actived(bool value) {
_actived = value;
}
set sort(int value) {
_sort = value;
}
set isDelete(int value) {
_isDelete = value;
}
set lessScore(int value) {
_lessScore = value;
}
set get(bool value) {
_get = value;
}
set max(bool value) {
_max = value;
}
}

12
lib/retrofit/data/exchange_order.dart

@ -12,7 +12,11 @@ class ExchangeOrder {
String mid; String mid;
String orderCode; String orderCode;
String amount; String amount;
String money;
int payStatus;
int sendStatus;
String address; String address;
String recAddress;
int state; int state;
int useTyped; int useTyped;
int isDelete; int isDelete;
@ -28,7 +32,11 @@ class ExchangeOrder {
..mid = json['mid'] as String ..mid = json['mid'] as String
..orderCode = json['orderCode'] as String ..orderCode = json['orderCode'] as String
..amount = json['amount'] as String ..amount = json['amount'] as String
..money = json['money'] as String
..payStatus = json['payStatus'] as int
..sendStatus = json['sendStatus'] as int
..address = json['address'] as String ..address = json['address'] as String
..recAddress = json['recAddress'] as String
..state = json['state'] as int ..state = json['state'] as int
..useTyped = json['useTyped'] as int ..useTyped = json['useTyped'] as int
..isDelete = json['isDelete'] as int ..isDelete = json['isDelete'] as int
@ -48,7 +56,11 @@ class ExchangeOrder {
'mid': this.mid, 'mid': this.mid,
'orderCode': this.orderCode, 'orderCode': this.orderCode,
'amount': this.amount, 'amount': this.amount,
'money': this.money,
'payStatus': this.payStatus,
'sendStatus': this.sendStatus,
'address': this.address, 'address': this.address,
'recAddress': this.recAddress,
'state': this.state, 'state': this.state,
'useTyped': this.useTyped, 'useTyped': this.useTyped,
'isDelete': this.isDelete, 'isDelete': this.isDelete,

73
lib/retrofit/data/second_card_list.dart

@ -0,0 +1,73 @@
/// id : "1438426197401796608"
/// phone : "18672306891"
/// nickname : "冬天的秘密"
/// headimg : ""
class SecondCardList {
SecondCardList({
String id,
String phone,
String nickname,
String headimg,
bool isAdd,
}) {
_id = id;
_phone = phone;
_nickname = nickname;
_headimg = headimg;
_isAdd = isAdd;
}
SecondCardList.fromJson(dynamic json) {
_id = json['id'];
_phone = json['phone'];
_nickname = json['nickname'];
_headimg = json['headimg'];
}
String _id;
String _phone;
String _nickname;
String _headimg;
bool _isAdd;
String get id => _id;
String get phone => _phone;
String get nickname => _nickname;
String get headimg => _headimg;
bool get isAdd => _isAdd;
set id(String value) {
_id = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['phone'] = _phone;
map['nickname'] = _nickname;
map['headimg'] = _headimg;
return map;
}
set phone(String value) {
_phone = value;
}
set nickname(String value) {
_nickname = value;
}
set headimg(String value) {
_headimg = value;
}
set isAdd(bool value) {
_isAdd = value;
}
}

147
lib/retrofit/data/vip_badges_list.dart

@ -0,0 +1,147 @@
/// id : "1460164746211753984"
/// createTime : "2021-11-15 16:36:19"
/// createUser : "1"
/// updateTime : "2021-11-17 11:39:54"
/// updateUser : "1"
/// name : "签到"
/// eachReward : 8
/// code : "SIGN"
/// icon : "https://pos.upload.gznl.top/admin/2021/11/93853f8d-ca0e-4c75-855b-d6245e4f6743.jpg"
/// actived : true
/// sort : 0
/// isDelete : 0
class VipBadgesList {
VipBadgesList({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String name,
int eachReward,
String code,
String icon,
bool actived,
int sort,
int isDelete,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_name = name;
_eachReward = eachReward;
_code = code;
_icon = icon;
_actived = actived;
_sort = sort;
_isDelete = isDelete;
}
VipBadgesList.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_name = json['name'];
_eachReward = json['eachReward'];
_code = json['code'];
_icon = json['icon'];
_actived = json['actived'];
_sort = json['sort'];
_isDelete = json['isDelete'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _name;
int _eachReward;
String _code;
String _icon;
bool _actived;
int _sort;
int _isDelete;
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get name => _name;
int get eachReward => _eachReward;
String get code => _code;
String get icon => _icon;
bool get actived => _actived;
int get sort => _sort;
int get isDelete => _isDelete;
set id(String value) {
_id = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['name'] = _name;
map['eachReward'] = _eachReward;
map['code'] = _code;
map['icon'] = _icon;
map['actived'] = _actived;
map['sort'] = _sort;
map['isDelete'] = _isDelete;
return map;
}
set createTime(String value) {
_createTime = value;
}
set createUser(String value) {
_createUser = value;
}
set updateTime(String value) {
_updateTime = value;
}
set updateUser(String value) {
_updateUser = value;
}
set name(String value) {
_name = value;
}
set eachReward(int value) {
_eachReward = value;
}
set code(String value) {
_code = value;
}
set icon(String value) {
_icon = value;
}
set actived(bool value) {
_actived = value;
}
set sort(int value) {
_sort = value;
}
set isDelete(int value) {
_isDelete = value;
}
}

180
lib/retrofit/data/vip_benefit_list.dart

@ -0,0 +1,180 @@
/// id : "5"
/// createTime : "2021-11-18 14:11:34"
/// createUser : "1"
/// updateTime : "2021-11-18 17:10:24"
/// updateUser : "1"
/// code : "DEPUTY"
/// name : "副卡"
/// icon : "https://pos.upload.gznl.top/MDAwMA==/2021/11/fb1e46d2-6213-4164-abbc-9aa24da24faf.png"
/// iconGrey : "https://pos.upload.gznl.top/MDAwMA==/2021/11/f50d211a-3d52-4663-bf8a-c4dff4f79310.png"
/// introduce : "可绑定副卡"
/// describes : "可绑定副卡"
/// actived : true
/// sort : 4
/// isDelete : 0
/// have : false
class VipBenefitList {
VipBenefitList({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String code,
String name,
String icon,
String iconGrey,
String introduce,
String describes,
bool actived,
int sort,
int isDelete,
bool have,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_code = code;
_name = name;
_icon = icon;
_iconGrey = iconGrey;
_introduce = introduce;
_describes = describes;
_actived = actived;
_sort = sort;
_isDelete = isDelete;
_have = have;
}
VipBenefitList.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_code = json['code'];
_name = json['name'];
_icon = json['icon'];
_iconGrey = json['iconGrey'];
_introduce = json['introduce'];
_describes = json['describes'];
_actived = json['actived'];
_sort = json['sort'];
_isDelete = json['isDelete'];
_have = json['have'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _code;
String _name;
String _icon;
String _iconGrey;
String _introduce;
String _describes;
bool _actived;
int _sort;
int _isDelete;
bool _have;
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get code => _code;
String get name => _name;
String get icon => _icon;
String get iconGrey => _iconGrey;
String get introduce => _introduce;
String get describes => _describes;
bool get actived => _actived;
int get sort => _sort;
int get isDelete => _isDelete;
bool get have => _have;
set id(String value) {
_id = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['code'] = _code;
map['name'] = _name;
map['icon'] = _icon;
map['iconGrey'] = _iconGrey;
map['introduce'] = _introduce;
map['describes'] = _describes;
map['actived'] = _actived;
map['sort'] = _sort;
map['isDelete'] = _isDelete;
map['have'] = _have;
return map;
}
set createTime(String value) {
_createTime = value;
}
set createUser(String value) {
_createUser = value;
}
set updateTime(String value) {
_updateTime = value;
}
set updateUser(String value) {
_updateUser = value;
}
set code(String value) {
_code = value;
}
set name(String value) {
_name = value;
}
set icon(String value) {
_icon = value;
}
set iconGrey(String value) {
_iconGrey = value;
}
set introduce(String value) {
_introduce = value;
}
set describes(String value) {
_describes = value;
}
set actived(bool value) {
_actived = value;
}
set sort(int value) {
_sort = value;
}
set isDelete(int value) {
_isDelete = value;
}
set have(bool value) {
_have = value;
}
}

48
lib/retrofit/data/vip_rule_details.dart

@ -0,0 +1,48 @@
/// rule : ""
/// contrast : ""
/// qa : ""
class VipRuleDetails {
VipRuleDetails({
String rule,
String contrast,
String qa,}){
_rule = rule;
_contrast = contrast;
_qa = qa;
}
VipRuleDetails.fromJson(dynamic json) {
_rule = json['rule'];
_contrast = json['contrast'];
_qa = json['qa'];
}
String _rule;
String _contrast;
String _qa;
String get rule => _rule;
String get contrast => _contrast;
String get qa => _qa;
set rule(String value) {
_rule = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['rule'] = _rule;
map['contrast'] = _contrast;
map['qa'] = _qa;
return map;
}
set contrast(String value) {
_contrast = value;
}
set qa(String value) {
_qa = value;
}
}

33
lib/retrofit/retrofit_api.dart

@ -17,6 +17,7 @@ import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:retrofit/retrofit.dart'; import 'package:retrofit/retrofit.dart';
import 'data/achievement_detail_list.dart';
import 'data/address.dart'; import 'data/address.dart';
import 'data/banner.dart'; import 'data/banner.dart';
import 'data/brand_data.dart'; import 'data/brand_data.dart';
@ -34,13 +35,17 @@ import 'data/member_comment_list.dart';
import 'data/message.dart'; import 'data/message.dart';
import 'data/page.dart'; import 'data/page.dart';
import 'data/rank.dart'; import 'data/rank.dart';
import 'data/second_card_list.dart';
import 'data/sign_info.dart'; import 'data/sign_info.dart';
import 'data/social_info.dart'; import 'data/social_info.dart';
import 'data/store.dart'; import 'data/store.dart';
import 'data/upload_result.dart'; import 'data/upload_result.dart';
import 'data/user_bill.dart'; import 'data/user_bill.dart';
import 'data/user_info.dart'; import 'data/user_info.dart';
import 'data/vip_badges_list.dart';
import 'data/vip_benefit_list.dart';
import 'data/vip_card.dart'; import 'data/vip_card.dart';
import 'data/vip_rule_details.dart';
import 'data/wx_pay.dart'; import 'data/wx_pay.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
@ -426,4 +431,32 @@ abstract class ApiService {
@GET("/course/likes/{courseId}") @GET("/course/likes/{courseId}")
Future<BaseData> courseLikes(@Path("courseId") String courseId); Future<BaseData> courseLikes(@Path("courseId") String courseId);
/// APP查询所有成就徽章
@POST("/app-memberAchievement/findBadges")
Future<BaseData<List<VipBadgesList>>> findBadges(@Body() Map<String, dynamic> map);
///
@GET("/app-memberAchievement/getAchievementDetail?achievementCategoryId={achievementCategoryId}")
Future<BaseData<List<AchievementDetailList>>> getAchievementDetail(@Path("achievementCategoryId") String achievementCategoryId);
///
@GET("/member/benefitList")
Future<BaseData<List<VipBenefitList>>> benefitList();
///
@GET("/home/vipBenefit")
Future<BaseData<VipRuleDetails>> vipBenefit();
///
@GET("/member/secondCardList")
Future<BaseData<List<SecondCardList>>> secondCardList();
///
@GET("/member/bindSecondCard/{phone}")
Future<BaseData> bindSecondCard(@Path("phone") String phone);
///
@GET("/member/unbindSecondCard/{phone}")
Future<BaseData> unbindSecondCard(@Path("phone") String phone);
} }

157
lib/retrofit/retrofit_api.g.dart

@ -1531,4 +1531,161 @@ class _ApiService implements ApiService {
return value; return value;
} }
@override
Future<BaseData<List<VipBadgesList>>> findBadges(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/app-memberAchievement/findBadges',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<VipBadgesList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<VipBadgesList>((i) => VipBadgesList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<List<AchievementDetailList>>> getAchievementDetail(achievementCategoryId) async {
ArgumentError.checkNotNull(achievementCategoryId, 'achievementCategoryId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/app-memberAchievement/getAchievementDetail?achievementCategoryId=$achievementCategoryId',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<AchievementDetailList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<AchievementDetailList>((i) => AchievementDetailList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<List<VipBenefitList>>> benefitList() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/member/benefitList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<VipBenefitList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<VipBenefitList>((i) => VipBenefitList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<VipRuleDetails>> vipBenefit() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/home/vipBenefit',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<VipRuleDetails>.fromJson(
_result.data,
(json) => VipRuleDetails.fromJson(json),
);
return value;
}
@override
Future<BaseData<List<SecondCardList>>> secondCardList() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/member/secondCardList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<SecondCardList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<SecondCardList>((i) => SecondCardList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<dynamic>> bindSecondCard(phone) async {
ArgumentError.checkNotNull(phone, 'phone');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/member/bindSecondCard/$phone',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
@override
Future<BaseData<dynamic>> unbindSecondCard(phone) async {
ArgumentError.checkNotNull(phone, 'phone');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/member/unbindSecondCard/$phone',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
} }

5
lib/store/store_order.dart

@ -243,7 +243,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
child: Container( child: Container(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
margin: EdgeInsets.only(left: 10), margin: EdgeInsets.only(left: 10),
padding: EdgeInsets.all(6), padding: EdgeInsets.all(10),
child: Icon( child: Icon(
Icons.arrow_back_ios, Icons.arrow_back_ios,
color: Colors.black, color: Colors.black,
@ -254,8 +254,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
flexibleSpace: FlexibleSpaceBar( flexibleSpace: FlexibleSpaceBar(
title: Title( title: Title(
controller, controller,
storeInfo != null ? storeInfo.storeName : '', storeInfo != null ? storeInfo.storeName : ''),
),
collapseMode: CollapseMode.pin, collapseMode: CollapseMode.pin,
stretchModes: [ stretchModes: [
StretchMode.zoomBackground, StretchMode.zoomBackground,

44
lib/view_widget/mine_vip_view.dart

@ -122,7 +122,7 @@ class MineVipView extends StatelessWidget {
: EdgeInsets.fromLTRB(padding.w, 16.h, padding.w, 0), : EdgeInsets.fromLTRB(padding.w, 16.h, padding.w, 0),
width: MediaQuery.of(context).size.width - 32.w, width: MediaQuery.of(context).size.width - 32.w,
height: ((MediaQuery.of(context).size.width - 32.w) / height: ((MediaQuery.of(context).size.width - 32.w) /
(isUserVip ? 1.88 : 2.3) * (isUserVip ? 1.88 : 1.90) *
AppUtils.textScale(context)), AppUtils.textScale(context)),
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( gradient: LinearGradient(
@ -267,28 +267,28 @@ class MineVipView extends StatelessWidget {
), ),
), ),
// if (isUserVip) // if (isUserVip)
Row( Expanded(child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( Text(
S.of(context).kaitongriqi( S.of(context).kaitongriqi(
(createTime != null && createTime != "") (createTime != null && createTime != "")
? createTime.split(" ")[0] ? createTime.split(" ")[0]
: "$createTime"), : "$createTime"),
style: TextStyle( style: TextStyle(
color: textColor, color: textColor,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
fontSize: 12.sp, fontSize: 12.sp,
),
),
Icon(
Icons.qr_code,
size: 24,
color:textColor,
), ),
], ),
), Icon(
Icons.qr_code,
size: 24,
color:textColor,
),
],
),),
], ],
), ),
), ),

96
lib/view_widget/vip_dialog.dart

@ -4,6 +4,8 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class VipDialog extends StatelessWidget { class VipDialog extends StatelessWidget {
int listCount = 9;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SimpleDialog( return SimpleDialog(
@ -22,9 +24,7 @@ class VipDialog extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(8),), borderRadius: BorderRadius.circular(8),),
child:SingleChildScrollView( child:Column(
physics: BouncingScrollPhysics(),
child: Column(
children: [ children: [
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -46,51 +46,49 @@ class VipDialog extends StatelessWidget {
), ),
), ),
), ),
Padding(
padding: EdgeInsets.only(top:16.h, bottom: 19.h),
child: Text(
S.of(context).huodequanyi,
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight:MyFontWeight.medium,
),
),
),
Container(
width: MediaQuery.of(context).size.width,
height: (((listCount~/3+(listCount%3>0?1:0))*90.h) >
MediaQuery.of(context).size.height/2 ?
MediaQuery.of(context).size.height/2 :
((listCount~/3+(listCount%3>0?1:0))*90.h)).toDouble(),child:vipUpgrade()),
Container( Container(
child: Column( margin: EdgeInsets.only(left: 32,right: 32,bottom: 20),
children: [ decoration: BoxDecoration(
Padding( gradient: new LinearGradient(
padding: EdgeInsets.only(top:16.h, bottom: 19.h), begin: Alignment.centerLeft,
child: Text( end: Alignment.centerRight,
S.of(context).huodequanyi, colors: [
style: TextStyle( Color(0xFFFFDCA1),
color: Colors.black, Color(0xFFFAE4C0),
fontSize: 14.sp, ]),
fontWeight:MyFontWeight.medium, borderRadius: BorderRadius.circular(22.5),
), ),
), width: MediaQuery.of(context).size.width,
), height: 40,
// vipUpgrade(), alignment: Alignment.center,
Container( child: Text(
margin: EdgeInsets.only(left: 32,right: 32,bottom: 20), S.of(context).chakanquanyi,
decoration: BoxDecoration( style: TextStyle(
gradient: new LinearGradient( fontWeight: FontWeight.bold,
begin: Alignment.centerLeft, fontSize: 16.sp,
end: Alignment.centerRight, color: Color(0xFF4A4748),
colors: [ ),
Color(0xFFFFDCA1),
Color(0xFFFAE4C0),
]),
borderRadius: BorderRadius.circular(22.5),
),
width: MediaQuery.of(context).size.width,
height: 40,
alignment: Alignment.center,
child: Text(
S.of(context).chakanquanyi,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16.sp,
color: Color(0xFF4A4748),
),
),
),
],
), ),
), ),
], ],
), ),
),
), ),
Image.asset( Image.asset(
"assets/image/vip_yk.png", "assets/image/vip_yk.png",
@ -107,22 +105,22 @@ class VipDialog extends StatelessWidget {
/// ///
Widget vipUpgrade() { Widget vipUpgrade() {
return GridView.builder( return GridView.builder(
itemCount:9, itemCount:listCount,
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: BouncingScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
//Widget数量 //Widget数量
crossAxisCount:3, crossAxisCount:3,
//Widget之间间距 //Widget之间间距
crossAxisSpacing:10, crossAxisSpacing:0,
//Widget之间间距 //Widget之间间距
mainAxisSpacing: 10, mainAxisSpacing: 0,
childAspectRatio: 1.5,
), ),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
Navigator.of(context) // Navigator.of(context).pushNamed('/router/legal_right_details', arguments: {});
.pushNamed('/router/legal_right_details', arguments: {});
}, },
child: vipUpgradeItem(), child: vipUpgradeItem(),
); );

Loading…
Cancel
Save