|
...
|
...
|
@@ -47,6 +47,9 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { |
|
|
|
|
|
|
|
UploadImageProvider _uploadImageProvider;
|
|
|
|
ScrollController controller = ScrollController();
|
|
|
|
bool addStoreIntroduce = false; //预订安排通知中附加餐厅文字介绍
|
|
|
|
bool addStoreImge = false; //预订安排通知中附加餐厅文字图片
|
|
|
|
bool addAbove = false; //餐厅介绍文字显示在第一张图片上
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
...
|
...
|
@@ -80,7 +83,7 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { |
|
|
|
getSellerTemplateConf() async {
|
|
|
|
bool success = await marketingCenterProvider.getSellerTemplateConf(context);
|
|
|
|
if (success && marketingCenterProvider.markDataModel.store != null) {
|
|
|
|
currIndex = int.parse(marketingCenterProvider.markDataModel.store.style);
|
|
|
|
// currIndex = int.parse(marketingCenterProvider.markDataModel.store.style);
|
|
|
|
|
|
|
|
_uploadImageProvider.storeImage1.qiniuUrl =
|
|
|
|
marketingCenterProvider.markDataModel.store.images.length > 0
|
|
...
|
...
|
@@ -121,6 +124,17 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { |
|
|
|
|
|
|
|
storeIntroduceC.text =
|
|
|
|
marketingCenterProvider.markDataModel.store.introduce;
|
|
|
|
addStoreIntroduce =
|
|
|
|
marketingCenterProvider.markDataModel.store.isIntroduce == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
addStoreImge = marketingCenterProvider.markDataModel.store.isImages == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
addAbove = marketingCenterProvider.markDataModel.store.isAbove == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}
|
|
...
|
...
|
@@ -405,9 +419,9 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { |
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
_introduceWidget(EdgeInsets.all(w(15)),
|
|
|
|
boxDecoration: BoxDecoration(color: MyColours.color_ffffff)),
|
|
|
|
VEmptyView(18),
|
|
|
|
// _introduceWidget(EdgeInsets.all(w(15)),
|
|
|
|
// boxDecoration: BoxDecoration(color: MyColours.color_ffffff)),
|
|
|
|
// VEmptyView(18),
|
|
|
|
ImgPickerInvitationWidget(
|
|
|
|
scrollController: controller,
|
|
|
|
uploadType: UploadType.InvitationStoreType,
|
|
...
|
...
|
@@ -439,6 +453,37 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { |
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _item(String title, {bool select, GestureTapCallback onTap}) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: onTap,
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
color: MyColours.color_E7E7E7, width: w(0.5)))),
|
|
|
|
margin: EdgeInsets.only(left: w(16)),
|
|
|
|
padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(16)),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setWidth(32)),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Container(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(horizontal: w(7), vertical: w(4)),
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath(select ? 'swich_on' : 'swich_off'),
|
|
|
|
width: w(44),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)));
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
_uploadImageProvider =
|
|
...
|
...
|
@@ -461,26 +506,100 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { |
|
|
|
controller: controller,
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
_selectBtnWidget(),
|
|
|
|
_item('预订安排通知中附加餐厅文字介绍', select: addStoreIntroduce,
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
addStoreIntroduce = !addStoreIntroduce;
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
|
|
|
|
VEmptyView(24),
|
|
|
|
//输入框
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
padding: EdgeInsets.only(left: w(16)),
|
|
|
|
height: w(48),
|
|
|
|
child: Text(
|
|
|
|
'效果预览',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(16),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
width: double.infinity,
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40)),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
vertical: ScreenUtil().setWidth(20)),
|
|
|
|
alignment: Alignment.topLeft,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
border: Border.all(
|
|
|
|
color: MyColours.color_DBDBDB,
|
|
|
|
width: ScreenUtil().setWidth(2)),
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(20))),
|
|
|
|
child: TextField(
|
|
|
|
controller: storeIntroduceC,
|
|
|
|
focusNode: storeIntroduceNode,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
textBaseline: TextBaseline.alphabetic),
|
|
|
|
textAlignVertical: TextAlignVertical.center,
|
|
|
|
maxLines: 5,
|
|
|
|
maxLength: 100,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "点击录入餐厅介绍文字信息,最多100个汉字。",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide.none),
|
|
|
|
),
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
onChanged: (value) {
|
|
|
|
setState(() {
|
|
|
|
// currentRemark = value ?? "";
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
currIndex == 0
|
|
|
|
? _noTextWidget()
|
|
|
|
: currIndex == 1
|
|
|
|
? _mergingWidget()
|
|
|
|
: _separateWidget(),
|
|
|
|
VEmptyView(18),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(20)),
|
|
|
|
child: MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(0.5),
|
|
|
|
color: MyColours.color_DBDBDB,
|
|
|
|
)),
|
|
|
|
VEmptyView(24),
|
|
|
|
// _selectBtnWidget(),
|
|
|
|
_item('预订安排通知中附加餐厅介绍图片', select: addStoreImge, onTap: () {
|
|
|
|
setState(() {
|
|
|
|
addStoreImge = !addStoreImge;
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
|
|
|
|
VEmptyView(24),
|
|
|
|
// Container(
|
|
|
|
// alignment: Alignment.centerLeft,
|
|
|
|
// padding: EdgeInsets.only(left: w(16)),
|
|
|
|
// height: w(48),
|
|
|
|
// child: Text(
|
|
|
|
// '效果预览',
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: font(16),
|
|
|
|
// color: MyColours.color_515151),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// currIndex == 0
|
|
|
|
// ? _noTextWidget()
|
|
|
|
// : currIndex == 1
|
|
|
|
// ? _mergingWidget()
|
|
|
|
// :
|
|
|
|
_separateWidget(),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item('餐厅介绍文字显示在第一张图片上', select: addAbove, onTap: () {
|
|
|
|
setState(() {
|
|
|
|
addAbove = !addAbove;
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
|
|
|
|
VEmptyView(24),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
...
|
...
|
@@ -501,7 +620,7 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { |
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
|
|
|
|
if ((currIndex == 1 || currIndex == 2) &&
|
|
|
|
if (addStoreIntroduce &&
|
|
|
|
storeIntroduceC.text.trim().length == 0) {
|
|
|
|
Utils.showToast('请输入餐厅介绍文字!');
|
|
|
|
return false;
|
|
...
|
...
|
@@ -531,10 +650,13 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { |
|
|
|
|
|
|
|
//接口
|
|
|
|
Map storeData = {
|
|
|
|
'style': currIndex.toString(),
|
|
|
|
'seller_name': sellername,
|
|
|
|
// 'style': currIndex.toString(),
|
|
|
|
// 'seller_name': sellername,
|
|
|
|
'introduce': storeIntroduceC.text,
|
|
|
|
'images': json.encode(images)
|
|
|
|
'images': json.encode(images),
|
|
|
|
'is_introduce': addStoreIntroduce ? '1' : '0',
|
|
|
|
'is_images': addStoreImge ? '1' : '0',
|
|
|
|
'is_above': addAbove ? '1' : '0'
|
|
|
|
};
|
|
|
|
|
|
|
|
Map<String, String> params = {
|
...
|
...
|
|