application_details_page.dart 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. import 'package:bbyyy/beans/my_shop_bean_entity.dart';
  2. import 'package:bbyyy/https/MyDio.dart';
  3. import 'package:bbyyy/https/url.dart';
  4. import 'package:bbyyy/my_tools/my_colors.dart';
  5. import 'package:bbyyy/my_tools/my_tools.dart';
  6. import 'package:bbyyy/my_tools/my_views.dart';
  7. import 'package:flutter/material.dart';
  8. class ApplicationDetailsPage extends StatefulWidget {
  9. MyShopBeanDataData data;
  10. ApplicationDetailsPage(this.data);
  11. @override
  12. _ApplicationDetailsPageState createState() =>
  13. _ApplicationDetailsPageState(data);
  14. }
  15. class _ApplicationDetailsPageState extends State<ApplicationDetailsPage> {
  16. MyShopBeanDataData data;
  17. _ApplicationDetailsPageState(this.data);
  18. @override
  19. Widget build(BuildContext context) {
  20. return Scaffold(
  21. body: Column(
  22. children: [
  23. MyViews().myAppBar('申请详情', context, []),
  24. Expanded(
  25. child: Column(
  26. children: [
  27. Stack(
  28. children: [
  29. Image.asset(
  30. 'images/bang_set_bg.png',
  31. width: MediaQuery.of(context).size.width,
  32. height: MediaQuery.of(context).size.width / 750 * 336,
  33. ),
  34. Container(
  35. height: MediaQuery.of(context).size.width / 750 * 336,
  36. child: Column(
  37. children: [
  38. Container(
  39. margin: EdgeInsets.only(bottom: 14),
  40. child: ClipRRect(
  41. child: MyViews()
  42. .netImg(imgURL(data.userPic), 60, 60),
  43. borderRadius: BorderRadius.circular(30),
  44. ),
  45. ),
  46. MyViews().myText(data.userName, MyColors.c333333, 15),
  47. ],
  48. mainAxisAlignment: MainAxisAlignment.center,
  49. ),
  50. alignment: Alignment.center,
  51. ),
  52. ],
  53. ),
  54. Container(
  55. color: Colors.white,
  56. child: Row(
  57. children: [
  58. MyViews().myText('申请入帮', MyColors.c333333, 15),
  59. Expanded(
  60. child: Row(
  61. children: [
  62. Container(
  63. margin: EdgeInsets.only(right: 4),
  64. child: ClipRRect(
  65. child: MyViews()
  66. .netImg(imgURL(data.shopPic), 25, 25),
  67. borderRadius: BorderRadius.circular(12.5),
  68. ),
  69. ),
  70. MyViews()
  71. .myText(data.shopName, MyColors.c666666, 15),
  72. ],
  73. mainAxisAlignment: MainAxisAlignment.end,
  74. ),
  75. ),
  76. ],
  77. ),
  78. padding: EdgeInsets.symmetric(vertical: 17, horizontal: 15),
  79. alignment: Alignment.center,
  80. ),
  81. // Container(
  82. // margin: EdgeInsets.only(top: 7),
  83. // color: Colors.white,
  84. // child: MyViews().myText('帮主拒绝你的申请', MyColors.c333333, 15),
  85. // padding: EdgeInsets.symmetric(vertical: 17),
  86. // alignment: Alignment.center,
  87. // ),
  88. Container(
  89. color: Colors.white,
  90. child: Column(
  91. children: [
  92. GestureDetector(
  93. child: Container(
  94. child: MyViews().myText('通过申请', MyColors.cFF4233, 15),
  95. padding: EdgeInsets.symmetric(vertical: 17),
  96. ),
  97. behavior: HitTestBehavior.translucent,
  98. onTap: () {
  99. approvalOfApplications(true);
  100. },
  101. ),
  102. Container(
  103. height: 0.5,
  104. color: MyColors.cF7F7F7,
  105. margin: EdgeInsets.symmetric(horizontal: 15),
  106. ),
  107. GestureDetector(
  108. child: Container(
  109. child: MyViews().myText('拒绝申请', MyColors.cFF4233, 15),
  110. padding: EdgeInsets.symmetric(vertical: 17),
  111. ),
  112. behavior: HitTestBehavior.translucent,
  113. onTap: () {
  114. approvalOfApplications(false);
  115. },
  116. ),
  117. ],
  118. ),
  119. alignment: Alignment.center,
  120. margin: EdgeInsets.only(top: 7),
  121. ),
  122. ],
  123. ),
  124. ),
  125. ],
  126. ),
  127. );
  128. }
  129. approvalOfApplications(bool isAgree) {
  130. MyDio().update({
  131. "key": "shop_user",
  132. "values": {
  133. "review_state": isAgree ? 1 : 2,
  134. // "shop_uid": data.shopUid,
  135. // "user_uid": data.userUid,
  136. "id": data.id
  137. }
  138. }, (response, hasError) {
  139. if(!hasError){
  140. showToast(isAgree?'同意申请':'驳回申请');
  141. Navigator.pop(context);
  142. }
  143. }, (error) {});
  144. }
  145. }