Browse Source

秒杀专区更改

zyh
w-R 3 years ago
parent
commit
8724cad0e4
  1. 2
      lib/main.dart
  2. 2
      lib/mine/vip_detail_page.dart
  3. 189
      lib/retrofit/data/activity_area_list.dart
  4. 4
      lib/retrofit/data/product.dart
  5. 3
      lib/retrofit/retrofit_api.dart
  6. 11
      lib/retrofit/retrofit_api.g.dart
  7. 1072
      lib/store/shopping/activity_prefecture_details.dart
  8. 9
      lib/store/shopping/shopping_home/shopping_acticvity.dart
  9. 6
      pubspec.lock

2
lib/main.dart

@ -281,7 +281,7 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/shopping_mall_home': (context, {arguments}) => '/router/shopping_mall_home': (context, {arguments}) =>
ShoppingMallHome(arguments: arguments), ShoppingMallHome(arguments: arguments),
'/router/activity_prefecture_details': (context, {arguments}) => '/router/activity_prefecture_details': (context, {arguments}) =>
ActivityPrefectureDetails(), ActivityPrefectureDetails(arguments: arguments),
'/router/shopping_goods_details': (context, {arguments}) => '/router/shopping_goods_details': (context, {arguments}) =>
ShoppingGoodsDetails(), ShoppingGoodsDetails(),
'/router/search_page': (context, {arguments}) => '/router/search_page': (context, {arguments}) =>

2
lib/mine/vip_detail_page.dart

