|
|
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:one_key/models/mark_data_model.dart';
|
|
|
|
import 'package:one_key/widgets/MyDivider.dart';
|
|
|
|
import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
import '../../../../constant/state.dart';
|
|
|
|
import '../../../../models/theme_color_model.dart';
|
|
|
|
import '../../../../provider/marketing_center_provider.dart';
|
|
|
|
import '../../../../provider/upload_img_provider.dart';
|
|
|
|
import '../../../../provider/user_model.dart';
|
|
|
|
import '../../../../res/colors.dart';
|
|
|
|
import '../../../../utils/screen_util.dart';
|
|
|
|
import '../../../../utils/utils.dart';
|
|
|
|
import '../../../../widgets/h_empty_view.dart';
|
|
|
|
import '../../../../widgets/page_exception.dart';
|
|
|
|
import '../../../../widgets/round_button.dart';
|
|
|
|
import '../../../../widgets/v_empty_view.dart';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 预订安排定制预览页
|
|
|
|
*/
|
|
|
|
|
|
|
|
class MarkingPreviewPage extends StatefulWidget {
|
|
|
|
MarkingPreviewPage({Key key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_MarkingPreviewPageState createState() => _MarkingPreviewPageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _MarkingPreviewPageState extends State<MarkingPreviewPage> {
|
|
|
|
ScrollController controller = ScrollController();
|
|
|
|
|
|
|
|
MarketingCenterProvider _marketingCenterProvider;
|
|
|
|
|
|
|
|
List<ThemeColorModel> themeColorData = [];
|
|
|
|
int themeColorIndex = 0;
|
|
|
|
|
|
|
|
String homeTitle = '';
|
|
|
|
String homeSlogan = '';
|
|
|
|
String homeImage = '';
|
|
|
|
|
|
|
|
UploadImageProvider _uploadImageProvider;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
_initThemeColor();
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
getSellerTemplateConf();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
///初始化主题颜色
|
|
|
|
_initThemeColor() {
|
|
|
|
// int colorValue = App.sp.get("themeColor");
|
|
|
|
|
|
|
|
// if (colorValue != null) {
|
|
|
|
// //缓存里有设置好的主题色
|
|
|
|
// if (colorValue == MyColours.color_0C0F0E.value) {
|
|
|
|
// themeColorIndex = 0;
|
|
|
|
// } else if (colorValue == MyColours.color_0143A3.value) {
|
|
|
|
// themeColorIndex = 1;
|
|
|
|
// } else if (colorValue == MyColours.color_438E93.value) {
|
|
|
|
// themeColorIndex = 2;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
ThemeColorModel colorModel = ThemeColorModel();
|
|
|
|
colorModel.name = '睿智黑';
|
|
|
|
colorModel.color = MyColours.color_0C0F0E;
|
|
|
|
colorModel.gradient = LinearGradient(
|
|
|
|
stops: [0, 1.24],
|
|
|
|
colors: [
|
|
|
|
// Color.fromARGB(67, 59, 206, 224),
|
|
|
|
// Color.fromRGBO(67, 85, 250, 162),
|
|
|
|
MyColours.color_0C0F0E,
|
|
|
|
MyColours.color_C76216,
|
|
|
|
],
|
|
|
|
// begin: Alignment(0, 0),
|
|
|
|
// end: Alignment(2, 2),
|
|
|
|
begin: Alignment.bottomCenter,
|
|
|
|
end: Alignment.topCenter,
|
|
|
|
);
|
|
|
|
colorModel.gradientSub = LinearGradient(
|
|
|
|
stops: [0, 1.24],
|
|
|
|
colors: [
|
|
|
|
// Color.fromARGB(67, 59, 206, 224),
|
|
|
|
// Color.fromRGBO(67, 85, 250, 162),
|
|
|
|
MyColours.color_0C0F0E,
|
|
|
|
MyColours.color_EEAE74,
|
|
|
|
],
|
|
|
|
begin: Alignment.bottomCenter,
|
|
|
|
end: Alignment.topCenter,
|
|
|
|
);
|
|
|
|
themeColorData.add(colorModel);
|
|
|
|
|
|
|
|
ThemeColorModel colorModel1 = ThemeColorModel();
|
|
|
|
colorModel1.name = '孔雀蓝';
|
|
|
|
colorModel1.color = MyColours.color_0143A3;
|
|
|
|
colorModel1.gradient = LinearGradient(
|
|
|
|
stops: [0, 1.24],
|
|
|
|
colors: [
|
|
|
|
// Color.fromARGB(67, 59, 206, 224),
|
|
|
|
// Color.fromRGBO(67, 85, 250, 162),
|
|
|
|
MyColours.color_0143A3,
|
|
|
|
MyColours.color_CFB53B,
|
|
|
|
],
|
|
|
|
// begin: Alignment(0, 0),
|
|
|
|
// end: Alignment(2, 2),
|
|
|
|
begin: Alignment.bottomCenter,
|
|
|
|
end: Alignment.topCenter,
|
|
|
|
);
|
|
|
|
colorModel1.gradientSub = LinearGradient(
|
|
|
|
stops: [0, 1.24],
|
|
|
|
colors: [
|
|
|
|
// Color.fromARGB(67, 59, 206, 224),
|
|
|
|
// Color.fromRGBO(67, 85, 250, 162),
|
|
|
|
MyColours.color_0143A3,
|
|
|
|
MyColours.color_EEAE74,
|
|
|
|
],
|
|
|
|
begin: Alignment.bottomCenter,
|
|
|
|
end: Alignment.topCenter,
|
|
|
|
);
|
|
|
|
themeColorData.add(colorModel1);
|
|
|
|
|
|
|
|
ThemeColorModel colorModel2 = ThemeColorModel();
|
|
|
|
colorModel2.name = '群青绿';
|
|
|
|
colorModel2.color = MyColours.color_438E93;
|
|
|
|
colorModel2.gradient = LinearGradient(
|
|
|
|
stops: [0, 1.24],
|
|
|
|
colors: [
|
|
|
|
// Color.fromARGB(67, 59, 206, 224),
|
|
|
|
// Color.fromRGBO(67, 85, 250, 162),
|
|
|
|
MyColours.color_438E93,
|
|
|
|
MyColours.color_CFB53B,
|
|
|
|
],
|
|
|
|
// begin: Alignment(0, 0),
|
|
|
|
// end: Alignment(2, 2),
|
|
|
|
begin: Alignment.bottomCenter,
|
|
|
|
end: Alignment.topCenter,
|
|
|
|
);
|
|
|
|
colorModel2.gradientSub = LinearGradient(
|
|
|
|
stops: [0, 1.24],
|
|
|
|
colors: [
|
|
|
|
// Color.fromARGB(67, 59, 206, 224),
|
|
|
|
// Color.fromRGBO(67, 85, 250, 162),
|
|
|
|
MyColours.color_438E93,
|
|
|
|
MyColours.color_EEAE74,
|
|
|
|
],
|
|
|
|
begin: Alignment.bottomCenter,
|
|
|
|
end: Alignment.topCenter,
|
|
|
|
);
|
|
|
|
themeColorData.add(colorModel2);
|
|
|
|
}
|
|
|
|
|
|
|
|
getSellerTemplateConf() async {
|
|
|
|
bool success =
|
|
|
|
await _marketingCenterProvider.getSellerTemplateConf(context);
|
|
|
|
if (success && _marketingCenterProvider.markDataModel != null) {
|
|
|
|
if (_marketingCenterProvider.markDataModel.home != null) {
|
|
|
|
int colorValue =
|
|
|
|
int.parse(_marketingCenterProvider.markDataModel.home.themeColor);
|
|
|
|
if (colorValue == MyColours.color_0C0F0E.value) {
|
|
|
|
themeColorIndex = 0;
|
|
|
|
} else if (colorValue == MyColours.color_0143A3.value) {
|
|
|
|
themeColorIndex = 1;
|
|
|
|
} else if (colorValue == MyColours.color_438E93.value) {
|
|
|
|
themeColorIndex = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
homeTitle = _marketingCenterProvider.markDataModel.home.title;
|
|
|
|
homeSlogan = _marketingCenterProvider.markDataModel.home.slogan;
|
|
|
|
homeImage = _marketingCenterProvider.markDataModel.home.image ?? null;
|
|
|
|
}
|
|
|
|
if (_marketingCenterProvider.markDataModel.reserve != null) {
|
|
|
|
int colorValue =
|
|
|
|
int.parse(_marketingCenterProvider.markDataModel.home.themeColor);
|
|
|
|
if (colorValue == MyColours.color_0C0F0E.value) {
|
|
|
|
themeColorIndex = 0;
|
|
|
|
} else if (colorValue == MyColours.color_0143A3.value) {
|
|
|
|
themeColorIndex = 1;
|
|
|
|
} else if (colorValue == MyColours.color_438E93.value) {
|
|
|
|
themeColorIndex = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
homeTitle = _marketingCenterProvider.markDataModel.home.title;
|
|
|
|
homeSlogan = _marketingCenterProvider.markDataModel.home.slogan;
|
|
|
|
homeImage = _marketingCenterProvider.markDataModel.home.image ?? null;
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//首图形象展示
|
|
|
|
Widget _firstImageWidget() {
|
|
|
|
ThemeColorModel themeColerModel = themeColorData[themeColorIndex];
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: w(165),
|
|
|
|
color: themeColerModel.color,
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath('olive_${themeColorIndex}'),
|
|
|
|
height: w(69),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
height: w(39),
|
|
|
|
child: ShaderMask(
|
|
|
|
shaderCallback: (rect) {
|
|
|
|
return themeColerModel.gradient.createShader(rect);
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
homeTitle,
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.white,
|
|
|
|
fontSize: font(36),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// child: Text(
|
|
|
|
// homeTitle,
|
|
|
|
// // maxLines: 1,
|
|
|
|
// // overflow: TextOverflow.ellipsis,
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: font(36),
|
|
|
|
// foreground: Paint()
|
|
|
|
// ..shader = themeColerModel.gradient.createShader(
|
|
|
|
// Rect.fromLTWH(
|
|
|
|
// 0, 0, ScreenUtil().screenWidth, w(39)))),
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
// ),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(12),
|
|
|
|
ShaderMask(
|
|
|
|
shaderCallback: (rect) {
|
|
|
|
return themeColerModel.gradientSub.createShader(rect);
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
homeSlogan,
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.white,
|
|
|
|
fontSize: font(20),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// Container(
|
|
|
|
// width: double.infinity,
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
// height: w(39),
|
|
|
|
// child: Text(
|
|
|
|
// homeSlogan,
|
|
|
|
// maxLines: 2,
|
|
|
|
// overflow: TextOverflow.ellipsis,
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: font(20),
|
|
|
|
// foreground: Paint()
|
|
|
|
// ..shader = themeColerModel.gradientSub.createShader(
|
|
|
|
// Rect.fromLTWH(0, 0, ScreenUtil().screenWidth, 0))),
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
homeImage != null && homeImage != ''
|
|
|
|
? CachedNetworkImage(
|
|
|
|
imageUrl: homeImage,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: double.infinity,
|
|
|
|
// width: ScreenUtil()
|
|
|
|
// .setWidth(imgSize * 2),
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(_uploadImageProvider.imgSizefirstImage * 2),
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
//预订信息模块
|
|
|
|
Widget _bookInfoWidget() {
|
|
|
|
MarkReserveModel reserveModel =
|
|
|
|
_marketingCenterProvider.markDataModel.reserve;
|
|
|
|
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(
|
|
|
|
int.parse(reserveModel.date.toString()) * 1000);
|
|
|
|
String date = Utils.returnYMDandLunarCalendar(dateTime, context);
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: w(10)),
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(8)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
left:
|
|
|
|
BorderSide(width: w(2), color: MyColours.color_EEAE74))),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'尊敬的贵宾,您好!',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_000000, fontSize: font(14)),
|
|
|
|
),
|
|
|
|
VEmptyView(10),
|
|
|
|
Text('非常感谢您选择【${reserveModel.sellerName}】!',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_000000, fontSize: font(14))),
|
|
|
|
VEmptyView(30),
|
|
|
|
_itemTitleAndSubTtile('日期', '${date}'),
|
|
|
|
VEmptyView(10),
|
|
|
|
_itemTitleAndSubTtile('餐段', '${reserveModel.dsolt}'),
|
|
|
|
VEmptyView(10),
|
|
|
|
_itemTitleAndSubTtile('包间', '${reserveModel.room}'),
|
|
|
|
VEmptyView(10),
|
|
|
|
_itemTitleAndSubTtile('人数', '${reserveModel.pnum}'),
|
|
|
|
VEmptyView(10),
|
|
|
|
_itemTitleAndSubTtile('地址', '${reserveModel.address}'),
|
|
|
|
VEmptyView(10),
|
|
|
|
reserveModel.swichPark == '1'
|
|
|
|
? _itemTitleAndSubTtile('停车', '${reserveModel.parkInfo}')
|
|
|
|
: SizedBox(),
|
|
|
|
reserveModel.swichPark == '1' ? VEmptyView(10) : SizedBox(),
|
|
|
|
_itemTitleAndSubTtile('联系', '${reserveModel.sellerPhone}'),
|
|
|
|
VEmptyView(20),
|
|
|
|
reserveModel.swichManager == '1'
|
|
|
|
? Row(
|
|
|
|
children: [
|
|
|
|
HEmptyView(72),
|
|
|
|
ClipRRect(
|
|
|
|
borderRadius: BorderRadius.circular(r(35)),
|
|
|
|
child: Image.network(
|
|
|
|
reserveModel.managerImage,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: w(70),
|
|
|
|
height: w(70),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'专属服务:${reserveModel.managerName}',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: font(12)),
|
|
|
|
),
|
|
|
|
VEmptyView(16),
|
|
|
|
Text(
|
|
|
|
'服务电话:${reserveModel.managerPhone}',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: font(12)),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
HEmptyView(6),
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
RoundButton(
|
|
|
|
width: w(72),
|
|
|
|
height: w(22),
|
|
|
|
text: '拨打电话',
|
|
|
|
gradientStart: MyColours.color_ffffff,
|
|
|
|
gradientEnd: MyColours.color_ffffff,
|
|
|
|
borderColor: MyColours.color_0143A3,
|
|
|
|
textColor: MyColours.color_0143A3,
|
|
|
|
radius: r(11),
|
|
|
|
fontSize: 24,
|
|
|
|
isBold: true,
|
|
|
|
onPressed: () {},
|
|
|
|
),
|
|
|
|
VEmptyView(16),
|
|
|
|
RoundButton(
|
|
|
|
width: w(72),
|
|
|
|
height: w(22),
|
|
|
|
text: '复制微信号',
|
|
|
|
gradientStart: MyColours.color_ffffff,
|
|
|
|
gradientEnd: MyColours.color_ffffff,
|
|
|
|
borderColor: MyColours.color_0143A3,
|
|
|
|
textColor: MyColours.color_0143A3,
|
|
|
|
radius: r(11),
|
|
|
|
fontSize: 24,
|
|
|
|
isBold: true,
|
|
|
|
onPressed: () {},
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
reserveModel.swichManager == '1' ? VEmptyView(10) : SizedBox(),
|
|
|
|
Text('欢迎垂询,恭候光临!',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_000000, fontSize: font(14))),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: w(20)),
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(15), vertical: w(12)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_d9d9d9,
|
|
|
|
borderRadius: BorderRadius.circular(r(5))),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('location_blue'),
|
|
|
|
width: w(26),
|
|
|
|
),
|
|
|
|
HEmptyView(28),
|
|
|
|
Expanded(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text('${reserveModel.sellerName}',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_000000,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: font(14))),
|
|
|
|
VEmptyView(10),
|
|
|
|
Text('${reserveModel.address}',
|
|
|
|
style: TextStyle(
|
|
|
|
height: 1.3,
|
|
|
|
color: MyColours.color_000000,
|
|
|
|
fontSize: font(14))),
|
|
|
|
],
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(21)),
|
|
|
|
child: Text(
|
|
|
|
'确认赴约客人:0位',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(18),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
)),
|
|
|
|
VEmptyView(40),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(21)),
|
|
|
|
child: MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(0.5),
|
|
|
|
color: MyColours.color_DBDBDB,
|
|
|
|
)),
|
|
|
|
VEmptyView(20),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
_itemTitleAndSubTtile(String title, String subtitle) {
|
|
|
|
return Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text('【${title}】',
|
|
|
|
style:
|
|
|
|
TextStyle(color: MyColours.color_000000, fontSize: font(14))),
|
|
|
|
HEmptyView(10),
|
|
|
|
Expanded(
|
|
|
|
child: Text('${subtitle}',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_000000, fontSize: font(14)))),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///店铺介绍
|
|
|
|
Widget _storeIntroduceWidget(ScrollController controller) {
|
|
|
|
int currIndex =
|
|
|
|
int.parse(_marketingCenterProvider.markDataModel.store.style);
|
|
|
|
return currIndex == 0
|
|
|
|
? _noTextWidget(controller)
|
|
|
|
: currIndex == 1
|
|
|
|
? _mergingWidget(controller)
|
|
|
|
: _separateWidget(controller);
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _introduceWidget(EdgeInsets edgeInsets,
|
|
|
|
{double width = double.infinity,
|
|
|
|
Color textColor = MyColours.color_515151,
|
|
|
|
Color hintColor = MyColours.color_999999,
|
|
|
|
BoxDecoration boxDecoration}) {
|
|
|
|
return Container(
|
|
|
|
width: width,
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
padding: edgeInsets,
|
|
|
|
decoration: boxDecoration,
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'Introduce',
|
|
|
|
style: TextStyle(color: MyColours.color_B39437, fontSize: font(14)),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
'品牌介绍',
|
|
|
|
style: TextStyle(color: MyColours.color_B39437, fontSize: font(14)),
|
|
|
|
),
|
|
|
|
VEmptyView(16),
|
|
|
|
Text(
|
|
|
|
'${_marketingCenterProvider.markDataModel.store.sellerName}',
|
|
|
|
style: TextStyle(color: textColor, fontSize: font(14)),
|
|
|
|
),
|
|
|
|
VEmptyView(32),
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
// margin: EdgeInsets.symmetric(horizontal: w(10)),
|
|
|
|
// padding: EdgeInsets.symmetric(horizontal: w(6)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
left: BorderSide(
|
|
|
|
width: w(2), color: MyColours.color_EEAE74))),
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(12),
|
|
|
|
),
|
|
|
|
alignment: Alignment.topLeft,
|
|
|
|
child: Text(
|
|
|
|
_marketingCenterProvider.markDataModel.store.introduce,
|
|
|
|
style: TextStyle(
|
|
|
|
height: 2,
|
|
|
|
color: textColor,
|
|
|
|
fontSize: ScreenUtil().setSp(20),
|
|
|
|
textBaseline: TextBaseline.alphabetic),
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
maxLines: 7,
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///无文字
|
|
|
|
Widget _noTextWidget(ScrollController controller) {
|
|
|
|
List<String> images = _marketingCenterProvider.markDataModel.store.images;
|
|
|
|
return ListView.builder(
|
|
|
|
shrinkWrap: true,
|
|
|
|
controller: controller,
|
|
|
|
itemCount: images.length,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return Container(
|
|
|
|
margin: EdgeInsets.only(bottom: w(8)),
|
|
|
|
child: CachedNetworkImage(
|
|
|
|
imageUrl: images[index],
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: double.infinity,
|
|
|
|
// width: ScreenUtil()
|
|
|
|
// .setWidth(imgSize * 2),
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(_uploadImageProvider.imgSizefirstImage * 2),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
///图文合并
|
|
|
|
Widget _mergingWidget(ScrollController controller) {
|
|
|
|
List<String> images = _marketingCenterProvider.markDataModel.store.images;
|
|
|
|
return ListView.builder(
|
|
|
|
shrinkWrap: true,
|
|
|
|
controller: controller,
|
|
|
|
itemCount: images.length,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
if (index == 0) {
|
|
|
|
return Stack(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(bottom: w(8)),
|
|
|
|
child: CachedNetworkImage(
|
|
|
|
imageUrl: images[index],
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: double.infinity,
|
|
|
|
// width: ScreenUtil()
|
|
|
|
// .setWidth(imgSize * 2),
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(_uploadImageProvider.imgSizefirstImage * 2),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
child: _introduceWidget(
|
|
|
|
EdgeInsets.only(
|
|
|
|
left: w(15), top: w(23), right: w(7), bottom: w(42)),
|
|
|
|
textColor: MyColours.color_ffffff,
|
|
|
|
hintColor: MyColours.color_ffffff,
|
|
|
|
boxDecoration: BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
stops: [0, 1],
|
|
|
|
begin: Alignment.topCenter,
|
|
|
|
end: Alignment.bottomCenter,
|
|
|
|
colors: [
|
|
|
|
themeColorData[themeColorIndex].color,
|
|
|
|
MyColours.color_4D0C0F0E,
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
width: w(160),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return Container(
|
|
|
|
margin: EdgeInsets.only(bottom: w(8)),
|
|
|
|
child: CachedNetworkImage(
|
|
|
|
imageUrl: images[index],
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: double.infinity,
|
|
|
|
// width: ScreenUtil()
|
|
|
|
// .setWidth(imgSize * 2),
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(_uploadImageProvider.imgSizefirstImage * 2),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
///图文分开
|
|
|
|
Widget _separateWidget(ScrollController controller) {
|
|
|
|
List<String> images = _marketingCenterProvider.markDataModel.store.images;
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
_introduceWidget(EdgeInsets.all(w(15)),
|
|
|
|
boxDecoration: BoxDecoration(color: MyColours.color_ffffff)),
|
|
|
|
VEmptyView(18),
|
|
|
|
ListView.builder(
|
|
|
|
shrinkWrap: true,
|
|
|
|
controller: controller,
|
|
|
|
itemCount: images.length,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return Container(
|
|
|
|
margin: EdgeInsets.only(bottom: w(8)),
|
|
|
|
child: CachedNetworkImage(
|
|
|
|
imageUrl: images[index],
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: double.infinity,
|
|
|
|
// width: ScreenUtil()
|
|
|
|
// .setWidth(imgSize * 2),
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(_uploadImageProvider.imgSizefirstImage * 2),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
})
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///厨师
|
|
|
|
Widget _chefWidget() {
|
|
|
|
int currIndex =
|
|
|
|
int.parse(_marketingCenterProvider.markDataModel.chef.style);
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
currIndex == 0
|
|
|
|
? _noTextChefWidget()
|
|
|
|
: currIndex == 1
|
|
|
|
? _mergingChefWidget()
|
|
|
|
: _separateChefWidget(),
|
|
|
|
VEmptyView(18),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///无介绍
|
|
|
|
Widget _noTextChefWidget() {
|
|
|
|
return SizedBox();
|
|
|
|
// return Column(
|
|
|
|
// children: [
|
|
|
|
// _uploadImage(),
|
|
|
|
// VEmptyView(18),
|
|
|
|
// ],
|
|
|
|
// );
|
|
|
|
}
|
|
|
|
|
|
|
|
///图文合并
|
|
|
|
Widget _mergingChefWidget() {
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
Stack(
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
children: [
|
|
|
|
CachedNetworkImage(
|
|
|
|
imageUrl: _marketingCenterProvider.markDataModel.chef.image,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: double.infinity,
|
|
|
|
// width: ScreenUtil()
|
|
|
|
// .setWidth(imgSize * 2),
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(_uploadImageProvider.imgSizefirstImage * 2),
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
child: _introduceChefWidget(
|
|
|
|
EdgeInsets.only(
|
|
|
|
right: w(15), top: w(23), left: w(7), bottom: w(42)),
|
|
|
|
textColor: MyColours.color_ffffff,
|
|
|
|
hintColor: MyColours.color_ffffff,
|
|
|
|
boxDecoration: BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
stops: [0, 1],
|
|
|
|
begin: Alignment.topCenter,
|
|
|
|
end: Alignment.bottomCenter,
|
|
|
|
colors: [
|
|
|
|
themeColorData[themeColorIndex].color,
|
|
|
|
MyColours.color_4D0C0F0E,
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
width: w(160),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///图文分开
|
|
|
|
Widget _separateChefWidget() {
|
|
|
|
return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
|
|
_introduceChefWidget(EdgeInsets.all(w(15)),
|
|
|
|
boxDecoration: BoxDecoration(color: MyColours.color_ffffff)),
|
|
|
|
VEmptyView(18),
|
|
|
|
CachedNetworkImage(
|
|
|
|
imageUrl: _marketingCenterProvider.markDataModel.chef.image,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: double.infinity,
|
|
|
|
// width: ScreenUtil()
|
|
|
|
// .setWidth(imgSize * 2),
|
|
|
|
height:
|
|
|
|
ScreenUtil().setWidth(_uploadImageProvider.imgSizefirstImage * 2),
|
|
|
|
)
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _introduceChefWidget(EdgeInsets edgeInsets,
|
|
|
|
{double width = double.infinity,
|
|
|
|
Color textColor = MyColours.color_515151,
|
|
|
|
Color hintColor = MyColours.color_999999,
|
|
|
|
BoxDecoration boxDecoration}) {
|
|
|
|
return Container(
|
|
|
|
width: width,
|
|
|
|
height: _uploadImageProvider.imgSizefirstImage,
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
padding: edgeInsets,
|
|
|
|
decoration: boxDecoration,
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'Chief Cook',
|
|
|
|
style: TextStyle(color: MyColours.color_B39437, fontSize: font(14)),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
'知名主厨',
|
|
|
|
style: TextStyle(color: MyColours.color_B39437, fontSize: font(14)),
|
|
|
|
),
|
|
|
|
VEmptyView(16),
|
|
|
|
// Text(
|
|
|
|
// '${sellername}',
|
|
|
|
// style: TextStyle(color: textColor, fontSize: font(14)),
|
|
|
|
// ),
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
alignment: Alignment.topRight,
|
|
|
|
child: Text(
|
|
|
|
_marketingCenterProvider.markDataModel.chef.chefName,
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
style: TextStyle(
|
|
|
|
color: textColor,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
textBaseline: TextBaseline.alphabetic),
|
|
|
|
maxLines: 1,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(32),
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
// margin: EdgeInsets.symmetric(horizontal: w(10)),
|
|
|
|
// padding: EdgeInsets.symmetric(horizontal: w(6)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
right: BorderSide(
|
|
|
|
width: w(2), color: MyColours.color_EEAE74))),
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(12),
|
|
|
|
),
|
|
|
|
alignment: Alignment.topRight,
|
|
|
|
child: Text(
|
|
|
|
_marketingCenterProvider.markDataModel.chef.introduce,
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
style: TextStyle(
|
|
|
|
height: 2,
|
|
|
|
color: textColor,
|
|
|
|
fontSize: ScreenUtil().setSp(20),
|
|
|
|
textBaseline: TextBaseline.alphabetic),
|
|
|
|
maxLines: 7,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///招牌菜展示
|
|
|
|
Widget _signboardWidget(ScrollController controller) {
|
|
|
|
List<String> images =
|
|
|
|
_marketingCenterProvider.markDataModel.signboard.images;
|
|
|
|
return _marketingCenterProvider.markDataModel.signboard.swich == '1'
|
|
|
|
? ListView.builder(
|
|
|
|
shrinkWrap: true,
|
|
|
|
controller: controller,
|
|
|
|
itemCount: images.length,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
if (index == 0) {
|
|
|
|
return Stack(
|
|
|
|
alignment: Alignment.topCenter,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(bottom: w(8)),
|
|
|
|
child: CachedNetworkImage(
|
|
|
|
imageUrl: images[index],
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: double.infinity,
|
|
|
|
// width: ScreenUtil()
|
|
|
|
// .setWidth(imgSize * 2),
|
|
|
|
height: ScreenUtil().setWidth(
|
|
|
|
_uploadImageProvider.imgSizefirstImage * 2),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: w(26), top: w(16), bottom: w(16)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
stops: [0, 1],
|
|
|
|
begin: Alignment.topCenter,
|
|
|
|
end: Alignment.bottomCenter,
|
|
|
|
colors: [
|
|
|
|
themeColorData[themeColorIndex].color,
|
|
|
|
MyColours.color_4D0C0F0E,
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text('Favorites',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_B39437,
|
|
|
|
fontSize: font(14))),
|
|
|
|
Text('菜品展示',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_B39437,
|
|
|
|
fontSize: font(14)))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return Container(
|
|
|
|
margin: EdgeInsets.only(bottom: w(8)),
|
|
|
|
child: CachedNetworkImage(
|
|
|
|
imageUrl: images[index],
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: double.infinity,
|
|
|
|
// width: ScreenUtil()
|
|
|
|
// .setWidth(imgSize * 2),
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(_uploadImageProvider.imgSizefirstImage * 2),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
})
|
|
|
|
: SizedBox();
|
|
|
|
}
|
|
|
|
|
|
|
|
///去点餐
|
|
|
|
Widget _orderWidget() {
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(20), vertical: w(8)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'特供服务',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(18),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(10)),
|
|
|
|
child: Text(
|
|
|
|
'本店特为贵宾提供提前点餐服务,您现在可以选菜下单,到店就餐时无需等待服务员点餐,可以直接享受就餐服务^_^',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(12),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
)),
|
|
|
|
VEmptyView(20),
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
child: Container(
|
|
|
|
width: w(72),
|
|
|
|
height: w(22),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(r(11)),
|
|
|
|
gradient: LinearGradient(stops: [
|
|
|
|
-0.57,
|
|
|
|
0.55,
|
|
|
|
1.48
|
|
|
|
], colors: [
|
|
|
|
MyColours.color_4C8DAD,
|
|
|
|
MyColours.color_0143A3,
|
|
|
|
MyColours.color_42A5FF
|
|
|
|
], begin: Alignment.topLeft, end: Alignment.bottomRight)),
|
|
|
|
child: Text(
|
|
|
|
'去点餐',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(12),
|
|
|
|
color: MyColours.color_F8F9FD,
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(0.5),
|
|
|
|
color: MyColours.color_DBDBDB,
|
|
|
|
),
|
|
|
|
VEmptyView(16),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///logo + 优惠政策链接
|
|
|
|
///
|
|
|
|
Widget _logoWidget() {
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
height: w(180),
|
|
|
|
child: CachedNetworkImage(
|
|
|
|
imageUrl: _marketingCenterProvider.markDataModel.marketing.logo,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: double.infinity,
|
|
|
|
// width: ScreenUtil()
|
|
|
|
// .setWidth(imgSize * 2),
|
|
|
|
height: w(180),
|
|
|
|
)),
|
|
|
|
VEmptyView(40),
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
),
|
|
|
|
child: Text(
|
|
|
|
_marketingCenterProvider.markDataModel.marketing.wecomle,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_000000,
|
|
|
|
fontSize: ScreenUtil().setSp(40),
|
|
|
|
textBaseline: TextBaseline.alphabetic),
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
maxLines: 5,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
// maxLength: 38,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
_marketingCenterProvider.markDataModel.marketing.isLink == '1'
|
|
|
|
? VEmptyView(90)
|
|
|
|
: SizedBox(),
|
|
|
|
_marketingCenterProvider.markDataModel.marketing.isLink == '1'
|
|
|
|
? Container(
|
|
|
|
width: w(188),
|
|
|
|
height: w(22),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(r(11)),
|
|
|
|
gradient: LinearGradient(
|
|
|
|
stops: [
|
|
|
|
-0.57,
|
|
|
|
0.55,
|
|
|
|
1.48
|
|
|
|
],
|
|
|
|
colors: [
|
|
|
|
MyColours.color_4C8DAD,
|
|
|
|
MyColours.color_0143A3,
|
|
|
|
MyColours.color_42A5FF
|
|
|
|
],
|
|
|
|
begin: Alignment.centerLeft,
|
|
|
|
end: Alignment.centerRight)),
|
|
|
|
child: RoundButton(
|
|
|
|
width: w(186),
|
|
|
|
height: w(20),
|
|
|
|
text: '点击了解更多会员优惠政策',
|
|
|
|
gradientStart: MyColours.color_ffffff,
|
|
|
|
gradientEnd: MyColours.color_ffffff,
|
|
|
|
borderColor: Colors.transparent,
|
|
|
|
// borderColor: MyColours.color_999999,
|
|
|
|
textColor: MyColours.color_999999,
|
|
|
|
radius: r(11),
|
|
|
|
fontSize: 24,
|
|
|
|
|
|
|
|
isBold: true,
|
|
|
|
onPressed: () {},
|
|
|
|
))
|
|
|
|
: SizedBox(),
|
|
|
|
VEmptyView(18),
|
|
|
|
Container(
|
|
|
|
height: w(28),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text(
|
|
|
|
Provider.of<UserModel>(context, listen: false).user.sellername,
|
|
|
|
style: TextStyle(fontSize: font(14), color: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(20)
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
_marketingCenterProvider =
|
|
|
|
Provider.of<MarketingCenterProvider>(context, listen: true);
|
|
|
|
_uploadImageProvider =
|
|
|
|
Provider.of<UploadImageProvider>(context, listen: false);
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
appBar: SystemAppBar(
|
|
|
|
'预览',
|
|
|
|
onTap: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
body: Container(child:
|
|
|
|
Consumer<MarketingCenterProvider>(builder: (context, model, _) {
|
|
|
|
if (model.pageState != PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageState,
|
|
|
|
callback: () {
|
|
|
|
// offset = 0;
|
|
|
|
// getMessage(showLoading: true);
|
|
|
|
|
|
|
|
// if (pageState == PageState.Empty) {
|
|
|
|
// NavigatorUtil.goCouponHistoryPage(context);
|
|
|
|
// } else {
|
|
|
|
// _couponNetworkData(widget.index);
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有预览信息哦,请提交后预览",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
controller: controller,
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
_marketingCenterProvider.markDataModel.home == null
|
|
|
|
? SizedBox()
|
|
|
|
: _firstImageWidget(),
|
|
|
|
VEmptyView(20),
|
|
|
|
_marketingCenterProvider.markDataModel.reserve == null
|
|
|
|
? SizedBox()
|
|
|
|
: _bookInfoWidget(),
|
|
|
|
_marketingCenterProvider.markDataModel.store == null
|
|
|
|
? SizedBox()
|
|
|
|
: _storeIntroduceWidget(controller),
|
|
|
|
_marketingCenterProvider.markDataModel.chef == null
|
|
|
|
? SizedBox()
|
|
|
|
: _chefWidget(),
|
|
|
|
_marketingCenterProvider.markDataModel.signboard == null
|
|
|
|
? SizedBox()
|
|
|
|
: _signboardWidget(controller),
|
|
|
|
_marketingCenterProvider.markDataModel.marketing != null &&
|
|
|
|
_marketingCenterProvider
|
|
|
|
.markDataModel.marketing.isOrder ==
|
|
|
|
'1'
|
|
|
|
? _orderWidget()
|
|
|
|
: SizedBox(),
|
|
|
|
_marketingCenterProvider.markDataModel.marketing != null
|
|
|
|
? _logoWidget()
|
|
|
|
: SizedBox()
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
color: MyColours.color_FAFAFA,
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: w(20), right: w(20), top: w(12), bottom: w(25)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
_marketingCenterProvider.markDataModel.marketing != null &&
|
|
|
|
_marketingCenterProvider
|
|
|
|
.markDataModel.marketing.isOnlineBook ==
|
|
|
|
'1'
|
|
|
|
? RoundButton(
|
|
|
|
text: '再次预订',
|
|
|
|
width: w(100),
|
|
|
|
gradientStart: MyColours.color_ffffff,
|
|
|
|
gradientEnd: MyColours.color_ffffff,
|
|
|
|
borderColor: MyColours.color_0143A3,
|
|
|
|
textColor: MyColours.color_0143A3,
|
|
|
|
radius: r(21),
|
|
|
|
fontSize: 32,
|
|
|
|
height: w(42),
|
|
|
|
isBold: true,
|
|
|
|
onPressed: () async {},
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
_marketingCenterProvider.markDataModel.marketing != null &&
|
|
|
|
_marketingCenterProvider
|
|
|
|
.markDataModel.marketing.isArrival ==
|
|
|
|
'1'
|
|
|
|
? RoundButton(
|
|
|
|
text: '确认赴约',
|
|
|
|
width: w(100),
|
|
|
|
gradientStart: MyColours.color_ffffff,
|
|
|
|
gradientEnd: MyColours.color_ffffff,
|
|
|
|
borderColor: MyColours.color_0143A3,
|
|
|
|
textColor: MyColours.color_0143A3,
|
|
|
|
radius: r(21),
|
|
|
|
fontSize: 32,
|
|
|
|
height: w(42),
|
|
|
|
isBold: true,
|
|
|
|
onPressed: () async {},
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
Container(
|
|
|
|
width: w(100),
|
|
|
|
height: w(42),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(r(21)),
|
|
|
|
gradient: LinearGradient(
|
|
|
|
stops: [
|
|
|
|
-0.57,
|
|
|
|
0.55,
|
|
|
|
1.48
|
|
|
|
],
|
|
|
|
colors: [
|
|
|
|
MyColours.color_4C8DAD,
|
|
|
|
MyColours.color_0143A3,
|
|
|
|
MyColours.color_42A5FF
|
|
|
|
],
|
|
|
|
begin: Alignment.topLeft,
|
|
|
|
end: Alignment.bottomRight)),
|
|
|
|
child: Text(
|
|
|
|
'转发给客人',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(16),
|
|
|
|
color: MyColours.color_F8F9FD,
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
})),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|