no message

parent 5a8e208f
...@@ -33,7 +33,7 @@ class MyApp extends StatelessWidget { ...@@ -33,7 +33,7 @@ class MyApp extends StatelessWidget {
), ),
home: Favorite() home: HomePage()
......
...@@ -17,6 +17,7 @@ import 'package:feelverapp/model/home_search/searchhomepage_model.dart'; ...@@ -17,6 +17,7 @@ import 'package:feelverapp/model/home_search/searchhomepage_model.dart';
import 'package:feelverapp/model/register/register_model.dart'; import 'package:feelverapp/model/register/register_model.dart';
import 'package:feelverapp/model/category/category_model.dart'; import 'package:feelverapp/model/category/category_model.dart';
import 'package:feelverapp/model/reviewshop/reviewshop_Model.dart';
import 'package:feelverapp/model/shoplist/shoplist_Model.dart'; import 'package:feelverapp/model/shoplist/shoplist_Model.dart';
import 'package:feelverapp/model/shoplistdetail/shoplistdetail_Model.dart'; import 'package:feelverapp/model/shoplistdetail/shoplistdetail_Model.dart';
import 'package:feelverapp/model/shopservice/shop_service_Model.dart'; import 'package:feelverapp/model/shopservice/shop_service_Model.dart';
...@@ -35,6 +36,26 @@ class Api<T> { ...@@ -35,6 +36,26 @@ class Api<T> {
static final String baseApiforimage = "https://backend-uat.feelver.com/api/storage/"; static final String baseApiforimage = "https://backend-uat.feelver.com/api/storage/";
Future<Response<T>> reviewshop(Object body) async {
var _model;
var _fail;
var result;
print("this is body" + body.toString());
await _httpConnection("${this._baseApi}/store/detail", this._headerApi, body).then((response){
print("ผลลัพท์ เท่ากับ" + "${response.body}");
if(response.statusCode == 200){
_model = ReviewShopModel.fromJson(json.decode(response.body));
}else{
_fail = FailModel.fromJson(json.decode(response.body));
}
result = new Response<T>(_model, _fail);
});
return result;
}
Future<Response<T>> deletefavorite(Object body) async { Future<Response<T>> deletefavorite(Object body) async {
......
import 'package:feelverapp/ui/review_shop/review_shop_presenter.dart';
import 'package:feelverapp/util/SizeConfig.dart'; import 'package:feelverapp/util/SizeConfig.dart';
import 'package:feelverapp/util/rating_star.dart'; import 'package:feelverapp/util/rating_star.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
...@@ -10,6 +11,23 @@ class ReviewShopPage extends StatefulWidget { ...@@ -10,6 +11,23 @@ class ReviewShopPage extends StatefulWidget {
class _ReviewShopPageState extends State<ReviewShopPage> { class _ReviewShopPageState extends State<ReviewShopPage> {
double rate1 = 0; double rate1 = 0;
ReviewshopPresenter presenter;
@override
void initState() {
super.initState();
presenter = ReviewshopPresenter(this);
presenter.Commentlist();
}
@override
void dispose() {
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
SizeConfig(context); SizeConfig(context);
...@@ -26,6 +44,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> { ...@@ -26,6 +44,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
fontFamily: "SF_Pro_Text", fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
), ),
), ),
body: _setupView(), body: _setupView(),
); );
...@@ -46,10 +65,10 @@ class _ReviewShopPageState extends State<ReviewShopPage> { ...@@ -46,10 +65,10 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
Widget containt() { Widget containt() {
return Expanded( return Expanded(
child: Container( child: Container(
child: ListView.builder( child: presenter.reviewShopModel == null ? Container():ListView.builder(
itemCount: 3, itemCount: presenter.reviewShopModel.result[0].comment.length,
itemBuilder: (context, i) { itemBuilder: (context, i) {
return list(); return list(presenter.reviewShopModel.result[i].comment[i].infoCustomer.name);
}), }),
), ),
); );
...@@ -227,7 +246,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> { ...@@ -227,7 +246,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
); );
} }
Widget list() { Widget list(String name,) {
return Card( return Card(
child: Container( child: Container(
// color: Colors.deepPurpleAccent, // color: Colors.deepPurpleAccent,
...@@ -263,7 +282,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> { ...@@ -263,7 +282,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Text( Text(
'Rattaya Pratumkan', name,
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.getFontSize(20), fontSize: SizeConfig.getFontSize(20),
color: Colors.black), color: Colors.black),
......
import 'package:feelverapp/model/reviewshop/reviewshop_Model.dart';
import 'package:feelverapp/service/api.dart';
import 'package:feelverapp/service/base_presenter.dart';
import 'package:feelverapp/ui/review_shop/review_shop_page.dart';
import 'package:flutter/material.dart';
class ReviewshopPresenter extends BasePresenter<ReviewShopPage>{
Api _api;
final formkey = GlobalKey<FormState>();
ReviewShopModel reviewShopModel;
ReviewshopPresenter(State<ReviewShopPage> state) : super(state);
Commentlist() async{
_api = Api<ReviewShopModel>();
var res = await _api.reviewshop({
"id": "284",
});
if(res.fail == null){
setState(() {
reviewShopModel = res.success;
});
}else{
print('res Fail');
}
}
}
\ No newline at end of file
...@@ -2,6 +2,7 @@ import 'package:carousel_pro/carousel_pro.dart'; ...@@ -2,6 +2,7 @@ import 'package:carousel_pro/carousel_pro.dart';
import 'package:feelverapp/service/api.dart'; import 'package:feelverapp/service/api.dart';
import 'package:feelverapp/ui/home/home.dart'; import 'package:feelverapp/ui/home/home.dart';
import 'package:feelverapp/ui/menu/menu.dart'; import 'package:feelverapp/ui/menu/menu.dart';
import 'package:feelverapp/ui/review_shop/review_shop_page.dart';
import 'package:feelverapp/ui/shop/shoplistdetail_presenter.dart'; import 'package:feelverapp/ui/shop/shoplistdetail_presenter.dart';
import 'package:feelverapp/util/SizeConfig.dart'; import 'package:feelverapp/util/SizeConfig.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
...@@ -46,7 +47,7 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -46,7 +47,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
), ),
),), ),),
): _setupView(), ): _setupView(),
); );
} }
...@@ -94,10 +95,10 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -94,10 +95,10 @@ class _ShopListDetailState extends State<ShopListDetail> {
), ),
), ),
), ),
), ),
], ],
), ),
Container( Container(
...@@ -108,10 +109,10 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -108,10 +109,10 @@ class _ShopListDetailState extends State<ShopListDetail> {
height: SizeConfig.getHeight(190), height: SizeConfig.getHeight(190),
width: SizeConfig.getHeight(350), width: SizeConfig.getHeight(350),
child: Carousel( child: Carousel(
images: [ images: [
Image.network(presenter.model.result[0].storeCover,fit: BoxFit.cover,), Image.network(presenter.model.result[0].storeCover,fit: BoxFit.cover,),
Image.network(presenter.model.result[0].storeCover,fit: BoxFit.cover,), Image.network(presenter.model.result[0].storeCover,fit: BoxFit.cover,),
Image.network(presenter.model.result[0].storeCover,fit: BoxFit.cover,), Image.network(presenter.model.result[0].storeCover,fit: BoxFit.cover,),
...@@ -180,7 +181,7 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -180,7 +181,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
), ),
Container( Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: SizeConfig.getPadding(24), left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24), right: SizeConfig.getPadding(24),
bottom: SizeConfig.getPadding(5), bottom: SizeConfig.getPadding(5),
...@@ -228,7 +229,7 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -228,7 +229,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
), ),
), ),
Container( Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: SizeConfig.getPadding(24), left: SizeConfig.getPadding(24),
...@@ -283,7 +284,7 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -283,7 +284,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
); );
} }
_servicelist() { _servicelist() {
return Column( return Column(
children: <Widget>[ children: <Widget>[
...@@ -306,7 +307,7 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -306,7 +307,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
), ),
), ),
Container( Container(
height: 600, height: 600,
padding: EdgeInsets.only( padding: EdgeInsets.only(
...@@ -324,7 +325,7 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -324,7 +325,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
Align( Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child:Text( child:Text(
presenter.model.result[0].storeProduct[i].product.name, presenter.model.result[0].storeProduct[i].product.name,
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
...@@ -336,14 +337,14 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -336,14 +337,14 @@ class _ShopListDetailState extends State<ShopListDetail> {
SizedBox(height: 30,), SizedBox(height: 30,),
Row(children: [ Row(children: [
Icon( Icon(
Icons.timer, Icons.timer,
color: Colors.pinkAccent, color: Colors.pinkAccent,
size: 20, size: 20,
), ),
Text( Text(
" "+presenter.model.result[0].storeProduct[i].product.duration+" ชม.", " "+presenter.model.result[0].storeProduct[i].product.duration+" ชม.",
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
...@@ -354,7 +355,7 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -354,7 +355,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
),Spacer(), ),Spacer(),
presenter.model.result[0].storeProduct[i].product.specialPrice==null? presenter.model.result[0].storeProduct[i].product.specialPrice==null?
Text( Text(
"฿"+presenter.model.result[0].storeProduct[i].product.price, "฿"+presenter.model.result[0].storeProduct[i].product.price,
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
...@@ -364,7 +365,7 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -364,7 +365,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
fontWeight: FontWeight.w700), fontWeight: FontWeight.w700),
): ):
Container(child: Container(child:
Row(children: [ Row(children: [
Icon( Icon(
Icons.local_offer, Icons.local_offer,
...@@ -372,7 +373,7 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -372,7 +373,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
size: 20, size: 20,
), ),
Text( Text(
" ฿"+presenter.model.result[0].storeProduct[i].product.price, " ฿"+presenter.model.result[0].storeProduct[i].product.price,
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
...@@ -384,7 +385,7 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -384,7 +385,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
), ),
Text( Text(
" ฿"+presenter.model.result[0].storeProduct[i].product.specialPrice, " ฿"+presenter.model.result[0].storeProduct[i].product.specialPrice,
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
...@@ -394,9 +395,9 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -394,9 +395,9 @@ class _ShopListDetailState extends State<ShopListDetail> {
fontWeight: FontWeight.w700), fontWeight: FontWeight.w700),
) )
],) ],)
) )
...@@ -406,23 +407,23 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -406,23 +407,23 @@ class _ShopListDetailState extends State<ShopListDetail> {
Padding( Padding(
padding: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 0.0), padding: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 0.0),
child: Material( //Wrap with Material child: Material( //Wrap with Material
shape: RoundedRectangleBorder(borderRadius:BorderRadius.circular(30.0) ), shape: RoundedRectangleBorder(borderRadius:BorderRadius.circular(30.0) ),
elevation: 0.0, elevation: 0.0,
color: Color.fromRGBO(106, 179, 170, 1), color: Color.fromRGBO(106, 179, 170, 1),
clipBehavior: Clip.antiAlias, // Add This clipBehavior: Clip.antiAlias, // Add This
child: MaterialButton( child: MaterialButton(
minWidth:MediaQuery.of(context).size.width - 50, minWidth:MediaQuery.of(context).size.width - 50,
height: 55, height: 55,
color: Color(0xff3694A3), color: Color(0xff3694A3),
child: child:
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Icon( Icon(
Icons.shopping_cart, Icons.shopping_cart,
...@@ -432,7 +433,7 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -432,7 +433,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
new Text(' หยิบใส่รถเข็น', new Text(' หยิบใส่รถเข็น',
style: new TextStyle(fontSize: 16.0, color: Colors.white)), style: new TextStyle(fontSize: 16.0, color: Colors.white)),
],), ],),
onPressed: () { onPressed: () {
...@@ -454,11 +455,11 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -454,11 +455,11 @@ class _ShopListDetailState extends State<ShopListDetail> {
width: MediaQuery.of(context).size.width - 40, width: MediaQuery.of(context).size.width - 40,
color: Colors.grey, color: Colors.grey,
) )
],); ],);
}, },
), ),
), ),
...@@ -500,7 +501,7 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -500,7 +501,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
), ),
), ),
Container( Container(
height: 200, height: 200,
padding: EdgeInsets.only( padding: EdgeInsets.only(
...@@ -513,7 +514,7 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -513,7 +514,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
child:ListView.builder( child:ListView.builder(
itemCount: presenter.model.result[0].openHour.length, itemCount: presenter.model.result[0].openHour.length,
itemBuilder: (context, i) { itemBuilder: (context, i) {
return return
Text( Text(
"${presenter.model.result[0].openHour[i].name} ${presenter.model.result[0].openHour[i].open} - ${presenter.model.result[0].openHour[i].closed} ", "${presenter.model.result[0].openHour[i].name} ${presenter.model.result[0].openHour[i].open} - ${presenter.model.result[0].openHour[i].closed} ",
textAlign: TextAlign.left, textAlign: TextAlign.left,
...@@ -522,7 +523,7 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -522,7 +523,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
fontSize: SizeConfig.getFontSize(12), fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text", fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
); );
}, },
), ),
...@@ -567,8 +568,13 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -567,8 +568,13 @@ class _ShopListDetailState extends State<ShopListDetail> {
), ),
Positioned( Positioned(
right: SizeConfig.getPadding(15), right: SizeConfig.getPadding(15),
top: SizeConfig.getPadding(20), top: SizeConfig.getPadding(6),
child: Text( child: FlatButton(
onPressed: (){Navigator.push(
context,
MaterialPageRoute(builder: (context) => ReviewShopPage()),
);},
child: Text(
'ดูทั้งหมด', 'ดูทั้งหมด',
textAlign: TextAlign.right, textAlign: TextAlign.right,
style: TextStyle( style: TextStyle(
...@@ -577,6 +583,7 @@ class _ShopListDetailState extends State<ShopListDetail> { ...@@ -577,6 +583,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
fontSize: SizeConfig.getFontSize(12), fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text", fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w700), fontWeight: FontWeight.w700),
),
), ),
), ),
Positioned( Positioned(
......
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