修改ui设计错误
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:EasyDartModule/EasyDartModule.dart';
|
||||
import 'package:ef/ef.dart';
|
||||
|
||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||
import 'package:vbvs_app/common/util/DailyLogUtils.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/model/api_response.dart';
|
||||
|
||||
class BookInfoModel {
|
||||
// DateTime? dateTime; //预约时间
|
||||
@@ -16,6 +23,14 @@ class BookInfoModel {
|
||||
Map dataT = {};
|
||||
|
||||
BookInfoModel();
|
||||
BookInfoModel.fromJson(Map<String, dynamic> json) {
|
||||
// dateTime = json['dateTime'];
|
||||
userName = json['userName'];
|
||||
userPhone = json['userPhone'];
|
||||
time_period = json['time_period'];
|
||||
// select_time = json['select_time'];
|
||||
select_time_index = json['select_time_index'];
|
||||
}
|
||||
}
|
||||
|
||||
class BookInfoController extends GetControllerEx<BookInfoModel> {
|
||||
@@ -25,13 +40,44 @@ class BookInfoController extends GetControllerEx<BookInfoModel> {
|
||||
|
||||
// get userInfoController => Get.find<UserInfoController>();
|
||||
|
||||
Future<void> getData(String storeId) async {
|
||||
// 初始化模型
|
||||
model.datetimes = [];
|
||||
model.datetimes_index = null;
|
||||
model.dataT = {};
|
||||
updateAll();
|
||||
|
||||
String url =
|
||||
"https://crm-api.swes.com.cn/agent/userBook/config/detailConfigByStore?storeId=$storeId";
|
||||
|
||||
await requestWithLog(
|
||||
logTitle: "获取预约门店时间",
|
||||
method: MyHttpMethod.get,
|
||||
queryUrl: url,
|
||||
successMsg: "获取预约门店时间成功",
|
||||
errorMsg: "获取预约门店时间失败",
|
||||
onSuccess: (res) {
|
||||
final data = res.data;
|
||||
if (data != null) {
|
||||
model.datetimes = data["dateList"] ?? [];
|
||||
model.datetimes_index = 0;
|
||||
model.dataT = data;
|
||||
time_periodChange(); // 原来的 time_periodChange
|
||||
updateAll();
|
||||
}
|
||||
},
|
||||
onFailure: (res) {},
|
||||
);
|
||||
}
|
||||
|
||||
// getData(id) {
|
||||
// model.datetimes = [];
|
||||
// model.datetimes_index = null;
|
||||
// model.dataT = {};
|
||||
// updateAll();
|
||||
// ApiService.reservation.get("/agent/userBook/config/detailConfigByStore?storeId=$id")
|
||||
// .then((d) {
|
||||
// ApiService.reservation
|
||||
// .get("/agent/userBook/config/detailConfigByStore?storeId=$id")
|
||||
// .then((d) {
|
||||
// model.datetimes = d.data["dateList"];
|
||||
// model.datetimes_index = 0;
|
||||
// model.dataT = d.data;
|
||||
@@ -39,14 +85,15 @@ class BookInfoController extends GetControllerEx<BookInfoModel> {
|
||||
// });
|
||||
// }
|
||||
|
||||
// time_periodChange() {
|
||||
// if(model.datetimes_index == null) {
|
||||
// return;
|
||||
// }
|
||||
// model.select_time_index = null;
|
||||
// model.time_period = model.dataT[model.datetimes?[model.datetimes_index!]["day"]];
|
||||
// updateAll();
|
||||
// }
|
||||
time_periodChange() {
|
||||
if (model.datetimes_index == null) {
|
||||
return;
|
||||
}
|
||||
model.select_time_index = null;
|
||||
model.time_period =
|
||||
model.dataT[model.datetimes?[model.datetimes_index!]["day"]];
|
||||
updateAll();
|
||||
}
|
||||
|
||||
// submitData(id) {
|
||||
// String tel = userInfoController.model?.user?.tel ?? "";
|
||||
|
||||
Reference in New Issue
Block a user