Browse Source

参团流程

zyh
w-R 3 years ago
parent
commit
1e10ea6a35
  1. 526
      lib/retrofit/data/activity_details.dart
  2. 18
      lib/retrofit/min_api.dart
  3. 46
      lib/retrofit/min_api.g.dart
  4. 8
      lib/retrofit/retrofit_api.dart
  5. 2
      lib/retrofit/retrofit_api.g.dart
  6. 105
      lib/store/shopping/activity_prefecture_details.dart
  7. 960
      lib/store/shopping/shopping_goods_details.dart

526
lib/retrofit/data/activity_details.dart

@ -0,0 +1,526 @@
/// actProduct : {"id":"1479377402042777600","createTime":"2022-01-07 17:00:33","createUser":"1364043181062094848","updateTime":"2022-01-07 17:00:33","updateUser":"1364043181062094848","storeId":"1460885296764682240","templateId":"1479377328797646848","timeId":"1479377329099636736","productId":"1460886580993458176","productName":"无花果礼盒","productImg":"https://pos.upload.gznl.top/1179/2021/11/e50b00a1-09a2-4bab-b71f-e26e80006459.png","productPrice":"88.00","promotionPrice":"88.00","productStock":0,"sellCount":0,"skuJson":[{"skuId":"1460886581089927168","skuPrice":88,"skuStock":0}],"isDelete":0}
/// actRecordAndJoinlDTOList : [{"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},"actRecordJoinList":[{"id":"1479399514073726976","createTime":"2022-01-07 18:28:25","createUser":"1478548720785031168","updateTime":"2022-01-07 18:28:25","updateUser":"1478548720785031168","storeId":"1460885296764682240","actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actRecordId":"1479399513473941504","mid":"1478548720785031168","orderId":"1479399514677706752","isLeader":true,"memberAvatar":"","memberNickname":"斯基","productId":"1479377402042777600","actPrice":"88.00","state":false,"isDelete":0}]},{"actRecord":{"id":"1479401111025614848","createTime":"2022-01-07 18:34:45","createUser":"1468903135782109184","updateTime":"2022-01-07 18:34:45","updateUser":"1468903135782109184","storeId":"1460885296764682240","type":1,"actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actProductId":"1479377402042777600","mid":"1468903135782109184","joinNum":0,"startTime":"2022-01-07 18:34:45","endTime":"2022-01-08 16:34:45","state":2,"isDelete":0},"actRecordJoinList":[{"id":"1479401111688314880","createTime":"2022-01-07 18:34:46","createUser":"1468903135782109184","updateTime":"2022-01-07 18:34:46","updateUser":"1468903135782109184","storeId":"1460885296764682240","actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actRecordId":"1479401111025614848","mid":"1468903135782109184","orderId":"1479401112292294656","isLeader":true,"memberAvatar":"https://pos.upload.gznl.top/admin/2021/08/1f8d55ed-85d2-42a2-b155-6737a66226e8.jpg","memberNickname":"哈哈哈","productId":"1479377402042777600","actPrice":"88.00","state":false,"isDelete":0}]}]
class ActivityDetails {
ActivityDetails({
ActProduct actProduct,
List<ActRecordAndJoinlDTOList> actRecordAndJoinlDTOList,}){
_actProduct = actProduct;
_actRecordAndJoinlDTOList = actRecordAndJoinlDTOList;
}
ActivityDetails.fromJson(dynamic json) {
_actProduct = json['actProduct'] != null ? ActProduct.fromJson(json['actProduct']) : null;
if (json['actRecordAndJoinlDTOList'] != null) {
_actRecordAndJoinlDTOList = [];
json['actRecordAndJoinlDTOList'].forEach((v) {
_actRecordAndJoinlDTOList.add(ActRecordAndJoinlDTOList.fromJson(v));
});
}
}
ActProduct _actProduct;
List<ActRecordAndJoinlDTOList> _actRecordAndJoinlDTOList;
ActProduct get actProduct => _actProduct;
List<ActRecordAndJoinlDTOList> get actRecordAndJoinlDTOList => _actRecordAndJoinlDTOList;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (_actProduct != null) {
map['actProduct'] = _actProduct.toJson();
}
if (_actRecordAndJoinlDTOList != null) {
map['actRecordAndJoinlDTOList'] = _actRecordAndJoinlDTOList.map((v) => v.toJson()).toList();
}
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}
/// actRecordJoinList : [{"id":"1479399514073726976","createTime":"2022-01-07 18:28:25","createUser":"1478548720785031168","updateTime":"2022-01-07 18:28:25","updateUser":"1478548720785031168","storeId":"1460885296764682240","actTemplateId":"1479377328797646848","actTimeId":"1479377329099636736","actRecordId":"1479399513473941504","mid":"1478548720785031168","orderId":"1479399514677706752","isLeader":true,"memberAvatar":"","memberNickname":"斯基","productId":"1479377402042777600","actPrice":"88.00","state":false,"isDelete":0}]
class ActRecordAndJoinlDTOList {
ActRecordAndJoinlDTOList({
ActRecord actRecord,
List<ActRecordJoinList> actRecordJoinList,}){
_actRecord = actRecord;
_actRecordJoinList = actRecordJoinList;
}
ActRecordAndJoinlDTOList.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 : "1479399514073726976"
/// createTime : "2022-01-07 18:28:25"
/// createUser : "1478548720785031168"
/// updateTime : "2022-01-07 18:28:25"
/// updateUser : "1478548720785031168"
/// storeId : "1460885296764682240"
/// actTemplateId : "1479377328797646848"
/// actTimeId : "1479377329099636736"
/// actRecordId : "1479399513473941504"
/// mid : "1478548720785031168"
/// orderId : "1479399514677706752"
/// isLeader : true
/// memberAvatar : ""
/// memberNickname : "斯基"
/// productId : "1479377402042777600"
/// actPrice : "88.00"
/// state : false
/// isDelete : 0
class ActRecordJoinList {
ActRecordJoinList({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String storeId,
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;
_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'];
_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;
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;
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['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 : "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
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;
}
}
/// id : "1479377402042777600"
/// createTime : "2022-01-07 17:00:33"
/// createUser : "1364043181062094848"
/// updateTime : "2022-01-07 17:00:33"
/// updateUser : "1364043181062094848"
/// storeId : "1460885296764682240"
/// templateId : "1479377328797646848"
/// timeId : "1479377329099636736"
/// productId : "1460886580993458176"
/// productName : "无花果礼盒"
/// productImg : "https://pos.upload.gznl.top/1179/2021/11/e50b00a1-09a2-4bab-b71f-e26e80006459.png"
/// productPrice : "88.00"
/// promotionPrice : "88.00"
/// productStock : 0
/// sellCount : 0
/// skuJson : [{"skuId":"1460886581089927168","skuPrice":88,"skuStock":0}]
/// isDelete : 0
class ActProduct {
ActProduct({
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;
}
ActProduct.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 : "1460886581089927168"
/// skuPrice : 88
/// skuStock : 0
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;
}
}

18
lib/retrofit/min_api.dart

@ -15,6 +15,7 @@ import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:retrofit/retrofit.dart';
import 'data/activity_area_list.dart';
import 'data/activity_details.dart';
import 'data/findMiNiGroupList.dart';
import 'data/home_recommend_list.dart';
import 'data/miNiDetail.dart';
@ -31,14 +32,14 @@ part 'min_api.g.dart';
// const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222
const base_url = "http://192.168.10.236:8765/app/";///
const baseUrl = "http://192.168.10.236:8765/app/";///
// const base_url = "http://192.168.10.236:8765/app/";///
// const baseUrl = "http://192.168.10.236:8765/app/";///
// const base_url = "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 baseUrl = "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/";///
///
@RestApi(baseUrl: baseUrl)
@ -219,10 +220,11 @@ abstract class MinApiService {
Future<BaseData<ActivityAreaList>> findActListByType(@Path("allDay") bool allDay,
@Path("type") String type);
// /// APP
// @GET("actTemplate/viewProduct?actProductId={actProductId}&type={type}")
// Future<BaseData<List<HomeRecommendList>>> viewProduct();
//
/// APP
@GET("actTemplate/viewProduct?actProductId={actProductId}&type={type}")
Future<BaseData<ActivityDetails>> viewProduct(@Path("actProductId") String actProductId,
@Path("type") String type);
// ///
// @POST("actTemplate/actPay")
// Future<BaseData> actPay(@Body() Map<String, dynamic> param);

46
lib/retrofit/min_api.g.dart

@ -9,7 +9,7 @@ part of 'min_api.dart';
class _MinApiService implements MinApiService {
_MinApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://192.168.10.236:8765/app/';
baseUrl ??= 'http://192.168.10.142:8765/app/';
}
final Dio _dio;
@ -465,27 +465,27 @@ class _MinApiService implements MinApiService {
return value;
}
// @override
// Future<BaseData<ActivityAreaList>> viewProduct (actProductId,type) async {
// ArgumentError.checkNotNull(actProductId, 'actProductId');
// ArgumentError.checkNotNull(type, 'type');
// const _extra = <String, dynamic>{};
// final queryParameters = <String, dynamic>{};
// final _data = <String, dynamic>{};
// final _result = await _dio.request<Map<String, dynamic>>(
// 'actTemplate/viewProduct?actProductId=$actProductId&type=$type',
// queryParameters: queryParameters,
// options: RequestOptions(
// method: 'GET',
// headers: <String, dynamic>{},
// extra: _extra,
// baseUrl: baseUrl),
// data: _data);
// final value = BaseData<ActivityAreaList>.fromJson(
// _result.data,
// (json) => ActivityAreaList.fromJson(json),
// );
// return value;
// }
@override
Future<BaseData<ActivityDetails>> viewProduct(actProductId,type) async {
ArgumentError.checkNotNull(actProductId, 'actProductId');
ArgumentError.checkNotNull(type, 'type');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'actTemplate/viewProduct?actProductId=$actProductId&type=$type',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<ActivityDetails>.fromJson(
_result.data,
(json) => ActivityDetails.fromJson(json),
);
return value;
}
}

8
lib/retrofit/retrofit_api.dart

@ -60,15 +60,15 @@ part 'retrofit_api.g.dart';
// const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
const base_url = "http://192.168.10.236:8766/app/"; ///
const baseUrl = "http://192.168.10.236:8766/app/"; ///
// const base_url = "http://192.168.10.236:8766/app/"; ///
// const baseUrl = "http://192.168.10.236:8766/app/"; ///
// const base_url = "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 baseUrl = "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/";///
@RestApi(baseUrl: baseUrl)
abstract class ApiService {

2
lib/retrofit/retrofit_api.g.dart

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

105
lib/store/shopping/activity_prefecture_details.dart

@ -68,16 +68,20 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
void initState() {
super.initState();
_scrollController = ScrollController();
_scrollController.addListener(() {
setState(() {
if (_scrollController.offset <
(325.h - MediaQuery.of(context).padding.top)) {
_scrollPhysics = NeverScrollableScrollPhysics();
} else {
_scrollPhysics = BouncingScrollPhysics();
}
if(pageType != "2"){
_scrollPhysics = BouncingScrollPhysics();
}else{
_scrollController.addListener(() {
setState(() {
if (_scrollController.offset <
(325.h - MediaQuery.of(context).padding.top)) {
_scrollPhysics = NeverScrollableScrollPhysics();
} else {
_scrollPhysics = BouncingScrollPhysics();
}
});
});
});
}
pageType = widget.arguments["type"];
storeId = widget.arguments["storeId"];
@ -201,6 +205,7 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
_timer = Timer.periodic(oneSec, callback);
}
@override
Widget build(BuildContext context) {
return Container(
@ -585,50 +590,62 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
///
Widget seckilList() {
return Container(
return (pageType == "2")?Container(
height: MediaQuery.of(context).size.height -
62.h -
MediaQuery.of(context).padding.top,
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
color: Colors.white,
child: productList.length == 0
child: seckilListChild(),
):Container(
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
color: Colors.white,
child: seckilListChild(),
);
}
Widget seckilListChild() {
return productList.length == 0
? Container(
width: double.infinity,
alignment: Alignment.topCenter,
child: Text(
"暂无商品参与活动",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.medium,
color: Colors.black,
),
),
)
width: double.infinity,
alignment: Alignment.topCenter,
child: Text(
"暂无商品参与活动",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.medium,
color: Colors.black,
),
),
)
: ListView.builder(
padding: EdgeInsets.zero,
itemCount: productList?.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: _scrollPhysics,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
setState(() {
Navigator.of(context).pushNamed(
'/router/shopping_goods_details',
arguments: {
"id": productList[position].id,
"storeId": storeId,
"tenant": tenant,
},
);
});
padding: EdgeInsets.zero,
itemCount: productList?.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: _scrollPhysics,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
setState(() {
Navigator.of(context).pushNamed(
'/router/shopping_goods_details',
arguments: {
"actProductId": productList[position].id,
"type":pageType,
"storeId": storeId,
"tenant": tenant,
"limitNumber":actTemplate.limitNumber,
"limitTime":actTemplate.limitTime,
"bannerImg":actTemplate.bannerImg
},
child: seckilItem(productList[position]),
);
},
),
);
});
},
child: seckilItem(productList[position]),
);
},
);
}
int timeFlag(String time) {

960
lib/store/shopping/shopping_goods_details.dart

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save