Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
feelver
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2F-ART
feelver
Commits
0722bbc6
Commit
0722bbc6
authored
Aug 17, 2020
by
Mobile : Art
Browse files
Options
Browse Files
Download
Plain Diff
update
parents
2cb9eec3
1db60f1a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
99 additions
and
22 deletions
+99
-22
ios/Flutter/.last_build_id
+2
-2
lib/model/shopservice/shop_service_Model.dart
+0
-0
lib/service/api.dart
+23
-0
lib/ui/home/home.dart
+6
-9
lib/ui/home/home_presenter.dart
+1
-2
lib/ui/reserve/reserve_date_time.dart
+32
-9
lib/ui/shop/shop_service.dart
+0
-0
lib/ui/shop/shop_service_presenter.dart
+35
-0
No files found.
ios/Flutter/.last_build_id
View file @
0722bbc6
65bf9efbfad64e1b5e4b50eeaed8247f
\ No newline at end of file
eba39b331d7b395476ba8953e31f8092
\ No newline at end of file
lib/model/shopservice/shop_service_Model.dart
0 → 100644
View file @
0722bbc6
This diff is collapsed.
Click to expand it.
lib/service/api.dart
View file @
0722bbc6
...
...
@@ -17,6 +17,7 @@ import 'package:feelverapp/model/register/register_model.dart';
import
'package:feelverapp/model/category/category_model.dart'
;
import
'package:feelverapp/model/shoplist/shoplist_Model.dart'
;
import
'package:feelverapp/model/shoplistdetail/shoplistdetail_Model.dart'
;
import
'package:feelverapp/model/shopservice/shop_service_Model.dart'
;
import
'package:http/http.dart'
as
http
;
class
Api
<
T
>
{
...
...
@@ -27,6 +28,28 @@ class Api<T> {
"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYmFja2VuZC11YXQuZmVlbHZlci5jb21cL2FwaVwvbG9naW4iLCJpYXQiOjE1OTYxMDAzNTgsImV4cCI6MTYwMzMwMDM1OCwibmJmIjoxNTk2MTAwMzU4LCJqdGkiOiJ2YjA2S0FHR1JtZDFseEw1Iiwic3ViIjozNzMsInBydiI6Ijg3ZTBhZjFlZjlmZDE1ODEyZmRlYzk3MTUzYTE0ZTBiMDQ3NTQ2YWEifQ.UkY70AshvW5O4M63XY_Iv2IPBohSUUwnRF1oi46p2zs"
,
};
Future
<
Response
<
T
>>
shopservice
(
Object
body
)
async
{
var
_model
;
var
_fail
;
var
result
;
print
(
"this is body"
+
body
.
toString
());
// (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
)
.
then
((
response
){
print
(
"ผลลัพท์ เท่ากับ"
+
"
${response.body}
"
);
if
(
response
.
statusCode
==
200
){
_model
=
shopserviceModel
.
fromJson
(
json
.
decode
(
response
.
body
));
}
else
{
_fail
=
FailModel
.
fromJson
(
json
.
decode
(
response
.
body
));
}
result
=
new
Response
<
T
>(
_model
,
_fail
);
});
return
result
;
}
Future
<
Response
<
T
>>
homesearch
(
Object
body
)
async
{
var
_model
;
var
_fail
;
...
...
lib/ui/home/home.dart
View file @
0722bbc6
...
...
@@ -38,7 +38,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
presenter
.
getprofile
();
// presenter.getSearch(widget.search
);
presenter
.
getSearch
(
);
}
@override
...
...
@@ -299,17 +299,17 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
fit:
BoxFit
.
fill
,
)
:
Image
.
network
(
presenter
.
CatModel
.
dATA
[
0
].
cover
,
presenter
.
CatModel
.
dATA
[
index
].
cover
,
height:
SizeConfig
.
getWidth
(
130
),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
fit:
BoxFit
.
fill
,
fit:
BoxFit
.
cover
,
),
presenter
.
CatModel
.
dATA
[
index
].
name
,
''
,
ShopList
(),
),
SizedBox
(
height:
3
0
,
height:
2
0
,
),
],
),
...
...
@@ -345,7 +345,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
child:
Text
(
title
,
style:
TextStyle
(
color:
Colors
.
black
,
color:
Colors
.
white
,
fontSize:
SizeConfig
.
getFontSize
(
30
),
fontWeight:
FontWeight
.
w600
,
),
...
...
@@ -389,10 +389,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
),
prefixIcon:
IconButton
(
onPressed:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
ShopList
()),
);
presenter
.
getSearch
();
},
icon:
Icon
(
Icons
.
search
,
color:
Colors
.
grey
)),
filled:
true
,
...
...
lib/ui/home/home_presenter.dart
View file @
0722bbc6
...
...
@@ -49,8 +49,7 @@ class HomePresenter extends BasePresenter<HomePage> {
}
}
getSearch
(
String
search
)
async
{
getSearch
()
async
{
_api
=
Api
<
SearchhomeModel
>();
var
res
=
await
_api
.
homesearch
({
"keyword_shop"
:
searchCtrl
.
text
,
...
...
lib/ui/reserve/reserve_date_time.dart
View file @
0722bbc6
...
...
@@ -245,8 +245,11 @@ class _ReserveDateTimeState extends State<ReserveDateTime> {
fontWeight:
FontWeight
.
w500
),
),
),
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
/
1
,
margin:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
)),
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
/
1
,
margin:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
)),
child:
Card
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
...
...
@@ -255,22 +258,40 @@ class _ReserveDateTimeState extends State<ReserveDateTime> {
),
child:
FlatButton
(
onPressed:
()
{
DatePicker
.
showDatePicker
(
context
,
showTitleActions:
true
,
minTime:
DateTime
(
1980
,
3
,
5
),
maxTime:
DateTime
(
2025
,
6
,
7
),
onChanged:
(
date
)
{
print
(
'change
$date
'
);
DatePicker
.
showDateTimePicker
(
context
,
showTitleActions:
true
,
onChanged:
(
date
)
{
print
(
'change
$date
in time zone '
+
date
.
timeZoneOffset
.
inHours
.
toString
());
},
onConfirm:
(
date
)
{
setState
(()
{
widget
.
day
=
date
;
widget
.
bith
=
"
${widget.day.year}
-
${widget.day.month}
-
${widget.day.day}
"
;
"
${widget.day.year}
-
${widget.day.month}
-
${widget.day.day}
เวลา
${widget.day.timeZoneOffset.inHours.toString()}
"
;
print
(
'
${widget.day.year}
/
${widget.day.month}
/
${widget.day.day}
'
);
print
(
widget
.
bith
);
});
print
(
'confirm
$date
'
);
},
currentTime:
DateTime
.
now
(),
locale:
LocaleType
.
th
);
},
// {
// DatePicker.showDatePicker(context,
// showTitleActions: true,
// minTime: DateTime(1980, 3, 5),
// maxTime: DateTime(2025, 6, 7), onChanged: (date) {
// print('change $date');
// }, onConfirm: (date) {
// setState(() {
// widget.day = date;
// widget.bith =
// "${widget.day.year}-${widget.day.month}-${widget.day.day}";
//
// print(
// '${widget.day.year} / ${widget.day.month} / ${widget.day.day}');
// print(widget.bith);
// });
// }, currentTime: DateTime.now(), locale: LocaleType.th);
// },
child:
widget
.
bith
==
'ปี / เดือน / วัน'
?
Text
(
'ปี / เดือน / วัน'
,
...
...
@@ -285,7 +306,9 @@ class _ReserveDateTimeState extends State<ReserveDateTime> {
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
30
),
top:
SizeConfig
.
getPadding
(
16
)),
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
30
),
top:
SizeConfig
.
getPadding
(
16
)),
child:
Text
(
'ระบุเวลาที่เข้าใช้บริการ'
,
style:
TextStyle
(
...
...
lib/ui/shop/shop_service.dart
View file @
0722bbc6
This diff is collapsed.
Click to expand it.
lib/ui/shop/shop_service_presenter.dart
0 → 100644
View file @
0722bbc6
import
'package:feelverapp/model/shopservice/shop_service_Model.dart'
;
import
'package:feelverapp/service/api.dart'
;
import
'package:feelverapp/service/base_presenter.dart'
;
import
'package:feelverapp/ui/shop/shop_service.dart'
;
import
'package:flutter/material.dart'
;
class
ShopServicePresenter
extends
BasePresenter
<
ShopServicePage
>
{
Api
_api
;
final
formkey
=
GlobalKey
<
FormState
>();
shopserviceModel
serviceModel
;
ShopServicePresenter
(
State
<
ShopServicePage
>
state
)
:
super
(
state
);
Servicelistitem
()
async
{
_api
=
Api
<
shopserviceModel
>();
var
res
=
await
_api
.
shopservice
({
"vendor_id"
:
"16"
,
"store_id"
:
"406"
,
"is_paginate"
:
"1"
,
"per_page"
:
"8"
,
"v"
:
"2"
,
});
if
(
res
.
fail
==
null
)
{
setState
(()
{
serviceModel
=
res
.
success
;
print
(
"sssssssssssss"
);
print
(
'
${serviceModel.data[0].name}
'
);
});
}
else
{
print
(
'res Fail'
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment