|
|
@@ -1,11 +1,12 @@
|
|
|
import 'dart:convert';
|
|
|
|
|
|
-import 'package:azlistview/azlistview.dart';
|
|
|
import 'package:bbyyy/beans/my_shop_bean_entity.dart';
|
|
|
+import 'package:bbyyy/beans/store_bean_entity.dart';
|
|
|
import 'package:bbyyy/https/MyDio.dart';
|
|
|
import 'package:bbyyy/https/url.dart';
|
|
|
import 'package:bbyyy/my_tools/const.dart';
|
|
|
import 'package:bbyyy/my_tools/dims.dart';
|
|
|
+import 'package:bbyyy/my_tools/easy_loading/easy_loading.dart';
|
|
|
import 'package:bbyyy/my_tools/event_bus.dart';
|
|
|
import 'package:bbyyy/my_tools/my_colors.dart';
|
|
|
import 'package:bbyyy/my_tools/my_cookie.dart';
|
|
|
@@ -323,32 +324,130 @@ class _GangPageState extends State<GangPage>
|
|
|
});
|
|
|
} else {
|
|
|
String s = '';
|
|
|
- if(data.shopState==shopStateArrearage){
|
|
|
+ if (data.shopState == shopStateArrearage) {
|
|
|
s = '欠费';
|
|
|
- }
|
|
|
- else if(data.shopState==shopStateBanned){
|
|
|
+ } else if (data.shopState == shopStateBanned) {
|
|
|
s = '被禁';
|
|
|
- }
|
|
|
- else if(data.shopState==shopStateClosed){
|
|
|
+ } else if (data.shopState == shopStateClosed) {
|
|
|
s = '关闭';
|
|
|
}
|
|
|
- showSimpleDialog('该店铺已$s,请尽快处理', context, (){
|
|
|
- if(data.shopState==shopStateArrearage){
|
|
|
- MyTools().toPage(
|
|
|
- context,
|
|
|
- OrderPage(
|
|
|
- index: 2,
|
|
|
- ), (then) {
|
|
|
- onRefresh();
|
|
|
- });
|
|
|
- }
|
|
|
- else if(data.shopState==shopStateBanned){
|
|
|
- Navigator.pop(context);
|
|
|
- }
|
|
|
- else if(data.shopState==shopStateClosed){
|
|
|
- Navigator.pop(context);
|
|
|
- }
|
|
|
- });
|
|
|
+
|
|
|
+ showDialog(
|
|
|
+ context: context,
|
|
|
+ builder: (BuildContext context) {
|
|
|
+ return Material(
|
|
|
+ color: Colors.black12,
|
|
|
+ child: Center(
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.circular(16),
|
|
|
+ color: Colors.white,
|
|
|
+ ),
|
|
|
+ height: 180,
|
|
|
+ margin: EdgeInsets.symmetric(horizontal: 18),
|
|
|
+ padding:
|
|
|
+ EdgeInsets.symmetric(horizontal: 12, vertical: 12),
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ GestureDetector(
|
|
|
+ child: Icon(Icons.clear),
|
|
|
+ onTap: () {
|
|
|
+ Navigator.pop(context);
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ mainAxisAlignment: MainAxisAlignment.end,
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Center(
|
|
|
+ child: Container(
|
|
|
+ child: MyViews().myText(
|
|
|
+ '该店铺已$s,请尽快处理', MyColors.c333333, 14),
|
|
|
+ margin: EdgeInsets.symmetric(horizontal: 20),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ height: 0.5,
|
|
|
+ color: MyColors.cE7E7E7,
|
|
|
+ margin: EdgeInsets.only(bottom: 12),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.symmetric(horizontal: 10),
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ Navigator.pop(context);
|
|
|
+ dismissTheBulletFrame(data);
|
|
|
+ },
|
|
|
+ behavior: HitTestBehavior.translucent,
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.only(
|
|
|
+ topLeft: Radius.circular(20),
|
|
|
+ bottomLeft: Radius.circular(20),
|
|
|
+ ),
|
|
|
+ border: Border.all(
|
|
|
+ color: MyColors.cFF4233,
|
|
|
+ width: 1.1),
|
|
|
+ color: Colors.white),
|
|
|
+ child: MyViews()
|
|
|
+ .myText('解散货帮', MyColors.cFF4233, 14),
|
|
|
+ height: 40,
|
|
|
+ alignment: Alignment.center,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: GestureDetector(
|
|
|
+ behavior: HitTestBehavior.translucent,
|
|
|
+ onTap: () {
|
|
|
+ if (data.shopState ==
|
|
|
+ shopStateArrearage) {
|
|
|
+ MyTools().toPage(
|
|
|
+ context,
|
|
|
+ OrderPage(
|
|
|
+ index: 2,
|
|
|
+ ), (then) {
|
|
|
+ onRefresh();
|
|
|
+ });
|
|
|
+ } else if (data.shopState ==
|
|
|
+ shopStateBanned) {
|
|
|
+ Navigator.pop(context);
|
|
|
+ } else if (data.shopState ==
|
|
|
+ shopStateClosed) {
|
|
|
+ Navigator.pop(context);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.only(
|
|
|
+ topRight: Radius.circular(20),
|
|
|
+ bottomRight: Radius.circular(20),
|
|
|
+ ),
|
|
|
+ color: MyColors.cFF4233),
|
|
|
+ height: 40,
|
|
|
+ child: MyViews()
|
|
|
+ .myText('去缴费', Colors.white, 14),
|
|
|
+ alignment: Alignment.center,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ },
|
|
|
+ );
|
|
|
}
|
|
|
},
|
|
|
behavior: HitTestBehavior.translucent,
|
|
|
@@ -472,6 +571,130 @@ class _GangPageState extends State<GangPage>
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ dismissTheBulletFrame(MyShopBeanDataData data) {
|
|
|
+ TextEditingController controller = TextEditingController();
|
|
|
+ showDialog(
|
|
|
+ context: context,
|
|
|
+ builder: (BuildContext context) {
|
|
|
+ return Material(
|
|
|
+ color: Colors.black12,
|
|
|
+ child: Center(
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.circular(16),
|
|
|
+ color: Colors.white,
|
|
|
+ ),
|
|
|
+ height: 180,
|
|
|
+ margin: EdgeInsets.symmetric(horizontal: 18),
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: Center(
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ child: MyViews().myText(
|
|
|
+ '确认解散${data.shopName}(${data.shopUid})?',
|
|
|
+ MyColors.c333333,
|
|
|
+ 14),
|
|
|
+ margin: EdgeInsets.symmetric(horizontal: 20),
|
|
|
+ ),
|
|
|
+ TextField(
|
|
|
+ controller: controller,
|
|
|
+ decoration: InputDecoration(
|
|
|
+ border: InputBorder.none,
|
|
|
+ disabledBorder: InputBorder.none,
|
|
|
+ enabledBorder: InputBorder.none,
|
|
|
+ focusedBorder: InputBorder.none,
|
|
|
+ hintText: '输入“解散货帮”确认解散',
|
|
|
+ hintStyle: TextStyle(
|
|
|
+ color: MyColors.c999999, fontSize: 16),
|
|
|
+ isDense: true,
|
|
|
+ contentPadding:
|
|
|
+ const EdgeInsets.fromLTRB(14, 4.5, 8, 4.5)),
|
|
|
+ textAlign: TextAlign.center,
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ height: 0.5,
|
|
|
+ color: MyColors.cE7E7E7,
|
|
|
+ margin: EdgeInsets.only(bottom: 12),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.symmetric(horizontal: 10),
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ Navigator.pop(context);
|
|
|
+ },
|
|
|
+ behavior: HitTestBehavior.translucent,
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.only(
|
|
|
+ topLeft: Radius.circular(20),
|
|
|
+ bottomLeft: Radius.circular(20),
|
|
|
+ ),
|
|
|
+ border: Border.all(
|
|
|
+ color: MyColors.cFF4233, width: 1.1),
|
|
|
+ color: Colors.white),
|
|
|
+ child:
|
|
|
+ MyViews().myText('取消', MyColors.cFF4233, 14),
|
|
|
+ height: 40,
|
|
|
+ alignment: Alignment.center,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: GestureDetector(
|
|
|
+ behavior: HitTestBehavior.translucent,
|
|
|
+ onTap: () {
|
|
|
+ if (controller.text.toString() == '解散货帮') {
|
|
|
+ Navigator.pop(context);
|
|
|
+ EasyLoading.instance
|
|
|
+ ..contentPadding = EdgeInsets.symmetric(
|
|
|
+ horizontal: 20, vertical: 12)
|
|
|
+ ..alignment = Alignment.center
|
|
|
+ ..loadingStyle = EasyLoadingStyle.light
|
|
|
+ ..contentMargin = EdgeInsets.all(20);
|
|
|
+ EasyLoading.show();
|
|
|
+ delShop(data);
|
|
|
+ } else {
|
|
|
+ showToast('请输入“解散货帮”');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.only(
|
|
|
+ topRight: Radius.circular(20),
|
|
|
+ bottomRight: Radius.circular(20),
|
|
|
+ ),
|
|
|
+ color: MyColors.cFF4233),
|
|
|
+ height: 40,
|
|
|
+ child: MyViews().myText('确认', Colors.white, 14),
|
|
|
+ alignment: Alignment.center,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ },
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
@override
|
|
|
// TODO: implement wantKeepAlive
|
|
|
bool get wantKeepAlive => true;
|
|
|
@@ -532,10 +755,11 @@ class _GangPageState extends State<GangPage>
|
|
|
// return aT.compareTo(bT);
|
|
|
// });
|
|
|
data.forEach((element) {
|
|
|
- element.tagIndex = PinyinHelper.getPinyinE(element.shopName).toLowerCase();
|
|
|
+ element.tagIndex =
|
|
|
+ PinyinHelper.getPinyinE(element.shopName).toLowerCase();
|
|
|
});
|
|
|
- data.sort((left,right)=>left.tagIndex.compareTo(right.tagIndex));
|
|
|
- if (applications.isNotEmpty&&page==1&&sIndex == 0) {
|
|
|
+ data.sort((left, right) => left.tagIndex.compareTo(right.tagIndex));
|
|
|
+ if (applications.isNotEmpty && page == 1 && sIndex == 0) {
|
|
|
MyShopBeanDataData shopB = MyShopBeanDataData();
|
|
|
shopB.shopName = '0';
|
|
|
// add hotCityList.
|
|
|
@@ -550,7 +774,7 @@ class _GangPageState extends State<GangPage>
|
|
|
}, (error) {});
|
|
|
}
|
|
|
|
|
|
- void _handleList(List<MyShopBeanDataData> list) {
|
|
|
+ /*void _handleList(List<MyShopBeanDataData> list) {
|
|
|
List<MyShopBeanDataData> selfBuilt = [];
|
|
|
list.forEach((element) {
|
|
|
if (element.ownerUid == MyCookie().getUID()) {
|
|
|
@@ -585,7 +809,7 @@ class _GangPageState extends State<GangPage>
|
|
|
SuspensionUtil.setShowSuspensionStatus(data);
|
|
|
|
|
|
setState(() {});
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
enquiryApplication() {
|
|
|
MyDio().query({
|
|
|
@@ -619,4 +843,29 @@ class _GangPageState extends State<GangPage>
|
|
|
queryGang();
|
|
|
enquiryApplication();
|
|
|
}
|
|
|
+
|
|
|
+ void delShop(MyShopBeanDataData data) {
|
|
|
+ MyDio().query({
|
|
|
+ "key": "shop",
|
|
|
+ "filters": {
|
|
|
+ "conditions": ["uid == ${data.shopUid}"]
|
|
|
+ },
|
|
|
+ "dims": shopDims,
|
|
|
+ "paging": [1, 5]
|
|
|
+ }, (response, hasError) {
|
|
|
+ if (!hasError) {
|
|
|
+ StoreBeanEntity entity =
|
|
|
+ StoreBeanEntity().fromJson(json.decode(response.data.toString()));
|
|
|
+ MyDio().del({
|
|
|
+ 'key': 'shop',
|
|
|
+ 'ids': [entity.data.data[0].id]
|
|
|
+ }, (response, hasError) {
|
|
|
+ if (!hasError) {
|
|
|
+ showToast('删除成功');
|
|
|
+ onRefresh();
|
|
|
+ }
|
|
|
+ }, (error) {});
|
|
|
+ }
|
|
|
+ }, (error) {});
|
|
|
+ }
|
|
|
}
|