Browse Source

详情,参团列表;

zyh
w-R 3 years ago
parent
commit
b92673e664
  1. BIN
      assets/image/2x/ji_fen.png
  2. BIN
      assets/image/2x/shopping_k.png
  3. BIN
      assets/image/3x/ji_fen.png
  4. BIN
      assets/image/3x/shopping_k.png
  5. BIN
      assets/image/ji_fen.png
  6. BIN
      assets/image/shopping_k.png
  7. 11
      lib/main.dart
  8. 315
      lib/retrofit/data/activity_actRecord_details.dart
  9. 245
      lib/retrofit/data/activity_details.dart
  10. 85
      lib/retrofit/data/activity_order_list.dart
  11. 40
      lib/retrofit/min_api.dart
  12. 114
      lib/retrofit/min_api.g.dart
  13. 8
      lib/retrofit/retrofit_api.dart
  14. 2
      lib/retrofit/retrofit_api.g.dart
  15. 23
      lib/store/shopping/shopping_cart/shopping_cart_page.dart
  16. 171
      lib/store/shopping/shopping_goods_details.dart
  17. 166
      lib/store/shopping/shopping_home/group_details.dart
  18. 190
      lib/store/shopping/shopping_home/group_page_details.dart
  19. 58
      lib/store/shopping/shopping_mall_home.dart

BIN
assets/image/2x/ji_fen.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/2x/shopping_k.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
assets/image/3x/ji_fen.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
assets/image/3x/shopping_k.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

BIN
assets/image/ji_fen.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

BIN
assets/image/shopping_k.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

11
lib/main.dart

@ -51,6 +51,13 @@ import 'package:huixiang/setting/help_feedback_page.dart';
import 'package:huixiang/setting/permission_setting_page.dart'; import 'package:huixiang/setting/permission_setting_page.dart';
import 'package:huixiang/setting/setting_page.dart'; import 'package:huixiang/setting/setting_page.dart';
import 'package:huixiang/setting/treaty_page.dart'; import 'package:huixiang/setting/treaty_page.dart';
import 'package:huixiang/store/shopping/activity_prefecture_details.dart';
import 'package:huixiang/store/shopping/shopping_goods_details.dart';
import 'package:huixiang/store/shopping/shopping_home/bargain_details.dart';
import 'package:huixiang/store/shopping/shopping_home/group_details.dart';
import 'package:huixiang/store/shopping/shopping_home/group_page_details.dart';
import 'package:huixiang/store/shopping/shopping_home/search_page.dart';
import 'package:huixiang/store/shopping/shopping_mall_home.dart';
import 'package:huixiang/store/store_order.dart'; import 'package:huixiang/store/store_order.dart';
import 'package:huixiang/settlement/settlement.dart'; import 'package:huixiang/settlement/settlement.dart';
import 'package:huixiang/test_page.dart'; import 'package:huixiang/test_page.dart';
@ -338,11 +345,11 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/headlines_column_details': (context, {arguments}) => '/router/headlines_column_details': (context, {arguments}) =>
HeadlinesColumnDetails(arguments: arguments), HeadlinesColumnDetails(arguments: arguments),
'/router/group_details': (context, {arguments}) => '/router/group_details': (context, {arguments}) =>
GroupDetails(), GroupDetails(arguments:arguments),
'/router/bargain_details': (context, {arguments}) => '/router/bargain_details': (context, {arguments}) =>
BargainDetails(), BargainDetails(),
'/router/group_page_details': (context, {arguments}) => '/router/group_page_details': (context, {arguments}) =>
GroupPageDetails(), GroupPageDetails(arguments:arguments),
'/router/photo_view_gallery_screen': (context, {arguments}) => '/router/photo_view_gallery_screen': (context, {arguments}) =>
PhotoViewGalleryScreen(), PhotoViewGalleryScreen(),
}; };

315
lib/retrofit/data/activity_actRecord_details.dart

