huxiaoqiang vor 4 Jahren
Ursprung
Commit
422947ad9d

+ 1 - 4
lib/paegs/ad_details_page/ad_details_page.dart

@@ -60,10 +60,7 @@ class _AdDetailsPageState extends State<AdDetailsPage> {
                     child: Container(
                       padding:
                           EdgeInsets.symmetric(vertical: 8, horizontal: 16),
-                      child: Text(
-                        '修改',
-                        style: TextStyle(color: MyColors.c333333, fontSize: 16),
-                      ),
+                      child: Icon(Icons.more_horiz),
                     ),
                   )
                 : Container()

+ 79 - 30
lib/paegs/gang_page/gang_in_page/gang_information_page/gang_information_page.dart

@@ -135,6 +135,52 @@ class _GangInformationPageState extends State<GangInformationPage> {
                         ),
                       ),
                     ),
+                    Container(
+                      color: Colors.white,
+                      margin: EdgeInsets.only(top: 3),
+                      padding: EdgeInsets.only(
+                          top: 9, bottom: 14, left: 16, right: 16),
+                      child: Column(
+                        children: [
+                          Row(
+                            children: [
+                              Text(
+                                '介绍',
+                                style: TextStyle(
+                                    color: MyColors.c333333, fontSize: 15),
+                              ),
+                              Visibility(
+                                child: SvgPicture.asset('images/svg/箭头.svg'),
+                                visible: widget.data.ownerUid ==
+                                    MyCookie().getUID(),
+                              ),
+                            ],
+                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                          ),
+                          Container(
+                            decoration: BoxDecoration(
+                              color: MyColors.c19FF4233,
+                              borderRadius: BorderRadius.all(
+                                Radius.circular(4),
+                              ),
+                            ),
+                            child: Text(
+                              store == null
+                                  ? '暂无介绍'
+                                  : store.introduction.isEmpty
+                                  ? '暂无介绍'
+                                  : store.introduction,
+                              style: TextStyle(
+                                  color: MyColors.c666666, fontSize: 13),
+                            ),
+                            alignment: Alignment.topLeft,
+                            padding: EdgeInsets.symmetric(
+                                vertical: 20, horizontal: 16),
+                            margin: EdgeInsets.only(top: 10),
+                          )
+                        ],
+                      ),
+                    ),
                     Visibility(
                       visible: store != null && store.mobile.isNotEmpty,
                       child: GestureDetector(
@@ -779,37 +825,40 @@ class _GangInformationPageState extends State<GangInformationPage> {
                         ),
                       ),
                     ),
