Commit f174a346e7252c3c8e99e8ccd3c6f36a0227c4d5

Authored by wdn127929
1 parent cc65b6f4

多时段部分UI

... ... @@ -18,19 +18,19 @@ if (flutterRoot == null) {
def flutterVersionCode = "530"
def flutterVersionCode = "531"
if (flutterVersionCode == null) {
flutterVersionCode = '530'
flutterVersionCode = '531'
}
def flutterVersionName = "5.3.0"
def flutterVersionName = "5.3.1"
if (flutterVersionName == null) {
flutterVersionName = '5.3.0'
flutterVersionName = '5.3.1'
}
... ...
import 'package:flutter/material.dart';
import 'package:one_key/res/colors.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 BookTimeSettingListPage extends StatefulWidget {
const BookTimeSettingListPage();
@override
State<BookTimeSettingListPage> createState() =>
_BookTimeSettingListPageState();
}
class _BookTimeSettingListPageState extends State<BookTimeSettingListPage> {
List<Widget> listWidget() {
List<Widget> datas = [];
for (int i = 0; i < 10; i++) {
datas.add(
Text(
'25-01-28 除夕',
style: TextStyle(fontSize: font(10), color: MyColours.color_515151),
),
);
}
return datas;
}
List<Widget> listWidgetTime() {
List<Widget> datas = [];
for (int i = 0; i < 10; i++) {
datas.add(
Text(
'25-01-28 除夕',
style: TextStyle(fontSize: font(10), color: MyColours.color_515151),
),
);
}
return datas;
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_f3f3f3,
appBar: SystemAppBar('多时段预订'),
body: Column(
children: [
VEmptyView(32),
Expanded(
child: ListView.builder(
itemCount: 10,
shrinkWrap: true,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.only(
left: w(20), right: w(20), bottom: w(10)),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(r(8))),
child: Column(
children: [
Container(
height: w(33),
decoration: BoxDecoration(
color: MyColours.color_438E93,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(r(8)),
topRight: Radius.circular(r(8)),
)),
child: Row(
children: [
Text(
'每周固定/指定日期',
style: TextStyle(
fontSize: font(18),
color: MyColours.color_ffffff),
)
],
),
),
VEmptyView(16),
Wrap(
spacing: w(10),
children: listWidget(),
),
],
),
);
})),
Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.only(
left: w(45), top: w(12), bottom: w(25), right: w(45)),
child: RoundButton(
text: '保存',
// width: ScreenUtil().setWidth(280 * 2),
height: w(41),
radius: r(5),
isBold: true,
fontSize: 32,
onPressed: () {}))
],
),
);
}
}
... ...
... ... @@ -85,6 +85,12 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
MarketingCenterProvider marketingCenterProvider;
List<String> imgAll = [];
TextEditingController _booktime1 = TextEditingController();
TextEditingController _booktime2 = TextEditingController();
TextEditingController _booktime3 = TextEditingController();
TextEditingController _booktime4 = TextEditingController();
TextEditingController _booktime5 = TextEditingController();
///获取接单时间接口
_getReceiveOrdersTime() async {
GetSellerInfoSunModel model = await bookSetTimeModel.getSellerById(context);
... ... @@ -110,6 +116,12 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
@override
void initState() {
super.initState();
_booktime1.text = '早茶';
_booktime2.text = '午餐';
_booktime3.text = '晚餐';
_booktime4.text = '夜宵';
mapAddress = {
"address": '点击选择',
'lat': '',
... ... @@ -121,7 +133,7 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
noon.end = '14:30';
night.start = '16:00';
night.end = '21:00';
swichState = [false, true, true];
swichState = [false, true, true, false, false];
Utils.changeStatusColor(color: MyColours.color_F8F9FD);
_scrollController = ScrollController();
receiveOrdersTime.start = '08:00';
... ... @@ -762,7 +774,7 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
context, afterImg,
needResize: true);
print(Utils.size(newImg.length));
print(Utils.size(newImg.length));
if (newImg != null) {
String path = await Utils.saveImage(newImg);
if (path == null) {
... ... @@ -1295,26 +1307,77 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
);
}
Widget _itemMorningNoonAngNight(String title, int tag) {
return InkWell(
onTap: () {
setState(() {
swichState[tag] = !swichState[tag];
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(title,
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_999999)),
Image.asset(
Utils.getImgPath(
swichState[tag] ? 'store_swich_on' : 'store_swich_off'),
width: ScreenUtil().setWidth(38 * 2)),
],
),
Widget _itemMorningNoonAngNight(int tag, TextEditingController booktimes) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Container(
// height: ScreenUtil().setWidth(50),
// padding: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(24)),
decoration: BoxDecoration(
color: MyColours.color_F8F9FD,
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(28))),
child: TextField(
controller: booktimes,
maxLines: 1,
// inputFormatters: [
// LengthLimitingTextInputFormatter(
// 15),
// // FilteringTextInputFormatter.digitsOnly
// ],
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_515151),
focusNode: _phoneFocusNode,
decoration: InputDecoration(
border: OutlineInputBorder(borderSide: BorderSide.none),
hintText: '请输入餐段名称',
hintStyle: TextStyle(
color: MyColours.color_BFC4D4,
fontSize: ScreenUtil().setSp(28),
),
contentPadding: EdgeInsets.zero,
isCollapsed: true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
enabledBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
focusedBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
),
onChanged: (value) {
// if (editingController == _nameController) {
// _nameController.text = value;
// }
},
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.text,
),
)),
// Text(title,
// style: TextStyle(
// fontSize: ScreenUtil().setSp(28),
// color: MyColours.color_999999)),
InkWell(
onTap: () {
setState(() {
swichState[tag] = !swichState[tag];
});
},
child: Image.asset(
Utils.getImgPath(
swichState[tag] ? 'store_swich_on' : 'store_swich_off'),
width: ScreenUtil().setWidth(38 * 2))),
],
);
}
... ... @@ -2113,27 +2176,73 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
),
child: Column(
children: [
_itemMorningNoonAngNight('早市:', 0),
_itemMorningNoonAngNight(0, _booktime1),
VEmptyView(34),
swichState[0]
? _itemBookTime(
morning.start, morning.end, 0)
: SizedBox(),
VEmptyView(32),
_itemMorningNoonAngNight('午市:', 1),
_itemMorningNoonAngNight(1, _booktime2),
VEmptyView(34),
swichState[1]
? _itemBookTime(noon.start, noon.end, 1)
: SizedBox(),
VEmptyView(32),
_itemMorningNoonAngNight('晚市:', 2),
_itemMorningNoonAngNight(2, _booktime3),
VEmptyView(34),
swichState[2]
? _itemBookTime(
night.start, night.end, 2)
: SizedBox(),
VEmptyView(32),
_itemMorningNoonAngNight(3, _booktime4),
VEmptyView(34),
swichState[3]
? _itemBookTime(
night.start, night.end, 3)
: SizedBox(),
VEmptyView(32),
_itemMorningNoonAngNight(4, _booktime5),
VEmptyView(34),
swichState[4]
? _itemBookTime(
night.start, night.end, 4)
: SizedBox(),
],
)),
VEmptyView(34),
InkWell(
onTap: () {
NavigatorUtil.goBookTimeSettingListPage(
context);
},
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(24)),
child: Container(
height: ScreenUtil().setWidth(40),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text('指定日期多时段预订设置',
style: TextStyle(
color: MyColours.color_999999,
fontSize:
ScreenUtil().setSp(28),
)),
Spacer(),
Image.asset(
Utils.getImgPath('arrow_right_new'),
width: ScreenUtil().setWidth(16),
height: ScreenUtil().setWidth(28),
)
],
),
))),
VEmptyView(96),
Text('接单时间',
style: TextStyle(
... ...
... ... @@ -2267,5 +2267,16 @@ class NavigatorUtil {
}
///多时段预订设置列表
static Future<dynamic> goBookTimeSettingListPage(
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.book_time_setting_list_page}",
replace: replace);
}
}
... ...
... ... @@ -199,6 +199,7 @@ import '../pages/login/collect_store_info_page.dart';
import '../pages/login/complete_create_store.dart';
import '../pages/login/web_page.dart';
import '../pages/message/message_recharge_info_page.dart';
import '../pages/my/book_time_setting/book_time_setting_list_page.dart';
import '../pages/my/comment_manage/comment_manage_home_page.dart';
import '../pages/my/customer_type/my_customer/my_customer_home_page.dart';
import '../pages/my/customer_type/store_customer/day_order_page.dart';
... ... @@ -3892,3 +3893,21 @@ var wineSettingMsgPageHandle = new Handler(
child: WineSettingMsgPage()));
});
///多时段预订设置列表
var bookTimeSettingListPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
// String rid = params["rid"].first;
// // String smsTemplate = params["smsTemplate"].first;
// CouponUse use = CouponUse.fromJson(
// json.decode(FluroConvertUtils.fluroCnParamsDecode(params["use"].first)));
// CouponSunModel couponSunModel = CouponSunModel.fromJson(json.decode(
// FluroConvertUtils.fluroCnParamsDecode(params["couponSunModel"].first)));
return ChangeNotifierProvider<MarketingCenterProvider>(
create: (_) => MarketingCenterProvider(),
child: BookTimeSettingListPage());
});
... ...
... ... @@ -390,7 +390,12 @@ class Routes {
static String wine_setting_msg_page =
"/wine_setting_msg_page"; //存酒短信模版设置
static String book_time_setting_list_page =
"/book_time_setting_list_page"; //多时段预订列表
... ... @@ -733,6 +738,9 @@ router.define(select_table_f_or_reserve, handler: handleSelectTableFOrReserveHan
router.define(mini_program_setting_page, handler: miniprogramSettingPageHandle);
router.define(wine_setting_msg_page, handler:wineSettingMsgPageHandle);
router.define(book_time_setting_list_page, handler:bookTimeSettingListPageHandle);
... ...