|
@@ -103,166 +103,163 @@ class _BookTimeSettingListPageState extends State<BookTimeSettingListPage> { |
|
@@ -103,166 +103,163 @@ class _BookTimeSettingListPageState extends State<BookTimeSettingListPage> { |
|
103
|
Widget build(BuildContext context) {
|
103
|
Widget build(BuildContext context) {
|
|
104
|
storeBaseInfoP = Provider.of<StoreBaseIndoProvider>(context, listen: false);
|
104
|
storeBaseInfoP = Provider.of<StoreBaseIndoProvider>(context, listen: false);
|
|
105
|
return Scaffold(
|
105
|
return Scaffold(
|
|
106
|
- backgroundColor: MyColours.color_f3f3f3,
|
|
|
|
107
|
- appBar: SystemAppBar('多时段预订'),
|
|
|
|
108
|
- body: Consumer<StoreBaseIndoProvider>(builder: (context, model, _) {
|
|
|
|
109
|
- if (model.pageState != PageState.Success) {
|
|
|
|
110
|
- return ExceptionPage(
|
|
|
|
111
|
- pageState: model.pageState,
|
|
|
|
112
|
- callback: () {
|
|
|
|
113
|
- getSellerMealSection();
|
|
|
|
114
|
- },
|
|
|
|
115
|
- emptyMsg: "暂时没有信息哦",
|
|
|
|
116
|
- emptyImg: "empty_search",
|
|
|
|
117
|
- showMsg: "加载中,请稍后...",
|
|
|
|
118
|
- );
|
|
|
|
119
|
- } else {
|
|
|
|
120
|
- return Column(
|
|
|
|
121
|
- children: [
|
|
|
|
122
|
- Expanded(
|
|
|
|
123
|
- child: ListView.builder(
|
|
|
|
124
|
- padding: EdgeInsets.only(top: w(16)),
|
|
|
|
125
|
- itemCount: storeBaseInfoP.mealListData.length,
|
|
|
|
126
|
- shrinkWrap: true,
|
|
|
|
127
|
- itemBuilder: (context, index) {
|
|
|
|
128
|
- MealListSunModel sunModel =
|
|
|
|
129
|
- storeBaseInfoP.mealListData[index];
|
|
|
|
130
|
- String dateSel = sunModel.type == '1'
|
|
|
|
131
|
- ? sunModel.dateSel.split(',').map((e) {
|
|
|
|
132
|
- String str = e.replaceAll(' ', '');
|
|
|
|
133
|
- List strlist = str.split('-');
|
106
|
+ backgroundColor: MyColours.color_f3f3f3,
|
|
|
|
107
|
+ appBar: SystemAppBar('多时段预订'),
|
|
|
|
108
|
+ body: Column(
|
|
|
|
109
|
+ children: [
|
|
|
|
110
|
+ Expanded(child:
|
|
|
|
111
|
+ Consumer<StoreBaseIndoProvider>(builder: (context, model, _) {
|
|
|
|
112
|
+ if (model.pageState != PageState.Success) {
|
|
|
|
113
|
+ return ExceptionPage(
|
|
|
|
114
|
+ pageState: model.pageState,
|
|
|
|
115
|
+ callback: () {
|
|
|
|
116
|
+ getSellerMealSection();
|
|
|
|
117
|
+ },
|
|
|
|
118
|
+ emptyMsg: "暂时没有信息哦",
|
|
|
|
119
|
+ emptyImg: "empty_search",
|
|
|
|
120
|
+ showMsg: "加载中,请稍后...",
|
|
|
|
121
|
+ );
|
|
|
|
122
|
+ } else {
|
|
|
|
123
|
+ return ListView.builder(
|
|
|
|
124
|
+ padding: EdgeInsets.only(top: w(16)),
|
|
|
|
125
|
+ itemCount: storeBaseInfoP.mealListData.length,
|
|
|
|
126
|
+ shrinkWrap: true,
|
|
|
|
127
|
+ itemBuilder: (context, index) {
|
|
|
|
128
|
+ MealListSunModel sunModel =
|
|
|
|
129
|
+ storeBaseInfoP.mealListData[index];
|
|
|
|
130
|
+ String dateSel = sunModel.type == '1'
|
|
|
|
131
|
+ ? sunModel.dateSel.split(',').map((e) {
|
|
|
|
132
|
+ String str = e.replaceAll(' ', '');
|
|
|
|
133
|
+ List strlist = str.split('-');
|
|
134
|
|
134
|
|
|
135
|
- return str +
|
|
|
|
136
|
- ' ${Utils.lunarCalendarHolidaysShow(DateTime(int.parse(strlist[0]), int.parse(strlist[1]), int.parse(strlist[2])))}';
|
|
|
|
137
|
- }).join(' ')
|
|
|
|
138
|
- : sunModel.dateSel
|
|
|
|
139
|
- .split(',')
|
|
|
|
140
|
- .map((e) => Utils.intToWeek(int.parse(e)))
|
|
|
|
141
|
- .join(' ');
|
135
|
+ return str +
|
|
|
|
136
|
+ ' ${Utils.lunarCalendarHolidaysShow(DateTime(int.parse(strlist[0]), int.parse(strlist[1]), int.parse(strlist[2])))}';
|
|
|
|
137
|
+ }).join(' ')
|
|
|
|
138
|
+ : sunModel.dateSel
|
|
|
|
139
|
+ .split(',')
|
|
|
|
140
|
+ .map((e) => Utils.intToWeek(int.parse(e)))
|
|
|
|
141
|
+ .join(' ');
|
|
142
|
|
142
|
|
|
143
|
- return InkWell(
|
|
|
|
144
|
- onTap: () {
|
|
|
|
145
|
- NavigatorUtil.goBookTimeSettingEditPage(context,
|
|
|
|
146
|
- sunModel: sunModel);
|
|
|
|
147
|
- },
|
|
|
|
148
|
- child: Container(
|
|
|
|
149
|
- margin: EdgeInsets.only(
|
|
|
|
150
|
- left: w(20), right: w(20), bottom: w(10)),
|
143
|
+ return InkWell(
|
|
|
|
144
|
+ onTap: () {
|
|
|
|
145
|
+ NavigatorUtil.goBookTimeSettingEditPage(context,
|
|
|
|
146
|
+ sunModel: sunModel);
|
|
|
|
147
|
+ },
|
|
|
|
148
|
+ child: Container(
|
|
|
|
149
|
+ margin: EdgeInsets.only(
|
|
|
|
150
|
+ left: w(20), right: w(20), bottom: w(10)),
|
|
|
|
151
|
+ decoration: BoxDecoration(
|
|
|
|
152
|
+ color: MyColours.color_ffffff,
|
|
|
|
153
|
+ boxShadow: [
|
|
|
|
154
|
+ BoxShadow(
|
|
|
|
155
|
+ offset: Offset(0, w(4)),
|
|
|
|
156
|
+ blurRadius: r(4),
|
|
|
|
157
|
+ color: MyColours.color_40000000)
|
|
|
|
158
|
+ ],
|
|
|
|
159
|
+ borderRadius: BorderRadius.circular(r(8))),
|
|
|
|
160
|
+ child: Column(
|
|
|
|
161
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
162
|
+ children: [
|
|
|
|
163
|
+ Container(
|
|
|
|
164
|
+ padding:
|
|
|
|
165
|
+ EdgeInsets.symmetric(horizontal: w(12)),
|
|
|
|
166
|
+ height: w(33),
|
|
151
|
decoration: BoxDecoration(
|
167
|
decoration: BoxDecoration(
|
|
152
|
- color: MyColours.color_ffffff,
|
|
|
|
153
|
- boxShadow: [
|
|
|
|
154
|
- BoxShadow(
|
|
|
|
155
|
- offset: Offset(0, w(4)),
|
|
|
|
156
|
- blurRadius: r(4),
|
|
|
|
157
|
- color: MyColours.color_40000000)
|
|
|
|
158
|
- ],
|
|
|
|
159
|
- borderRadius: BorderRadius.circular(r(8))),
|
|
|
|
160
|
- child: Column(
|
|
|
|
161
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
168
|
+ color: sunModel.status == '1'
|
|
|
|
169
|
+ ? MyColours.color_438E93
|
|
|
|
170
|
+ : MyColours.color_999999,
|
|
|
|
171
|
+ borderRadius: BorderRadius.only(
|
|
|
|
172
|
+ topLeft: Radius.circular(r(8)),
|
|
|
|
173
|
+ topRight: Radius.circular(r(8)),
|
|
|
|
174
|
+ )),
|
|
|
|
175
|
+ child: Row(
|
|
|
|
176
|
+ mainAxisAlignment:
|
|
|
|
177
|
+ MainAxisAlignment.spaceBetween,
|
|
162
|
children: [
|
178
|
children: [
|
|
163
|
- Container(
|
|
|
|
164
|
- padding: EdgeInsets.symmetric(
|
|
|
|
165
|
- horizontal: w(12)),
|
|
|
|
166
|
- height: w(33),
|
|
|
|
167
|
- decoration: BoxDecoration(
|
|
|
|
168
|
- color: sunModel.status == '1'
|
|
|
|
169
|
- ? MyColours.color_438E93
|
|
|
|
170
|
- : MyColours.color_999999,
|
|
|
|
171
|
- borderRadius: BorderRadius.only(
|
|
|
|
172
|
- topLeft: Radius.circular(r(8)),
|
|
|
|
173
|
- topRight: Radius.circular(r(8)),
|
|
|
|
174
|
- )),
|
|
|
|
175
|
- child: Row(
|
|
|
|
176
|
- mainAxisAlignment:
|
|
|
|
177
|
- MainAxisAlignment.spaceBetween,
|
|
|
|
178
|
- children: [
|
|
|
|
179
|
- Text(
|
|
|
|
180
|
- sunModel.type == '1'
|
|
|
|
181
|
- ? '指定日期'
|
|
|
|
182
|
- : '每周固定',
|
|
|
|
183
|
- style: TextStyle(
|
|
|
|
184
|
- fontSize: font(18),
|
|
|
|
185
|
- color: MyColours.color_ffffff),
|
|
|
|
186
|
- ),
|
|
|
|
187
|
- RoundButton(
|
|
|
|
188
|
- width: w(32),
|
|
|
|
189
|
- height: w(19),
|
|
|
|
190
|
- radius: r(5),
|
|
|
|
191
|
- text: sunModel.status == '1'
|
|
|
|
192
|
- ? '停用'
|
|
|
|
193
|
- : '启用',
|
|
|
|
194
|
- fontSize: 24,
|
|
|
|
195
|
- textColor: MyColours.color_ffffff,
|
|
|
|
196
|
- gradientStart: Colors.transparent,
|
|
|
|
197
|
- gradientEnd: Colors.transparent,
|
|
|
|
198
|
- borderColor: MyColours.color_ffffff,
|
|
|
|
199
|
- onPressed: () async {
|
|
|
|
200
|
- String status = '';
|
|
|
|
201
|
- if (sunModel.status == '1') {
|
|
|
|
202
|
- status = '0';
|
|
|
|
203
|
- } else {
|
|
|
|
204
|
- status = '1';
|
|
|
|
205
|
- }
|
|
|
|
206
|
- Map<String, String> params = {
|
|
|
|
207
|
- 'id': sunModel.id,
|
|
|
|
208
|
- 'sellerid': sunModel.sellerid,
|
|
|
|
209
|
- 'type': sunModel.type,
|
|
|
|
210
|
- 'status': status
|
|
|
|
211
|
- };
|
|
|
|
212
|
-
|
|
|
|
213
|
- bool sucess = await storeBaseInfoP
|
|
|
|
214
|
- .setSellerMealSection(
|
|
|
|
215
|
- context, params);
|
|
|
|
216
|
- if (sucess) {
|
|
|
|
217
|
- getSellerMealSection();
|
|
|
|
218
|
- }
|
|
|
|
219
|
- },
|
|
|
|
220
|
- // onPressed: widget.onPressedSwich,
|
|
|
|
221
|
- )
|
|
|
|
222
|
- ],
|
|
|
|
223
|
- ),
|
179
|
+ Text(
|
|
|
|
180
|
+ sunModel.type == '1' ? '指定日期' : '每周固定',
|
|
|
|
181
|
+ style: TextStyle(
|
|
|
|
182
|
+ fontSize: font(18),
|
|
|
|
183
|
+ color: MyColours.color_ffffff),
|
|
224
|
),
|
184
|
),
|
|
225
|
- VEmptyView(16),
|
|
|
|
226
|
- Padding(
|
|
|
|
227
|
- padding: EdgeInsets.symmetric(
|
|
|
|
228
|
- horizontal: w(12)),
|
|
|
|
229
|
- child: Text(
|
|
|
|
230
|
- dateSel,
|
|
|
|
231
|
- style: TextStyle(
|
|
|
|
232
|
- fontSize: font(10),
|
|
|
|
233
|
- color: MyColours.color_515151),
|
|
|
|
234
|
- )
|
|
|
|
235
|
- // Wrap(
|
|
|
|
236
|
- // spacing: w(5),
|
|
|
|
237
|
- // children: listWidget(),
|
|
|
|
238
|
- // )
|
|
|
|
239
|
- ),
|
|
|
|
240
|
- VEmptyView(16),
|
|
|
|
241
|
- Column(
|
|
|
|
242
|
- children:
|
|
|
|
243
|
- listWidgetTime(sunModel.dateStr),
|
185
|
+ RoundButton(
|
|
|
|
186
|
+ width: w(32),
|
|
|
|
187
|
+ height: w(19),
|
|
|
|
188
|
+ radius: r(5),
|
|
|
|
189
|
+ text:
|
|
|
|
190
|
+ sunModel.status == '1' ? '停用' : '启用',
|
|
|
|
191
|
+ fontSize: 24,
|
|
|
|
192
|
+ textColor: MyColours.color_ffffff,
|
|
|
|
193
|
+ gradientStart: Colors.transparent,
|
|
|
|
194
|
+ gradientEnd: Colors.transparent,
|
|
|
|
195
|
+ borderColor: MyColours.color_ffffff,
|
|
|
|
196
|
+ onPressed: () async {
|
|
|
|
197
|
+ String status = '';
|
|
|
|
198
|
+ if (sunModel.status == '1') {
|
|
|
|
199
|
+ status = '0';
|
|
|
|
200
|
+ } else {
|
|
|
|
201
|
+ status = '1';
|
|
|
|
202
|
+ }
|
|
|
|
203
|
+ Map<String, String> params = {
|
|
|
|
204
|
+ 'id': sunModel.id,
|
|
|
|
205
|
+ 'sellerid': sunModel.sellerid,
|
|
|
|
206
|
+ 'type': sunModel.type,
|
|
|
|
207
|
+ 'status': status
|
|
|
|
208
|
+ };
|
|
|
|
209
|
+
|
|
|
|
210
|
+ bool sucess = await storeBaseInfoP
|
|
|
|
211
|
+ .setSellerMealSection(
|
|
|
|
212
|
+ context, params);
|
|
|
|
213
|
+ if (sucess) {
|
|
|
|
214
|
+ getSellerMealSection();
|
|
|
|
215
|
+ }
|
|
|
|
216
|
+ },
|
|
|
|
217
|
+ // onPressed: widget.onPressedSwich,
|
|
244
|
)
|
218
|
)
|
|
245
|
],
|
219
|
],
|
|
246
|
),
|
220
|
),
|
|
247
|
- ));
|
|
|
|
248
|
- })),
|
|
|
|
249
|
- Container(
|
|
|
|
250
|
- color: MyColours.color_ffffff,
|
|
|
|
251
|
- padding: EdgeInsets.only(
|
|
|
|
252
|
- left: w(45), top: w(12), bottom: w(25), right: w(45)),
|
|
|
|
253
|
- child: RoundButton(
|
|
|
|
254
|
- text: '创建新的多时段预订规则',
|
|
|
|
255
|
- // width: ScreenUtil().setWidth(280 * 2),
|
|
|
|
256
|
- height: w(41),
|
|
|
|
257
|
- radius: r(5),
|
|
|
|
258
|
- isBold: true,
|
|
|
|
259
|
- fontSize: 32,
|
|
|
|
260
|
- onPressed: () {
|
|
|
|
261
|
- NavigatorUtil.goBookTimeSettingEditPage(context);
|
|
|
|
262
|
- }))
|
|
|
|
263
|
- ],
|
|
|
|
264
|
- );
|
|
|
|
265
|
- }
|
|
|
|
266
|
- }));
|
221
|
+ ),
|
|
|
|
222
|
+ VEmptyView(16),
|
|
|
|
223
|
+ Padding(
|
|
|
|
224
|
+ padding:
|
|
|
|
225
|
+ EdgeInsets.symmetric(horizontal: w(12)),
|
|
|
|
226
|
+ child: Text(
|
|
|
|
227
|
+ dateSel,
|
|
|
|
228
|
+ style: TextStyle(
|
|
|
|
229
|
+ fontSize: font(10),
|
|
|
|
230
|
+ color: MyColours.color_515151),
|
|
|
|
231
|
+ )
|
|
|
|
232
|
+ // Wrap(
|
|
|
|
233
|
+ // spacing: w(5),
|
|
|
|
234
|
+ // children: listWidget(),
|
|
|
|
235
|
+ // )
|
|
|
|
236
|
+ ),
|
|
|
|
237
|
+ VEmptyView(16),
|
|
|
|
238
|
+ Column(
|
|
|
|
239
|
+ children: listWidgetTime(sunModel.dateStr),
|
|
|
|
240
|
+ )
|
|
|
|
241
|
+ ],
|
|
|
|
242
|
+ ),
|
|
|
|
243
|
+ ));
|
|
|
|
244
|
+ });
|
|
|
|
245
|
+ }
|
|
|
|
246
|
+ })),
|
|
|
|
247
|
+ Container(
|
|
|
|
248
|
+ color: MyColours.color_ffffff,
|
|
|
|
249
|
+ padding: EdgeInsets.only(
|
|
|
|
250
|
+ left: w(45), top: w(12), bottom: w(25), right: w(45)),
|
|
|
|
251
|
+ child: RoundButton(
|
|
|
|
252
|
+ text: '创建新的多时段预订规则',
|
|
|
|
253
|
+ // width: ScreenUtil().setWidth(280 * 2),
|
|
|
|
254
|
+ height: w(41),
|
|
|
|
255
|
+ radius: r(5),
|
|
|
|
256
|
+ isBold: true,
|
|
|
|
257
|
+ fontSize: 32,
|
|
|
|
258
|
+ onPressed: () {
|
|
|
|
259
|
+ NavigatorUtil.goBookTimeSettingEditPage(context);
|
|
|
|
260
|
+ }))
|
|
|
|
261
|
+ ],
|
|
|
|
262
|
+ ),
|
|
|
|
263
|
+ );
|
|
267
|
}
|
264
|
}
|
|
268
|
} |
265
|
} |