buy_service.dart 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  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. import 'package:liftmanager/widgets/bbs_content.dart';
  14. class BuyServiceMaster extends StatefulWidget {
  15. // BuyService(this.id);
  16. // final String id;
  17. @override
  18. State<StatefulWidget> createState() {
  19. return BuyServiceMasterState();
  20. }
  21. }
  22. class BuyServiceMasterState extends State<BuyServiceMaster> {
  23. // ExpertListState({Key key}) : super(key: key);
  24. static const payType = [
  25. {
  26. "icon":"tab_first/pay_yue",
  27. "title":"账户余额支付",
  28. "price":"",
  29. },
  30. {
  31. "icon":"tab_first/pay_zhifubao",
  32. "title":"支付宝支付",
  33. },
  34. {
  35. "icon":"tab_first/pay_winxin",
  36. "title":"微信支付",
  37. },
  38. ];
  39. List<String> labelList = ["特邀专家","回复及时"];
  40. List<String> sortListChiose = [
  41. "综合排序",
  42. "咨询人数",
  43. "评论星级",
  44. "回复速度",
  45. ];
  46. String quanChiose = "";
  47. List<String> quanListChiose = ['quan1','quan2'];
  48. String redChiose = "";
  49. List<String> redListChiose = ['red1','red2'];
  50. int indexNow = 999;
  51. String checkFalse = "tab_first/check_false";
  52. String checkTrue = "tab_first/check_true";
  53. @override
  54. Widget build(BuildContext context) {
  55. double width = MediaQuery.of(context).size.width;
  56. double height = MediaQuery.of(context).size.height;
  57. return Container(
  58. child: Scaffold(
  59. resizeToAvoidBottomPadding: false,
  60. appBar: MyAppBar(
  61. centerTitle: "购买服务",
  62. ),
  63. body:Container(
  64. child: Stack(
  65. children: <Widget>[
  66. Container(
  67. // padding: EdgeInsets.only(top:70),
  68. child:ListView(
  69. children:<Widget>[
  70. Container(
  71. padding: EdgeInsets.all(ScreenUtil().setWidth(15)),
  72. decoration: BoxDecoration(
  73. border: Border(
  74. bottom: BorderSide(width: 5, color:Color(0xfff5f5f5)),
  75. ),
  76. ),
  77. child:Row(
  78. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  79. children:<Widget>[
  80. Row(
  81. crossAxisAlignment: CrossAxisAlignment.center,
  82. children:<Widget>[
  83. Text(
  84. "问诊服务",
  85. style: TextStyle(
  86. color:Color(0xff333333),
  87. fontSize:ScreenUtil().setSp(16)
  88. ),
  89. textAlign:TextAlign.start,
  90. ),
  91. Container(
  92. padding: EdgeInsets.only(left:ScreenUtil().setWidth(10)),
  93. child:Text(
  94. "张涛",
  95. style: TextStyle(
  96. color:Color(0xff666666),
  97. fontSize:ScreenUtil().setSp(16)
  98. ),
  99. textAlign:TextAlign.start,
  100. ),
  101. )
  102. ]
  103. ),
  104. Container(
  105. child:Text(
  106. "¥20",
  107. style: TextStyle(
  108. color:Colors.red,
  109. fontSize:ScreenUtil().setSp(16)
  110. ),
  111. textAlign:TextAlign.end,
  112. ),
  113. )
  114. ]
  115. )
  116. ),
  117. ChioseThis(list: quanListChiose,label: "优惠券",labelText: '无可用优惠券',value:quanChiose,fun:(index){
  118. setState(() {
  119. quanChiose = quanListChiose[index];
  120. });
  121. Navigator.maybePop(context);
  122. }),
  123. ChioseThis(list: redListChiose,label: "红包",labelText: '无可用红包',value:redChiose,fun:(index){
  124. setState(() {
  125. redChiose = redListChiose[index];
  126. });
  127. Navigator.maybePop(context);
  128. }),
  129. Container(
  130. padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
  131. decoration: BoxDecoration(
  132. border: Border(
  133. bottom: BorderSide(width: 5, color:Color(0xfff5f5f5)),
  134. ),
  135. ),
  136. child: Row(
  137. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  138. children:<Widget>[
  139. Text(
  140. "共需支付",
  141. style: TextStyle(
  142. color:Color(0xff222222),
  143. fontSize:ScreenUtil().setSp(14)
  144. ),
  145. textAlign:TextAlign.start,
  146. ),
  147. Text(
  148. "¥20",
  149. style: TextStyle(
  150. color:Colors.red,
  151. fontSize:ScreenUtil().setSp(14)
  152. ),
  153. textAlign:TextAlign.start,
  154. ),
  155. ]
  156. ),
  157. ),
  158. Container(
  159. padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
  160. decoration: BoxDecoration(
  161. border: Border(
  162. bottom: BorderSide(width: 0.5, color:Color(0xfff5f5f5)),
  163. ),
  164. ),
  165. child: Row(
  166. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  167. children:<Widget>[
  168. Text(
  169. "选择支付方式",
  170. style: TextStyle(
  171. color:Color(0xff000000),
  172. fontSize:ScreenUtil().setSp(16)
  173. ),
  174. textAlign:TextAlign.start,
  175. ),
  176. ]
  177. ),
  178. ),
  179. Container(
  180. padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),right:ScreenUtil().setWidth(15)),
  181. child:Column(
  182. children: payType.asMap().keys.map((i){
  183. return Container(
  184. decoration: BoxDecoration(
  185. border: Border(
  186. bottom: BorderSide(width: 0.5, color:Color(0xfff5f5f5)),
  187. ),
  188. ),
  189. height:60,
  190. child:Row(
  191. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  192. children:<Widget>[
  193. Row(
  194. children: <Widget>[
  195. LoadAssetImage(
  196. // image: AssetImage(i['img']),
  197. payType[i]["icon"],
  198. width: ScreenUtil().setWidth(20),
  199. height:ScreenUtil().setWidth(20),
  200. // alignment: Alignment.centerLeft,
  201. ),
  202. Container(
  203. width:5,
  204. child:null
  205. ),
  206. Text(
  207. payType[i]["title"],
  208. style: TextStyle(
  209. color:Color(0xff000000),
  210. fontSize:ScreenUtil().setSp(14)
  211. ),
  212. textAlign:TextAlign.start,
  213. ),
  214. Container(
  215. width:5,
  216. child:null
  217. ),
  218. // Text(
  219. // payType[i]["price"] != null?"¥${payType[i]["price"]}":"",
  220. // style: TextStyle(
  221. // color:Color(0xff999999),
  222. // fontSize:ScreenUtil().setSp(16)
  223. // ),
  224. // textAlign:TextAlign.start,
  225. // ),
  226. ],
  227. ),
  228. InkWell(
  229. child: Container(
  230. // padding: EdgeInsets.only(top:10,left:5,right:5,bottom:10),
  231. child: LoadAssetImage(
  232. // image: AssetImage(i['img']),
  233. indexNow == i?checkTrue:checkFalse,
  234. width: ScreenUtil().setWidth(18),
  235. height:ScreenUtil().setWidth(18),
  236. // alignment: Alignment.centerLeft,
  237. ),
  238. ),
  239. onTap: (){
  240. setState(() {
  241. indexNow = i;
  242. });
  243. print(indexNow);
  244. },
  245. ),
  246. ]
  247. )
  248. );
  249. }).toList(),
  250. )
  251. )
  252. ]
  253. ),
  254. ),
  255. Positioned(
  256. bottom:0,
  257. left:0,
  258. child:Container(
  259. width: width,
  260. padding: EdgeInsets.only(top:ScreenUtil().setWidth(15),bottom:ScreenUtil().setWidth(15),left:ScreenUtil().setWidth(25),right:ScreenUtil().setWidth(25)),
  261. color:Colors.white,
  262. child: Container(
  263. height:ScreenUtil().setWidth(44),
  264. decoration: BoxDecoration(
  265. borderRadius: BorderRadius.circular(22.0),
  266. gradient: const LinearGradient(
  267. colors: [Color(0xFF00D9FF), Color(0xFF0287FF)]),
  268. ),
  269. child: FlatButton(
  270. // padding: EdgeInsets.all(15.0),
  271. child: Text("立即购买"),
  272. textColor: Colors.white,
  273. onPressed: () {
  274. NavigatorUtils.push(context, BbsRouter.chatRoom);
  275. },
  276. ),
  277. ),
  278. )
  279. )
  280. ],
  281. )
  282. )
  283. ),
  284. );
  285. }
  286. }