@ -0,0 +1,315 @@
/// actRecord : {"id":"1480458252863930368","createTime":"2022-01-10 16:35:28","createUser":"1478548720785031168","updateTime":"2022-01-10 16:35:28","updateUser":"1478548720785031168","storeId":"1460885296764682240","type":1,"actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actProductId":"1479377402160218112","mid":"1478548720785031168","joinNum":1,"startTime":"2022-01-10 16:35:28","endTime":"2022-01-11 14:35:28","state":1,"isDelete":0}
/// actRecordJoinList : [{"id":"1480458253568573440","createTime":"2022-01-10 16:35:28","createUser":"1478548720785031168","updateTime":"2022-01-10 16:35:28","updateUser":"1478548720785031168","storeId":"1460885296764682240","type":1,"actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actRecordId":"1480458252863930368","mid":"1478548720785031168","orderId":"1480458254545846272","isLeader":true,"memberAvatar":"","memberNickname":"斯基","productId":"1479377402160218112","actPrice":"78.00","state":false,"isDelete":0},{"id":"1480465728682328064","createTime":"2022-01-10 17:05:10","createUser":"1478548720785031168","updateTime":"2022-01-10 17:05:10","updateUser":"1478548720785031168","storeId":"1460885296764682240","type":1,"actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actRecordId":"1480458252863930368","mid":"1478548720785031168","orderId":"1480465729634435072","isLeader":false,"memberAvatar":"","memberNickname":"斯基","productId":"1479377402160218112","actPrice":"78.00","state":true,"isDelete":0},{"id":"1480466261283438592","createTime":"2022-01-10 17:07:17","createUser":"1478548720785031168","updateTime":"2022-01-10 17:07:17","updateUser":"1478548720785031168","storeId":"1460885296764682240","type":1,"actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actRecordId":"1480458252863930368","mid":"1478548720785031168","orderId":"1480466261941944320","isLeader":false,"memberAvatar":"","memberNickname":"斯基","productId":"1479377402160218112","actPrice":"78.00","state":false,"isDelete":0}]
class ActivityActRecordDetails {
ActivityActRecordDetails({
ActRecord actRecord,
List<ActRecordJoinList> actRecordJoinList,}){
_actRecord = actRecord;
_actRecordJoinList = actRecordJoinList;
}
ActivityActRecordDetails.fromJson(dynamic json) {
_actRecord = json['actRecord'] != null ? ActRecord.fromJson(json['actRecord']) : null;
if (json['actRecordJoinList'] != null) {
_actRecordJoinList = [];
json['actRecordJoinList'].forEach((v) {
_actRecordJoinList.add(ActRecordJoinList.fromJson(v));
});
}
}
ActRecord _actRecord;
List<ActRecordJoinList> _actRecordJoinList;
ActRecord get actRecord => _actRecord;
List<ActRecordJoinList> get actRecordJoinList => _actRecordJoinList;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (_actRecord != null) {
map['actRecord'] = _actRecord.toJson();
}
if (_actRecordJoinList != null) {
map['actRecordJoinList'] = _actRecordJoinList.map((v) => v.toJson()).toList();
}
return map;
}
}
/// id : "1480458253568573440"
/// createTime : "2022-01-10 16:35:28"
/// createUser : "1478548720785031168"
/// updateTime : "2022-01-10 16:35:28"
/// updateUser : "1478548720785031168"
/// storeId : "1460885296764682240"
/// type : 1
/// actTemplateId : "1479377328797646848"
/// actTimeId : "1479377329099636736"
/// actRecordId : "1480458252863930368"
/// mid : "1478548720785031168"
/// orderId : "1480458254545846272"
/// isLeader : true
/// memberAvatar : ""
/// memberNickname : "斯基"
/// productId : "1479377402160218112"
/// actPrice : "78.00"
/// state : false
/// isDelete : 0
class ActRecordJoinList {
ActRecordJoinList({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String storeId,
int type,
String actTemplateId,
String actTimeId,
String actRecordId,
String mid,
String orderId,
bool isLeader,
String memberAvatar,
String memberNickname,
String productId,
String actPrice,
bool state,
int isDelete,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_storeId = storeId;
_type = type;
_actTemplateId = actTemplateId;
_actTimeId = actTimeId;
_actRecordId = actRecordId;
_mid = mid;
_orderId = orderId;
_isLeader = isLeader;
_memberAvatar = memberAvatar;
_memberNickname = memberNickname;
_productId = productId;
_actPrice = actPrice;
_state = state;
_isDelete = isDelete;
}
ActRecordJoinList.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_storeId = json['storeId'];
_type = json['type'];
_actTemplateId = json['actTemplateId'];
_actTimeId = json['actTimeId'];
_actRecordId = json['actRecordId'];
_mid = json['mid'];
_orderId = json['orderId'];
_isLeader = json['isLeader'];
_memberAvatar = json['memberAvatar'];
_memberNickname = json['memberNickname'];
_productId = json['productId'];
_actPrice = json['actPrice'];
_state = json['state'];
_isDelete = json['isDelete'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _storeId;
int _type;
String _actTemplateId;
String _actTimeId;
String _actRecordId;
String _mid;
String _orderId;
bool _isLeader;
String _memberAvatar;
String _memberNickname;
String _productId;
String _actPrice;
bool _state;
int _isDelete;
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get storeId => _storeId;
int get type => _type;
String get actTemplateId => _actTemplateId;
String get actTimeId => _actTimeId;
String get actRecordId => _actRecordId;
String get mid => _mid;
String get orderId => _orderId;
bool get isLeader => _isLeader;
String get memberAvatar => _memberAvatar;
String get memberNickname => _memberNickname;
String get productId => _productId;
String get actPrice => _actPrice;
bool get state => _state;
int get isDelete => _isDelete;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['storeId'] = _storeId;
map['type'] = _type;
map['actTemplateId'] = _actTemplateId;
map['actTimeId'] = _actTimeId;
map['actRecordId'] = _actRecordId;
map['mid'] = _mid;
map['orderId'] = _orderId;
map['isLeader'] = _isLeader;
map['memberAvatar'] = _memberAvatar;
map['memberNickname'] = _memberNickname;
map['productId'] = _productId;
map['actPrice'] = _actPrice;
map['state'] = _state;
map['isDelete'] = _isDelete;
return map;
}
}
/// id : "1480458252863930368"
/// createTime : "2022-01-10 16:35:28"
/// createUser : "1478548720785031168"
/// updateTime : "2022-01-10 16:35:28"
/// updateUser : "1478548720785031168"
/// storeId : "1460885296764682240"
/// type : 1
/// actTemplateId : "1479377328797646848"
/// actTimeId : "1479377329099636736"
/// actProductId : "1479377402160218112"
/// mid : "1478548720785031168"
/// joinNum : 1
/// startTime : "2022-01-10 16:35:28"
/// endTime : "2022-01-11 14:35:28"
/// state : 1
/// isDelete : 0
class ActRecord {
ActRecord({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String storeId,
int type,
String actTemplateId,
String actTimeId,
String actProductId,
String mid,
int joinNum,
String startTime,
String endTime,
int state,
int isDelete,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_storeId = storeId;
_type = type;
_actTemplateId = actTemplateId;
_actTimeId = actTimeId;
_actProductId = actProductId;
_mid = mid;
_joinNum = joinNum;
_startTime = startTime;
_endTime = endTime;
_state = state;
_isDelete = isDelete;
}
ActRecord.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_storeId = json['storeId'];
_type = json['type'];
_actTemplateId = json['actTemplateId'];
_actTimeId = json['actTimeId'];
_actProductId = json['actProductId'];
_mid = json['mid'];
_joinNum = json['joinNum'];
_startTime = json['startTime'];
_endTime = json['endTime'];
_state = json['state'];
_isDelete = json['isDelete'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _storeId;
int _type;
String _actTemplateId;
String _actTimeId;
String _actProductId;
String _mid;
int _joinNum;
String _startTime;
String _endTime;
int _state;
int _isDelete;
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get storeId => _storeId;
int get type => _type;
String get actTemplateId => _actTemplateId;
String get actTimeId => _actTimeId;
String get actProductId => _actProductId;
String get mid => _mid;
int get joinNum => _joinNum;
String get startTime => _startTime;
String get endTime => _endTime;
int get state => _state;
int get isDelete => _isDelete;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['storeId'] = _storeId;
map['type'] = _type;
map['actTemplateId'] = _actTemplateId;
map['actTimeId'] = _actTimeId;
map['actProductId'] = _actProductId;
map['mid'] = _mid;
map['joinNum'] = _joinNum;
map['startTime'] = _startTime;
map['endTime'] = _endTime;
map['state'] = _state;
map['isDelete'] = _isDelete;
return map;
}
}

245
lib/retrofit/data/activity_details.dart

@ -3,14 +3,17 @@
class ActivityDetails { class ActivityDetails {
ActivityDetails({ ActivityDetails({
ActProduct actProduct, ActProduct actProduct,
List<ActRecordAndJoinlDTOList> actRecordAndJoinlDTOList,}){ List<ActRecordAndJoinlDTOList> actRecordAndJoinlDTOList,
}) {
_actProduct = actProduct; _actProduct = actProduct;
_actRecordAndJoinlDTOList = actRecordAndJoinlDTOList; _actRecordAndJoinlDTOList = actRecordAndJoinlDTOList;
} }
ActivityDetails.fromJson(dynamic json) { ActivityDetails.fromJson(dynamic json) {
_actProduct = json['actProduct'] != null ? ActProduct.fromJson(json['actProduct']) : null; _actProduct = json['actProduct'] != null
? ActProduct.fromJson(json['actProduct'])
: null;
if (json['actRecordAndJoinlDTOList'] != null) { if (json['actRecordAndJoinlDTOList'] != null) {
_actRecordAndJoinlDTOList = []; _actRecordAndJoinlDTOList = [];
json['actRecordAndJoinlDTOList'].forEach((v) { json['actRecordAndJoinlDTOList'].forEach((v) {
@ -18,11 +21,14 @@ class ActivityDetails {
}); });
} }
} }
ActProduct _actProduct; ActProduct _actProduct;
List<ActRecordAndJoinlDTOList> _actRecordAndJoinlDTOList; List<ActRecordAndJoinlDTOList> _actRecordAndJoinlDTOList;
ActProduct get actProduct => _actProduct; ActProduct get actProduct => _actProduct;
List<ActRecordAndJoinlDTOList> get actRecordAndJoinlDTOList => _actRecordAndJoinlDTOList;
List<ActRecordAndJoinlDTOList> get actRecordAndJoinlDTOList =>
_actRecordAndJoinlDTOList;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final map = <String, dynamic>{}; final map = <String, dynamic>{};
@ -30,11 +36,11 @@ class ActivityDetails {
map['actProduct'] = _actProduct.toJson(); map['actProduct'] = _actProduct.toJson();
} }
if (_actRecordAndJoinlDTOList != null) { if (_actRecordAndJoinlDTOList != null) {
map['actRecordAndJoinlDTOList'] = _actRecordAndJoinlDTOList.map((v) => v.toJson()).toList(); map['actRecordAndJoinlDTOList'] =
_actRecordAndJoinlDTOList.map((v) => v.toJson()).toList();
} }
return map; return map;
} }
} }
/// actRecord : {"id":"1479399513473941504","createTime":"2022-01-07 18:28:25","createUser":"1478548720785031168","updateTime":"2022-01-07 18:28:25","updateUser":"1478548720785031168","storeId":"1460885296764682240","type":1,"actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actProductId":"1479377402042777600","mid":"1478548720785031168","joinNum":0,"startTime":"2022-01-07 18:28:25","endTime":"2022-01-08 16:28:25","state":2,"isDelete":0} /// actRecord : {"id":"1479399513473941504","createTime":"2022-01-07 18:28:25","createUser":"1478548720785031168","updateTime":"2022-01-07 18:28:25","updateUser":"1478548720785031168","storeId":"1460885296764682240","type":1,"actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actProductId":"1479377402042777600","mid":"1478548720785031168","joinNum":0,"startTime":"2022-01-07 18:28:25","endTime":"2022-01-08 16:28:25","state":2,"isDelete":0}
@ -42,14 +48,17 @@ class ActivityDetails {
class ActRecordAndJoinlDTOList { class ActRecordAndJoinlDTOList {
ActRecordAndJoinlDTOList({ ActRecordAndJoinlDTOList({
ActRecord actRecord, ActRecord actRecord,
List<ActRecordJoinList> actRecordJoinList,}){ List<ActRecordJoinList> actRecordJoinList,
}) {
_actRecord = actRecord; _actRecord = actRecord;
_actRecordJoinList = actRecordJoinList; _actRecordJoinList = actRecordJoinList;
} }
ActRecordAndJoinlDTOList.fromJson(dynamic json) { ActRecordAndJoinlDTOList.fromJson(dynamic json) {
_actRecord = json['actRecord'] != null ? ActRecord.fromJson(json['actRecord']) : null; _actRecord = json['actRecord'] != null
? ActRecord.fromJson(json['actRecord'])
: null;
if (json['actRecordJoinList'] != null) { if (json['actRecordJoinList'] != null) {
_actRecordJoinList = []; _actRecordJoinList = [];
json['actRecordJoinList'].forEach((v) { json['actRecordJoinList'].forEach((v) {
@ -57,10 +66,12 @@ class ActRecordAndJoinlDTOList {
}); });
} }
} }
ActRecord _actRecord; ActRecord _actRecord;
List<ActRecordJoinList> _actRecordJoinList; List<ActRecordJoinList> _actRecordJoinList;
ActRecord get actRecord => _actRecord; ActRecord get actRecord => _actRecord;
List<ActRecordJoinList> get actRecordJoinList => _actRecordJoinList; List<ActRecordJoinList> get actRecordJoinList => _actRecordJoinList;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -69,11 +80,11 @@ class ActRecordAndJoinlDTOList {
map['actRecord'] = _actRecord.toJson(); map['actRecord'] = _actRecord.toJson();
} }
if (_actRecordJoinList != null) { if (_actRecordJoinList != null) {
map['actRecordJoinList'] = _actRecordJoinList.map((v) => v.toJson()).toList(); map['actRecordJoinList'] =
_actRecordJoinList.map((v) => v.toJson()).toList();
} }
return map; return map;
} }
} }
/// id : "1479399514073726976" /// id : "1479399514073726976"
@ -97,24 +108,25 @@ class ActRecordAndJoinlDTOList {
class ActRecordJoinList { class ActRecordJoinList {
ActRecordJoinList({ ActRecordJoinList({
String id, String id,
String createTime, String createTime,
String createUser, String createUser,
String updateTime, String updateTime,
String updateUser, String updateUser,
String storeId, String storeId,
String actTemplateId, String actTemplateId,
String actTimeId, String actTimeId,
String actRecordId, String actRecordId,
String mid, String mid,
String orderId, String orderId,
bool isLeader, bool isLeader,
String memberAvatar, String memberAvatar,
String memberNickname, String memberNickname,
String productId, String productId,
String actPrice, String actPrice,
bool state, bool state,
int isDelete,}){ int isDelete,
}) {
_id = id; _id = id;
_createTime = createTime; _createTime = createTime;
_createUser = createUser; _createUser = createUser;
@ -133,7 +145,7 @@ class ActRecordJoinList {
_actPrice = actPrice; _actPrice = actPrice;
_state = state; _state = state;
_isDelete = isDelete; _isDelete = isDelete;
} }
ActRecordJoinList.fromJson(dynamic json) { ActRecordJoinList.fromJson(dynamic json) {
_id = json['id']; _id = json['id'];
@ -155,6 +167,7 @@ class ActRecordJoinList {
_state = json['state']; _state = json['state'];
_isDelete = json['isDelete']; _isDelete = json['isDelete'];
} }
String _id; String _id;
String _createTime; String _createTime;
String _createUser; String _createUser;
@ -175,22 +188,39 @@ class ActRecordJoinList {
int _isDelete; int _isDelete;
String get id => _id; String get id => _id;
String get createTime => _createTime; String get createTime => _createTime;
String get createUser => _createUser; String get createUser => _createUser;
String get updateTime => _updateTime; String get updateTime => _updateTime;
String get updateUser => _updateUser; String get updateUser => _updateUser;
String get storeId => _storeId; String get storeId => _storeId;
String get actTemplateId => _actTemplateId; String get actTemplateId => _actTemplateId;
String get actTimeId => _actTimeId; String get actTimeId => _actTimeId;
String get actRecordId => _actRecordId; String get actRecordId => _actRecordId;
String get mid => _mid; String get mid => _mid;
String get orderId => _orderId; String get orderId => _orderId;
bool get isLeader => _isLeader; bool get isLeader => _isLeader;
String get memberAvatar => _memberAvatar; String get memberAvatar => _memberAvatar;
String get memberNickname => _memberNickname; String get memberNickname => _memberNickname;
String get productId => _productId; String get productId => _productId;
String get actPrice => _actPrice; String get actPrice => _actPrice;
bool get state => _state; bool get state => _state;
int get isDelete => _isDelete; int get isDelete => _isDelete;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -215,7 +245,6 @@ class ActRecordJoinList {
map['isDelete'] = _isDelete; map['isDelete'] = _isDelete;
return map; return map;
} }
} }
/// id : "1479399513473941504" /// id : "1479399513473941504"
@ -237,22 +266,23 @@ class ActRecordJoinList {
class ActRecord { class ActRecord {
ActRecord({ ActRecord({
String id, String id,
String createTime, String createTime,
String createUser, String createUser,
String updateTime, String updateTime,
String updateUser, String updateUser,
String storeId, String storeId,
int type, int type,
String actTemplateId, String actTemplateId,
String actTimeId, String actTimeId,
String actProductId, String actProductId,
String mid, String mid,
int joinNum, int joinNum,
String startTime, String startTime,
String endTime, String endTime,
int state, int state,
int isDelete,}){ int isDelete,
}) {
_id = id; _id = id;
_createTime = createTime; _createTime = createTime;
_createUser = createUser; _createUser = createUser;
@ -269,7 +299,7 @@ class ActRecord {
_endTime = endTime; _endTime = endTime;
_state = state; _state = state;
_isDelete = isDelete; _isDelete = isDelete;
} }
ActRecord.fromJson(dynamic json) { ActRecord.fromJson(dynamic json) {
_id = json['id']; _id = json['id'];
@ -289,6 +319,7 @@ class ActRecord {
_state = json['state']; _state = json['state'];
_isDelete = json['isDelete']; _isDelete = json['isDelete'];
} }
String _id; String _id;
String _createTime; String _createTime;
String _createUser; String _createUser;
@ -305,22 +336,48 @@ class ActRecord {
String _endTime; String _endTime;
int _state; int _state;
int _isDelete; int _isDelete;
int _tempDay;
int _tempHour;
int _tempM;
int _tempS;
int get tempDay => _tempDay;
set tempDay(int value) {
_tempDay = value;
}
String get id => _id; String get id => _id;
String get createTime => _createTime; String get createTime => _createTime;
String get createUser => _createUser; String get createUser => _createUser;
String get updateTime => _updateTime; String get updateTime => _updateTime;
String get updateUser => _updateUser; String get updateUser => _updateUser;
String get storeId => _storeId; String get storeId => _storeId;
int get type => _type; int get type => _type;
String get actTemplateId => _actTemplateId; String get actTemplateId => _actTemplateId;
String get actTimeId => _actTimeId; String get actTimeId => _actTimeId;
String get actProductId => _actProductId; String get actProductId => _actProductId;
String get mid => _mid; String get mid => _mid;
int get joinNum => _joinNum; int get joinNum => _joinNum;
String get startTime => _startTime; String get startTime => _startTime;
String get endTime => _endTime; String get endTime => _endTime;
int get state => _state; int get state => _state;
int get isDelete => _isDelete; int get isDelete => _isDelete;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -344,6 +401,24 @@ class ActRecord {
return map; return map;
} }
int get tempHour => _tempHour;
set tempHour(int value) {
_tempHour = value;
}
int get tempM => _tempM;
set tempM(int value) {
_tempM = value;
}
int get tempS => _tempS;
set tempS(int value) {
_tempS = value;
}
} }
/// id : "1479377402042777600" /// id : "1479377402042777600"
@ -366,23 +441,24 @@ class ActRecord {
class ActProduct { class ActProduct {
ActProduct({ ActProduct({
String id, String id,
String createTime, String createTime,
String createUser, String createUser,
String updateTime, String updateTime,
String updateUser, String updateUser,
String storeId, String storeId,
String templateId, String templateId,
String timeId, String timeId,
String productId, String productId,
String productName, String productName,
String productImg, String productImg,
String productPrice, String productPrice,
String promotionPrice, String promotionPrice,
int productStock, int productStock,
int sellCount, int sellCount,
List<SkuJson> skuJson, List<SkuJson> skuJson,
int isDelete,}){ int isDelete,
}) {
_id = id; _id = id;
_createTime = createTime; _createTime = createTime;
_createUser = createUser; _createUser = createUser;
@ -400,7 +476,7 @@ class ActProduct {
_sellCount = sellCount; _sellCount = sellCount;
_skuJson = skuJson; _skuJson = skuJson;
_isDelete = isDelete; _isDelete = isDelete;
} }
ActProduct.fromJson(dynamic json) { ActProduct.fromJson(dynamic json) {
_id = json['id']; _id = json['id'];
@ -426,6 +502,7 @@ class ActProduct {
} }
_isDelete = json['isDelete']; _isDelete = json['isDelete'];
} }
String _id; String _id;
String _createTime; String _createTime;
String _createUser; String _createUser;
@ -445,21 +522,37 @@ class ActProduct {
int _isDelete; int _isDelete;
String get id => _id; String get id => _id;
String get createTime => _createTime; String get createTime => _createTime;
String get createUser => _createUser; String get createUser => _createUser;
String get updateTime => _updateTime; String get updateTime => _updateTime;
String get updateUser => _updateUser; String get updateUser => _updateUser;
String get storeId => _storeId; String get storeId => _storeId;
String get templateId => _templateId; String get templateId => _templateId;
String get timeId => _timeId; String get timeId => _timeId;
String get productId => _productId; String get productId => _productId;
String get productName => _productName; String get productName => _productName;
String get productImg => _productImg; String get productImg => _productImg;
String get productPrice => _productPrice; String get productPrice => _productPrice;
String get promotionPrice => _promotionPrice; String get promotionPrice => _promotionPrice;
int get productStock => _productStock; int get productStock => _productStock;
int get sellCount => _sellCount; int get sellCount => _sellCount;
List<SkuJson> get skuJson => _skuJson; List<SkuJson> get skuJson => _skuJson;
int get isDelete => _isDelete; int get isDelete => _isDelete;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -485,7 +578,6 @@ class ActProduct {
map['isDelete'] = _isDelete; map['isDelete'] = _isDelete;
return map; return map;
} }
} }
/// skuId : "1460886581089927168" /// skuId : "1460886581089927168"
@ -494,25 +586,29 @@ class ActProduct {
class SkuJson { class SkuJson {
SkuJson({ SkuJson({
String skuId, String skuId,
int skuPrice, int skuPrice,
int skuStock,}){ int skuStock,
}) {
_skuId = skuId; _skuId = skuId;
_skuPrice = skuPrice; _skuPrice = skuPrice;
_skuStock = skuStock; _skuStock = skuStock;
} }
SkuJson.fromJson(dynamic json) { SkuJson.fromJson(dynamic json) {
_skuId = json['skuId']; _skuId = json['skuId'];
_skuPrice = json['skuPrice']; _skuPrice = json['skuPrice'];
_skuStock = json['skuStock']; _skuStock = json['skuStock'];
} }
String _skuId; String _skuId;
int _skuPrice; int _skuPrice;
int _skuStock; int _skuStock;
String get skuId => _skuId; String get skuId => _skuId;
int get skuPrice => _skuPrice; int get skuPrice => _skuPrice;
int get skuStock => _skuStock; int get skuStock => _skuStock;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -522,5 +618,4 @@ class SkuJson {
map['skuStock'] = _skuStock; map['skuStock'] = _skuStock;
return map; return map;
} }
}
}

85
lib/retrofit/data/activity_order_list.dart

@ -0,0 +1,85 @@
/// storeName : "一心回乡商城"
/// joinTime : "2022-01-07 18:28:25"
/// productImg : "https://pos.upload.gznl.top/1179/2021/11/e50b00a1-09a2-4bab-b71f-e26e80006459.png"
/// productName : "无花果礼盒"
/// productSkuName : ""
/// actRecordstate : 4
/// actRecordJoinState : null
/// howManyMore : null
/// bargainMoney : null
/// howManyMoney : null
class ActivityOrderList {
ActivityOrderList({
String storeName,
String joinTime,
String productImg,
String productName,
String productSkuName,
int actRecordstate,
dynamic actRecordJoinState,
dynamic howManyMore,
dynamic bargainMoney,
dynamic howManyMoney,}){
_storeName = storeName;
_joinTime = joinTime;
_productImg = productImg;
_productName = productName;
_productSkuName = productSkuName;
_actRecordstate = actRecordstate;
_actRecordJoinState = actRecordJoinState;
_howManyMore = howManyMore;
_bargainMoney = bargainMoney;
_howManyMoney = howManyMoney;
}
ActivityOrderList.fromJson(dynamic json) {
_storeName = json['storeName'];
_joinTime = json['joinTime'];
_productImg = json['productImg'];
_productName = json['productName'];
_productSkuName = json['productSkuName'];
_actRecordstate = json['actRecordstate'];
_actRecordJoinState = json['actRecordJoinState'];
_howManyMore = json['howManyMore'];
_bargainMoney = json['bargainMoney'];
_howManyMoney = json['howManyMoney'];
}
String _storeName;
String _joinTime;
String _productImg;
String _productName;
String _productSkuName;
int _actRecordstate;
dynamic _actRecordJoinState;
dynamic _howManyMore;
dynamic _bargainMoney;
dynamic _howManyMoney;
String get storeName => _storeName;
String get joinTime => _joinTime;
String get productImg => _productImg;
String get productName => _productName;
String get productSkuName => _productSkuName;
int get actRecordstate => _actRecordstate;
dynamic get actRecordJoinState => _actRecordJoinState;
dynamic get howManyMore => _howManyMore;
dynamic get bargainMoney => _bargainMoney;
dynamic get howManyMoney => _howManyMoney;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['storeName'] = _storeName;
map['joinTime'] = _joinTime;
map['productImg'] = _productImg;
map['productName'] = _productName;
map['productSkuName'] = _productSkuName;
map['actRecordstate'] = _actRecordstate;
map['actRecordJoinState'] = _actRecordJoinState;
map['howManyMore'] = _howManyMore;
map['bargainMoney'] = _bargainMoney;
map['howManyMoney'] = _howManyMoney;
return map;
}
}

40
lib/retrofit/min_api.dart

@ -14,9 +14,11 @@ import 'package:huixiang/retrofit/data/wx_pay.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:retrofit/retrofit.dart'; import 'package:retrofit/retrofit.dart';
import 'data/activity_actRecord_details.dart';
import 'data/activity_area_list.dart'; import 'data/activity_area_list.dart';
import 'data/activity_details.dart'; import 'data/activity_details.dart';
import 'data/findMiNiGroupList.dart'; import 'data/findMiNiGroupList.dart';
import 'data/activity_order_list.dart';
import 'data/home_recommend_list.dart'; import 'data/home_recommend_list.dart';
import 'data/miNiDetail.dart'; import 'data/miNiDetail.dart';
import 'data/settleOrderInfo.dart'; import 'data/settleOrderInfo.dart';
@ -25,8 +27,8 @@ import 'data/shopping_home_config.dart';
part 'min_api.g.dart'; part 'min_api.g.dart';
const base_url = "https://pos.api.lotus-wallet.com/app/"; /// // const base_url = "https://pos.api.lotus-wallet.com/app/"; ///
const baseUrl = "https://pos.api.lotus-wallet.com/app/"; /// // const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///
// const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 // const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222
@ -38,8 +40,8 @@ const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式
// const base_url = "http://192.168.10.37:8766/app/"; // const base_url = "http://192.168.10.37:8766/app/";
// const baseUrl = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/";
// const base_url = "http://192.168.10.142:8765/app/";/// const base_url = "http://192.168.10.142:8765/app/";///
// const baseUrl = "http://192.168.10.142:8765/app/";/// const baseUrl = "http://192.168.10.142:8765/app/";///
/// ///
@RestApi(baseUrl: baseUrl) @RestApi(baseUrl: baseUrl)
@ -225,16 +227,24 @@ abstract class MinApiService {
Future<BaseData<ActivityDetails>> viewProduct(@Path("actProductId") String actProductId, Future<BaseData<ActivityDetails>> viewProduct(@Path("actProductId") String actProductId,
@Path("type") String type); @Path("type") String type);
// /// ///
// @POST("actTemplate/actPay") @POST("actTemplate/launchAct")
// Future<BaseData> actPay(@Body() Map<String, dynamic> param); Future<BaseData> launchAct(@Body() Map<String, dynamic> param);
//
// /// ///
// @POST("actTemplate/joinAct") @POST("actTemplate/joinAct")
// Future<BaseData> joinAct(@Body() Map<String, dynamic> param); Future<BaseData> joinAct(@Body() Map<String, dynamic> param);
//
// /// ///
// @POST("actTemplate/launchAct") @POST("actTemplate/actPay")
// Future<BaseData> launchAct(@Body() Map<String, dynamic> param); Future<BaseData> actPay(@Body() Map<String, dynamic> param);
///
@POST("actTemplate/showMyActList")
Future<BaseData<List<ActivityOrderList>>> showMyActList(@Body() Map<String, dynamic> param);
///
@GET("actTemplate/showOneAct?actRecordId={actRecordId}")
Future<BaseData<ActivityActRecordDetails>> showOneAct(@Path("actRecordId") String actRecordId);
} }

114
lib/retrofit/min_api.g.dart

@ -9,7 +9,7 @@ part of 'min_api.dart';
class _MinApiService implements MinApiService { class _MinApiService implements MinApiService {
_MinApiService(this._dio, {this.baseUrl}) { _MinApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio'); ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'https://pos.api.lotus-wallet.com/app/'; baseUrl ??= 'http://192.168.10.142:8765/app/';
} }
final Dio _dio; final Dio _dio;
@ -488,4 +488,116 @@ class _MinApiService implements MinApiService {
return value; return value;
} }
@override
Future<BaseData<dynamic>> launchAct(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('actTemplate/launchAct',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
@override
Future<BaseData<dynamic>> joinAct(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('actTemplate/joinAct',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
@override
Future<BaseData<dynamic>> actPay(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('actTemplate/actPay',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
@override
Future<BaseData<List<ActivityOrderList>>> showMyActList(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('actTemplate/launchAct',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<ActivityOrderList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<ActivityOrderList>(
(i) => ActivityOrderList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<ActivityActRecordDetails>> showOneAct(actRecordId) async {
ArgumentError.checkNotNull(actRecordId, 'actRecordId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'actTemplate/showOneAct?actRecordId=$actRecordId',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<ActivityActRecordDetails>.fromJson(
_result.data,
(json) => ActivityActRecordDetails.fromJson(json),
);
return value;
}
} }

8
lib/retrofit/retrofit_api.dart

@ -54,8 +54,8 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
const base_url = "https://pos.platform.lotus-wallet.com/app/"; /// // const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; /// // const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///
// const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
@ -67,8 +67,8 @@ const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式
// const baseUrl = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/";
// const base_url = "http://192.168.10.142:8766/app/";/// const base_url = "http://192.168.10.142:8766/app/";///
// const baseUrl = "http://192.168.10.142:8766/app/";/// const baseUrl = "http://192.168.10.142:8766/app/";///
@RestApi(baseUrl: baseUrl) @RestApi(baseUrl: baseUrl)
abstract class ApiService { abstract class ApiService {

2
lib/retrofit/retrofit_api.g.dart

@ -9,7 +9,7 @@ part of 'retrofit_api.dart';
class _ApiService implements ApiService { class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) { _ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio'); ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/'; baseUrl ??= 'http://192.168.10.142:8766/app/';
} }
final Dio _dio; final Dio _dio;

23
lib/store/shopping/shopping_cart/shopping_cart_page.dart

@ -388,7 +388,27 @@ class _ShoppingCartPage extends State<ShoppingCartPage>
} }
Widget cartGoodsList(){ Widget cartGoodsList(){
return Container( return
// ((shopCarGoods?.length ?? 0) > 0) ?Container(
// // width: double.infinity,
// alignment: Alignment.center,
// margin: EdgeInsets.only(bottom: 47.h,left: 66.w,right: 59.w),
// child:Column(children: [
// Image.asset(
// "assets/image/shopping_k.png",
// width:double.infinity,
// height: 250.h,
// ),
// Text(
// "目前暂无商品,要快去买点好吃的哦~",
// style: TextStyle(
// fontSize: 16.sp,
// fontWeight: MyFontWeight.regular,
// color: Color(0xFF353535),
// ),
// ),
// ],)):
Container(
margin: EdgeInsets.only(bottom: 50.h), margin: EdgeInsets.only(bottom: 50.h),
child: ListView.builder( child: ListView.builder(
itemCount:((shopCarGoods?.length ?? 0) > 0) ? (shopCarGoods[0]?.shoppingCartSkuItemList?.length ?? 0) : 0, itemCount:((shopCarGoods?.length ?? 0) > 0) ? (shopCarGoods[0]?.shoppingCartSkuItemList?.length ?? 0) : 0,
@ -401,7 +421,6 @@ class _ShoppingCartPage extends State<ShoppingCartPage>
itemBuilder: (context, position) { itemBuilder: (context, position) {
return InkWell( return InkWell(
onTap: () { onTap: () {
}, },
child: cartGoodsItem(position), child: cartGoodsItem(position),
); );

171
lib/store/shopping/shopping_goods_details.dart

@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
@ -14,6 +15,7 @@ import 'package:huixiang/retrofit/data/activity_details.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/goods.dart'; import 'package:huixiang/retrofit/data/goods.dart';
import 'package:huixiang/retrofit/data/activity_order_list.dart';
import 'package:huixiang/retrofit/data/miNiDetail.dart'; import 'package:huixiang/retrofit/data/miNiDetail.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart'; import 'package:huixiang/retrofit/data/shoppingCart.dart';
import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/data/store_info.dart';
@ -70,8 +72,24 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
int limitNumber = 0; int limitNumber = 0;
int limitTime = 0; int limitTime = 0;
String bannerImg; String bannerImg;
// String pName;
// String pid;
// String cName;
// String cid;
bool isDispose = false;
Timer _timer;
String testTime = "2021-12-30 10:00:00";
@override
void dispose() {
super.dispose();
isDispose = true;
if (_timer != null) {
_timer.cancel();
}
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -84,6 +102,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
limitTime = widget.arguments["limitTime"]; limitTime = widget.arguments["limitTime"];
bannerImg = widget.arguments["bannerImg"]; bannerImg = widget.arguments["bannerImg"];
startCountdownTimer();
debugPrint("store_param tenant:$tenant storeId:$storeId"); debugPrint("store_param tenant:$tenant storeId:$storeId");
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
@ -128,6 +147,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
queryViewProduct(actProductId, pageType); queryViewProduct(actProductId, pageType);
} }
EasyLoading.dismiss(); EasyLoading.dismiss();
} }
}); });
@ -202,6 +222,40 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
} }
} }
///
// queryLaunchAct() async {
// if (minService == null)
// minService = MinApiService(
// Dio(),
// context: context,
// token: minToken,
// tenant: tenant,
// storeId: storeId,
// showLoading: false,
// );
// BaseData baseData = await minService.launchAct({
// "actProductId":activityDetails.actProduct.id,
// "actRecordId":0,
// "actTemplateId":activityDetails.actProduct.templateId,
// "actTimeId":activityDetails.actProduct.timeId,
// "getType":1,
// "productId":activityDetails.actProduct.productId,
// "skuId":activityDetails.actProduct.skuJson[0].skuId,
// "skuPrice":activityDetails.actProduct.skuJson[0].skuPrice,
// "templateType":pageType
// }).catchError((error) {
// refreshController.refreshFailed();
// });
// if (baseData != null && baseData.isSuccess) {
// setState(() {
//
// refreshController.refreshCompleted();
// });
// } else {
// refreshController.refreshFailed();
// }
// }
/// ///
showStoreSelector(MiNiDetail miNiDetail, String id, int count) async { showStoreSelector(MiNiDetail miNiDetail, String id, int count) async {
if (miNiDetail.attrList != null && if (miNiDetail.attrList != null &&
@ -294,6 +348,42 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
} }
} }
_onRefresh(){
if (pageType == null) {
queryMiNiDetail(id);
} else {
queryViewProduct(actProductId, pageType);
}
}
////
startCountdownTimer() {
if (_timer != null) return;
const oneSec = const Duration(seconds: 1);
var callback = ((timer) {
if (isDispose) return;
setState(() {
activityDetails.actRecordAndJoinlDTOList.forEach((element) {
var tempDateTime =
DateTime.parse(element.actRecord.endTime).difference(DateTime.now());
if (tempDateTime.inSeconds < 0) {
element.actRecord.tempDay = 0;
element.actRecord.tempHour = 0;
element.actRecord.tempM = 0;
element.actRecord.tempS = 0;
return;
}
element.actRecord.tempDay = tempDateTime.inDays;
element.actRecord.tempHour = tempDateTime.inHours - (tempDateTime.inDays * 24);
element.actRecord.tempM = tempDateTime.inMinutes - (tempDateTime.inHours * 60);
element.actRecord.tempS = tempDateTime.inSeconds - (tempDateTime.inMinutes * 60);
});
});
});
_timer = Timer.periodic(oneSec, callback);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Stack( return Stack(
@ -318,7 +408,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
onRefresh: () { onRefresh: () {
setState(() { setState(() {
queryMiNiDetail(id); _onRefresh();
}); });
}, },
child: SingleChildScrollView( child: SingleChildScrollView(
@ -840,7 +930,6 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
GestureDetector( GestureDetector(
onTap: (){ onTap: (){
Navigator.of(context).popAndPushNamed('/router/bargain_details');
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -929,7 +1018,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
decoration: BoxDecoration( decoration: BoxDecoration(
// image: DecorationImage( // image: DecorationImage(
// fit: BoxFit.fill, // fit: BoxFit.fill,
// image: AssetImage(bannerImg), // image: NetworkImage(bannerImg),
// ), // ),
color: Colors.green, color: Colors.green,
), ),
@ -1328,7 +1417,8 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
onTap: () { onTap: () {
setState(() { setState(() {
Navigator.of(context) Navigator.of(context)
.popAndPushNamed('/router/group_page_details'); .popAndPushNamed('/router/group_page_details',
arguments: {"actRecordAndJoinlDTOList":json.encode(activityDetails.actRecordAndJoinlDTOList),});
}); });
}, },
child: Text( child: Text(
@ -1359,7 +1449,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
onTap: () { onTap: () {
setState(() {}); setState(() {});
}, },
child: groupItem(activityDetails.actRecordAndJoinlDTOList[position]), child: groupItem(activityDetails.actRecordAndJoinlDTOList[position],position),
); );
}, },
), ),
@ -1368,7 +1458,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
); );
} }
Widget groupItem(ActRecordAndJoinlDTOList actRecordAndJoinlDTOList) { Widget groupItem(ActRecordAndJoinlDTOList actRecordAndJoinlDTOList,index) {
return Container( return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: Row( child: Row(
@ -1429,7 +1519,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
), ),
Text( Text(
"剩余23:12:12", "剩余${(actRecordAndJoinlDTOList.actRecord.tempDay != 0)?actRecordAndJoinlDTOList.actRecord.tempDay : ""}:${actRecordAndJoinlDTOList.actRecord.tempHour}:${actRecordAndJoinlDTOList.actRecord.tempM}:${actRecordAndJoinlDTOList.actRecord.tempS}",
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 10.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -1438,38 +1528,45 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
], ],
), ),
Container( GestureDetector(
alignment: Alignment.center, onTap: (){
width: 53.w, Navigator.of(context).popAndPushNamed('/router/group_details',
height: 22.h, arguments: {"actRecordId":activityDetails.actRecordAndJoinlDTOList[0].actRecordJoinList[index].actRecordId});
margin: EdgeInsets.only(left: 4.w), },
decoration: BoxDecoration( child: Container(
borderRadius: BorderRadius.circular(13), alignment: Alignment.center,
gradient: new LinearGradient( width: 53.w,
begin: Alignment.centerRight, height: 22.h,
end: Alignment.centerLeft, margin: EdgeInsets.only(left: 4.w),
colors: [ decoration: BoxDecoration(
Color(0xFF61CE6B), borderRadius: BorderRadius.circular(13),
Color(0xFF32A057), gradient: new LinearGradient(
]), begin: Alignment.centerRight,
boxShadow: [ end: Alignment.centerLeft,
BoxShadow( colors: [
color: Colors.black.withAlpha(12), Color(0xFF61CE6B),
offset: Offset(0, 3), Color(0xFF32A057),
blurRadius: 14, ]),
spreadRadius: 0, boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Text(
"去参团",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
), ),
],
),
child: Text(
"去参团",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
), ),
), ) ,
) ),
], ],
), ),
); );

166
lib/store/shopping/shopping_home/group_details.dart

@ -1,15 +1,26 @@
import 'dart:async';
import 'dart:core';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/data/activity_actRecord_details.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
class GroupDetails extends StatefulWidget { class GroupDetails extends StatefulWidget {
final Map<String, dynamic> arguments;
GroupDetails({this.arguments});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _GroupDetails(); return _GroupDetails();
@ -17,15 +28,82 @@ class GroupDetails extends StatefulWidget {
} }
class _GroupDetails extends State<GroupDetails> { class _GroupDetails extends State<GroupDetails> {
ApiService apiService; MinApiService minService;
String actRecordId;
ActivityActRecordDetails activityActRecordDetails;
bool isDispose = false;
Timer _timer;
String testTime = "2021-12-30 10:00:00";
int tempDay = 0;
int tempHour = 0;
int tempM = 0;
int tempS = 0;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
actRecordId = widget.arguments["actRecordId"];
startCountdownTimer();
SharedPreferences.getInstance().then((value) {
String minToken = value.getString("minToken");
String tenant = value.getString("tenant");
String storeId = value.getString("storeId");
minService = MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
);
queryShowOneAct(actRecordId);
});
} }
final SwiperController controller = SwiperController(); final SwiperController controller = SwiperController();
////
startCountdownTimer() {
if (_timer != null) return;
const oneSec = const Duration(seconds: 1);
var callback = ((timer) {
if (isDispose) return;
setState(() {
var tempDateTime =
DateTime.parse(activityActRecordDetails.actRecord.endTime).difference(DateTime.now());
if (tempDateTime.inSeconds < 0) {
tempDay = 0;
tempHour = 0;
tempM = 0;
tempS = 0;
return;
}
tempDay = tempDateTime.inDays;
tempHour = tempDateTime.inHours - (tempDateTime.inDays * 24);
tempM = tempDateTime.inMinutes - (tempDateTime.inHours * 60);
tempS = tempDateTime.inSeconds - (tempDateTime.inMinutes * 60);
});
});
_timer = Timer.periodic(oneSec, callback);
}
///
queryShowOneAct(actRecordId) async {
BaseData<ActivityActRecordDetails> baseData = await minService
.showOneAct(actRecordId)
.catchError((error) {
refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
setState(() {
activityActRecordDetails = baseData.data;
});
refreshController.refreshCompleted();
} else {
refreshController.refreshFailed();
}
}
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
@ -285,6 +363,40 @@ class _GroupDetails extends State<GroupDetails> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
if(tempDay != 0)
Row(
children: [
InkWell(
onTap: () {},
child: Container(
width: 27,
height: 28,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFD2D2D2),
borderRadius: BorderRadius.circular(4)),
child: Text(
tempDay.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
),
),
Padding(
padding: EdgeInsets.only(left: 10, right: 10),
child: Text(
":",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFFD2D2D2),
),
)),
],
),
InkWell( InkWell(
onTap: () {}, onTap: () {},
child: Container( child: Container(
@ -295,7 +407,7 @@ class _GroupDetails extends State<GroupDetails> {
color: Color(0xFFD2D2D2), color: Color(0xFFD2D2D2),
borderRadius: BorderRadius.circular(4)), borderRadius: BorderRadius.circular(4)),
child: Text( child: Text(
"22", tempHour.toString(),
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 14.sp, fontSize: 14.sp,
@ -324,7 +436,7 @@ class _GroupDetails extends State<GroupDetails> {
color: Color(0xFFD2D2D2), color: Color(0xFFD2D2D2),
borderRadius: BorderRadius.circular(4)), borderRadius: BorderRadius.circular(4)),
child: Text( child: Text(
"59", tempM.toString(),
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 14.sp, fontSize: 14.sp,
@ -353,7 +465,7 @@ class _GroupDetails extends State<GroupDetails> {
color: Color(0xFFD2D2D2), color: Color(0xFFD2D2D2),
borderRadius: BorderRadius.circular(4)), borderRadius: BorderRadius.circular(4)),
child: Text( child: Text(
"59", tempS.toString(),
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 14.sp, fontSize: 14.sp,
@ -387,7 +499,7 @@ class _GroupDetails extends State<GroupDetails> {
), ),
), ),
TextSpan( TextSpan(
text: "2", text:(activityActRecordDetails?.actRecord?.joinNum ?? 0).toString(),
style: TextStyle( style: TextStyle(
fontSize: 18.sp, fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
@ -419,17 +531,17 @@ class _GroupDetails extends State<GroupDetails> {
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
width: double.infinity, width: double.infinity,
height: 75.h, height:80.h,
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemCount: 3, itemCount:activityActRecordDetails?.actRecord?.joinNum ?? 0,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
onTap: () {}, onTap: () {},
child: groupItem(), child: groupItem(activityActRecordDetails.actRecordJoinList[position]),
); );
}, },
), ),
@ -523,10 +635,12 @@ class _GroupDetails extends State<GroupDetails> {
); );
} }
Widget groupItem() { Widget groupItem(ActRecordJoinList actRecordJoinList) {
return Container( return Container(
margin: EdgeInsets.only(right:25), margin: EdgeInsets.only(right:25),
child:Row( child:Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Stack( Stack(
children: [ children: [
@ -541,15 +655,16 @@ class _GroupDetails extends State<GroupDetails> {
), ),
), ),
child:MImage( child:MImage(
"", actRecordJoinList?.memberAvatar ?? "",
width:60.w, width:60,
height:60.h, height:60,
fit: BoxFit.cover, fit: BoxFit.cover,
isCircle: true, isCircle: true,
errorSrc: "assets/image/default_1.png", errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png", fadeSrc: "assets/image/default_1.png",
), ),
), ),
actRecordJoinList.isLeader ?
Align( Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child:Container( child:Container(
@ -572,19 +687,22 @@ class _GroupDetails extends State<GroupDetails> {
)), )),
), ),
) ):Container(),
], ],
), ),
// Container( if(
// width: 60.w, activityActRecordDetails.actRecord.joinNum != 0)
// height: 67.h, Container(
// child:Image.asset( width: 60,
// "assets/image/pin_t.png", height: 67,
// width: 60.w, margin: EdgeInsets.only(left:20),
// height: 60.h, child:Image.asset(
// fit: BoxFit.cover, "assets/image/pin_t.png",
// ), width: 60.w,
// ), height: 60.h,
fit: BoxFit.cover,
),
),
], ],
) )
); );

190
lib/store/shopping/shopping_home/group_page_details.dart

@ -1,13 +1,20 @@
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/retrofit/data/activity_details.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class GroupPageDetails extends StatefulWidget { class GroupPageDetails extends StatefulWidget {
final Map<String, dynamic> arguments;
GroupPageDetails({this.arguments});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -17,28 +24,74 @@ class GroupPageDetails extends StatefulWidget {
class _GroupPageDetails extends State<GroupPageDetails> { class _GroupPageDetails extends State<GroupPageDetails> {
RefreshController refreshController = RefreshController(); RefreshController refreshController = RefreshController();
ApiService apiService; List<ActRecordAndJoinlDTOList> actRecordAndJoinlDTOList = [];
int pageNum = 0; bool isDispose = false;
Timer _timer;
String testTime = "2021-12-30 10:00:00";
@override
void dispose() {
super.dispose();
isDispose = true;
if (_timer != null) {
_timer.cancel();
}
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_onRefresh(); // _onRefresh();
actRecordAndJoinlDTOList.addAll((json.decode(
widget.arguments["actRecordAndJoinlDTOList"]) as List<dynamic>)
.map<ActRecordAndJoinlDTOList>(
(i) => ActRecordAndJoinlDTOList.fromJson(i as Map<String, dynamic>))
.toList());
startCountdownTimer();
} }
_onRefresh() async { ////
pageNum = 0; startCountdownTimer() {
setState(() {}); if (_timer != null) return;
const oneSec = const Duration(seconds: 1);
var callback = ((timer) {
if (isDispose) return;
setState(() {
actRecordAndJoinlDTOList.forEach((element) {
var tempDateTime = DateTime.parse(element.actRecord.endTime)
.difference(DateTime.now());
if (tempDateTime.inSeconds < 0) {
element.actRecord.tempDay = 0;
element.actRecord.tempHour = 0;
element.actRecord.tempM = 0;
element.actRecord.tempS = 0;
return;
}
element.actRecord.tempDay = tempDateTime.inDays;
element.actRecord.tempHour =
tempDateTime.inHours - (tempDateTime.inDays * 24);
element.actRecord.tempM =
tempDateTime.inMinutes - (tempDateTime.inHours * 60);
element.actRecord.tempS =
tempDateTime.inSeconds - (tempDateTime.inMinutes * 60);
});
});
});
_timer = Timer.periodic(oneSec, callback);
}
_onRefresh() {
refreshController.refreshCompleted();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
color: Colors.white, color: Colors.white,
child: Column( child: Column(
children: [ children: [
MyAppBar( MyAppBar(
title:"可参加的团", title: "可参加的团",
titleColor: Colors.black, titleColor: Colors.black,
leadingColor: Colors.black, leadingColor: Colors.black,
background: Colors.transparent, background: Colors.transparent,
@ -52,7 +105,9 @@ class _GroupPageDetails extends State<GroupPageDetails> {
header: MyHeader(), header: MyHeader(),
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
onRefresh: () { onRefresh: () {
setState(() {}); setState(() {
_onRefresh();
});
}, },
child: SingleChildScrollView( child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
@ -78,11 +133,13 @@ class _GroupPageDetails extends State<GroupPageDetails> {
/// ///
Widget groupList() { Widget groupList() {
return Container( return Container(
height: MediaQuery.of(context).size.height-62.h-MediaQuery.of(context).padding.top, height: MediaQuery.of(context).size.height -
62.h -
MediaQuery.of(context).padding.top,
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
child: ListView.builder( child: ListView.builder(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
itemCount:10, itemCount: actRecordAndJoinlDTOList?.length ?? 0,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
@ -91,14 +148,14 @@ class _GroupPageDetails extends State<GroupPageDetails> {
onTap: () { onTap: () {
setState(() {}); setState(() {});
}, },
child: groupItem(), child: groupItem(actRecordAndJoinlDTOList[position], position),
); );
}, },
), ),
); );
} }
Widget groupItem() { Widget groupItem(ActRecordAndJoinlDTOList actRecordAndJoinlDTOList, index) {
return Container( return Container(
height: 44.h, height: 44.h,
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
@ -106,31 +163,28 @@ class _GroupPageDetails extends State<GroupPageDetails> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
// MImage( MImage(
// "", actRecordAndJoinlDTOList?.actRecordJoinList[index]?.memberAvatar ??
// width:44, "",
// height:44,
// fit: BoxFit.cover,
// isCircle: true,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
Image.asset(
"assets/image/icon_story_td.png",
width: 44, width: 44,
height: 44, height: 44,
fit: BoxFit.cover, fit: BoxFit.cover,
isCircle: true,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
), ),
SizedBox(width: 4.w), SizedBox(width: 4.w),
Expanded( Expanded(
child: Text( child: Text(
"团长名称", actRecordAndJoinlDTOList
style: TextStyle( ?.actRecordJoinList[index]?.memberNickname ??
fontSize: 12.sp, "",
fontWeight: MyFontWeight.regular, style: TextStyle(
color: Color(0xFF4D4D4D), fontSize: 12.sp,
), fontWeight: MyFontWeight.regular,
)), color: Color(0xFF4D4D4D),
),
)),
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
@ -147,7 +201,8 @@ class _GroupPageDetails extends State<GroupPageDetails> {
), ),
), ),
TextSpan( TextSpan(
text: "1", text:
actRecordAndJoinlDTOList.actRecord.joinNum.toString(),
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 10.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -166,7 +221,7 @@ class _GroupPageDetails extends State<GroupPageDetails> {
), ),
), ),
Text( Text(
"剩余23:12:12", "剩余${(actRecordAndJoinlDTOList.actRecord.tempDay != 0) ? actRecordAndJoinlDTOList.actRecord.tempDay : ""}:${actRecordAndJoinlDTOList?.actRecord?.tempHour ?? 0}:${actRecordAndJoinlDTOList?.actRecord?.tempM ?? 0}:${actRecordAndJoinlDTOList?.actRecord?.tempS ?? 0}",
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 10.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -175,38 +230,47 @@ class _GroupPageDetails extends State<GroupPageDetails> {
), ),
], ],
), ),
Container( GestureDetector(
alignment: Alignment.center, onTap: () {
width: 53.w, Navigator.of(context).popAndPushNamed('/router/group_details',
height: 22.h, arguments: {
margin: EdgeInsets.only(left: 4.w), "actRecordId": actRecordAndJoinlDTOList
decoration: BoxDecoration( .actRecordJoinList[index].actRecordId
borderRadius: BorderRadius.circular(13), });
gradient: new LinearGradient( },
begin: Alignment.centerRight, child: Container(
end: Alignment.centerLeft, alignment: Alignment.center,
colors: [ width: 53.w,
Color(0xFF61CE6B), height: 22.h,
Color(0xFF32A057), margin: EdgeInsets.only(left: 4.w),
]), decoration: BoxDecoration(
boxShadow: [ borderRadius: BorderRadius.circular(13),
BoxShadow( gradient: new LinearGradient(
color: Colors.black.withAlpha(12), begin: Alignment.centerRight,
offset: Offset(0, 3), end: Alignment.centerLeft,
blurRadius: 14, colors: [
spreadRadius: 0, Color(0xFF61CE6B),
Color(0xFF32A057),
]),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Text(
"去参团",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
), ),
],
),
child: Text(
"去参团",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
), ),
), ),
) ),
], ],
), ),
); );

58
lib/store/shopping/shopping_mall_home.dart

@ -71,7 +71,7 @@ class _ShoppingMallHome extends State<ShoppingMallHome>
}); });
queryStoreInfo(); queryStoreInfo();
SharedPreferences.getInstance().then( SharedPreferences.getInstance().then(
(value) => { (value) => {
value.setString('minToken', minToken), value.setString('minToken', minToken),
value.setString('tenant', tenant), value.setString('tenant', tenant),
value.setString('storeId', storeId), value.setString('storeId', storeId),
@ -94,7 +94,7 @@ class _ShoppingMallHome extends State<ShoppingMallHome>
/// ///
queryStoreInfo() async { queryStoreInfo() async {
BaseData baseData = BaseData baseData =
await apiService.queryStoreInfo(storeId).catchError((error) { await apiService.queryStoreInfo(storeId).catchError((error) {
debugPrint(error.toString()); debugPrint(error.toString());
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
@ -143,7 +143,7 @@ class _ShoppingMallHome extends State<ShoppingMallHome>
minToken, minToken,
storeId, storeId,
tenant, tenant,
storeInfo, storeInfo,
), ),
Align( Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
@ -187,33 +187,33 @@ class _ShoppingMallHome extends State<ShoppingMallHome>
), ),
Expanded( Expanded(
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
choiceIndex = 1; choiceIndex = 1;
}); });
}, },
child: Column( child: Column(
children: [ children: [
Image.asset( Image.asset(
choiceIndex == 0 choiceIndex == 0
? "assets/image/shopping_cart_h.png" ? "assets/image/shopping_cart_h.png"
: "assets/image/shopping_cart.png", : "assets/image/shopping_cart.png",
width: 30, width: 30,
height: 30, height: 30,
), ),
Text( Text(
"购物车", "购物车",
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 10.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: choiceIndex == 0 color: choiceIndex == 0
? Color(0xFFC6C6C6) ? Color(0xFFC6C6C6)
: Color(0xFF4C4C4C), : Color(0xFF4C4C4C),
), ),
),
],
), ),
], ))
),
))
], ],
), ),
), ),

Loading…
Cancel
Save