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
1e0bb6fc
Commit
1e0bb6fc
authored
Aug 25, 2020
by
Mobile : Ball (Apprentice)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
593f890b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
53 deletions
+70
-53
lib/model/favorite/favorite_Model.dart
+8
-8
lib/model/reviewshop/reviewshop_Model.dart
+11
-11
lib/service/api.dart
+8
-3
lib/ui/favorite/favorite.dart
+20
-14
lib/ui/favorite/favorite_presenter.dart
+6
-1
lib/ui/review_shop/review_shop_page.dart
+17
-16
No files found.
lib/model/favorite/favorite_Model.dart
View file @
1e0bb6fc
...
@@ -152,7 +152,7 @@ class Product {
...
@@ -152,7 +152,7 @@ class Product {
int
vendorId
;
int
vendorId
;
String
allowRoute
;
String
allowRoute
;
String
type
;
String
type
;
int
star
;
//
int star;
List
<
Null
>
ratings
;
List
<
Null
>
ratings
;
Product
(
Product
(
...
@@ -197,7 +197,7 @@ class Product {
...
@@ -197,7 +197,7 @@ class Product {
this
.
vendorId
,
this
.
vendorId
,
this
.
allowRoute
,
this
.
allowRoute
,
this
.
type
,
this
.
type
,
this
.
star
,
//
this.star,
this
.
ratings
});
this
.
ratings
});
Product
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
Product
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
...
@@ -242,7 +242,7 @@ class Product {
...
@@ -242,7 +242,7 @@ class Product {
vendorId
=
json
[
'vendor_id'
];
vendorId
=
json
[
'vendor_id'
];
allowRoute
=
json
[
'allow_route'
];
allowRoute
=
json
[
'allow_route'
];
type
=
json
[
'type'
];
type
=
json
[
'type'
];
star
=
json
[
'star'
];
//
star = json['star'];
}
}
...
@@ -289,7 +289,7 @@ class Product {
...
@@ -289,7 +289,7 @@ class Product {
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
;
data
[
'star'
]
=
this
.
star
;
//
data['star'] = this.star;
return
data
;
return
data
;
}
}
}
}
...
@@ -321,7 +321,7 @@ class Store {
...
@@ -321,7 +321,7 @@ class Store {
String
storeLogo
;
String
storeLogo
;
String
isFacilities
;
String
isFacilities
;
String
distanceWithLocation
;
String
distanceWithLocation
;
String
star
;
//
String star;
Ratings
ratings
;
Ratings
ratings
;
Store
(
Store
(
...
@@ -351,7 +351,7 @@ class Store {
...
@@ -351,7 +351,7 @@ class Store {
this
.
storeLogo
,
this
.
storeLogo
,
this
.
isFacilities
,
this
.
isFacilities
,
this
.
distanceWithLocation
,
this
.
distanceWithLocation
,
this
.
star
,
//
this.star,
this
.
ratings
});
this
.
ratings
});
Store
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
Store
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
...
@@ -381,7 +381,7 @@ class Store {
...
@@ -381,7 +381,7 @@ class Store {
storeLogo
=
json
[
'store_logo'
];
storeLogo
=
json
[
'store_logo'
];
isFacilities
=
json
[
'is_facilities'
];
isFacilities
=
json
[
'is_facilities'
];
distanceWithLocation
=
json
[
'distance_with_location'
];
distanceWithLocation
=
json
[
'distance_with_location'
];
star
=
json
[
'star'
];
//
star = json['star'];
ratings
=
ratings
=
json
[
'ratings'
]
!=
null
?
new
Ratings
.
fromJson
(
json
[
'ratings'
])
:
null
;
json
[
'ratings'
]
!=
null
?
new
Ratings
.
fromJson
(
json
[
'ratings'
])
:
null
;
}
}
...
@@ -414,7 +414,7 @@ class Store {
...
@@ -414,7 +414,7 @@ class Store {
data
[
'store_logo'
]
=
this
.
storeLogo
;
data
[
'store_logo'
]
=
this
.
storeLogo
;
data
[
'is_facilities'
]
=
this
.
isFacilities
;
data
[
'is_facilities'
]
=
this
.
isFacilities
;
data
[
'distance_with_location'
]
=
this
.
distanceWithLocation
;
data
[
'distance_with_location'
]
=
this
.
distanceWithLocation
;
data
[
'star'
]
=
this
.
star
;
//
data['star'] = this.star;
if
(
this
.
ratings
!=
null
)
{
if
(
this
.
ratings
!=
null
)
{
data
[
'ratings'
]
=
this
.
ratings
.
toJson
();
data
[
'ratings'
]
=
this
.
ratings
.
toJson
();
}
}
...
...
lib/model/reviewshop/reviewshop_Model.dart
View file @
1e0bb6fc
...
@@ -51,10 +51,10 @@ class Result {
...
@@ -51,10 +51,10 @@ class Result {
int
star
;
int
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
<
Image
>
image
;
List
<
Image
>
image
;
Null
ratings
;
dynamic
ratings
;
Result
(
Result
(
{
this
.
id
,
{
this
.
id
,
...
@@ -298,7 +298,7 @@ class Product {
...
@@ -298,7 +298,7 @@ class Product {
dynamic
type
;
dynamic
type
;
int
star
;
int
star
;
List
<
CategoryFeelverByProductId
>
categoryFeelverByProductId
;
List
<
CategoryFeelverByProductId
>
categoryFeelverByProductId
;
List
<
Null
>
ratings
;
List
<
dynamic
>
ratings
;
Product
(
Product
(
{
this
.
id
,
{
this
.
id
,
...
@@ -576,8 +576,8 @@ class Comment {
...
@@ -576,8 +576,8 @@ class Comment {
dynamic
updatedAt
;
dynamic
updatedAt
;
int
shopScore
;
int
shopScore
;
int
flagShop
;
int
flagShop
;
List
<
Null
>
tagShop
;
List
<
dynamic
>
tagShop
;
List
<
Null
>
productTag
;
List
<
dynamic
>
productTag
;
bool
purchased
;
bool
purchased
;
InfoCustomer
infoCustomer
;
InfoCustomer
infoCustomer
;
List
<
CommentSub
>
commentSub
;
List
<
CommentSub
>
commentSub
;
...
@@ -778,8 +778,8 @@ class CommentSub {
...
@@ -778,8 +778,8 @@ class CommentSub {
dynamic
updatedAt
;
dynamic
updatedAt
;
int
shopScore
;
int
shopScore
;
int
flagShop
;
int
flagShop
;
List
<
Null
>
tagShop
;
List
<
dynamic
>
tagShop
;
List
<
Null
>
productTag
;
List
<
dynamic
>
productTag
;
bool
purchased
;
bool
purchased
;
InfoCustomer
infoCustomer
;
InfoCustomer
infoCustomer
;
...
@@ -958,8 +958,8 @@ class OpenHour {
...
@@ -958,8 +958,8 @@ class OpenHour {
String
closed
;
String
closed
;
int
vendorId
;
int
vendorId
;
int
storeId
;
int
storeId
;
Null
createdAt
;
dynamic
createdAt
;
Null
updatedAt
;
dynamic
updatedAt
;
OpenHour
(
OpenHour
(
{
this
.
id
,
{
this
.
id
,
...
@@ -1010,8 +1010,8 @@ class Image {
...
@@ -1010,8 +1010,8 @@ class Image {
String
detail
;
String
detail
;
String
status
;
String
status
;
int
vendorId
;
int
vendorId
;
Null
createdAt
;
dynamic
createdAt
;
Null
updatedAt
;
dynamic
updatedAt
;
String
imageTb
;
String
imageTb
;
int
tbId
;
int
tbId
;
...
...
lib/service/api.dart
View file @
1e0bb6fc
...
@@ -84,10 +84,15 @@ class Api<T> {
...
@@ -84,10 +84,15 @@ class Api<T> {
// (body as Map)['lang'] = allTranslations.currentLanguage;
// (body as Map)['lang'] = allTranslations.currentLanguage;
await
_httpConnection
(
"
${this._baseApi}
/wish-list/listByCustomer"
,
this
.
_headerApi
,
body
)
await
_httpConnection
(
"
${this._baseApi}
/wish-list/listByCustomer"
,
this
.
_headerApi
,
body
)
.
then
((
response
){
.
then
((
response
){
print
(
"ผลลัพท์ เท่ากับ"
+
"
${response.body}
"
);
print
(
"ผลลัพท์ เท่ากับบบบบบบบบบบบ"
+
"
${response.body}
"
);
if
(
response
.
statusCode
==
200
){
if
(
response
.
statusCode
==
200
&&
json
.
decode
(
response
.
body
)[
"message"
]!=
"data not found"
){
_model
=
FavoriteModel
.
fromJson
(
json
.
decode
(
response
.
body
));
print
(
"aaaa"
);
_model
=
FavoriteModel
.
fromJson
(
json
.
decode
(
response
.
body
));
}
else
{
}
else
{
print
(
"bbbb"
);
_fail
=
FailModel
.
fromJson
(
json
.
decode
(
response
.
body
));
_fail
=
FailModel
.
fromJson
(
json
.
decode
(
response
.
body
));
}
}
result
=
new
Response
<
T
>(
_model
,
_fail
);
result
=
new
Response
<
T
>(
_model
,
_fail
);
...
...
lib/ui/favorite/favorite.dart
View file @
1e0bb6fc
...
@@ -4,11 +4,9 @@ import 'package:feelverapp/ui/menu/menu.dart';
...
@@ -4,11 +4,9 @@ import 'package:feelverapp/ui/menu/menu.dart';
import
'package:feelverapp/ui/my_order_status/my_order_status.dart'
;
import
'package:feelverapp/ui/my_order_status/my_order_status.dart'
;
import
'package:feelverapp/util/SizeConfig.dart'
;
import
'package:feelverapp/util/SizeConfig.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
class
Favorite
extends
StatefulWidget
{
class
Favorite
extends
StatefulWidget
{
@override
@override
_FavoriteState
createState
()
=>
_FavoriteState
();
_FavoriteState
createState
()
=>
_FavoriteState
();
}
}
...
@@ -24,8 +22,6 @@ class _FavoriteState extends State<Favorite> {
...
@@ -24,8 +22,6 @@ class _FavoriteState extends State<Favorite> {
presenter
=
FavoritePresenter
(
this
);
presenter
=
FavoritePresenter
(
this
);
presenter
.
Favoriteitem
();
presenter
.
Favoriteitem
();
}
}
@override
@override
...
@@ -76,7 +72,9 @@ class _FavoriteState extends State<Favorite> {
...
@@ -76,7 +72,9 @@ class _FavoriteState extends State<Favorite> {
);
);
}
}
Widget
list
(
int
index
,)
{
Widget
list
(
int
index
,
)
{
return
Container
(
return
Container
(
// color: Colors.red,
// color: Colors.red,
margin:
EdgeInsets
.
only
(
bottom:
15
),
margin:
EdgeInsets
.
only
(
bottom:
15
),
...
@@ -112,21 +110,29 @@ class _FavoriteState extends State<Favorite> {
...
@@ -112,21 +110,29 @@ class _FavoriteState extends State<Favorite> {
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
children:
<
Widget
>[
Container
(
Container
(
// width: MediaQuery.of(context).size.width,
// color: Colors.blue,
// color: Colors.blue,
child:
Row
(
child:
Row
(
children:
<
Widget
>[
children:
<
Widget
>[
Text
(
Expanded
(
presenter
.
favoriteModel
.
wishListItem
[
index
]
.
product
.
name
,
child:
Container
(
style:
TextStyle
(
child:
Text
(
color:
Colors
.
black
,
presenter
.
favoriteModel
.
wishListItem
[
index
].
product
.
name
,
fontSize:
SizeConfig
.
getFontSize
(
15
)),
style:
TextStyle
(
color:
Colors
.
black
,
fontSize:
SizeConfig
.
getFontSize
(
15
)),
maxLines:
2
,
),
),
Spacer
(),
),
),
// Spacer(),
IconButton
(
IconButton
(
onPressed:
()
{
onPressed:
()
{
print
(
'delete'
);
print
(
'delete'
);
presenter
.
Deletefavoriteitem
(
presenter
.
favoriteModel
.
wishListItem
[
index
].
id
.
toString
());
presenter
.
Deletefavoriteitem
(
presenter
.
favoriteModel
.
wishListItem
[
index
].
id
.
toString
());
},
},
icon:
Icon
(
Icons
.
favorite
),
icon:
Icon
(
Icons
.
favorite
),
color:
Color
(
0xFFDD175F
),
color:
Color
(
0xFFDD175F
),
...
...
lib/ui/favorite/favorite_presenter.dart
View file @
1e0bb6fc
...
@@ -3,6 +3,7 @@ import 'package:feelverapp/model/favorite/favorite_Model.dart';
...
@@ -3,6 +3,7 @@ import 'package:feelverapp/model/favorite/favorite_Model.dart';
import
'package:feelverapp/service/api.dart'
;
import
'package:feelverapp/service/api.dart'
;
import
'package:feelverapp/service/base_presenter.dart'
;
import
'package:feelverapp/service/base_presenter.dart'
;
import
'package:feelverapp/ui/favorite/favorite.dart'
;
import
'package:feelverapp/ui/favorite/favorite.dart'
;
import
'package:feelverapp/util/Accout_util.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
class
FavoritePresenter
extends
BasePresenter
<
Favorite
>
{
class
FavoritePresenter
extends
BasePresenter
<
Favorite
>
{
...
@@ -14,9 +15,13 @@ class FavoritePresenter extends BasePresenter<Favorite> {
...
@@ -14,9 +15,13 @@ class FavoritePresenter extends BasePresenter<Favorite> {
FavoritePresenter
(
State
<
Favorite
>
state
)
:
super
(
state
);
FavoritePresenter
(
State
<
Favorite
>
state
)
:
super
(
state
);
Favoriteitem
()
async
{
Favoriteitem
()
async
{
var
_id
=
await
AccountUtil
.
getID
();
print
(
_id
);
print
(
"555555555555"
);
_api
=
Api
<
FavoriteModel
>();
_api
=
Api
<
FavoriteModel
>();
var
res
=
await
_api
.
favorite
({
var
res
=
await
_api
.
favorite
({
"customer_id"
:
"224"
,
"customer_id"
:
_id
,
});
});
if
(
res
.
fail
==
null
)
{
if
(
res
.
fail
==
null
)
{
...
...
lib/ui/review_shop/review_shop_page.dart
View file @
1e0bb6fc
...
@@ -19,7 +19,6 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
...
@@ -19,7 +19,6 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
presenter
=
ReviewshopPresenter
(
this
);
presenter
=
ReviewshopPresenter
(
this
);
presenter
.
Commentlist
();
presenter
.
Commentlist
();
}
}
@override
@override
...
@@ -27,7 +26,6 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
...
@@ -27,7 +26,6 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
super
.
dispose
();
super
.
dispose
();
}
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
SizeConfig
(
context
);
SizeConfig
(
context
);
...
@@ -44,7 +42,6 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
...
@@ -44,7 +42,6 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
fontFamily:
"SF_Pro_Text"
,
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
fontWeight:
FontWeight
.
w500
),
),
),
),
),
body:
_setupView
(),
body:
_setupView
(),
);
);
...
@@ -65,11 +62,16 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
...
@@ -65,11 +62,16 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
Widget
containt
()
{
Widget
containt
()
{
return
Expanded
(
return
Expanded
(
child:
Container
(
child:
Container
(
child:
presenter
.
reviewShopModel
==
null
?
Container
():
ListView
.
builder
(
child:
presenter
.
reviewShopModel
==
null
itemCount:
presenter
.
reviewShopModel
.
result
[
0
].
comment
.
length
,
?
Container
()
itemBuilder:
(
context
,
i
)
{
:
ListView
.
builder
(
return
list
(
presenter
.
reviewShopModel
.
result
[
i
].
comment
[
i
].
infoCustomer
.
name
);
itemCount:
presenter
.
reviewShopModel
.
result
[
0
].
comment
.
length
,
}),
itemBuilder:
(
context
,
i
)
{
print
(
presenter
.
reviewShopModel
.
result
[
0
].
comment
[
i
].
infoCustomer
.
name
);
return
list
(
presenter
.
reviewShopModel
.
result
[
0
].
comment
[
i
].
infoCustomer
.
name
,
);
}),
),
),
);
);
}
}
...
@@ -246,15 +248,15 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
...
@@ -246,15 +248,15 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
);
);
}
}
Widget
list
(
String
name
,
)
{
Widget
list
(
String
name
)
{
return
Card
(
return
Card
(
child:
Container
(
child:
Container
(
// color: Colors.deepPurpleAccent,
// color: Colors.deepPurpleAccent,
margin:
EdgeInsets
.
only
(
margin:
EdgeInsets
.
only
(
right:
SizeConfig
.
getPadding
(
20
),
right:
SizeConfig
.
getPadding
(
20
),
left:
SizeConfig
.
getPadding
(
20
),
left:
SizeConfig
.
getPadding
(
20
),
top:
SizeConfig
.
getPadding
(
10
),
top:
SizeConfig
.
getPadding
(
10
),
bottom:
SizeConfig
.
getPadding
(
10
),
bottom:
SizeConfig
.
getPadding
(
10
),
),
),
child:
Column
(
child:
Column
(
children:
<
Widget
>[
children:
<
Widget
>[
...
@@ -278,8 +280,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
...
@@ -278,8 +280,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
children:
<
Widget
>[
SingleChildScrollView
(
Row
(
child:
Row
(
children:
<
Widget
>[
children:
<
Widget
>[
Text
(
Text
(
name
,
name
,
...
@@ -293,7 +294,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
...
@@ -293,7 +294,7 @@ class _ReviewShopPageState extends State<ReviewShopPage> {
)
)
],
],
),
),
),
SizedBox
(
SizedBox
(
height:
SizeConfig
.
getHeight
(
5
),
height:
SizeConfig
.
getHeight
(
5
),
),
),
...
...
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