no message

parent 9773dcd7
...@@ -49,9 +49,9 @@ class Result { ...@@ -49,9 +49,9 @@ class Result {
String star; String star;
List<StoreProduct> storeProduct; List<StoreProduct> storeProduct;
List<Comment> comment; List<Comment> comment;
List<Null> commentReview; List<dynamic> commentReview;
List<OpenHour> openHour; List<OpenHour> openHour;
List<Null> image; List<dynamic> image;
Ratings ratings; Ratings ratings;
Result({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.storeProduct, this.comment, this.commentReview, this.openHour, this.image, this.ratings}); Result({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.storeProduct, this.comment, this.commentReview, this.openHour, this.image, this.ratings});
...@@ -155,7 +155,7 @@ class StoreProduct { ...@@ -155,7 +155,7 @@ class StoreProduct {
int vendorId; int vendorId;
String status; String status;
int sortOrders; int sortOrders;
Null createdAt; dynamic createdAt;
String updatedAt; String updatedAt;
String typeRateService; String typeRateService;
String priceRateService; String priceRateService;
...@@ -206,20 +206,20 @@ class Product { ...@@ -206,20 +206,20 @@ class Product {
String price; String price;
String specialPrice; String specialPrice;
String sku; String sku;
Null tax; dynamic tax;
int quantity; int quantity;
Null weight; dynamic weight;
String visibility; String visibility;
Null newsFromDate; dynamic newsFromDate;
Null newsToDate; dynamic newsToDate;
Null layout; dynamic layout;
Null theme; dynamic theme;
String duration; String duration;
Null sellingStartTime; dynamic sellingStartTime;
Null sellingEndTime; dynamic sellingEndTime;
Null redemptionStartTime; dynamic redemptionStartTime;
Null redemptionEndTime; dynamic redemptionEndTime;
Null availibility; dynamic availibility;
String isFeatured; String isFeatured;
String isDeal; String isDeal;
String hasTeam; String hasTeam;
...@@ -353,12 +353,12 @@ class CategoryFeelverByProductId { ...@@ -353,12 +353,12 @@ class CategoryFeelverByProductId {
String displayName; String displayName;
String cover; String cover;
String detail; String detail;
Null type; dynamic type;
String status; String status;
int sortOrder; int sortOrder;
Null storeId; dynamic storeId;
Null vendorId; dynamic vendorId;
Null createdAt; dynamic createdAt;
String updatedAt; String updatedAt;
String visibility; String visibility;
Pivot pivot; Pivot pivot;
...@@ -438,19 +438,19 @@ class Comment { ...@@ -438,19 +438,19 @@ class Comment {
int commentItemsId; int commentItemsId;
String commentAuthor; String commentAuthor;
String commentEmail; String commentEmail;
Null commentUrl; dynamic commentUrl;
String commentIp; String commentIp;
String commentDate; String commentDate;
String commentContent; String commentContent;
String commentApproved; String commentApproved;
String commentType; String commentType;
Null commentParent; dynamic commentParent;
String status; String status;
int userId; int userId;
int storeId; int storeId;
int vendorId; int vendorId;
Null createdAt; dynamic createdAt;
Null updatedAt; dynamic updatedAt;
int shopScore; int shopScore;
int flagShop; int flagShop;
List<Null> tagShop; List<Null> tagShop;
...@@ -522,7 +522,7 @@ class Comment { ...@@ -522,7 +522,7 @@ class Comment {
class InfoCustomer { class InfoCustomer {
int id; int id;
Null prefix; dynamic prefix;
String name; String name;
String lastname; String lastname;
String displayName; String displayName;
...@@ -533,10 +533,10 @@ class InfoCustomer { ...@@ -533,10 +533,10 @@ class InfoCustomer {
String phone; String phone;
String address; String address;
String socialRegister; String socialRegister;
Null socialType; dynamic socialType;
String status; String status;
String approved; String approved;
Null createdAt; dynamic createdAt;
String updatedAt; String updatedAt;
int userId; int userId;
...@@ -597,8 +597,8 @@ class OpenHour { ...@@ -597,8 +597,8 @@ class OpenHour {
String halftime; String halftime;
int vendorId; int vendorId;
int storeId; int storeId;
Null createdAt; dynamic createdAt;
Null updatedAt; dynamic updatedAt;
OpenHour({this.id, this.name, this.code, this.dayName, this.open, this.closed, this.halftime, this.vendorId, this.storeId, this.createdAt, this.updatedAt}); OpenHour({this.id, this.name, this.code, this.dayName, this.open, this.closed, this.halftime, this.vendorId, this.storeId, this.createdAt, this.updatedAt});
...@@ -641,7 +641,7 @@ class Ratings { ...@@ -641,7 +641,7 @@ class Ratings {
String rateTb; String rateTb;
int rateRowId; int rateRowId;
String isCustom; String isCustom;
Null customScore; dynamic customScore;
int rateRange; int rateRange;
int storeId; int storeId;
int vendorId; int vendorId;
......
import 'dart:convert'; import 'dart:convert';
import 'package:feelverapp/home_search/searchhomepage_model.dart';
import 'package:feelverapp/model/Login/login_model.dart'; import 'package:feelverapp/model/Login/login_model.dart';
import 'package:feelverapp/model/base/base.dart'; import 'package:feelverapp/model/base/base.dart';
...@@ -23,6 +25,27 @@ class Api<T> { ...@@ -23,6 +25,27 @@ class Api<T> {
"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYmFja2VuZC11YXQuZmVlbHZlci5jb21cL2FwaVwvbG9naW4iLCJpYXQiOjE1OTYxMDAzNTgsImV4cCI6MTYwMzMwMDM1OCwibmJmIjoxNTk2MTAwMzU4LCJqdGkiOiJ2YjA2S0FHR1JtZDFseEw1Iiwic3ViIjozNzMsInBydiI6Ijg3ZTBhZjFlZjlmZDE1ODEyZmRlYzk3MTUzYTE0ZTBiMDQ3NTQ2YWEifQ.UkY70AshvW5O4M63XY_Iv2IPBohSUUwnRF1oi46p2zs", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYmFja2VuZC11YXQuZmVlbHZlci5jb21cL2FwaVwvbG9naW4iLCJpYXQiOjE1OTYxMDAzNTgsImV4cCI6MTYwMzMwMDM1OCwibmJmIjoxNTk2MTAwMzU4LCJqdGkiOiJ2YjA2S0FHR1JtZDFseEw1Iiwic3ViIjozNzMsInBydiI6Ijg3ZTBhZjFlZjlmZDE1ODEyZmRlYzk3MTUzYTE0ZTBiMDQ3NTQ2YWEifQ.UkY70AshvW5O4M63XY_Iv2IPBohSUUwnRF1oi46p2zs",
}; };
Future<Response<T>> homesearch(Object body) async {
var _model;
var _fail;
var result;
// (body as Map)['lang'] = allTranslations.currentLanguage;
await _httpConnection("${this._baseApi}/store/shop-list", this._headerApi, body)
.then((response){
print("ผลลัพ เท่ากับบบบ " + "${response.body}");
if (response.statusCode == 200){
_model = SearchhomeModel.fromJson(json.decode(response.body));
} else {
_fail = FailModel.fromJson(json.decode(response.body));
}
result = new Response<T>(_model, _fail);
});
return result;
}
Future<Response<T>> getprofile(Object body) async { Future<Response<T>> getprofile(Object body) async {
var _model; var _model;
var _fail; var _fail;
......
...@@ -33,6 +33,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin { ...@@ -33,6 +33,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
// presenter.getid(); // presenter.getid();
presenter.getprofile (); presenter.getprofile ();
presenter.Search();
} }
......
import 'package:feelverapp/home_search/searchhomepage_model.dart';
import 'package:feelverapp/model/Login/login_model.dart'; import 'package:feelverapp/model/Login/login_model.dart';
import 'package:feelverapp/model/category/category_model.dart'; import 'package:feelverapp/model/category/category_model.dart';
import 'package:feelverapp/model/editprofile/getprofilemodel.dart'; import 'package:feelverapp/model/editprofile/getprofilemodel.dart';
...@@ -32,6 +33,45 @@ class HomePresenter extends BasePresenter<HomePage> { ...@@ -32,6 +33,45 @@ class HomePresenter extends BasePresenter<HomePage> {
} }
} }
Search() async{
_api = Api<SearchhomeModel>();
var res = await _api.homesearch({
"keyword_shop" : "spa",
"lang" : "all",
"access" : "portal",
});
if (res.fail == null) {
print('res Success');
} else {
Alert(
style: AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
),
context: state.context,
title: "ไม่สามารถติดต่อ\nเซิร์ฟเวอร์ได้",
content: Icon(
Icons.warning,
color: Colors.orange,
size: 80,
),
buttons: [
DialogButton(
color: Color.fromRGBO(106, 179, 170, 1),
onPressed: () => Navigator.pop(state.context),
child: Text(
"ค้นหาใหม่อีกครั้ง",
style: TextStyle(color: Colors.white, fontSize: 20),
),
)
]).show();
}
}
getid() async { getid() async {
SharedPreferences pref = await SharedPreferences.getInstance(); SharedPreferences pref = await SharedPreferences.getInstance();
setState(() {uid =pref.getString('Id');}); setState(() {uid =pref.getString('Id');});
......
...@@ -13,7 +13,7 @@ class ShopList extends StatefulWidget { ...@@ -13,7 +13,7 @@ class ShopList extends StatefulWidget {
} }
class _ShopListState extends State<ShopList> with TickerProviderStateMixin { class _ShopListState extends State<ShopList> with TickerProviderStateMixin {
var entries = new List<String>.generate(2, (i) => "Item $i"); var entries = new List<String>.generate(1, (i) => "Item $i");
ShoplistPresenter presenter; ShoplistPresenter presenter;
...@@ -277,12 +277,12 @@ class _ShopListState extends State<ShopList> with TickerProviderStateMixin { ...@@ -277,12 +277,12 @@ class _ShopListState extends State<ShopList> with TickerProviderStateMixin {
child: new Text( child: new Text(
'Load more ...', 'Load more ...',
style: new TextStyle( style: new TextStyle(
color: Colors.white, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
onPressed: () { onPressed: () {
var nextItems = new List<String>.generate(2, (i) { var nextItems = new List<String>.generate(1, (i) {
var itemId = i + entries.length; var itemId = i + entries.length;
return "Item $itemId"; return "Item $itemId";
}); });
......
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