@ -550,7 +550,7 @@ class _VipDetailPage extends State<VipDetailPage> {
return "$totalPrice"; return "$totalPrice";
} }
List<Widget> goodsItem(List<ProductList> products) { List<Widget> goodsItem(List<ProductsList> products) {
if (products == null) return []; if (products == null) return [];
if (products.length > 3) { if (products.length > 3) {
products = products.sublist(0, 3); products = products.sublist(0, 3);

189
lib/retrofit/data/activity_area_list.dart

@ -1,7 +1,7 @@
import 'package:huixiang/retrofit/data/product.dart'; import 'package:huixiang/retrofit/data/product.dart';
/// actTemplate : {"id":"1473198577613275136","createTime":"2021-12-21 15:48:06","createUser":"1333246101196636160","updateTime":"2021-12-21 15:48:06","updateUser":"1333246101196636160","storeId":"1333246101343436800","type":2,"limitTime":null,"limitNumber":0,"coverImg":"https://pos.upload.gznl.top/1175/2021/12/5bf7a846-768b-4a17-872f-e927988c24c9.jpg","shareImg":"https://pos.upload.gznl.top/1175/2021/12/65f6a0f7-14d1-4393-902e-42e5dc464800.jpg","bannerImg":"https://pos.upload.gznl.top/1175/2021/12/9ee395eb-718c-40c0-bfe0-673dbbade4cf.jpg","state":1,"allDay":false,"startTime":"2021-12-20 00:00:00","endTime":"2021-12-30 00:00:00","isDelete":0} /// actTemplate : {"id":"1473198577613275136","createTime":"2021-12-21 15:48:06","createUser":"1333246101196636160","updateTime":"2021-12-21 15:48:06","updateUser":"1333246101196636160","storeId":"1333246101343436800","type":2,"limitTime":null,"limitNumber":0,"coverImg":"https://pos.upload.gznl.top/1175/2021/12/5bf7a846-768b-4a17-872f-e927988c24c9.jpg","shareImg":"https://pos.upload.gznl.top/1175/2021/12/65f6a0f7-14d1-4393-902e-42e5dc464800.jpg","bannerImg":"https://pos.upload.gznl.top/1175/2021/12/9ee395eb-718c-40c0-bfe0-673dbbade4cf.jpg","state":1,"allDay":false,"startTime":"2021-12-20 00:00:00","endTime":"2021-12-30 00:00:00","isDelete":0}
/// timeProductList : [{"actTime":{"id":"1473198590141661184","createTime":"2021-12-21 15:48:09","createUser":"1333246101196636160","updateTime":"2021-12-21 15:48:09","updateUser":"1333246101196636160","storeId":"1333246101343436800","templateId":"1473198577613275136","allDay":false,"startHour":"09:00:00","endHour":"10:00:00","isDelete":0},"productList":[]},{"actTime":{"id":"1473570616966643712","createTime":"2021-12-22 16:26:27","createUser":"1333246101196636160","updateTime":"2021-12-22 16:26:27","updateUser":"1333246101196636160","storeId":"1333246101343436800","templateId":"1473198577613275136","allDay":false,"startHour":"11:00:00","endHour":"17:00:00","isDelete":0},"productList":[{"id":"1473570776908038144","createTime":"2021-12-22 16:27:05","createUser":"1333246101196636160","updateTime":"2021-12-22 16:27:05","updateUser":"1333246101196636160","storeId":"1333246101343436800","templateId":"1473198577613275136","timeId":"1473570616966643712","productId":"1456500820571848704","productName":"毛毛虫面包","productImg":"https://pos.upload.gznl.top/1175/2021/11/4a6ffabd-0e10-4720-ac93-57ec6855c5cf.jpg","productPrice":"8.00","promotionPrice":"8.00","productStock":-20,"sellCount":0,"skuJson":[{"skuId":"1456500821968551936","skuPrice":8,"skuStock":-20}],"isDelete":0}]}] /// timeProductList : [{"actTime":{"id":"1473198590141661184","createTime":"2021-12-21 15:48:09","createUser":"1333246101196636160","updateTime":"2021-12-21 15:48:09","updateUser":"1333246101196636160","storeId":"1333246101343436800","templateId":"1473198577613275136","allDay":false,"startHour":"09:00:00","endHour":"10:00:00","isDelete":0},"productList":[{"id":"1473543964270264320","createTime":"2021-12-22 14:40:33","createUser":"1333246101196636160","updateTime":"2021-12-22 14:40:33","updateUser":"1333246101196636160","storeId":"1333246101343436800","templateId":"1473198577613275136","timeId":"1473198590141661184","productId":"1425724410261667840","productName":"西瓜椰椰甘露","productImg":"https://pos.upload.gznl.top/1177/2021/08/3471058e-ac5e-47dd-8ed5-148e8cb28316.jpg","productPrice":"15.00","promotionPrice":"15.00","productStock":2847,"sellCount":0,"skuJson":[{"skuId":"1425724410358136832","skuPrice":15,"skuStock":996},{"skuId":"1425724410387496960","skuPrice":15,"skuStock":851},{"skuId":"1425724410454605824","skuPrice":15,"skuStock":1000}],"isDelete":0}]}]
class ActivityAreaList { class ActivityAreaList {
ActivityAreaList({ ActivityAreaList({
@ -40,12 +40,12 @@ class ActivityAreaList {
} }
/// actTime : {"id":"1473198590141661184","createTime":"2021-12-21 15:48:09","createUser":"1333246101196636160","updateTime":"2021-12-21 15:48:09","updateUser":"1333246101196636160","storeId":"1333246101343436800","templateId":"1473198577613275136","allDay":false,"startHour":"09:00:00","endHour":"10:00:00","isDelete":0} /// actTime : {"id":"1473198590141661184","createTime":"2021-12-21 15:48:09","createUser":"1333246101196636160","updateTime":"2021-12-21 15:48:09","updateUser":"1333246101196636160","storeId":"1333246101343436800","templateId":"1473198577613275136","allDay":false,"startHour":"09:00:00","endHour":"10:00:00","isDelete":0}
/// productList : [] /// productList : [{"id":"1473543964270264320","createTime":"2021-12-22 14:40:33","createUser":"1333246101196636160","updateTime":"2021-12-22 14:40:33","updateUser":"1333246101196636160","storeId":"1333246101343436800","templateId":"1473198577613275136","timeId":"1473198590141661184","productId":"1425724410261667840","productName":"西瓜椰椰甘露","productImg":"https://pos.upload.gznl.top/1177/2021/08/3471058e-ac5e-47dd-8ed5-148e8cb28316.jpg","productPrice":"15.00","promotionPrice":"15.00","productStock":2847,"sellCount":0,"skuJson":[{"skuId":"1425724410358136832","skuPrice":15,"skuStock":996},{"skuId":"1425724410387496960","skuPrice":15,"skuStock":851},{"skuId":"1425724410454605824","skuPrice":15,"skuStock":1000}],"isDelete":0}]
class TimeProductList { class TimeProductList {
TimeProductList({ TimeProductList({
ActTime actTime, ActTime actTime,
List<dynamic> productList,}){ List<ProductList> productList,}){
_actTime = actTime; _actTime = actTime;
_productList = productList; _productList = productList;
} }
@ -60,10 +60,10 @@ class TimeProductList {
} }
} }
ActTime _actTime; ActTime _actTime;
List<dynamic> _productList; List<ProductList> _productList;
ActTime get actTime => _actTime; ActTime get actTime => _actTime;
List<dynamic> get productList => _productList; List<ProductList> get productList => _productList;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final map = <String, dynamic>{}; final map = <String, dynamic>{};
@ -78,6 +78,185 @@ class TimeProductList {
} }
/// id : "1473543964270264320"
/// createTime : "2021-12-22 14:40:33"
/// createUser : "1333246101196636160"
/// updateTime : "2021-12-22 14:40:33"
/// updateUser : "1333246101196636160"
/// storeId : "1333246101343436800"
/// templateId : "1473198577613275136"
/// timeId : "1473198590141661184"
/// productId : "1425724410261667840"
/// productName : "西瓜椰椰甘露"
/// productImg : "https://pos.upload.gznl.top/1177/2021/08/3471058e-ac5e-47dd-8ed5-148e8cb28316.jpg"
/// productPrice : "15.00"
/// promotionPrice : "15.00"
/// productStock : 2847
/// sellCount : 0
/// skuJson : [{"skuId":"1425724410358136832","skuPrice":15,"skuStock":996},{"skuId":"1425724410387496960","skuPrice":15,"skuStock":851},{"skuId":"1425724410454605824","skuPrice":15,"skuStock":1000}]
/// isDelete : 0
class ProductList {
ProductList({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String storeId,
String templateId,
String timeId,
String productId,
String productName,
String productImg,
String productPrice,
String promotionPrice,
int productStock,
int sellCount,
List<SkuJson> skuJson,
int isDelete,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_storeId = storeId;
_templateId = templateId;
_timeId = timeId;
_productId = productId;
_productName = productName;
_productImg = productImg;
_productPrice = productPrice;
_promotionPrice = promotionPrice;
_productStock = productStock;
_sellCount = sellCount;
_skuJson = skuJson;
_isDelete = isDelete;
}
ProductList.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_storeId = json['storeId'];
_templateId = json['templateId'];
_timeId = json['timeId'];
_productId = json['productId'];
_productName = json['productName'];
_productImg = json['productImg'];
_productPrice = json['productPrice'];
_promotionPrice = json['promotionPrice'];
_productStock = json['productStock'];
_sellCount = json['sellCount'];
if (json['skuJson'] != null) {
_skuJson = [];
json['skuJson'].forEach((v) {
_skuJson.add(SkuJson.fromJson(v));
});
}
_isDelete = json['isDelete'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _storeId;
String _templateId;
String _timeId;
String _productId;
String _productName;
String _productImg;
String _productPrice;
String _promotionPrice;
int _productStock;
int _sellCount;
List<SkuJson> _skuJson;
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;
String get templateId => _templateId;
String get timeId => _timeId;
String get productId => _productId;
String get productName => _productName;
String get productImg => _productImg;
String get productPrice => _productPrice;
String get promotionPrice => _promotionPrice;
int get productStock => _productStock;
int get sellCount => _sellCount;
List<SkuJson> get skuJson => _skuJson;
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['templateId'] = _templateId;
map['timeId'] = _timeId;
map['productId'] = _productId;
map['productName'] = _productName;
map['productImg'] = _productImg;
map['productPrice'] = _productPrice;
map['promotionPrice'] = _promotionPrice;
map['productStock'] = _productStock;
map['sellCount'] = _sellCount;
if (_skuJson != null) {
map['skuJson'] = _skuJson.map((v) => v.toJson()).toList();
}
map['isDelete'] = _isDelete;
return map;
}
}
/// skuId : "1425724410358136832"
/// skuPrice : 15
/// skuStock : 996
class SkuJson {
SkuJson({
String skuId,
int skuPrice,
int skuStock,}){
_skuId = skuId;
_skuPrice = skuPrice;
_skuStock = skuStock;
}
SkuJson.fromJson(dynamic json) {
_skuId = json['skuId'];
_skuPrice = json['skuPrice'];
_skuStock = json['skuStock'];
}
String _skuId;
int _skuPrice;
int _skuStock;
String get skuId => _skuId;
int get skuPrice => _skuPrice;
int get skuStock => _skuStock;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['skuId'] = _skuId;
map['skuPrice'] = _skuPrice;
map['skuStock'] = _skuStock;
return map;
}
}
/// id : "1473198590141661184" /// id : "1473198590141661184"
/// createTime : "2021-12-21 15:48:09" /// createTime : "2021-12-21 15:48:09"
/// createUser : "1333246101196636160" /// createUser : "1333246101196636160"

4
lib/retrofit/data/product.dart

@ -1,5 +1,5 @@
class ProductList { class ProductsList {
String _id; String _id;
String _createTime; String _createTime;
String _createUser; String _createUser;
@ -124,7 +124,7 @@ class ProductList {
_batch = batch; _batch = batch;
} }
ProductList.fromJson(dynamic json) { ProductsList.fromJson(dynamic json) {
_id = json["id"]; _id = json["id"];
_createTime = json["createTime"]; _createTime = json["createTime"];
_createUser = json["createUser"]; _createUser = json["createUser"];

3
lib/retrofit/retrofit_api.dart

@ -484,6 +484,7 @@ abstract class ApiService {
///,,, ///,,,
@GET("/actTemplate/findActListByType?allDay={allDay}&type={type}") @GET("/actTemplate/findActListByType?allDay={allDay}&type={type}")
Future<BaseData<List<ActivityAreaList>>> findActListByType(@Path("allDay") bool allDay, @Path("type") int type); Future<BaseData<ActivityAreaList>> findActListByType(@Path("allDay") bool allDay, @Path("type") int type);
} }

11
lib/retrofit/retrofit_api.g.dart

@ -1774,7 +1774,7 @@ class _ApiService implements ApiService {
} }
@override @override
Future<BaseData<List<ActivityAreaList>>> findActListByType(allDay,type) async { Future<BaseData<ActivityAreaList>> findActListByType(allDay,type) async {
ArgumentError.checkNotNull(allDay, 'allDay'); ArgumentError.checkNotNull(allDay, 'allDay');
ArgumentError.checkNotNull(type, 'type'); ArgumentError.checkNotNull(type, 'type');
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
@ -1789,11 +1789,10 @@ class _ApiService implements ApiService {
extra: _extra, extra: _extra,
baseUrl: baseUrl), baseUrl: baseUrl),
data: _data); data: _data);
final value = BaseData<List<ActivityAreaList>>.fromJson( final value = BaseData<ActivityAreaList>.fromJson(
_result.data, _result.data,
(json) => (json as List<dynamic>) (json) => ActivityAreaList.fromJson(json),
.map<ActivityAreaList>((i) => ActivityAreaList.fromJson(i as Map<String, dynamic>)) );
.toList());
return value; return value;
} }

1072
lib/store/shopping/activity_prefecture_details.dart

File diff suppressed because it is too large Load Diff

9
lib/store/shopping/shopping_home/shopping_acticvity.dart

@ -39,7 +39,10 @@ class _ShoppingActivity extends State<ShoppingActivity> {
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/activity_prefecture_details'); Navigator.of(context).pushNamed('/router/activity_prefecture_details',
arguments: {
"type":2
});
}, },
child: Container( child: Container(
margin: EdgeInsets.symmetric(horizontal: 5.w ), margin: EdgeInsets.symmetric(horizontal: 5.w ),
@ -127,6 +130,8 @@ class _ShoppingActivity extends State<ShoppingActivity> {
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/activity_prefecture_details',
arguments: { "type":3});
}, },
child: Container( child: Container(
margin: EdgeInsets.symmetric(horizontal: 5.w), margin: EdgeInsets.symmetric(horizontal: 5.w),
@ -218,6 +223,8 @@ class _ShoppingActivity extends State<ShoppingActivity> {
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/activity_prefecture_details',
arguments: { "type":1});
}, },
child: Container( child: Container(
margin: EdgeInsets.symmetric(horizontal: 5.w), margin: EdgeInsets.symmetric(horizontal: 5.w),

6
pubspec.lock

@ -269,7 +269,7 @@ packages:
name: flutter_screenutil name: flutter_screenutil
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "5.0.1+2" version: "5.0.1+3"
flutter_smart_dialog: flutter_smart_dialog:
dependency: "direct main" dependency: "direct main"
description: description:
@ -615,7 +615,7 @@ packages:
name: scan name: scan
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.5.0" version: "1.6.0"
shared_preferences: shared_preferences:
dependency: "direct main" dependency: "direct main"
description: description:
@ -846,7 +846,7 @@ packages:
name: video_player_web name: video_player_web
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.4" version: "2.0.5"
wakelock: wakelock:
dependency: transitive dependency: transitive
description: description:

Loading…
Cancel
Save