Commit 292681d6cf94f78719f413b973bcef771f37ed0e

Authored by wdn127929
1 parent f507313c

店铺介绍设置OK

... ... @@ -209,13 +209,18 @@ class MarkStoreModel {
String sellerName; //
String introduce;
List<String> images;
String isIntroduce;
String isAbove;
String isImages;
MarkStoreModel({
this.style,
this.sellerName,
this.introduce,
this.images,
});
MarkStoreModel(
{this.style,
this.sellerName,
this.introduce,
this.images,
this.isIntroduce,
this.isAbove,
this.isImages});
MarkStoreModel.fromJson(Map<String, dynamic> json) {
style = json['style'];
... ... @@ -234,6 +239,10 @@ class MarkStoreModel {
});
}
}
isIntroduce = json['is_introduce'];
isAbove = json['is_above'];
isImages = json['is_images'];
}
Map<String, dynamic> toJson() {
... ... @@ -242,6 +251,10 @@ class MarkStoreModel {
data['seller_name'] = this.sellerName;
data['introduce'] = this.introduce;
data['images'] = this.images;
data['is_introduce'] = this.isIntroduce;
data['is_above'] = this.isAbove;
data['is_images'] = this.isImages;
return data;
}
}
... ...
... ... @@ -61,8 +61,8 @@ class _BookInfoPageState extends State<BookInfoPage> {
bool addParking = false;
bool addPhone = true;
bool addFirstImage = true; //附加餐厅首图
bool addLogo = true; //logo是否展示
bool addFirstImage = false; //附加餐厅首图
bool addLogo = false; //logo是否展示
String dateValue;
BaseIndoProvider _baseIndoProvider;
... ... @@ -645,60 +645,56 @@ class _BookInfoPageState extends State<BookInfoPage> {
}),
VEmptyView(24),
//输入框
addParking
? Container(
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: parkingIncoC,
focusNode: parkingIncoNode,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
textBaseline: TextBaseline.alphabetic),
textAlignVertical: TextAlignVertical.center,
maxLines: 5,
maxLength: 38,
decoration: InputDecoration(
hintText: "点击录入停车信息,最多38个汉字。",
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 ?? "";
});
}),
)
: SizedBox(),
addParking ? VEmptyView(24) : SizedBox(),
addParking
? Padding(
padding: EdgeInsets.symmetric(horizontal: w(20)),
child: MyDivider(
double.infinity,
w(0.5),
Container(
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,
))
: SizedBox(),
width: ScreenUtil().setWidth(2)),
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(20))),
child: TextField(
controller: parkingIncoC,
focusNode: parkingIncoNode,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
textBaseline: TextBaseline.alphabetic),
textAlignVertical: TextAlignVertical.center,
maxLines: 5,
maxLength: 38,
decoration: InputDecoration(
hintText: "点击录入停车信息,最多38个汉字。",
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),
Padding(
padding: EdgeInsets.symmetric(horizontal: w(20)),
child: MyDivider(
double.infinity,
w(0.5),
color: MyColours.color_DBDBDB,
)),
VEmptyView(24),
_item('预订安排通知中附加餐厅Logo图片', select: addLogo, onTap: () {
setState(() {
... ...
... ... @@ -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 = {
... ...