Commit 51df2b836ae6f0e4191bed915030895c94becb39

Authored by wdn127929
1 parent 8c221f31

创建新优惠

... ... @@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/models/coupon_model.dart';
import 'package:one_key/models/notebook_detail.dart';
import 'package:one_key/models/seller_phone_model.dart';
... ... @@ -24,6 +25,7 @@ import 'package:one_key/utils/misc.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/page_exception.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
... ... @@ -92,13 +94,12 @@ class InvicationPageState extends State<InvicationPage> {
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
WidgetsBinding.instance.addPostFrameCallback((_) async {
couponProvider.sendSMS = false;
_couponNetworkData(isShowLoading: false);
_getCustomerActivityBaseinfo();
_getTablesPhoto();
_getReserveDetail();
await _couponNetworkData(isShowLoading: false);
await _getCustomerActivityBaseinfo();
await _getTablesPhoto();
await _getReserveDetail(showCicle: false);
});
bus.on("refresh_coupon_invitation", (args) {
_couponNetworkData(isShowLoading: false);
... ... @@ -130,7 +131,8 @@ class InvicationPageState extends State<InvicationPage> {
{
"rid": widget.rid,
},
showCircle: showCicle);
showCircle: false);
_baseIndoProvider.pageState = PageState.Success;
String _nameStr = '';
String _tid = '';
for (int i = 0; i < detailEntity.tables.length; i++) {
... ... @@ -177,7 +179,8 @@ class InvicationPageState extends State<InvicationPage> {
"sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
"tableids": tid,
};
bool success = await _baseIndoProvider.getTablesPhoto(context, params);
bool success = await _baseIndoProvider.getTablesPhoto(context, params,
isShowLoading: false);
}
//客户经理添加/修改基本信息
... ... @@ -213,8 +216,8 @@ class InvicationPageState extends State<InvicationPage> {
'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid,
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
};
bool success =
await _baseIndoProvider.getCustomerActivityBaseinfo(context, params);
bool success = await _baseIndoProvider
.getCustomerActivityBaseinfo(context, params, isShowLoading: false);
if (success) {
name = _baseIndoProvider.baseInfoSunModel.name;
qiniuUrl = _baseIndoProvider.baseInfoSunModel.photo;
... ... @@ -267,7 +270,7 @@ class InvicationPageState extends State<InvicationPage> {
//此人已经新建好券
if (couponProvider.couponListSelect.length > 0) {
// couponProvider.initCouponSelect(context);
couponsCan = [];
for (int i = 0; i < couponProvider.couponListSelect.length; i++) {
couponsCan.add(couponProvider.couponListSelect[i].aname);
}
... ... @@ -1301,8 +1304,15 @@ class InvicationPageState extends State<InvicationPage> {
}))),
HEmptyView(40),
InkWell(
onTap: () {
onTap: () async {
// NavigatorUtil.goMarketingRecordsDetailPage(context);
bool needRefresh = await NavigatorUtil.goCouponEditPage(context);
print(needRefresh);
if (needRefresh != null && needRefresh) {
//刷新页面数据
// _controller.callRefresh();
_couponNetworkData();
}
},
child: Text('创建新优惠',
style: TextStyle(
... ... @@ -1589,23 +1599,42 @@ class InvicationPageState extends State<InvicationPage> {
],
)),
Expanded(
child: Container(
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)),
child: SingleChildScrollView(
child: Column(
children: [
VEmptyView(40),
_managerWidget(),
VEmptyView(50),
_orderInfoWidget(),
VEmptyView(30),
_couponWidget(),
VEmptyView(20),
_btnWidget(),
],
)),
)),
child: Consumer<BaseIndoProvider>(builder: (context, model, _) {
if (model.pageState != PageState.Success) {
return ExceptionPage(
pageState: model.pageState,
callback: () async {
model.pageState = PageState.Loading;
await _couponNetworkData(isShowLoading: false);
await _getCustomerActivityBaseinfo();
await _getTablesPhoto();
await _getReserveDetail(showCicle: false);
model.notifyListeners();
},
emptyMsg: "稍后加载",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return Container(
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)),
child: SingleChildScrollView(
child: Column(
children: [
VEmptyView(40),
_managerWidget(),
VEmptyView(50),
_orderInfoWidget(),
VEmptyView(30),
_couponWidget(),
VEmptyView(20),
_btnWidget(),
],
)),
);
}
})),
],
),
... ...
import 'package:flutter/material.dart';
import 'package:one_key/constant/constant.dart';
import 'package:one_key/constant/error.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/models/base_info_model.dart';
import 'package:one_key/models/seller_phone_model.dart';
import 'package:one_key/models/table_photo_model.dart';
... ... @@ -16,6 +17,8 @@ class BaseIndoProvider with ChangeNotifier {
BaseInfoSunModel baseInfoSunModel; //客户经理基础信息
List<String> photoList = []; //商家图片信息
PageState pageState = PageState.Loading;
TextEditingController phoneController = TextEditingController();
TextEditingController nameController = TextEditingController();
List sexList;
... ...