promotion.dart 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. import 'package:flutter/material.dart';
  2. import 'package:twong/config/style.dart';
  3. import 'package:twong/router/base.dart';
  4. import 'package:twong/utils/index.dart';
  5. import 'package:twong/widgets/app_bar.dart';
  6. class PromotionPage extends StatefulWidget {
  7. @override
  8. State<StatefulWidget> createState() {
  9. return _PromotionState();
  10. }
  11. }
  12. class _PromotionState extends State<PromotionPage> {
  13. @override
  14. Widget build(BuildContext context) {
  15. return Scaffold(
  16. backgroundColor: DColors.back,
  17. appBar: DAppBar("推广中心", actions: [
  18. InkWell(
  19. onTap: () => Navigator.pushNamed(context, RouteNames.cashRecord),
  20. child: Container(
  21. alignment: Alignment.center,
  22. margin: EdgeInsets.only(right: 12.px),
  23. child: Text("提现记录", style: TextStyle(color: Colors.white)),
  24. ),
  25. )
  26. ]),
  27. body: SafeArea(
  28. child: Container(
  29. child: ListView(
  30. physics: ClampingScrollPhysics(),
  31. children: [
  32. Container(
  33. height: MediaQuery.of(context).size.height,
  34. child: Stack(
  35. alignment: Alignment.center,
  36. children: [
  37. Positioned(child: _buildHeader(), top: 0),
  38. Positioned(child: Container(
  39. width: 120.px,
  40. decoration: BoxDecoration(
  41. color: DColors.back,
  42. borderRadius: BorderRadius.circular(30.px)
  43. ),
  44. padding: EdgeInsets.only(left: 9.px, right: 9.px),
  45. child: FlatButton(
  46. onPressed: () {
  47. Navigator.pushNamed(context, RouteNames.cashDraw);
  48. },
  49. color: DColors.Main,
  50. shape: StadiumBorder(),
  51. child: Text("立即提现", style: TextStyle(color: Colors.white)),
  52. ),
  53. ), top: 126.px),
  54. Positioned(child: Container(
  55. width: MediaQuery.of(context).size.width,
  56. child: _buildMenus(),
  57. ), top: 160.px, left: 0)
  58. ],
  59. ),
  60. ),
  61. ],
  62. ),
  63. )
  64. ),
  65. );
  66. }
  67. Widget _buildHeader() {
  68. return Container(
  69. color: DColors.Main,
  70. height: 146.px,
  71. width: MediaQuery.of(context).size.width,
  72. padding: EdgeInsets.only(left: 12.px, right: 12.px, top: 12.px),
  73. child: Column(
  74. children: [
  75. Container(
  76. child: Column(
  77. children: [
  78. Text("当前佣金", style: TextStyle(color: Colors.white)),
  79. Text(Utils.formatRMB(Cache.user.brokerage_price), style:
  80. TextStyle(fontSize: 36.px, color: Colors.white))
  81. ],
  82. ),
  83. ),
  84. Spacer(),
  85. Container(
  86. margin: EdgeInsets.only(bottom: 6.px),
  87. child: Row(
  88. children: [
  89. Column(
  90. children: [
  91. Text("昨日收益", style: TextStyle(color: Colors.white)),
  92. Text("0.00", style: TextStyle(color: Colors.white)),
  93. ],
  94. ),
  95. Spacer(),
  96. Column(
  97. children: [
  98. Text("累计提现", style: TextStyle(color: Colors.white)),
  99. Text("0.00", style: TextStyle(color: Colors.white)),
  100. ],
  101. ),
  102. ],
  103. ),
  104. )
  105. ],
  106. ),
  107. );
  108. }
  109. Widget _buildMenus() {
  110. return Container(
  111. margin: EdgeInsets.only(left: 12.px, right: 12.px, top: 12.px),
  112. child: Column(
  113. children: [
  114. Row(
  115. children: [
  116. Expanded(child: InkWell(
  117. onTap: () {
  118. Navigator.pushNamed(context, RouteNames.promotionPoster);
  119. },
  120. child: Container(
  121. height: 86.px,
  122. padding: EdgeInsets.all(6.px),
  123. margin: EdgeInsets.only(right: 6.px, bottom: 12.px),
  124. decoration: BoxDecoration(
  125. color: Colors.white,
  126. borderRadius: BorderRadius.circular(6.px)
  127. ),
  128. child: Column(
  129. children: [
  130. Icon(Icons.padding),
  131. Text("推广名片")
  132. ],
  133. )
  134. ),
  135. )),
  136. Expanded(child: InkWell(
  137. onTap: () {
  138. Navigator.pushNamed(context, RouteNames.promotionSpread);
  139. },
  140. child: Container(
  141. height: 86.px,
  142. padding: EdgeInsets.all(6.px),
  143. margin: EdgeInsets.only(left: 6.px, bottom: 12.px),
  144. decoration: BoxDecoration(
  145. color: Colors.white,
  146. borderRadius: BorderRadius.circular(6.px)
  147. ),
  148. child: Column(
  149. children: [
  150. Icon(Icons.padding),
  151. Text("推广人统计")
  152. ],
  153. )
  154. ),
  155. )),
  156. ],
  157. ),
  158. Row(
  159. children: [
  160. Expanded(child: InkWell(
  161. onTap: () {
  162. Navigator.pushNamed(context, RouteNames.promotionRecord);
  163. },
  164. child: Container(
  165. height: 86.px,
  166. padding: EdgeInsets.all(6.px),
  167. margin: EdgeInsets.only(right: 6.px),
  168. decoration: BoxDecoration(
  169. color: Colors.white,
  170. borderRadius: BorderRadius.circular(6.px)
  171. ),
  172. child: Column(
  173. children: [
  174. Icon(Icons.padding),
  175. Text("佣金记录")
  176. ],
  177. )
  178. ),
  179. )),
  180. Expanded(child: InkWell(
  181. onTap: () {
  182. Navigator.pushNamed(context, RouteNames.promotionOrder);
  183. },
  184. child: Container(
  185. height: 86.px,
  186. padding: EdgeInsets.all(6.px),
  187. margin: EdgeInsets.only(left: 6.px),
  188. decoration: BoxDecoration(
  189. color: Colors.white,
  190. borderRadius: BorderRadius.circular(6.px)
  191. ),
  192. child: Column(
  193. children: [
  194. Icon(Icons.padding),
  195. Text("推广人订单")
  196. ],
  197. )
  198. ),
  199. )),
  200. ],
  201. )
  202. ],
  203. ),
  204. );
  205. }
  206. }