-                    GestureDetector(
-                      onTap: () {},
-                      behavior: HitTestBehavior.translucent,
-                      child: Container(
-                        child: Row(
-                          children: [
-                            Text(
-                              '隐私保护',
-                              style: TextStyle(
-                                  color: MyColors.c333333, fontSize: 15),
-                            ),
-                            CupertinoSwitch(
-                                value: privacyProtection,
-                                onChanged: (v) {
-                                  if (v) {
-                                    MyTools().toPage(
-                                        context,
-                                        PrivacyProtectionPropsPage(
-                                            widget.data, vpKeyChatWaterMark),
-                                        (then) {
-                                      controller.requestRefresh();
-                                    });
-                                  }
-                                }),
-                          ],
-                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                    Visibility(
+                      visible: widget.data.ownerUid==MyCookie().getUID(),
+                      child: GestureDetector(
+                        onTap: () {},
+                        behavior: HitTestBehavior.translucent,
+                        child: Container(
+                          child: Row(
+                            children: [
+                              Text(
+                                '隐私保护',
+                                style: TextStyle(
+                                    color: MyColors.c333333, fontSize: 15),
+                              ),
+                              CupertinoSwitch(
+                                  value: privacyProtection,
+                                  onChanged: (v) {
+                                    if (v) {
+                                      MyTools().toPage(
+                                          context,
+                                          PrivacyProtectionPropsPage(
+                                              widget.data, vpKeyChatWaterMark),
+                                          (then) {
+                                        controller.requestRefresh();
+                                      });
+                                    }
+                                  }),
+                            ],
+                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                          ),
+                          padding:
+                              EdgeInsets.symmetric(horizontal: 16, vertical: 12),
+                          color: Colors.white,
+                          margin: EdgeInsets.only(top: 3),
                         ),
-                        padding:
-                            EdgeInsets.symmetric(horizontal: 16, vertical: 12),
-                        color: Colors.white,
-                        margin: EdgeInsets.only(top: 3),
                       ),
                     ),
                     /* Container(

+ 11 - 3
lib/paegs/mine_page/advertising_page/advertising_page.dart

@@ -3,11 +3,14 @@ import 'dart:convert';
 import 'package:bbyyy/beans/ad_bean_entity.dart';
 import 'package:bbyyy/https/MyDio.dart';
 import 'package:bbyyy/my_tools/dims.dart';
+import 'package:bbyyy/my_tools/my_colors.dart';
 import 'package:bbyyy/my_tools/my_cookie.dart';
 import 'package:bbyyy/my_tools/my_tools.dart';
 import 'package:bbyyy/my_tools/my_views.dart';
 import 'package:bbyyy/paegs/ad_details_page/ad_details_page.dart';
 import 'package:flutter/material.dart';
+import 'package:flutter_slidable/flutter_slidable.dart';
+import 'package:flutter_svg/svg.dart';
 import 'package:pull_to_refresh/pull_to_refresh.dart';
 
 import 'new_ad_page.dart';
@@ -32,7 +35,7 @@ class _AdvertisingPageState extends State<AdvertisingPage> {
                 icon: Icon(Icons.add_circle_outline),
                 onPressed: () {
                   MyTools().toPage(context, NewAdPage(null), (then) {
-                    page=1;
+                    page = 1;
                     controller.requestRefresh();
                   });
                 }),
@@ -58,8 +61,13 @@ class _AdvertisingPageState extends State<AdvertisingPage> {
                         return GestureDetector(
                           child: advertisingItems(context, data[index]),
                           onTap: () {
-                            MyTools().toPage(context, AdDetailsPage(data[index],canBeModified: true,), (then){
-                              page=1;
+                            MyTools().toPage(
+                                context,
+                                AdDetailsPage(
+                                  data[index],
+                                  canBeModified: true,
+                                ), (then) {
+                              page = 1;
                               controller.requestRefresh();
                             });
                           },

+ 52 - 1
lib/paegs/mine_page/advertising_page/new_ad_page.dart

@@ -59,11 +59,26 @@ class _NewAdPageState extends State<NewAdPage> {
   DateTime startDate;
   MyShopBeanDataData shop;
   GoodsBeanDataData product;
-
+  int status;
   @override
   void initState() {
     // TODO: implement initState
     super.initState();
+    if(widget.data!=null){
+      if (widget.data.paid == false) {
+        status = 1;
+      } else {
+        var sT = DateTime.parse(widget.data.startDate);
+        var eT = sT.add(Duration(days: widget.data.days));
+        if (sT.isBefore(DateTime.now()) && eT.isAfter(DateTime.now())) {
+          status = 0;
+        } else if (sT.isAfter(DateTime.now())) {
+          status = 3;
+        } else if (eT.isBefore(DateTime.now())) {
+          status = 2;
+        }
+      }
+    }
     Future.delayed(Duration.zero, () {
       advertisingPricing((re, hE) {
         if (!hE) {
@@ -500,6 +515,30 @@ class _NewAdPageState extends State<NewAdPage> {
                               alignment: Alignment.center,
                             ),
                           ),
+                          Container(
+                            height: 10,
+                            color: MyColors.cF7F7F7,
+                          ),
+                          Visibility(
+                            visible: status==1||status==2,
+                            child: GestureDetector(
+                              onTap: () {
+                                showSimpleDialog('确认删除此广告?',context,(){
+                                  Navigator.pop(context);
+                                  deleteAD(widget.data);
+                                });
+                              },
+                              behavior: HitTestBehavior.translucent,
+                              child: Container(
+                                height: 50,
+                                child: MyViews().myText(
+                                    '删  除',
+                                    MyColors.cFF4233,
+                                    16),
+                                alignment: Alignment.center,
+                              ),
+                            ),
+                          ),
                           Container(
                             height: 50,
                             color: MyColors.cF7F7F7,
@@ -1168,6 +1207,9 @@ class _NewAdPageState extends State<NewAdPage> {
             .fromJson(json.decode(response.data.toString()));
         if (!widget.data.paid) {
           showPayOrder(entity);
+        }else{
+          EasyLoading.dismiss();
+          Navigator.pop(context, widget.data == null);
         }
       }
     }, (error) {});
@@ -1200,4 +1242,13 @@ class _NewAdPageState extends State<NewAdPage> {
       showPayOrder(entity);
     }, (error) {});
   }
+
+  void deleteAD(AdBeanDataData ad) {
+    MyDio().del({
+      'key': 'ad',
+      'ids': [ad.id]
+    }, (response, hasError) {
+      Navigator.pop(context,widget.data==null);
+    }, (error) {});
+  }
 }