Commit db3a7fcf by Mobile : Art

update

parent 9e266a4a
...@@ -21,74 +21,6 @@ class ProductModel { ...@@ -21,74 +21,6 @@ class ProductModel {
} }
class Results { class Results {
int currentPage;
List<Data> data;
String firstPageUrl;
int from;
int lastPage;
String lastPageUrl;
String nextPageUrl;
String path;
int perPage;
Null prevPageUrl;
int to;
int total;
Results(
{this.currentPage,
this.data,
this.firstPageUrl,
this.from,
this.lastPage,
this.lastPageUrl,
this.nextPageUrl,
this.path,
this.perPage,
this.prevPageUrl,
this.to,
this.total});
Results.fromJson(Map<String, dynamic> json) {
currentPage = json['current_page'];
if (json['data'] != null) {
data = new List<Data>();
json['data'].forEach((v) {
data.add(new Data.fromJson(v));
});
}
firstPageUrl = json['first_page_url'];
from = json['from'];
lastPage = json['last_page'];
lastPageUrl = json['last_page_url'];
nextPageUrl = json['next_page_url'];
path = json['path'];
perPage = json['per_page'];
prevPageUrl = json['prev_page_url'];
to = json['to'];
total = json['total'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['current_page'] = this.currentPage;
if (this.data != null) {
data['data'] = this.data.map((v) => v.toJson()).toList();
}
data['first_page_url'] = this.firstPageUrl;
data['from'] = this.from;
data['last_page'] = this.lastPage;
data['last_page_url'] = this.lastPageUrl;
data['next_page_url'] = this.nextPageUrl;
data['path'] = this.path;
data['per_page'] = this.perPage;
data['prev_page_url'] = this.prevPageUrl;
data['to'] = this.to;
data['total'] = this.total;
return data;
}
}
class Data {
int id; int id;
String urlCode; String urlCode;
String name; String name;
...@@ -99,7 +31,7 @@ class Data { ...@@ -99,7 +31,7 @@ class Data {
String specialPrice; String specialPrice;
String sku; String sku;
Null tax; Null tax;
Null quantity; int quantity;
Null weight; Null weight;
String visibility; String visibility;
Null newsFromDate; Null newsFromDate;
...@@ -122,22 +54,38 @@ class Data { ...@@ -122,22 +54,38 @@ class Data {
String crossSellsStatus; String crossSellsStatus;
String allowGiftMessage; String allowGiftMessage;
String stockStatus; String stockStatus;
String status; int status;
int businessTypeId; int businessTypeId;
int businessCateId; int businessCateId;
int businessServiceId; Null businessServiceId;
int attributeSetId; int attributeSetId;
int vendorId; int vendorId;
String allowRoute; String allowRoute;
String type; Null type;
List<Null> promotions;
int star; int star;
List<StoresByVendorId> storesByVendorId;
List<Null> images;
List<CategoryByProductId> categoryByProductId; List<CategoryByProductId> categoryByProductId;
List<Null> ratings; List<Null> ratings;
List<Null> comments; List<Null> comments;
List<Null> vendorRoute; List<Null> commentReview;
int storeProductId;
Null typeRateService;
Null priceRateService;
int productId;
int storeId;
String storeCode;
String storeName;
String location;
int storeStatus;
int vendorStatus;
String latitude;
String longitude;
Null popular;
List<Null> promotions;
List<Null> wishList;
Data( Results(
{this.id, {this.id,
this.urlCode, this.urlCode,
this.name, this.name,
...@@ -179,14 +127,30 @@ class Data { ...@@ -179,14 +127,30 @@ class Data {
this.vendorId, this.vendorId,
this.allowRoute, this.allowRoute,
this.type, this.type,
this.promotions,
this.star, this.star,
this.storesByVendorId,
this.images,
this.categoryByProductId, this.categoryByProductId,
this.ratings, this.ratings,
this.comments, this.comments,
this.vendorRoute}); this.commentReview,
this.storeProductId,
this.typeRateService,
this.priceRateService,
this.productId,
this.storeId,
this.storeCode,
this.storeName,
this.location,
this.storeStatus,
this.vendorStatus,
this.latitude,
this.longitude,
this.popular,
this.promotions,
this.wishList});
Data.fromJson(Map<String, dynamic> json) { Results.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
urlCode = json['url_code']; urlCode = json['url_code'];
name = json['name']; name = json['name'];
...@@ -228,13 +192,19 @@ class Data { ...@@ -228,13 +192,19 @@ class Data {
vendorId = json['vendor_id']; vendorId = json['vendor_id'];
allowRoute = json['allow_route']; allowRoute = json['allow_route'];
type = json['type']; type = json['type'];
// if (json['promotions'] != null) { star = json['star'];
// promotions = new List<Null>(); if (json['stores_by_vendor_id'] != null) {
// json['promotions'].forEach((v) { storesByVendorId = new List<StoresByVendorId>();
// promotions.add(new Null.fromJson(v)); json['stores_by_vendor_id'].forEach((v) {
storesByVendorId.add(new StoresByVendorId.fromJson(v));
});
}
// if (json['images'] != null) {
// images = new List<Null>();
// json['images'].forEach((v) {
// images.add(new Null.fromJson(v));
// }); // });
// } // }
star = json['star'];
if (json['category_by_product_id'] != null) { if (json['category_by_product_id'] != null) {
categoryByProductId = new List<CategoryByProductId>(); categoryByProductId = new List<CategoryByProductId>();
json['category_by_product_id'].forEach((v) { json['category_by_product_id'].forEach((v) {
...@@ -253,10 +223,35 @@ class Data { ...@@ -253,10 +223,35 @@ class Data {
// comments.add(new Null.fromJson(v)); // comments.add(new Null.fromJson(v));
// }); // });
// } // }
// if (json['vendor_route'] != null) { // if (json['comment_review'] != null) {
// vendorRoute = new List<Null>(); // commentReview = new List<Null>();
// json['vendor_route'].forEach((v) { // json['comment_review'].forEach((v) {
// vendorRoute.add(new Null.fromJson(v)); // commentReview.add(new Null.fromJson(v));
// });
// }
storeProductId = json['store_product_id'];
typeRateService = json['type_rate_service'];
priceRateService = json['price_rate_service'];
productId = json['product_id'];
storeId = json['store_id'];
storeCode = json['store_code'];
storeName = json['store_name'];
location = json['location'];
storeStatus = json['store_status'];
vendorStatus = json['vendor_status'];
latitude = json['latitude'];
longitude = json['longitude'];
popular = json['popular'];
// if (json['promotions'] != null) {
// promotions = new List<Null>();
// json['promotions'].forEach((v) {
// promotions.add(new Null.fromJson(v));
// });
// }
// if (json['wishList'] != null) {
// wishList = new List<Null>();
// json['wishList'].forEach((v) {
// wishList.add(new Null.fromJson(v));
// }); // });
// } // }
} }
...@@ -304,10 +299,14 @@ class Data { ...@@ -304,10 +299,14 @@ class Data {
data['vendor_id'] = this.vendorId; data['vendor_id'] = this.vendorId;
data['allow_route'] = this.allowRoute; data['allow_route'] = this.allowRoute;
data['type'] = this.type; data['type'] = this.type;
// if (this.promotions != null) {
// data['promotions'] = this.promotions.map((v) => v.toJson()).toList();
// }
data['star'] = this.star; data['star'] = this.star;
if (this.storesByVendorId != null) {
data['stores_by_vendor_id'] =
this.storesByVendorId.map((v) => v.toJson()).toList();
}
// if (this.images != null) {
// data['images'] = this.images.map((v) => v.toJson()).toList();
// }
if (this.categoryByProductId != null) { if (this.categoryByProductId != null) {
data['category_by_product_id'] = data['category_by_product_id'] =
this.categoryByProductId.map((v) => v.toJson()).toList(); this.categoryByProductId.map((v) => v.toJson()).toList();
...@@ -318,16 +317,161 @@ class Data { ...@@ -318,16 +317,161 @@ class Data {
// if (this.comments != null) { // if (this.comments != null) {
// data['comments'] = this.comments.map((v) => v.toJson()).toList(); // data['comments'] = this.comments.map((v) => v.toJson()).toList();
// } // }
// if (this.vendorRoute != null) { // if (this.commentReview != null) {
// data['vendor_route'] = this.vendorRoute.map((v) => v.toJson()).toList(); // data['comment_review'] =
// this.commentReview.map((v) => v.toJson()).toList();
// }
data['store_product_id'] = this.storeProductId;
data['type_rate_service'] = this.typeRateService;
data['price_rate_service'] = this.priceRateService;
data['product_id'] = this.productId;
data['store_id'] = this.storeId;
data['store_code'] = this.storeCode;
data['store_name'] = this.storeName;
data['location'] = this.location;
data['store_status'] = this.storeStatus;
data['vendor_status'] = this.vendorStatus;
data['latitude'] = this.latitude;
data['longitude'] = this.longitude;
data['popular'] = this.popular;
// if (this.promotions != null) {
// data['promotions'] = this.promotions.map((v) => v.toJson()).toList();
// }
// if (this.wishList != null) {
// data['wishList'] = this.wishList.map((v) => v.toJson()).toList();
// } // }
return data; return data;
} }
} }
class StoresByVendorId {
int id;
String storeCode;
String storeName;
String storeCover;
String displayCover;
String isActive;
int storeOrder;
int customerGroupId;
int vendorId;
Null createdAt;
String updatedAt;
String location;
String email;
String phone;
String mobile;
String address;
String city;
String country;
String zipCode;
String website;
String allowRoute;
String excerpt;
String detail;
String storeLogo;
String isFacilities;
String distanceWithLocation;
int star;
Null ratings;
StoresByVendorId(
{this.id,
this.storeCode,
this.storeName,
this.storeCover,
this.displayCover,
this.isActive,
this.storeOrder,
this.customerGroupId,
this.vendorId,
this.createdAt,
this.updatedAt,
this.location,
this.email,
this.phone,
this.mobile,
this.address,
this.city,
this.country,
this.zipCode,
this.website,
this.allowRoute,
this.excerpt,
this.detail,
this.storeLogo,
this.isFacilities,
this.distanceWithLocation,
this.star,
this.ratings});
StoresByVendorId.fromJson(Map<String, dynamic> json) {
id = json['id'];
storeCode = json['store_code'];
storeName = json['store_name'];
storeCover = json['store_cover'];
displayCover = json['display_cover'];
isActive = json['is_active'];
storeOrder = json['store_order'];
customerGroupId = json['customer_group_id'];
vendorId = json['vendor_id'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
location = json['location'];
email = json['email'];
phone = json['phone'];
mobile = json['mobile'];
address = json['address'];
city = json['city'];
country = json['country'];
zipCode = json['zip_code'];
website = json['website'];
allowRoute = json['allow_route'];
excerpt = json['excerpt'];
detail = json['detail'];
storeLogo = json['store_logo'];
isFacilities = json['is_facilities'];
distanceWithLocation = json['distance_with_location'];
star = json['star'];
ratings = json['ratings'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['store_code'] = this.storeCode;
data['store_name'] = this.storeName;
data['store_cover'] = this.storeCover;
data['display_cover'] = this.displayCover;
data['is_active'] = this.isActive;
data['store_order'] = this.storeOrder;
data['customer_group_id'] = this.customerGroupId;
data['vendor_id'] = this.vendorId;
data['created_at'] = this.createdAt;
data['updated_at'] = this.updatedAt;
data['location'] = this.location;
data['email'] = this.email;
data['phone'] = this.phone;
data['mobile'] = this.mobile;
data['address'] = this.address;
data['city'] = this.city;
data['country'] = this.country;
data['zip_code'] = this.zipCode;
data['website'] = this.website;
data['allow_route'] = this.allowRoute;
data['excerpt'] = this.excerpt;
data['detail'] = this.detail;
data['store_logo'] = this.storeLogo;
data['is_facilities'] = this.isFacilities;
data['distance_with_location'] = this.distanceWithLocation;
data['star'] = this.star;
data['ratings'] = this.ratings;
return data;
}
}
class CategoryByProductId { class CategoryByProductId {
int id; int id;
int parentId; Null parentId;
String name; String name;
String code; String code;
String displayName; String displayName;
...@@ -336,8 +480,8 @@ class CategoryByProductId { ...@@ -336,8 +480,8 @@ class CategoryByProductId {
Null type; Null type;
String status; String status;
int sortOrder; int sortOrder;
int storeId; Null storeId;
int vendorId; Null vendorId;
Null createdAt; Null createdAt;
String updatedAt; String updatedAt;
String visibility; String visibility;
......
...@@ -38,11 +38,8 @@ class Api<T> { ...@@ -38,11 +38,8 @@ class Api<T> {
static final String baseApi = "https://backend-uat.feelver.com/api"; static final String baseApi = "https://backend-uat.feelver.com/api";
<<<<<<< HEAD
static final String baseApiforimage = "https://backend.feelver.com/storage/"; static final String baseApiforimage = "https://backend.feelver.com/storage/";
=======
static final String baseApiforimage = "https://backend-uat.feelver.com/api/storage/";
Future<Response<T>> reviewshop(Object body) async { Future<Response<T>> reviewshop(Object body) async {
...@@ -62,7 +59,6 @@ class Api<T> { ...@@ -62,7 +59,6 @@ class Api<T> {
}); });
return result; return result;
} }
>>>>>>> baadf91b2b909230e56f29edefbed7cfd2f5e949
Future<Response<T>> deletefavorite(Object body) async { Future<Response<T>> deletefavorite(Object body) async {
...@@ -109,7 +105,10 @@ class Api<T> { ...@@ -109,7 +105,10 @@ class Api<T> {
var result; var result;
print("this is body"+body.toString()); print("this is body"+body.toString());
// (body as Map)['lang'] = allTranslations.currentLanguage; // (body as Map)['lang'] = allTranslations.currentLanguage;
await _httpConnection("${this._baseApi}/product/getListsProductFormat?vendor_id=16&store_id=406&is_paginate=1&per_page=8&v=2", this._headerApi, null)
await _httpConnection("${this._baseApi}/product/getListsProductFormat?vendor_id=9&store_id=284&is_paginate=1&per_page=1&v=1", this._headerApi, null)
.then((response){ .then((response){
print("ผลลัพท์ เท่ากับ" + "${response.body}"); print("ผลลัพท์ เท่ากับ" + "${response.body}");
if(response.statusCode == 200){ if(response.statusCode == 200){
...@@ -199,7 +198,7 @@ class Api<T> { ...@@ -199,7 +198,7 @@ class Api<T> {
print("this is body " + body.toString()); print("this is body " + body.toString());
// (body as Map)['lang'] = allTranslations.currentLanguage; // (body as Map)['lang'] = allTranslations.currentLanguage;
await http.get(Uri.encodeFull("https://backend.feelver.com/api/portal/product/?id=5"), headers: this._headerApi ).then((response) { await http.get(Uri.encodeFull("https://backend.feelver.com/api/product/1000?store_id=284&vendor_id=9"), headers: this._headerApi ).then((response) {
print("ผลลัพ เท่ากับบบบ2 " + "${response.body}"); print("ผลลัพ เท่ากับบบบ2 " + "${response.body}");
print("statusCode=${response.statusCode}"); print("statusCode=${response.statusCode}");
if (response.statusCode == 200) { if (response.statusCode == 200) {
......
...@@ -9,11 +9,9 @@ import '../splashscreen/splash_screen_page.dart'; ...@@ -9,11 +9,9 @@ import '../splashscreen/splash_screen_page.dart';
class BookingDetail extends StatefulWidget { class BookingDetail extends StatefulWidget {
int getid; int getid;
int vendor_id;
BookingDetail( int store_id;
{Key key, BookingDetail({Key key, this.getid,this.vendor_id,this.store_id}) : super(key: key);
this.getid})
: super(key: key);
@override @override
_BookingDetailState createState() => _BookingDetailState(); _BookingDetailState createState() => _BookingDetailState();
...@@ -30,10 +28,8 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -30,10 +28,8 @@ class _BookingDetailState extends State<BookingDetail> {
presenter = BookingDetailtPresenter(this); presenter = BookingDetailtPresenter(this);
setState(() { setState(() {
presenter.getid = widget.getid; presenter.getid = widget.getid;
}); });
presenter.getDetail(); presenter.getDetail();
} }
@override @override
...@@ -67,7 +63,7 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -67,7 +63,7 @@ class _BookingDetailState extends State<BookingDetail> {
children: <Widget>[ children: <Widget>[
Stack( Stack(
children: <Widget>[ children: <Widget>[
presenter.getmodel.results.data[0].cover == null presenter.getmodel.results.cover == null
? Image.asset( ? Image.asset(
'assets/images/demo_img.png', 'assets/images/demo_img.png',
width: SizeConfig.getWidth(110), width: SizeConfig.getWidth(110),
...@@ -75,45 +71,15 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -75,45 +71,15 @@ class _BookingDetailState extends State<BookingDetail> {
fit: BoxFit.fitWidth, fit: BoxFit.fitWidth,
) )
: Image.network( : Image.network(
presenter.getmodel.results.data[0].cover, presenter.getmodel.results.cover,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: SizeConfig.getHeight(450), height: SizeConfig.getHeight(450),
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
], ],
), ),
presenter.getmodel.results.data[0].duration == null
? Container( presenter.getmodel.results.name == null
padding: EdgeInsets.only(
left: SizeConfig.getPadding(24),
top: SizeConfig.getPadding(16)),
alignment: Alignment.topLeft,
child: Text(
'',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black54,
fontSize: SizeConfig.getFontSize(11),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
)
: Container(
padding: EdgeInsets.only(
left: SizeConfig.getPadding(24),
top: SizeConfig.getPadding(16)),
alignment: Alignment.topLeft,
child: Text(
presenter.getmodel.results.data[0].duration,
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black54,
fontSize: SizeConfig.getFontSize(11),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
),
presenter.getmodel.results.data[0].name == null
? Container( ? Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: SizeConfig.getPadding(24), left: SizeConfig.getPadding(24),
...@@ -136,7 +102,7 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -136,7 +102,7 @@ class _BookingDetailState extends State<BookingDetail> {
bottom: SizeConfig.getPadding(16)), bottom: SizeConfig.getPadding(16)),
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
presenter.getmodel.results.data[0].name, presenter.getmodel.results.name,
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
...@@ -152,7 +118,7 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -152,7 +118,7 @@ class _BookingDetailState extends State<BookingDetail> {
), ),
ImageIcon( ImageIcon(
AssetImage('assets/images/ic_fav_active.png'), AssetImage('assets/images/ic_fav_active.png'),
color: Colors.pink, color: Colors.grey,
size: SizeConfig.getFontSize(24), size: SizeConfig.getFontSize(24),
), ),
SizedBox( SizedBox(
...@@ -161,7 +127,7 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -161,7 +127,7 @@ class _BookingDetailState extends State<BookingDetail> {
Container( Container(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
'70', '0',
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
...@@ -188,7 +154,7 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -188,7 +154,7 @@ class _BookingDetailState extends State<BookingDetail> {
Container( Container(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
'70', '0',
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
...@@ -228,10 +194,11 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -228,10 +194,11 @@ class _BookingDetailState extends State<BookingDetail> {
right: SizeConfig.getPadding(24), right: SizeConfig.getPadding(24),
), ),
), ),
presenter.getmodel.results.data[0].detail == null presenter.getmodel.results.excerpt == null
? Container( ? Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: SizeConfig.getPadding(24), left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24),
top: SizeConfig.getPadding(16)), top: SizeConfig.getPadding(16)),
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
...@@ -247,11 +214,11 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -247,11 +214,11 @@ class _BookingDetailState extends State<BookingDetail> {
: Container( : Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: SizeConfig.getPadding(24), left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24),
top: SizeConfig.getPadding(16)), top: SizeConfig.getPadding(16)),
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
Util.removeHTMLTag( Util.removeHTMLTag('${presenter.getmodel.results.excerpt}'),
'${presenter.getmodel.results.data[0].detail}'),
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
...@@ -260,49 +227,49 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -260,49 +227,49 @@ class _BookingDetailState extends State<BookingDetail> {
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
), ),
), ),
Container( // Container(
alignment: Alignment.topLeft, // alignment: Alignment.topLeft,
padding: EdgeInsets.only( // padding: EdgeInsets.only(
top: SizeConfig.getPadding(24), // top: SizeConfig.getPadding(24),
left: SizeConfig.getPadding(24), // left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24)), // right: SizeConfig.getPadding(24)),
child: Text( // child: Text(
'Thai Body Balance 60 นาที', // 'Thai Body Balance 60 นาที',
textAlign: TextAlign.left, // textAlign: TextAlign.left,
style: TextStyle( // style: TextStyle(
color: Colors.black87, // color: Colors.black87,
fontSize: SizeConfig.getFontSize(20), // fontSize: SizeConfig.getFontSize(20),
fontFamily: "SF_Pro_Text", // fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500), // fontWeight: FontWeight.w500),
), // ),
), // ),
SizedBox( SizedBox(
height: SizeConfig.getHeight(10), height: SizeConfig.getHeight(16),
),
Row(
children: <Widget>[
SizedBox(
width: SizeConfig.getWidth(24),
),
Image.asset(
'assets/images/clock.png',
width: SizeConfig.getWidth(20),
height: SizeConfig.getWidth(20),
),
SizedBox(
width: SizeConfig.getWidth(10),
),
Text(
'150 นาที',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black87,
fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
],
), ),
// Row(
// children: <Widget>[
// SizedBox(
// width: SizeConfig.getWidth(24),
// ),
// Image.asset(
// 'assets/images/clock.png',
// width: SizeConfig.getWidth(20),
// height: SizeConfig.getWidth(20),
// ),
// SizedBox(
// width: SizeConfig.getWidth(10),
// ),
// Text(
// '150 นาที',
// textAlign: TextAlign.left,
// style: TextStyle(
// color: Colors.black87,
// fontSize: SizeConfig.getFontSize(12),
// fontFamily: "SF_Pro_Text",
// fontWeight: FontWeight.w500),
// ),
// ],
// ),
Stack( Stack(
children: <Widget>[ children: <Widget>[
Container( Container(
...@@ -334,43 +301,77 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -334,43 +301,77 @@ class _BookingDetailState extends State<BookingDetail> {
bottom: SizeConfig.getPadding(20), bottom: SizeConfig.getPadding(20),
), ),
), ),
Container( presenter.getmodel.results.specialPrice == null
alignment: Alignment.topLeft, ? Container(
child: Text( padding: EdgeInsets.only(
'฿199.00', left: SizeConfig.getPadding(24),
textAlign: TextAlign.left, right: SizeConfig.getPadding(24),
style: TextStyle( top: SizeConfig.getPadding(16)),
color: Color.fromRGBO(255, 0, 0, 1), alignment: Alignment.topLeft,
fontSize: SizeConfig.getFontSize(26), child: Text(
fontFamily: "SF_Pro_Text", '',
fontWeight: FontWeight.w500), textAlign: TextAlign.left,
), style: TextStyle(
padding: EdgeInsets.only( color: Colors.black54,
left: SizeConfig.getPadding(90), fontSize: SizeConfig.getFontSize(11),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
)
: Container(
alignment: Alignment.topLeft,
child: Text(
presenter.getmodel.results.specialPrice,
textAlign: TextAlign.left,
style: TextStyle(
color: Color.fromRGBO(255, 0, 0, 1),
fontSize: SizeConfig.getFontSize(26),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
padding: EdgeInsets.only(
left: SizeConfig.getPadding(90),
// right: SizeConfig.getPadding(20), // right: SizeConfig.getPadding(20),
top: SizeConfig.getPadding(10), top: SizeConfig.getPadding(10),
bottom: SizeConfig.getPadding(20), bottom: SizeConfig.getPadding(20),
), ),
), ),
Container( presenter.getmodel.results.price == null
alignment: Alignment.topLeft, ? Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: SizeConfig.getPadding(90), left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24),
top: SizeConfig.getPadding(16)),
alignment: Alignment.topLeft,
child: Text(
'',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black54,
fontSize: SizeConfig.getFontSize(11),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
)
: Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.only(
left: SizeConfig.getPadding(90),
// right: SizeConfig.getPadding(20), // right: SizeConfig.getPadding(20),
top: SizeConfig.getPadding(40), top: SizeConfig.getPadding(40),
bottom: SizeConfig.getPadding(20), bottom: SizeConfig.getPadding(20),
), ),
child: Text( child: Text(
'฿599.00 ', presenter.getmodel.results.price,
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
color: Colors.black45, color: Colors.black45,
fontSize: SizeConfig.getFontSize(20), fontSize: SizeConfig.getFontSize(20),
decoration: TextDecoration.lineThrough, decoration: TextDecoration.lineThrough,
fontFamily: "SF_Pro_Text", fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
), ),
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: SizeConfig.getPadding(20), top: SizeConfig.getPadding(20),
...@@ -380,8 +381,8 @@ class _BookingDetailState extends State<BookingDetail> { ...@@ -380,8 +381,8 @@ class _BookingDetailState extends State<BookingDetail> {
width: SizeConfig.getWidth(100), width: SizeConfig.getWidth(100),
height: SizeConfig.getHeight(45), height: SizeConfig.getHeight(45),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24), borderRadius: BorderRadius.circular(0),
color: Color.fromRGBO(69, 85, 79, 1), color: Color.fromRGBO(238, 175, 183, 1),
), ),
child: Container( child: Container(
padding: EdgeInsets.only(top: SizeConfig.getPadding(6)), padding: EdgeInsets.only(top: SizeConfig.getPadding(6)),
......
...@@ -18,6 +18,8 @@ class BookingDetailtPresenter extends BasePresenter<BookingDetail> { ...@@ -18,6 +18,8 @@ class BookingDetailtPresenter extends BasePresenter<BookingDetail> {
Api _api; Api _api;
String type = '3'; String type = '3';
int getid; int getid;
int vendor_id;
int store_id;
ProductModel getmodel; ProductModel getmodel;
...@@ -25,9 +27,12 @@ class BookingDetailtPresenter extends BasePresenter<BookingDetail> { ...@@ -25,9 +27,12 @@ class BookingDetailtPresenter extends BasePresenter<BookingDetail> {
getDetail() async { getDetail() async {
print(getid); print(getid);
print(store_id);
print(vendor_id);
_api = Api<ProductModel>(); _api = Api<ProductModel>();
var res = await _api.getProductDetail({getid}); var res = await _api.getProductDetail({});
if (res.fail == null) { if (res.fail == null) {
if (res.success.status) { if (res.success.status) {
...@@ -35,8 +40,7 @@ class BookingDetailtPresenter extends BasePresenter<BookingDetail> { ...@@ -35,8 +40,7 @@ class BookingDetailtPresenter extends BasePresenter<BookingDetail> {
() { () {
print("AAAA :${res.success}"); print("AAAA :${res.success}");
getmodel = res.success; getmodel = res.success;
// print(getmodel.results.data.length);
// print("getmodel" + getmodel[0].results.data[0].storeName);
}, },
); );
} }
......
...@@ -10,9 +10,10 @@ import 'dart:math'; ...@@ -10,9 +10,10 @@ import 'dart:math';
class MainShop extends StatefulWidget { class MainShop extends StatefulWidget {
int getid; int getid;
int vendor_id;
int store_id;
MainShop({Key key, this.title,this.getid,this.vendor_id,this.store_id}) : super(key: key);
MainShop({Key key, this.title,this.getid}) : super(key: key);
final String title; final String title;
...@@ -176,7 +177,7 @@ class _MainShopState extends State<MainShop> ...@@ -176,7 +177,7 @@ class _MainShopState extends State<MainShop>
controller: _controller, controller: _controller,
children: <Widget>[ children: <Widget>[
Container( Container(
child: BookingDetail(getid: widget.getid,), child: BookingDetail(getid: widget.getid,vendor_id: widget.vendor_id,store_id: widget.store_id,),
// child: getlist(), // child: getlist(),
//width: 20, //width: 20,
), ),
......
...@@ -50,6 +50,8 @@ class _ShopServicePageState extends State<ShopServicePage> ...@@ -50,6 +50,8 @@ class _ShopServicePageState extends State<ShopServicePage>
presenter.serviceModel.data[i].specialPrice == null presenter.serviceModel.data[i].specialPrice == null
? "" ? ""
: presenter.serviceModel.data[i].specialPrice, : presenter.serviceModel.data[i].specialPrice,
presenter.serviceModel.data[i].vendorId,
presenter.serviceModel.data[i].storeId,
); );
}, },
), ),
...@@ -57,7 +59,7 @@ class _ShopServicePageState extends State<ShopServicePage> ...@@ -57,7 +59,7 @@ class _ShopServicePageState extends State<ShopServicePage>
} }
Widget myCard(String title, String image, String price, String time, int id, Widget myCard(String title, String image, String price, String time, int id,
String special_price) { String special_price , int vendor_id,int store_id) {
return InkWell( return InkWell(
onTap: () { onTap: () {
setState( setState(
...@@ -66,7 +68,8 @@ class _ShopServicePageState extends State<ShopServicePage> ...@@ -66,7 +68,8 @@ class _ShopServicePageState extends State<ShopServicePage>
context, context,
CupertinoPageRoute( CupertinoPageRoute(
builder: (context) => MainShop( builder: (context) => MainShop(
getid: id, getid: id,vendor_id: vendor_id,store_id: store_id,
), ),
), ),
); );
......
...@@ -14,11 +14,11 @@ class ShopServicePresenter extends BasePresenter<ShopServicePage> { ...@@ -14,11 +14,11 @@ class ShopServicePresenter extends BasePresenter<ShopServicePage> {
Servicelistitem() async { Servicelistitem() async {
_api = Api<shopserviceModel>(); _api = Api<shopserviceModel>();
var res = await _api.shopservice({ var res = await _api.shopservice({
"vendor_id": "16", "vendor_id": "9",
"store_id": "406", "store_id": "284",
"is_paginate": "1", "is_paginate": "1",
"per_page": "8", "per_page": "1",
"v": "2", "v": "1",
}); });
if (res.fail == null) { if (res.fail == null) {
......
...@@ -162,7 +162,7 @@ packages: ...@@ -162,7 +162,7 @@ packages:
name: image_picker name: image_picker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.7+4" version: "0.6.7+6"
image_picker_platform_interface: image_picker_platform_interface:
dependency: transitive dependency: transitive
description: description:
...@@ -281,14 +281,14 @@ packages: ...@@ -281,14 +281,14 @@ packages:
name: shared_preferences name: shared_preferences
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.5.8" version: "0.5.10"
shared_preferences_linux: shared_preferences_linux:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_linux name: shared_preferences_linux
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.2+1" version: "0.0.2+2"
shared_preferences_macos: shared_preferences_macos:
dependency: transitive dependency: transitive
description: description:
......
...@@ -14,7 +14,7 @@ description: A new Flutter project. ...@@ -14,7 +14,7 @@ description: A new Flutter project.
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ">=2.1.0 <3.0.0" sdk: ">=2.2.0 <3.0.0"
dependencies: dependencies:
flutter: flutter:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment