finance_main_view.dart
4.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../common/colors.dart';
import 'finance_main_logic.dart';
class Finance_mainPage extends GetView<Finance_mainLogic> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('票务'),
centerTitle: true,
backgroundColor: ColorConfig.themeColor,
),
body: Container(
alignment: Alignment.topLeft,
child: ListView.builder(
itemBuilder: (item, index) {
var item2 = controller.list[index];
return Container(
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12),
decoration: const BoxDecoration(
color: ColorConfig.white,
border: Border(bottom: BorderSide(color: ColorConfig.colorF2F2F2, width: 5, style: BorderStyle.solid))
),
child: InkWell(
child: Row(
children: [
Expanded(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
text: item2['name'] as String,
style: TextStyle(color: ColorConfig.color33, fontWeight: FontWeight.bold, fontSize: 15),
children: [
const WidgetSpan(child: SizedBox(width: 5,)),
item2['type'] == 1 ? WidgetSpan(
child: Container(
width: 18,
height: 18,
alignment: Alignment.center,
decoration: BoxDecoration(
color: ColorConfig.red,
borderRadius: BorderRadius.all(Radius.circular(9))
),
child: Text('急', style: TextStyle(color: ColorConfig.white, fontSize: 8),),
),
alignment: PlaceholderAlignment.middle
) : const WidgetSpan(child: SizedBox())
]
)
),
_buildType(item2['type'])
],
),
const SizedBox(height: 5,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("5串1 20倍 3000.00元", style: TextStyle(color: ColorConfig.themeColor),),
Text("体育西路店")
],
)
],
)
),
const Icon(Icons.keyboard_arrow_right, size: 30, color: ColorConfig.color99,)
],
),
onTap: () {
controller.jumpToScheme();
},
),
);
},
itemCount: controller.list.length,
),
)
);
}
Text _buildType(type) {
var txt;
if(type == 1) {
txt = '等待出票';
} else if(type == 2) {
txt = '等待兑奖';
} else if(type == 3) {
txt = '等待开奖';
} else {
txt = '其他状态';
}
return Text(
txt,
style: TextStyle(color: ColorConfig.color548DEE, fontSize: 15),
);
}
}