75 lines
1.9 KiB
Dart
75 lines
1.9 KiB
Dart
import 'dart:convert';
|
|
|
|
import 'package:ef/ef.dart';
|
|
|
|
|
|
class BookInfoModel {
|
|
// DateTime? dateTime; //预约时间
|
|
String? userName; //预约人
|
|
String? userPhone; //预约电话
|
|
List time_period = []; //预约时段
|
|
// String? select_time; //选择时间
|
|
int? select_time_index; //选择时间
|
|
|
|
List datetimes = [];
|
|
int? datetimes_index;
|
|
Map dataT = {};
|
|
|
|
BookInfoModel();
|
|
}
|
|
|
|
class BookInfoController extends GetControllerEx<BookInfoModel> {
|
|
BookInfoController() {
|
|
attr = GetModel(BookInfoModel()).obs;
|
|
}
|
|
|
|
// get userInfoController => Get.find<UserInfoController>();
|
|
|
|
// getData(id) {
|
|
// model.datetimes = [];
|
|
// model.datetimes_index = null;
|
|
// model.dataT = {};
|
|
// updateAll();
|
|
// ApiService.reservation.get("/agent/userBook/config/detailConfigByStore?storeId=$id")
|
|
// .then((d) {
|
|
// model.datetimes = d.data["dateList"];
|
|
// model.datetimes_index = 0;
|
|
// model.dataT = d.data;
|
|
// time_periodChange();
|
|
// });
|
|
// }
|
|
|
|
// 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 ?? "";
|
|
// if(tel.isEmpty) {
|
|
// showToast("用户未存在手机号");
|
|
// return;
|
|
// }
|
|
// return ApiService.reservation.post("/agent/userBook/submitBook", data: {
|
|
// "extUserId": tel,
|
|
// "storeId": id,
|
|
// "realName": model.userName,
|
|
// "userPhone": model.userPhone,
|
|
// "bookDateId": model.time_period[model.select_time_index!]["id"]
|
|
// });
|
|
// }
|
|
|
|
// messageAdd(Map data) {
|
|
// return ApiService.request.post("/api/message/info", data: {
|
|
// "type": 0,
|
|
// "status": 1,
|
|
// "read": 1,
|
|
// "data": jsonEncode(data)
|
|
// });
|
|
// }
|
|
}
|