update shop detail

parent 18c95738
......@@ -8,6 +8,7 @@ import 'package:feelverapp/ui/login/login.dart';
import 'package:feelverapp/ui/my_reviews/my_reviews_page.dart';
import 'package:feelverapp/ui/review_shop/review_shop_page.dart';
import 'package:feelverapp/ui/shop/shop_list.dart';
import 'package:feelverapp/ui/shop/shop_list_detail.dart';
import 'package:feelverapp/ui/shop/shop_main.dart';
import 'package:feelverapp/ui/splashscreen/splash_screen_page.dart';
......@@ -32,7 +33,7 @@ class MyApp extends StatelessWidget {
),
home: MainShop()
home: SplashScreenPage()
......
......@@ -29,7 +29,7 @@ class Api<T> {
"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYmFja2VuZC11YXQuZmVlbHZlci5jb21cL2FwaVwvbG9naW4iLCJpYXQiOjE1OTYxMDAzNTgsImV4cCI6MTYwMzMwMDM1OCwibmJmIjoxNTk2MTAwMzU4LCJqdGkiOiJ2YjA2S0FHR1JtZDFseEw1Iiwic3ViIjozNzMsInBydiI6Ijg3ZTBhZjFlZjlmZDE1ODEyZmRlYzk3MTUzYTE0ZTBiMDQ3NTQ2YWEifQ.UkY70AshvW5O4M63XY_Iv2IPBohSUUwnRF1oi46p2zs",
};
static final String baseApi = "https://backend-uat.feelver.com/api";
static final String baseApi = "https://backend-uat.feelver.com/api/storage/";
Future<Response<T>> favorite(Object body) async {
var _model;
var _fail;
......
......@@ -8,6 +8,7 @@ import 'package:feelverapp/ui/nearme/near_me_list.dart';
import 'package:feelverapp/ui/payment/payment_detail.dart';
import 'package:feelverapp/ui/reserve/reserve_list.dart';
import 'package:feelverapp/ui/shop/shop_list.dart';
import 'package:feelverapp/ui/shop/shop_list_detail.dart';
import 'package:feelverapp/util/Accout_util.dart';
import 'package:feelverapp/util/SizeConfig.dart';
import 'package:flutter/cupertino.dart';
......@@ -26,7 +27,7 @@ class HomePage extends StatefulWidget {
}
class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
bool search=false;
bool search = false;
TabController _tabController;
HomePresenter presenter;
......@@ -49,7 +50,6 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
void dispose() {
super.dispose();
_tabController.dispose();
}
......@@ -57,8 +57,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
Widget build(BuildContext context) {
SizeConfig(context);
return
Scaffold(
return Scaffold(
body: _setupView(),
bottomNavigationBar: Container(
color: Color.fromRGBO(69, 85, 79, 1),
......@@ -138,7 +137,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Paymentdetail()),
MaterialPageRoute(
builder: (context) => Paymentdetail()),
);
},
),
......@@ -191,7 +191,6 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
}
_setupView() {
return Column(
children: <Widget>[
Stack(
......@@ -270,7 +269,6 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
),
),
),
Positioned(
top: SizeConfig.getPadding(77),
right: SizeConfig.getPadding(20),
......@@ -299,17 +297,22 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
),
_searchField(),
],
),SizedBox(height: 20,),
presenter.CatModel==null? Container(
),
SizedBox(
height: 20,
),
presenter.CatModel == null
? Container(
child: CircularProgressIndicator(
valueColor: new AlwaysStoppedAnimation<Color>(Color.fromRGBO(69, 85, 79, 1),),
valueColor: new AlwaysStoppedAnimation<Color>(
Color.fromRGBO(69, 85, 79, 1),
),
): search?_getlist():Expanded(
),
)
: search
? _getlist()
: Expanded(
child: Container(
child: ListView.builder(
itemCount: presenter.CatModel.result.length,
itemBuilder: (context, i) {
......@@ -321,7 +324,6 @@ valueColor: new AlwaysStoppedAnimation<Color>(Color.fromRGBO(69, 85, 79, 1),),
);
}
list(int index) {
return Container(
//color: Colors.orange,
......@@ -358,7 +360,7 @@ valueColor: new AlwaysStoppedAnimation<Color>(Color.fromRGBO(69, 85, 79, 1),),
);
}
Widget _shopItem(String title, String image, String address, String detail) {
Widget _shopItem(String title, String image, String address, String detail,String id) {
return Card(
child: Column(
children: <Widget>[
......@@ -374,7 +376,7 @@ valueColor: new AlwaysStoppedAnimation<Color>(Color.fromRGBO(69, 85, 79, 1),),
fit: BoxFit.cover,
)
: Image.network(
"https://backend-uat.feelver.com/storage/"+ image,
"https://backend-uat.feelver.com/storage/" + image,
height: SizeConfig.getWidth(180),
width: MediaQuery.of(context).size.width,
fit: BoxFit.cover,
......@@ -400,27 +402,50 @@ valueColor: new AlwaysStoppedAnimation<Color>(Color.fromRGBO(69, 85, 79, 1),),
Positioned(
left: SizeConfig.getPadding(75),
top: SizeConfig.getPadding(190),
child: Text(
child:
InkWell(
child:Text(
title,
textAlign: TextAlign.left,
style: TextStyle(
decoration: TextDecoration.underline,
color: Colors.black,
fontSize: SizeConfig.getFontSize(11),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w700),
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => ShopListDetail(id:id)),
);
},
),
),
Positioned(
left: SizeConfig.getPadding(280),
top: SizeConfig.getPadding(190),
child:Icon(Icons.star,color: Colors.orangeAccent,size: SizeConfig.getFontSize(18),),
child: Icon(
Icons.star,
color: Colors.orangeAccent,
size: SizeConfig.getFontSize(18),
),
),
Positioned(
left: SizeConfig.getPadding(300),
top: SizeConfig.getPadding(190),
child: Text(
"4.9",
presenter.searchhomeModel.thTH[0].star.toString(),
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
......@@ -434,7 +459,7 @@ valueColor: new AlwaysStoppedAnimation<Color>(Color.fromRGBO(69, 85, 79, 1),),
),
Container(
padding: EdgeInsets.only(
bottom:SizeConfig.getPadding(14),
bottom: SizeConfig.getPadding(14),
left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24)),
alignment: Alignment.topLeft,
......@@ -458,13 +483,14 @@ valueColor: new AlwaysStoppedAnimation<Color>(Color.fromRGBO(69, 85, 79, 1),),
fontWeight: FontWeight.w500),
),
),
SizedBox(height: 10,)
SizedBox(
height: 10,
)
],
),
);
}
_getlist() {
return Expanded(
child: Container(
......@@ -500,7 +526,11 @@ valueColor: new AlwaysStoppedAnimation<Color>(Color.fromRGBO(69, 85, 79, 1),),
presenter.searchhomeModel.thTH[i].storeName,
presenter.searchhomeModel.thTH[i].storeCover,
presenter.searchhomeModel.thTH[i].address,
presenter.searchhomeModel.thTH[i].detail == null ? "" : presenter.searchhomeModel.thTH[i].detail,);
presenter.searchhomeModel.thTH[i].detail == null
? ""
: presenter.searchhomeModel.thTH[i].detail,
presenter.searchhomeModel.thTH[i].id.toString(),
);
}),
),
);
......@@ -511,7 +541,7 @@ valueColor: new AlwaysStoppedAnimation<Color>(Color.fromRGBO(69, 85, 79, 1),),
onTap: () {
presenter.getSearch();
setState(() {
search=true;
search = true;
});
},
child: Container(
......@@ -528,15 +558,14 @@ valueColor: new AlwaysStoppedAnimation<Color>(Color.fromRGBO(69, 85, 79, 1),),
child: img,
),
Container(
margin: const EdgeInsets.only(top: 10.0,left: 14),
margin: const EdgeInsets.only(top: 10.0, left: 14),
height: SizeConfig.getHeight(110),
width:SizeConfig.getWidth(320),
width: SizeConfig.getWidth(320),
decoration: BoxDecoration(
color: Colors.transparent,//remove color to make it transpatent
color:
Colors.transparent, //remove color to make it transpatent
border: Border.all(
style: BorderStyle.solid,
width: 2,
color: Colors.white)),
style: BorderStyle.solid, width: 2, color: Colors.white)),
),
Container(
alignment: Alignment.center,
......@@ -590,20 +619,20 @@ valueColor: new AlwaysStoppedAnimation<Color>(Color.fromRGBO(69, 85, 79, 1),),
),
suffixIcon: IconButton(
onPressed: () {
presenter.searchCtrl.clear();
},
icon: Icon(Icons.clear, color: presenter.searchCtrl==null?Colors.transparent:Colors.black)),
icon: Icon(Icons.clear,
color: presenter.searchCtrl == null
? Colors.transparent
: Colors.black)),
prefixIcon: IconButton(
onPressed: () {
setState(() {
search=true;
search = true;
print(search);
});
presenter.getSearch();
},
icon: Icon(Icons.search, color: Colors.grey)),
filled: true,
hintText: 'ค้นหาแบบละเอียด',
......
import 'package:feelverapp/service/api.dart';
import 'package:feelverapp/ui/nearme/near_me_detail.dart';
import 'package:feelverapp/ui/nearme/near_me_list_presenter.dart';
import 'package:feelverapp/util/SizeConfig.dart';
......@@ -217,7 +218,7 @@ class _NearmeListState extends State<NearmeList> with TickerProviderStateMixin {
),
Expanded(
child: Image.network(
'https://backend.feelver.com/storage/' + img,
Api.baseApi + img,
// width: SizeConfig.getWidth(50),
height: SizeConfig.getHeight(160),
fit: BoxFit.fitHeight,
......
import 'package:feelverapp/service/api.dart';
import 'package:feelverapp/ui/nearme/near_me_detail.dart';
import 'package:feelverapp/ui/nearme/near_me_list_presenter.dart';
import 'package:feelverapp/ui/shop/shop_main.dart';
......@@ -234,7 +235,7 @@ class _ShopNearbyPlacesPageState extends State<ShopNearbyPlacesPage>with TickerP
fit: BoxFit.cover,
)
: Image.network(
'https://backend.feelver.com/storage/' + img,
Api.baseApi + img,
fit: BoxFit.cover,
),),
),
......
import 'package:feelverapp/service/api.dart';
import 'package:feelverapp/ui/home/home.dart';
import 'package:feelverapp/ui/menu/menu.dart';
import 'package:feelverapp/ui/shop/shoplistdetail_presenter.dart';
......@@ -6,6 +7,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ShopListDetail extends StatefulWidget {
String id;
ShopListDetail({Key key, this.id,}) : super(key: key);
@override
_ShopListDetailState createState() => _ShopListDetailState();
}
......@@ -17,9 +20,9 @@ class _ShopListDetailState extends State<ShopListDetail> {
@override
void initState() {
super.initState();
print(widget.id);
presenter = ShoplistdetailPresenter(this);
presenter.Detai();
presenter.Detai(widget.id);
}
......@@ -33,138 +36,14 @@ class _ShopListDetailState extends State<ShopListDetail> {
Widget build(BuildContext context) {
SizeConfig(context);
return Scaffold(
body: _setupView(),
bottomNavigationBar: Container(
color: Color.fromRGBO(69, 85, 79, 1),
height: SizeConfig.getWidth(80),
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: SizeConfig.getPadding(16), top: 0),
width: SizeConfig.getWidth(60),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
IconButton(
icon: Image.asset(
'assets/images/ic_home.png',
width: SizeConfig.getWidth(24),
height: SizeConfig.getWidth(24),
),
onPressed: () {
print("Pressed");
Navigator.push(
context,
MaterialPageRoute(builder: (context) => HomePage()),
);
},
),
Text(
'หน้าแรก',
style: TextStyle(
color: Colors.white,
fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w700),
),
],
),
),
Container(
margin: EdgeInsets.only(left: SizeConfig.getPadding(16), top: 0),
width: SizeConfig.getWidth(100),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
IconButton(
icon: Image.asset(
'assets/images/ic_list.png',
width: SizeConfig.getWidth(24),
height: SizeConfig.getWidth(24),
),
onPressed: () {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => LoginPage()),
// );
print("Pressed");
},
),
Text(
'การจองของฉัน',
style: TextStyle(
color: Colors.grey,
fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w700),
),
],
),
),
Container(
margin: EdgeInsets.only(left: SizeConfig.getPadding(16), top: 0),
width: SizeConfig.getWidth(80),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
IconButton(
icon: Image.asset(
'assets/images/ic_cart.png',
width: SizeConfig.getWidth(24),
height: SizeConfig.getWidth(24),
),
onPressed: () {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => LoginPage()),
// );
},
),
Text(
'รถเข็นของฉัน',
style: TextStyle(
color: Colors.grey,
fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w700),
)
],
),
),
Container(
margin: EdgeInsets.only(
left: SizeConfig.getPadding(16), top: 0, right: 0),
width: SizeConfig.getWidth(60),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
IconButton(
icon: Image.asset(
'assets/images/ic_nearme.png',
width: SizeConfig.getWidth(24),
height: SizeConfig.getWidth(24),
),
onPressed: () {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => LoginPage()),
// );
},
),
Text(
'ใกล้ฉัน',
style: TextStyle(
color: Colors.grey,
fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w700),
)
],
),
),
],
),
body:presenter.model==null?Container(child:
Center( child: CircularProgressIndicator(
valueColor: new AlwaysStoppedAnimation<Color>(
Color.fromRGBO(69, 85, 79, 1),
),
),),
): _setupView(),
);
}
......@@ -176,7 +55,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
children: <Widget>[
Container(
color: Color.fromRGBO(69, 85, 79, 1),
height: SizeConfig.getHeight(200),
height: SizeConfig.getHeight(150),
width: MediaQuery.of(context).size.width,
),
Positioned(
......@@ -204,47 +83,17 @@ class _ShopListDetailState extends State<ShopListDetail> {
},
);
},
child: Image.asset(
'assets/images/ic_menu.png',
height: SizeConfig.getWidth(24),
width: SizeConfig.getWidth(30),
fit: BoxFit.cover,
),
),
),
),
Positioned(
top: SizeConfig.getPadding(77),
right: SizeConfig.getPadding(60),
child: Container(
child: Image.asset(
'assets/images/ic_noti.png',
height: SizeConfig.getWidth(30),
width: SizeConfig.getWidth(30),
fit: BoxFit.cover,
),
),
),
Positioned(
top: SizeConfig.getPadding(77),
right: SizeConfig.getPadding(20),
child: InkWell(
// onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => LoginPage()),
// );
// },
child: Container(
child: Image.asset(
'assets/images/ic_userimg.png',
height: SizeConfig.getWidth(30),
width: SizeConfig.getWidth(30),
fit: BoxFit.cover,
child: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: SizeConfig.getFontSize(24),
),
),
),
),
],
),
Container(
......@@ -252,9 +101,9 @@ class _ShopListDetailState extends State<ShopListDetail> {
child: Stack(
children: <Widget>[
Image.network(
'https://image.freepik.com/free-photo/girl-massage-spa-salon_110955-422.jpg',
height: SizeConfig.getWidth(180),
width: MediaQuery.of(context).size.width,
presenter.model.result[0].storeCover,
height: SizeConfig.getWidth(190),
width: SizeConfig.getWidth(350),
fit: BoxFit.cover,
),
Positioned(
......@@ -279,7 +128,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
left: SizeConfig.getPadding(75),
top: SizeConfig.getPadding(190),
child: Text(
'Ivory Relax and Spa',
presenter.model.result[0].storeName,
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
......@@ -293,12 +142,63 @@ class _ShopListDetailState extends State<ShopListDetail> {
),
Container(
padding: EdgeInsets.only(
left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24),
bottom: SizeConfig.getPadding(5),
),
alignment: Alignment.topLeft,
child: Text(
'ข้อมูลติดต่อ',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black87,
fontSize: SizeConfig.getFontSize(16),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w700),
),
),
Container(
padding: EdgeInsets.only(
left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24),
bottom: SizeConfig.getPadding(15)),
alignment: Alignment.topLeft,
child: Text(
'4/18, 4/21 BTS Nana Exit4 Sukhumvit Soi 8 , KlongToey Bangkok, Thailand 10110',
"โทร "+presenter.model.result[0].phone,
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.grey,
fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
),
Container(
padding: EdgeInsets.only(
left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24),
bottom: SizeConfig.getPadding(15)),
alignment: Alignment.topLeft,
child: Text(
"email "+presenter.model.result[0].email,
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.grey,
fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
),
Container(
padding: EdgeInsets.only(
left: SizeConfig.getPadding(24),
right: SizeConfig.getPadding(24),
bottom: SizeConfig.getPadding(15)),
alignment: Alignment.topLeft,
child: Text(
"ที่อยู่ "+ presenter.model.result[0].address,
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.grey,
......@@ -555,7 +455,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
left: SizeConfig.getPadding(45),
top: SizeConfig.getPadding(50),
child: Text(
'4.9',
presenter.model.result[0].star,
textAlign: TextAlign.right,
style: TextStyle(
decoration: TextDecoration.underline,
......@@ -565,20 +465,20 @@ class _ShopListDetailState extends State<ShopListDetail> {
fontWeight: FontWeight.w700),
),
),
Positioned(
left: SizeConfig.getPadding(80),
top: SizeConfig.getPadding(52),
child: Text(
'267 รีวิว',
textAlign: TextAlign.right,
style: TextStyle(
// decoration: TextDecoration.underline,
color: Colors.black54,
fontSize: SizeConfig.getFontSize(12),
fontFamily: "SF_Pro_Text",
fontWeight: FontWeight.w500),
),
),
// Positioned(
// left: SizeConfig.getPadding(80),
// top: SizeConfig.getPadding(52),
// child: Text(
// '267 รีวิว',
// textAlign: TextAlign.right,
// style: TextStyle(
// // decoration: TextDecoration.underline,
// color: Colors.black54,
// fontSize: SizeConfig.getFontSize(12),
// fontFamily: "SF_Pro_Text",
// fontWeight: FontWeight.w500),
// ),
// ),
Positioned(
right: SizeConfig.getPadding(20),
top: SizeConfig.getPadding(52),
......@@ -612,7 +512,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
'ความคุ้มค่า'
];
return Container(
height: 80,
height: 90,
child: GridView.count(
crossAxisCount: 4,
physics: const NeverScrollableScrollPhysics(),
......@@ -676,7 +576,7 @@ class _ShopListDetailState extends State<ShopListDetail> {
top: SizeConfig.getPadding(10),
),
child: Text(
'ไม่ว่าคุณจะมาเยี่ยมเยียนเมืองเพลิดเพลินไปกับการพักผ่อนหรือคุณเป็นคนกรุงเทพฯตลอดไปสปาธรรมชาติของเราเป็นทางเลือกที่สมบูรณ์แบบหากคุณกำลังมองหาการผ่อนคลายความรู้สึกทั้งหมดในขณะที่เราปรนเปรอคุณด้วยสปาธรรมชาติ 100% และ ผลิตภัณฑ์สปาออร์แกนิก ทุกสิ่งที่คุณสัมผัสกลิ่นความรู้สึกการได้ยินและประสบการณ์นั้นเป็นเรื่องจริงและเป็นธรรมชาติอย่างที่ได้รับการเดินทางครั้งใหญ่จากความเร่งรีบและวุ่นวายของกรุงเทพฯที่วุ่นวายและความวุ่นวายของชีวิตสมัยใหม่! ด้วยเสียงมลภาวะความวุ่นวายและสารเคมีที่กลายเป็นบรรทัดฐานในการใช้ชีวิตในเมืองข้อเสนอของสปาของเราจึงเป็นสิ่งที่ต้องการ ดังนั้นอย่าลืมที่จะได้รับ Plant Day Spa อันสดใหม่ของคุณ',
presenter.model.result[0].excerpt,
textAlign: TextAlign.left,
style: TextStyle(
// decoration: TextDecoration.underline,
......
......@@ -76,7 +76,7 @@ class _ShopServicePageState extends State<ShopServicePage>
fit: BoxFit.cover,
)
: Image.network(
'https://backend.feelver.com/storage/' + image,
Api.baseApi + image,
fit: BoxFit.cover,
),),
),
......
import 'package:feelverapp/model/shoplistdetail/shoplistdetail_Model.dart';
import 'package:feelverapp/service/Loading.dart';
import 'package:feelverapp/service/api.dart';
import 'package:feelverapp/service/base_presenter.dart';
import 'package:feelverapp/ui/shop/shop_list_detail.dart';
......@@ -8,16 +9,24 @@ import 'package:flutter/material.dart';
class ShoplistdetailPresenter extends BasePresenter<ShopListDetail>{
Api _api;
final formkey = GlobalKey<FormState>();
shoplistdetailModel model;
ShoplistdetailPresenter(State<ShopListDetail> state) : super(state);
Detai() async{
Detai(String id) async{
_api = Api<shoplistdetailModel>();
var res = await _api.shoplistDetail({
"id": "406",
"id": id,
});
if (res.fail == null) {
setState(() {
model = res.success;
print("complete");
});
print('res Success');
} else {
print('res Fail');
......
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