video_pay.dart 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. import 'package:flutter/material.dart';
  2. import 'package:liftmanager/res/gaps.dart';
  3. import 'package:liftmanager/net/api_service.dart';
  4. import 'package:liftmanager/utils/toast.dart';
  5. import 'package:liftmanager/widgets/app_bar.dart';
  6. import 'package:liftmanager/internal/search/search_router.dart';
  7. import 'package:liftmanager/widgets/app_search_bar.dart';
  8. import 'package:liftmanager/res/resources.dart';
  9. import 'package:liftmanager/routers/fluro_navigator.dart';
  10. import 'package:liftmanager/widgets/load_image.dart';
  11. import 'package:liftmanager/internal/bbs/bbs_router.dart';
  12. import 'package:flutter_screenutil/flutter_screenutil.dart';
  13. class VideoPay extends StatefulWidget {
  14. VideoPay(this.pay);
  15. final String pay;
  16. @override
  17. State<StatefulWidget> createState() {
  18. return VideoPayState();
  19. }
  20. }
  21. class VideoPayState extends State<VideoPay> {
  22. // ExpertListState({Key key}) : super(key: key);
  23. static const payType = [
  24. {
  25. "icon":"tab_first/pay_yue",
  26. "title":"账户余额支付",
  27. "price":"",
  28. },
  29. {
  30. "icon":"tab_first/pay_zhifubao",
  31. "title":"支付宝支付",
  32. },
  33. {
  34. "icon":"tab_first/pay_winxin",
  35. "title":"微信支付",
  36. },
  37. ];
  38. int indexNow = 999;
  39. String checkFalse = "tab_first/check_false";
  40. String checkTrue = "tab_first/check_true";
  41. @override
  42. Widget build(BuildContext context) {
  43. double width = MediaQuery.of(context).size.width;
  44. double height = MediaQuery.of(context).size.height;
  45. return Container(
  46. child: Scaffold(
  47. appBar: MyAppBar(
  48. centerTitle: "打赏",
  49. ),
  50. body:Container(
  51. child: Stack(
  52. children: <Widget>[
  53. Container(
  54. // padding: EdgeInsets.only(top:70),
  55. child:ListView(
  56. children:<Widget>[
  57. Container(
  58. padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(15),bottom:ScreenUtil().setWidth(15)),
  59. decoration: BoxDecoration(
  60. border: Border(
  61. bottom: BorderSide(width: 5, color:Color(0xfff5f5f5)),
  62. ),
  63. ),
  64. child:Row(
  65. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  66. children:<Widget>[
  67. Row(
  68. crossAxisAlignment: CrossAxisAlignment.center,
  69. children:<Widget>[
  70. Text(
  71. "学堂打赏",
  72. style: TextStyle(
  73. color:Color(0xff333333),
  74. fontSize:ScreenUtil().setSp(16)
  75. ),
  76. textAlign:TextAlign.start,
  77. ),
  78. Container(
  79. padding: EdgeInsets.only(left:ScreenUtil().setWidth(10)),
  80. child:Text(
  81. "小小维修工",
  82. style: TextStyle(
  83. color:Color(0xff666666),
  84. fontSize:ScreenUtil().setSp(16)
  85. ),
  86. textAlign:TextAlign.start,
  87. ),
  88. )
  89. ]
  90. ),
  91. Container(
  92. child:Text(
  93. "¥${widget.pay}",
  94. style: TextStyle(
  95. color:Colors.red,
  96. fontSize:ScreenUtil().setSp(16)
  97. ),
  98. textAlign:TextAlign.end,
  99. ),
  100. )
  101. ]
  102. )
  103. ),
  104. Container(
  105. padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(15),bottom:ScreenUtil().setWidth(15)),
  106. decoration: BoxDecoration(
  107. border: Border(
  108. bottom: BorderSide(width: 5, color:Color(0xfff5f5f5)),
  109. ),
  110. ),
  111. child: Row(
  112. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  113. children:<Widget>[
  114. Text(
  115. "共需支付",
  116. style: TextStyle(
  117. color:Color(0xff222222),
  118. fontSize:ScreenUtil().setSp(16)
  119. ),
  120. textAlign:TextAlign.start,
  121. ),
  122. Text(
  123. "¥${widget.pay}",
  124. style: TextStyle(
  125. color:Colors.red,
  126. fontSize:ScreenUtil().setSp(16)
  127. ),
  128. textAlign:TextAlign.start,
  129. ),
  130. ]
  131. ),
  132. ),
  133. Container(
  134. padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(100),bottom:ScreenUtil().setWidth(10)),
  135. decoration: BoxDecoration(
  136. border: Border(
  137. bottom: BorderSide(width: 0.5, color:Color(0xfff5f5f5)),
  138. ),
  139. ),
  140. child: Row(
  141. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  142. children:<Widget>[
  143. Text(
  144. "选择支付方式",
  145. style: TextStyle(
  146. color:Color(0xff000000),
  147. fontSize:ScreenUtil().setSp(16)
  148. ),
  149. textAlign:TextAlign.start,
  150. ),
  151. ]
  152. ),
  153. ),
  154. Container(
  155. padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),right:ScreenUtil().setWidth(15)),
  156. child:Column(
  157. children: payType.asMap().keys.map((i){
  158. return Container(
  159. decoration: BoxDecoration(
  160. border: Border(
  161. bottom: BorderSide(width: 0.5, color:Color(0xfff5f5f5)),
  162. ),
  163. ),
  164. height:60,
  165. child:Row(
  166. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  167. children:<Widget>[
  168. Row(
  169. children: <Widget>[
  170. LoadAssetImage(
  171. // image: AssetImage(i['img']),
  172. payType[i]["icon"],
  173. width: ScreenUtil().setWidth(26),
  174. height:ScreenUtil().setWidth(26),
  175. // alignment: Alignment.centerLeft,
  176. ),
  177. Container(
  178. width:5,
  179. child:null
  180. ),
  181. Text(
  182. payType[i]["title"],
  183. style: TextStyle(
  184. color:Color(0xff000000),
  185. fontSize:ScreenUtil().setSp(16)
  186. ),
  187. textAlign:TextAlign.start,
  188. ),
  189. Container(
  190. width:5,
  191. child:null
  192. ),
  193. Text(
  194. payType[i]["price"] != null?"¥${payType[i]["price"]}":"",
  195. style: TextStyle(
  196. color:Color(0xff999999),
  197. fontSize:ScreenUtil().setSp(16)
  198. ),
  199. textAlign:TextAlign.start,
  200. ),
  201. ],
  202. ),
  203. InkWell(
  204. child: Container(
  205. // padding: EdgeInsets.only(top:10,left:5,right:5,bottom:10),
  206. child: LoadAssetImage(
  207. // image: AssetImage(i['img']),
  208. indexNow == i?checkTrue:checkFalse,
  209. width: ScreenUtil().setWidth(20),
  210. height:ScreenUtil().setWidth(20),
  211. // alignment: Alignment.centerLeft,
  212. ),
  213. ),
  214. onTap: (){
  215. setState(() {
  216. indexNow = i;
  217. });
  218. print(indexNow);
  219. },
  220. ),
  221. ]
  222. )
  223. );
  224. }).toList(),
  225. )
  226. )
  227. ]
  228. ),
  229. ),
  230. Positioned(
  231. bottom:0,
  232. left:0,
  233. child:Container(
  234. width: width,
  235. padding: EdgeInsets.only(top:ScreenUtil().setWidth(15),bottom:ScreenUtil().setWidth(15),left:ScreenUtil().setWidth(25),right:ScreenUtil().setWidth(25)),
  236. color:Colors.white,
  237. child: Container(
  238. height:ScreenUtil().setWidth(44),
  239. decoration: BoxDecoration(
  240. borderRadius: BorderRadius.circular(ScreenUtil().setWidth(22)),
  241. gradient: const LinearGradient(
  242. colors: [Color(0xFF00D9FF), Color(0xFF0287FF)]),
  243. ),
  244. child: FlatButton(
  245. // padding: EdgeInsets.all(15.0),
  246. child: Text("立即支付"),
  247. textColor: Colors.white,
  248. onPressed: () {
  249. toasts("支付成功");
  250. Navigator.pop(context);
  251. },
  252. ),
  253. ),
  254. )
  255. )
  256. ],
  257. )
  258. )
  259. ),
  260. );
  261. }
  262. }