|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:one_key/res/colors.dart';
|
|
|
|
import 'package:one_key/utils/dialog_util.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 '../../../utils/screen_util.dart';
|
|
|
|
import '../../../widgets/round_button.dart';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 短信模版配置页面
|
|
|
|
*/
|
|
|
|
|
|
|
|
class SmsTemplateSettingPage extends StatefulWidget {
|
|
|
|
SmsTemplateSettingPage({Key key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_SmsTemplateSettingPageState createState() => _SmsTemplateSettingPageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _SmsTemplateSettingPageState extends State<SmsTemplateSettingPage> {
|
|
|
|
String content = '尊敬的贵宾,您好!\n诚挚感谢您选择老北京烤鸭用餐!\n';
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
// TODO: implement initState
|
|
|
|
super.initState();
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Widget> templateWidgets() {
|
|
|
|
List<Widget> data = [];
|
|
|
|
for (var i = 0; i < 25; i++) {
|
|
|
|
data.add(btnItem('Gld4X4', onTap: () {
|
|
|
|
setState(() {
|
|
|
|
content += 'Gld4X4' + '\n';
|
|
|
|
});
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget btnItem(String title, {GestureTapCallback onTap}) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: onTap,
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.all(w(3)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(r(5)),
|
|
|
|
border: Border.all(width: w(1), color: MyColours.color_438E93)),
|
|
|
|
child: Text(title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_438E93,
|
|
|
|
fontSize: font(12),
|
|
|
|
fontWeight: FontWeight.bold)),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _templeteWidget(
|
|
|
|
String title,
|
|
|
|
) {
|
|
|
|
return Container(
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: w(16), vertical: w(5)),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(fontSize: font(16), color: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
HEmptyView(34),
|
|
|
|
Expanded(
|
|
|
|
child: Wrap(
|
|
|
|
spacing: w(5),
|
|
|
|
runSpacing: w(5),
|
|
|
|
children: templateWidgets(),
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
appBar: SystemAppBar('预订通知短信模板选择'),
|
|
|
|
body: Column(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
_templeteWidget('固定模版'),
|
|
|
|
_templeteWidget('可变模版'),
|
|
|
|
VEmptyView(10),
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
padding: EdgeInsets.all(w(10)),
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: w(16)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
color: MyColours.color_DBDBDB, width: w(1)),
|
|
|
|
borderRadius: BorderRadius.circular(r(8))),
|
|
|
|
child: Text(
|
|
|
|
content,
|
|
|
|
style: TextStyle(
|
|
|
|
height: 1.5,
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(14)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(10),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(21)),
|
|
|
|
child: Wrap(
|
|
|
|
spacing: w(10),
|
|
|
|
runSpacing: w(10),
|
|
|
|
children: templateWidgets(),
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(91 * 2),
|
|
|
|
width: double.infinity,
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
top: ScreenUtil().setWidth(16 * 2),
|
|
|
|
bottom: ScreenUtil().setWidth(35 * 2),
|
|
|
|
left: ScreenUtil().setWidth(23 * 2),
|
|
|
|
right: ScreenUtil().setWidth(23 * 2),
|
|
|
|
),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
spreadRadius: ScreenUtil().setWidth(2),
|
|
|
|
color: Color.fromRGBO(0, 0, 0, 0.1),
|
|
|
|
offset: Offset(0, ScreenUtil().setWidth(-2)),
|
|
|
|
blurRadius: ScreenUtil().setWidth(8))
|
|
|
|
],
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
Radius.circular(ScreenUtil().setWidth(16)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
RoundButton(
|
|
|
|
text: '预览效果',
|
|
|
|
width: w(100),
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
radius: ScreenUtil().setWidth(14),
|
|
|
|
gradientStart: MyColours.color_ffffff,
|
|
|
|
gradientEnd: MyColours.color_ffffff,
|
|
|
|
borderColor: MyColours.color_438E93,
|
|
|
|
textColor: MyColours.color_438E93,
|
|
|
|
isBold: true,
|
|
|
|
fontSize: 32,
|
|
|
|
onPressed: () {
|
|
|
|
DialogUtil.cupertinoAlertDialog(context,
|
|
|
|
content: content);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
HEmptyView(30),
|
|
|
|
Expanded(
|
|
|
|
child: RoundButton(
|
|
|
|
text: '保存',
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
radius: ScreenUtil().setWidth(14),
|
|
|
|
isBold: true,
|
|
|
|
fontSize: 32,
|
|
|
|
onPressed: () async {},
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|