| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- import 'package:bbyyy/beans/my_shop_bean_entity.dart';
- import 'package:bbyyy/https/MyDio.dart';
- import 'package:bbyyy/https/url.dart';
- import 'package:bbyyy/my_tools/my_colors.dart';
- import 'package:bbyyy/my_tools/my_tools.dart';
- import 'package:bbyyy/my_tools/my_views.dart';
- import 'package:flutter/material.dart';
- class ApplicationDetailsPage extends StatefulWidget {
- MyShopBeanDataData data;
- ApplicationDetailsPage(this.data);
- @override
- _ApplicationDetailsPageState createState() =>
- _ApplicationDetailsPageState(data);
- }
- class _ApplicationDetailsPageState extends State<ApplicationDetailsPage> {
- MyShopBeanDataData data;
- _ApplicationDetailsPageState(this.data);
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: Column(
- children: [
- MyViews().myAppBar('申请详情', context, []),
- Expanded(
- child: Column(
- children: [
- Stack(
- children: [
- Image.asset(
- 'images/bang_set_bg.png',
- width: MediaQuery.of(context).size.width,
- height: MediaQuery.of(context).size.width / 750 * 336,
- ),
- Container(
- height: MediaQuery.of(context).size.width / 750 * 336,
- child: Column(
- children: [
- Container(
- margin: EdgeInsets.only(bottom: 14),
- child: ClipRRect(
- child: MyViews()
- .netImg(imgURL(data.userPic), 60, 60),
- borderRadius: BorderRadius.circular(30),
- ),
- ),
- MyViews().myText(data.userName, MyColors.c333333, 15),
- ],
- mainAxisAlignment: MainAxisAlignment.center,
- ),
- alignment: Alignment.center,
- ),
- ],
- ),
- Container(
- color: Colors.white,
- child: Row(
- children: [
- MyViews().myText('申请入帮', MyColors.c333333, 15),
- Expanded(
- child: Row(
- children: [
- Container(
- margin: EdgeInsets.only(right: 4),
- child: ClipRRect(
- child: MyViews()
- .netImg(imgURL(data.shopPic), 25, 25),
- borderRadius: BorderRadius.circular(12.5),
- ),
- ),
- MyViews()
- .myText(data.shopName, MyColors.c666666, 15),
- ],
- mainAxisAlignment: MainAxisAlignment.end,
- ),
- ),
- ],
- ),
- padding: EdgeInsets.symmetric(vertical: 17, horizontal: 15),
- alignment: Alignment.center,
- ),
- // Container(
- // margin: EdgeInsets.only(top: 7),
- // color: Colors.white,
- // child: MyViews().myText('帮主拒绝你的申请', MyColors.c333333, 15),
- // padding: EdgeInsets.symmetric(vertical: 17),
- // alignment: Alignment.center,
- // ),
- Container(
- color: Colors.white,
- child: Column(
- children: [
- GestureDetector(
- child: Container(
- child: MyViews().myText('通过申请', MyColors.cFF4233, 15),
- padding: EdgeInsets.symmetric(vertical: 17),
- ),
- behavior: HitTestBehavior.translucent,
- onTap: () {
- approvalOfApplications(true);
- },
- ),
- Container(
- height: 0.5,
- color: MyColors.cF7F7F7,
- margin: EdgeInsets.symmetric(horizontal: 15),
- ),
- GestureDetector(
- child: Container(
- child: MyViews().myText('拒绝申请', MyColors.cFF4233, 15),
- padding: EdgeInsets.symmetric(vertical: 17),
- ),
- behavior: HitTestBehavior.translucent,
- onTap: () {
- approvalOfApplications(false);
- },
- ),
- ],
- ),
- alignment: Alignment.center,
- margin: EdgeInsets.only(top: 7),
- ),
- ],
- ),
- ),
- ],
- ),
- );
- }
- approvalOfApplications(bool isAgree) {
- MyDio().update({
- "key": "shop_user",
- "values": {
- "review_state": isAgree ? 1 : 2,
- // "shop_uid": data.shopUid,
- // "user_uid": data.userUid,
- "id": data.id
- }
- }, (response, hasError) {
- if(!hasError){
- showToast(isAgree?'同意申请':'驳回申请');
- Navigator.pop(context);
- }
- }, (error) {});
- }
- }
|