|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:one_key/provider/customer_making_provider.dart';
|
|
|
|
import 'package:one_key/provider/customer_provider.dart';
|
|
|
|
import 'package:one_key/provider/user_model.dart';
|
|
|
|
import 'package:one_key/res/colors.dart';
|
|
|
|
import 'package:one_key/route/navigator_util.dart';
|
|
|
|
import 'package:one_key/utils/dialog_util.dart';
|
|
|
|
import 'package:one_key/utils/screen_util.dart';
|
|
|
|
import 'package:one_key/utils/utils.dart';
|
|
|
|
import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 客户沉睡/流失发放优惠设置
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef ClickCallback = void Function(dynamic value);
|
|
|
|
|
|
|
|
class AwakeningSendSettingPage extends StatefulWidget {
|
|
|
|
const AwakeningSendSettingPage({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<AwakeningSendSettingPage> createState() =>
|
|
|
|
_AwakeningSendSettingPageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _AwakeningSendSettingPageState extends State<AwakeningSendSettingPage> {
|
|
|
|
TextEditingController moneyC = TextEditingController();
|
|
|
|
FocusNode moneyNode = FocusNode();
|
|
|
|
|
|
|
|
late CustomerMakingProvider customerMakingProvider;
|
|
|
|
late CustomerProvider customerProvider;
|
|
|
|
List<String?> couponList = [];
|
|
|
|
|
|
|
|
///消费券
|
|
|
|
_couponNetworkData({bool isShowLoading = true}) async {
|
|
|
|
// customerMakingProvider.couponSelectIndex = 0;
|
|
|
|
Map<String, String?> params = {
|
|
|
|
"uid": Provider.of<UserModel>(context, listen: false).user!.openid,
|
|
|
|
'status': '1'
|
|
|
|
};
|
|
|
|
await customerProvider.getCustomerSelectActivityNew(context, params,
|
|
|
|
isShowLoading: isShowLoading);
|
|
|
|
//此人已经新建好券
|
|
|
|
if (customerProvider.couponListSelect!.length > 0) {
|
|
|
|
// couponProvider.initCouponSelect(context);
|
|
|
|
couponList = [];
|
|
|
|
for (int i = 0; i < customerProvider.couponListSelect!.length; i++) {
|
|
|
|
couponList.add(customerProvider.couponListSelect![i].aname);
|
|
|
|
}
|
|
|
|
customerProvider.notifyListeners();
|
|
|
|
} else {
|
|
|
|
//没有新建的优惠券
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Widget> _templateUI() {
|
|
|
|
List<Widget> templates = [];
|
|
|
|
customerProvider.marketingSmsData!.forEach((element) {
|
|
|
|
templates.add(InkWell(
|
|
|
|
onTap: () {
|
|
|
|
//选择模版.默认数据
|
|
|
|
|
|
|
|
String newStr = '';
|
|
|
|
UserModel userModel =
|
|
|
|
Provider.of<UserModel>(context, listen: false);
|
|
|
|
newStr = element.content!
|
|
|
|
.replaceAll('{店铺名称}', userModel.user!.sellername!);
|
|
|
|
newStr =
|
|
|
|
newStr.replaceAll('{店铺电话号码}', userModel.user!.sellerphone!);
|
|
|
|
newStr =
|
|
|
|
newStr.replaceAll('{经理名称}', userModel.user!.nickName ?? '');
|
|
|
|
newStr = newStr.replaceAll('{礼品领取链接}', '');
|
|
|
|
|
|
|
|
customerMakingProvider.controller.text = newStr;
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(10), vertical: w(5)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(r(5)),
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
border: Border.all(width: w(1), color: MyColours.color_438E93)),
|
|
|
|
child: Text(
|
|
|
|
element.title!,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_438E93,
|
|
|
|
fontSize: font(12),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
)));
|
|
|
|
});
|
|
|
|
return templates;
|
|
|
|
}
|
|
|
|
|
|
|
|
_insertUrllink(String? link) {
|
|
|
|
// *************开始直接插入会报错***********还没有改
|
|
|
|
|
|
|
|
var cursorPos =
|
|
|
|
customerMakingProvider.controller.selection.base.offset; //获取到光标的在字符串的位置
|
|
|
|
|
|
|
|
if (cursorPos < 0) {
|
|
|
|
customerMakingProvider.controller.text += link!;
|
|
|
|
} else {
|
|
|
|
String textAfterCursor = customerMakingProvider.controller.text
|
|
|
|
.substring(cursorPos); //把字符串从光标的位置截取,光标后面的
|
|
|
|
|
|
|
|
String textBeforeCursor = customerMakingProvider.controller.text
|
|
|
|
.substring(0, cursorPos); //光标前面的字符串
|
|
|
|
customerMakingProvider.controller.text =
|
|
|
|
textBeforeCursor + link! + textAfterCursor; //把想要的插入的内容拼接在光标位置处
|
|
|
|
|
|
|
|
customerMakingProvider.controller.selection = TextSelection.collapsed(
|
|
|
|
offset: customerMakingProvider.controller.text.length);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_buttonChoose(String title, ClickCallback callback) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
callback(title);
|
|
|
|
},
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(20),
|
|
|
|
vertical: ScreenUtil().setWidth(10)),
|
|
|
|
// height: ScreenUtil().setWidth(50),
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
// // border: Border.all(
|
|
|
|
// // width: ScreenUtil().setWidth(2),
|
|
|
|
// // color: MyColours.color_199095),
|
|
|
|
// borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
title,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
style: TextStyle(
|
|
|
|
color: title == '时间(选填)' ||
|
|
|
|
title == '(选填)' ||
|
|
|
|
title == '选择优惠' ||
|
|
|
|
!customerMakingProvider.isUse
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_438E93,
|
|
|
|
fontSize: ScreenUtil().setWidth(30)),
|
|
|
|
)),
|
|
|
|
HEmptyView(20),
|
|
|
|
Image.asset(
|
|
|
|
// Utils.getImgPath(!customerMakingProvider.isUse
|
|
|
|
// ? 'c_arrow_down_unsel'
|
|
|
|
// : 'c_arrow_down'),
|
|
|
|
Utils.getImgPath('down_c'),
|
|
|
|
width: ScreenUtil().setWidth(44),
|
|
|
|
// height: ScreenUtil().setWidth(10),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)));
|
|
|
|
}
|
|
|
|
|
|
|
|
///短信内容编辑UI
|
|
|
|
Widget _contentWidget(String hintText) {
|
|
|
|
return Container(
|
|
|
|
// height: ScreenUtil().setWidth(380),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
// Align(
|
|
|
|
// alignment: Alignment.centerLeft,
|
|
|
|
// child: Text(
|
|
|
|
// title,
|
|
|
|
// textAlign: TextAlign.left,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
// fontSize: ScreenUtil().setSp(34)),
|
|
|
|
// )),
|
|
|
|
// VEmptyView(30),
|
|
|
|
TextField(
|
|
|
|
controller: customerMakingProvider.controller,
|
|
|
|
// keyboardType: TextInputType.numberWithOptions(decimal: true), //键盘类型,数字键盘
|
|
|
|
maxLines: 6,
|
|
|
|
// focusNode: _focusNode,
|
|
|
|
// maxLength: 50,
|
|
|
|
|
|
|
|
// maxLengthEnforced: true,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: MyColours.color_515151), //输入文本的样式
|
|
|
|
decoration: InputDecoration(
|
|
|
|
contentPadding: EdgeInsets.all(ScreenUtil().setWidth(30)),
|
|
|
|
hintText: hintText,
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
fillColor: MyColours.color_ffffff,
|
|
|
|
// fillColor: Colors.red,
|
|
|
|
filled: true,
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
//未选中时候的颜色
|
|
|
|
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
borderSide: BorderSide(
|
|
|
|
color: MyColours.color_cccccc,
|
|
|
|
width: ScreenUtil().setWidth(2)),
|
|
|
|
),
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
//选中时外边框颜色
|
|
|
|
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
borderSide: BorderSide(
|
|
|
|
color: MyColours.app_main,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// border: OutlineInputBorder(
|
|
|
|
// borderRadius:
|
|
|
|
// BorderRadius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
// borderSide: BorderSide(
|
|
|
|
// color: Colors.red, width: ScreenUtil().setWidth(2))),
|
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.only(left: w(10), right: w(10), bottom: w(10)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(r(5)),
|
|
|
|
border: Border.all(width: w(1), color: MyColours.color_F8F7F3)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
height: w(34),
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
'常用模版',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(12),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(10),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(10)),
|
|
|
|
child: Wrap(
|
|
|
|
spacing: w(10),
|
|
|
|
runSpacing: w(5),
|
|
|
|
crossAxisAlignment: WrapCrossAlignment.center,
|
|
|
|
children: _templateUI(),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(50),
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
customerMakingProvider.controller.text = '';
|
|
|
|
setState(() {});
|
|
|
|
// NavigatorUtil.goMarketingRecordsDetailPage(context);
|
|
|
|
},
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(right: ScreenUtil().setWidth(20)),
|
|
|
|
child: Text('清空',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
fontSize: ScreenUtil().setSp(30))),
|
|
|
|
)),
|
|
|
|
Text(
|
|
|
|
'共 ${customerMakingProvider.controller.text.length} 字 ${customerMakingProvider.selectCustomerSeller.length} 条短信',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(26))),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
|
|
|
|
Column(children: [
|
|
|
|
VEmptyView(30),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
customerMakingProvider.isUpdate =
|
|
|
|
!customerMakingProvider.isUpdate;
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
child: Row(children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(customerMakingProvider.isUpdate
|
|
|
|
? 'f_select'
|
|
|
|
: 'f_select_not'),
|
|
|
|
width: ScreenUtil().setWidth(44)),
|
|
|
|
HEmptyView(15),
|
|
|
|
Text(
|
|
|
|
'客户经理不可修改短信内容',
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
])),
|
|
|
|
VEmptyView(30),
|
|
|
|
]),
|
|
|
|
VEmptyView(30),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
customerProvider = Provider.of<CustomerProvider>(context, listen: true);
|
|
|
|
customerMakingProvider =
|
|
|
|
Provider.of<CustomerMakingProvider>(context, listen: true);
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
appBar: SystemAppBar('客户沉睡发放优惠设置'),
|
|
|
|
body: Column(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
width: w(0.5), color: MyColours.color_E7E7E7))),
|
|
|
|
margin: EdgeInsets.only(left: w(16)),
|
|
|
|
padding: EdgeInsets.symmetric(vertical: w(13)),
|
|
|
|
child: Text('赠送优惠选择',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151, fontSize: font(16))),
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {},
|
|
|
|
child: Container(
|
|
|
|
height: w(40),
|
|
|
|
margin: EdgeInsets.only(left: w(40)),
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// top: w(8),
|
|
|
|
// bottom: w(8),
|
|
|
|
// ),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
color: MyColours.color_E7E7E7, width: w(0.5)))),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
true ? 'radio_back' : 'radio_back_un'),
|
|
|
|
width: ScreenUtil().setWidth(18),
|
|
|
|
),
|
|
|
|
HEmptyView(4),
|
|
|
|
Container(
|
|
|
|
// height: ScreenUtil().setWidth(40),
|
|
|
|
// color: Colors.red,
|
|
|
|
child: Text(
|
|
|
|
'发放消费金',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(4),
|
|
|
|
Container(
|
|
|
|
width: w(54),
|
|
|
|
height: w(26),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
color: MyColours.color_999999, width: w(1))),
|
|
|
|
child: TextField(
|
|
|
|
controller: moneyC,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
textAlignVertical: TextAlignVertical.center,
|
|
|
|
maxLines: 1,
|
|
|
|
// //光标颜色
|
|
|
|
// cursorColor:
|
|
|
|
// widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
//输入文本的样式
|
|
|
|
inputFormatters: [
|
|
|
|
FilteringTextInputFormatter.allow(
|
|
|
|
RegExp("[0-9.]")),
|
|
|
|
], // 限制输入为数字,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(20),
|
|
|
|
),
|
|
|
|
focusNode: moneyNode,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
isCollapsed: true,
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide.none),
|
|
|
|
hintText: '请输入数字',
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(20),
|
|
|
|
),
|
|
|
|
enabledBorder: new UnderlineInputBorder(
|
|
|
|
borderSide: BorderSide.none,
|
|
|
|
),
|
|
|
|
focusedBorder: new UnderlineInputBorder(
|
|
|
|
borderSide: BorderSide.none,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onChanged: (value) {},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.numberWithOptions()),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
Text(
|
|
|
|
'元',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(14)),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {},
|
|
|
|
child: Container(
|
|
|
|
height: w(40),
|
|
|
|
margin: EdgeInsets.only(left: w(40)),
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// top: w(8),
|
|
|
|
// bottom: w(8),
|
|
|
|
// ),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
color: MyColours.color_E7E7E7, width: w(0.5)))),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
true ? 'radio_back' : 'radio_back_un'),
|
|
|
|
width: ScreenUtil().setWidth(18),
|
|
|
|
),
|
|
|
|
HEmptyView(4),
|
|
|
|
Container(
|
|
|
|
// height: ScreenUtil().setWidth(40),
|
|
|
|
// color: Colors.red,
|
|
|
|
child: Text(
|
|
|
|
'赠送优惠券',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(4),
|
|
|
|
Spacer(),
|
|
|
|
Row(children: [
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(70),
|
|
|
|
// width: ScreenUtil().setWidth(130),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(10)),
|
|
|
|
color: MyColours.color_DBDBDB),
|
|
|
|
child: _buttonChoose(
|
|
|
|
customerMakingProvider.youhui!, (value) {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
if (couponList == null ||
|
|
|
|
couponList.length == 0) {
|
|
|
|
Utils.showToast('暂无优惠券,请创建新优惠');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
DialogUtil.showSelectCusmanDialog(
|
|
|
|
context, couponList, (value) async {
|
|
|
|
if (value != null) {
|
|
|
|
if (customerProvider
|
|
|
|
.couponListSelect![value.first]
|
|
|
|
.urllink ==
|
|
|
|
null) {
|
|
|
|
//创建链接
|
|
|
|
//创建券的二维码
|
|
|
|
Map<String, String?> param = {
|
|
|
|
"sid": Provider.of<UserModel>(
|
|
|
|
context,
|
|
|
|
listen: false)
|
|
|
|
.user!
|
|
|
|
.sellerid,
|
|
|
|
"id": customerProvider
|
|
|
|
.couponListSelect![value.first]
|
|
|
|
.id,
|
|
|
|
};
|
|
|
|
dynamic object =
|
|
|
|
await customerProvider
|
|
|
|
.createActivityUrlLink(
|
|
|
|
context, param);
|
|
|
|
if (object is bool ||
|
|
|
|
object == null) {
|
|
|
|
//
|
|
|
|
} else {
|
|
|
|
//成功
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
customerMakingProvider
|
|
|
|
.couponSelectIndex =
|
|
|
|
value.first;
|
|
|
|
customerMakingProvider.youhui =
|
|
|
|
couponList[
|
|
|
|
customerMakingProvider
|
|
|
|
.couponSelectIndex!];
|
|
|
|
});
|
|
|
|
_insertUrllink(object);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// 直接使用
|
|
|
|
setState(() {
|
|
|
|
customerMakingProvider
|
|
|
|
.couponSelectIndex =
|
|
|
|
value.first;
|
|
|
|
customerMakingProvider.youhui =
|
|
|
|
couponList[
|
|
|
|
customerMakingProvider
|
|
|
|
.couponSelectIndex!];
|
|
|
|
});
|
|
|
|
|
|
|
|
_insertUrllink(customerProvider
|
|
|
|
.couponListSelect![value.first]
|
|
|
|
.urllink);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
selecteds: customerMakingProvider
|
|
|
|
.couponSelectIndex ==
|
|
|
|
null
|
|
|
|
? []
|
|
|
|
: [
|
|
|
|
customerMakingProvider
|
|
|
|
.couponSelectIndex!
|
|
|
|
])
|
|
|
|
.then((value) {});
|
|
|
|
}))),
|
|
|
|
HEmptyView(40),
|
|
|
|
InkWell(
|
|
|
|
onTap: () async {
|
|
|
|
// NavigatorUtil.goMarketingRecordsDetailPage(context);
|
|
|
|
// bool? needRefresh =
|
|
|
|
// await NavigatorUtil.goCouponEditPage(context) ;
|
|
|
|
// print(needRefresh);
|
|
|
|
// if (needRefresh != null && needRefresh) {
|
|
|
|
// //刷新页面数据
|
|
|
|
// // _controller.callRefresh();
|
|
|
|
// _couponNetworkData();
|
|
|
|
// }
|
|
|
|
bool? needRefresh = await NavigatorUtil
|
|
|
|
.goCouponCreateSelectTypePage(
|
|
|
|
context,
|
|
|
|
);
|
|
|
|
if (needRefresh != null && needRefresh) {
|
|
|
|
//刷新页面数据
|
|
|
|
// _controller.callRefresh();
|
|
|
|
_couponNetworkData();
|
|
|
|
} else {
|
|
|
|
Utils.showToast('您没有相关权限!');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: Text('创建新优惠',
|
|
|
|
style: TextStyle(
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
color: MyColours.color_438E93,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: ScreenUtil().setSp(28)))),
|
|
|
|
]),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
_contentWidget(('输入营销短信内容'))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|