Browse Source

活动更改

zyh
w-R 3 years ago
parent
commit
dab4e2d2c3
  1. 92
      lib/order/bargain_group_order.dart
  2. 74
      lib/order/order_history_page.dart
  3. 9
      lib/retrofit/data/activity_actRecord_details.dart
  4. 8
      lib/retrofit/data/activity_order_list.dart
  5. 29
      lib/settlement/settlement_view/distribution.dart
  6. 20
      lib/store/shopping/shopping_goods_details.dart
  7. 53
      lib/store/shopping/shopping_home/bargain_details.dart
  8. 1102
      lib/store/shopping/shopping_home/group_details.dart
  9. 10
      lib/store/shopping/shopping_home/group_page_details.dart
  10. 9
      lib/store/shopping/shopping_home/search_page.dart
  11. 3
      lib/store/shopping/shopping_home/shopping_home_page.dart

92
lib/order/bargain_group_order.dart

@ -1,10 +1,14 @@
import 'package:dio/dio.dart'; 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_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/activity_order_list.dart'; import 'package:huixiang/retrofit/data/activity_order_list.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/min_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/custom_image.dart';
@ -61,9 +65,9 @@ class _BargainGroupOrder extends State<BargainGroupOrder>
]; ];
_pages = [ _pages = [
ExchangeHistoryList(0,type), ExchangeHistoryList(0,type),
ExchangeHistoryList(1,type),
ExchangeHistoryList(2,type), ExchangeHistoryList(2,type),
ExchangeHistoryList(3,type) ExchangeHistoryList(3,type),
ExchangeHistoryList(4,type)
]; ];
} }
@ -124,8 +128,11 @@ class ExchangeHistoryList extends StatefulWidget {
class _ExchangeHistoryList extends State<ExchangeHistoryList> { class _ExchangeHistoryList extends State<ExchangeHistoryList> {
MinApiService minService; MinApiService minService;
List<ActivityOrderList> activityOrderList = []; List<ActivityOrderList> activityOrderList = [];
RefreshController _refreshController = RefreshController _refreshController = RefreshController(initialRefresh: false);
RefreshController(initialRefresh: false); ApiService apiService;
StoreInfo storeInfo;
List<Activity> activitys;
String storeId;
@override @override
void initState() { void initState() {
@ -140,6 +147,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
token: minToken, token: minToken,
tenant: tenant, tenant: tenant,
storeId: storeId, storeId: storeId,
showLoading: true
); );
queryShowMyActList(); queryShowMyActList();
}); });
@ -149,7 +157,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
queryShowMyActList() async { queryShowMyActList() async {
BaseData<List<ActivityOrderList>> baseData = BaseData<List<ActivityOrderList>> baseData =
await minService.showMyActList({ await minService.showMyActList({
"state":0, "state":widget.orderStatus,
"type" :widget.type, "type" :widget.type,
}).catchError((error) { }).catchError((error) {
_refreshController.loadFailed(); _refreshController.loadFailed();
@ -161,6 +169,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
activityOrderList.clear(); activityOrderList.clear();
if(baseData.data.length > 0) if(baseData.data.length > 0)
activityOrderList.addAll(baseData.data); activityOrderList.addAll(baseData.data);
queryStoreInfo();
}); });
} else { } else {
_refreshController.refreshFailed(); _refreshController.refreshFailed();
@ -168,6 +177,32 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
} }
} }
///
queryStoreInfo() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData baseData =
await apiService.queryStoreInfo(activityOrderList[0].storeId).catchError((error) {
debugPrint(error.toString());
});
if (baseData != null && baseData.isSuccess) {
storeInfo = StoreInfo.fromJson(baseData.data);
activitys = storeInfo.informationVOPageVO.list
.map((e) => Activity.fromJson(e))
.toList();
if (mounted) {
setState(() {});
}
}
EasyLoading.dismiss();
}
_refresh() { _refresh() {
queryShowMyActList(); queryShowMyActList();
} }
@ -198,7 +233,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
return bargainOrder(activityOrderList[position]); return bargainOrder(activityOrderList[position]);
}, },
):NoDataView( ):NoDataView(
src: "assets/image/icon_empty.png", src: "assets/image/ding_dan.png",
isShowBtn: false, isShowBtn: false,
text: "还没有订单,快去下一单吧~", text: "还没有订单,快去下一单吧~",
fontSize: 16.sp, fontSize: 16.sp,
@ -257,8 +292,8 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
// borderRadius: BorderRadius.circular(2), // borderRadius: BorderRadius.circular(2),
// ), // ),
// child: Text( // child: Text(
// // (orderInfo != null && orderInfo.isTakeOut == 0) ? "" : "", // (orderInfo != null && orderInfo.isTakeOut == 0) ? "" : "",
// "", // // "",
// style: TextStyle( // style: TextStyle(
// fontSize: 12.sp, // fontSize: 12.sp,
// fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
@ -285,32 +320,12 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
Padding( Padding(
padding: EdgeInsets.only(top: 12.h, right: 12.w), padding: EdgeInsets.only(top: 12.h, right: 12.w),
child:Text( child:Text(
// (orderInfo != null && (widget.type == 1)?(widget.orderStatus == 4 ? "拼团失败" :(activityOrderList.howManyMore != 0 ? "还差${activityOrderList?.howManyMore ?? 0}人拼团成功" : "拼团成功"))
// orderInfo.storeVO != null && :(widget.orderStatus == 4 ? "砍价失败" : (activityOrderList.howManyMoney != "0.00" ? "还差¥${activityOrderList?.howManyMoney ?? 0}砍价成功" : "砍价成功")),
// orderInfo.storeVO.posType != null)
// ? StatusUtils.statusText(
// context,
// orderInfo.refundStatus,
// orderInfo.orderStatus,
// orderInfo.payStatus,
// orderInfo.sendStatus,
// orderInfo.isTakeOut)
// : "",
(widget.type == 1)?(activityOrderList.howManyMore != 0 ? "还差${activityOrderList?.howManyMore ?? 0}人拼团成功" : "拼团成功")
:(activityOrderList.howManyMoney != 0 ? "还差¥${activityOrderList?.howManyMoney ?? 0}砍价成功" : "成功"),
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: color: widget.orderStatus == 4 ? Color(0xff32A060) : Color(0xffFE951E),
// (orderInfo == null)
// ? Color(0xFF32A060)
// : (orderInfo.refundStatus == 1 ||
// orderInfo.orderStatus >= 5)
// ? Colors.grey
// : (orderInfo.orderStatus == 4)
// ? Color(0xFF32A060)
// :
Color(0xffFE951E),
), ),
), ),
), ),
@ -448,6 +463,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
.pushNamed('/router/bargain_details',arguments: { .pushNamed('/router/bargain_details',arguments: {
"actRecordId": activityOrderList.actRecordId, "actRecordId": activityOrderList.actRecordId,
"limitNumber":activityOrderList.successNumber, "limitNumber":activityOrderList.successNumber,
"storeInfo":storeInfo,
}); });
} }
}, },
@ -461,20 +477,6 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
padding: EdgeInsets.fromLTRB(17.w,0, 17.w,0), padding: EdgeInsets.fromLTRB(17.w,0, 17.w,0),
), ),
), ),
// GestureDetector(
// onTap: () {
//
// },
// child:RoundButton(
// height: 25.h,
// padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
// text: S.of(context).chakanxiangqing,
// textColor: Colors.white,
// fontSize: 12,
// backgroup: Color(0xFF32A060),
// radius: 2,
// ),
// ),
], ],
), ),
), ),

74
lib/order/order_history_page.dart

@ -142,7 +142,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
}, },
), ),
onRefresh: _onRefresh, onRefresh: _onRefresh,
// onLoading: queryOrder, onLoading: queryOrder,
child: (orderInfos != null && orderInfos.length > 0) child: (orderInfos != null && orderInfos.length > 0)
? ListView.builder( ? ListView.builder(
itemCount: orderInfos != null ? orderInfos.length : 0, itemCount: orderInfos != null ? orderInfos.length : 0,
@ -156,7 +156,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
); );
}) })
: NoDataView( : NoDataView(
src: "assets/image/ding_dan.png", src: "assets/image/ding_dan.png",
isShowBtn: false, isShowBtn: false,
text: "目前暂无订单,快去下一单吧~", text: "目前暂无订单,快去下一单吧~",
fontSize: 16.sp, fontSize: 16.sp,
@ -193,7 +193,10 @@ class _OrderHistoryList extends State<OrderHistoryList>
if (current == 1) { if (current == 1) {
orderInfos.clear(); orderInfos.clear();
} }
orderInfos.addAll(baseData.data.records); baseData.data.records.forEach((element) {
if((element.orderType == 0 || element.orderType == 1 ||element.orderType == 2 ||element.orderType == 3) && element.payStatus == 1 && element.refundStatus ==0)
orderInfos.add(element);
});
refreshController.refreshCompleted(); refreshController.refreshCompleted();
refreshController.loadComplete(); refreshController.loadComplete();
if (current * 10 > int.tryParse(baseData.data.total)) { if (current * 10 > int.tryParse(baseData.data.total)) {
@ -215,7 +218,8 @@ class _OrderHistoryList extends State<OrderHistoryList>
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
showLoading: true, showLoading: true,
context: context, token: value.getString("token")), context: context,
token: value.getString("token")),
queryOrder(), queryOrder(),
}); });
} }
@ -243,29 +247,34 @@ class _OrderHistoryList extends State<OrderHistoryList>
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
(orderInfo != null && orderInfo.orderType == 0) ? Container(): (orderInfo != null && orderInfo.orderType == 0)
Container( ? Container()
width: 19, : Container(
height: 21, width: 19,
margin: EdgeInsets.only(left: 12.w, top: 12.h), height: 21,
alignment: Alignment.center, margin: EdgeInsets.only(left: 12.w, top: 12.h),
decoration: BoxDecoration( alignment: Alignment.center,
color: Colors.white, decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2), color: Colors.white,
border: Border.all( borderRadius: BorderRadius.circular(2),
width: 1, border: Border.all(
color: Color(0xFF32A060), width: 1,
style: BorderStyle.solid, color: Color(0xFF32A060),
)), style: BorderStyle.solid,
child: Text( )),
(orderInfo != null && orderInfo.orderType == 7) ?"":"", child: Text(
style: TextStyle( (orderInfo != null && orderInfo.orderType == 1)
fontSize: 12.sp, ? ""
fontWeight: FontWeight.bold, : ((orderInfo != null && orderInfo.orderType == 2)
color: Color(0xFF32A060), ? ""
), : ""),
), style: TextStyle(
), fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF32A060),
),
),
),
Container( Container(
width: 19, width: 19,
height: 21, height: 21,
@ -276,7 +285,11 @@ class _OrderHistoryList extends State<OrderHistoryList>
borderRadius: BorderRadius.circular(2), borderRadius: BorderRadius.circular(2),
), ),
child: Text( child: Text(
(orderInfo != null && orderInfo.isTakeOut == 0) ? "" : ((orderInfo != null && orderInfo.isTakeOut == 1) ? "" : ""), (orderInfo != null && orderInfo.isTakeOut == 0)
? ""
: ((orderInfo != null && orderInfo.isTakeOut == 1)
? ""
: ""),
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -436,7 +449,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
), ),
TextSpan( TextSpan(
// text: totalPrice(orderInfo), // text: totalPrice(orderInfo),
text:orderInfo.finalPayPrice, text: orderInfo.finalPayPrice,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -562,7 +575,8 @@ class _OrderHistoryList extends State<OrderHistoryList>
payResult(BaseData baseData) {} payResult(BaseData baseData) {}
orderCancel(String orderId) async { orderCancel(String orderId) async {
BaseData baseData = await apiService.orderCancel(orderId).catchError((onError) {}); BaseData baseData =
await apiService.orderCancel(orderId).catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("订单取消成功"); SmartDialog.showToast("订单取消成功");
_onRefresh(); _onRefresh();

9
lib/retrofit/data/activity_actRecord_details.dart

@ -9,13 +9,15 @@ class ActivityActRecordDetails {
ActRecord actRecord, ActRecord actRecord,
List<ActRecordJoinList> actRecordJoinList, List<ActRecordJoinList> actRecordJoinList,
ActProduct actProduct, ActProduct actProduct,
dynamic skuName, dynamic skuName,
String skuId,
bool isBargain, bool isBargain,
int successNumber}){ int successNumber}){
_actRecord = actRecord; _actRecord = actRecord;
_actRecordJoinList = actRecordJoinList; _actRecordJoinList = actRecordJoinList;
_actProduct = actProduct; _actProduct = actProduct;
_skuName = skuName; _skuName = skuName;
_skuId = skuId;
_isBargain = isBargain; _isBargain = isBargain;
_successNumber = successNumber; _successNumber = successNumber;
@ -31,6 +33,7 @@ class ActivityActRecordDetails {
} }
_actProduct = json['actProduct'] != null ? ActProduct.fromJson(json['actProduct']) : null; _actProduct = json['actProduct'] != null ? ActProduct.fromJson(json['actProduct']) : null;
_skuName = json['skuName']; _skuName = json['skuName'];
_skuId = json['skuId'];
_isBargain = json['isBargain']; _isBargain = json['isBargain'];
_successNumber = json['successNumber']; _successNumber = json['successNumber'];
} }
@ -38,6 +41,7 @@ class ActivityActRecordDetails {
List<ActRecordJoinList> _actRecordJoinList; List<ActRecordJoinList> _actRecordJoinList;
ActProduct _actProduct; ActProduct _actProduct;
dynamic _skuName; dynamic _skuName;
String _skuId;
bool _isBargain; bool _isBargain;
int _successNumber; int _successNumber;
@ -45,6 +49,7 @@ class ActivityActRecordDetails {
List<ActRecordJoinList> get actRecordJoinList => _actRecordJoinList; List<ActRecordJoinList> get actRecordJoinList => _actRecordJoinList;
ActProduct get actProduct => _actProduct; ActProduct get actProduct => _actProduct;
dynamic get skuName => _skuName; dynamic get skuName => _skuName;
String get skuId => _skuId;
bool get isBargain => _isBargain; bool get isBargain => _isBargain;
int get successNumber => _successNumber; int get successNumber => _successNumber;
@ -59,7 +64,7 @@ class ActivityActRecordDetails {
if (_actProduct != null) { if (_actProduct != null) {
map['actProduct'] = _actProduct.toJson(); map['actProduct'] = _actProduct.toJson();
} }
map['skuName'] = _skuName; map['skuId'] = _skuId;
map['isBargain'] = _isBargain; map['isBargain'] = _isBargain;
map['successNumber'] = _successNumber; map['successNumber'] = _successNumber;
return map; return map;

8
lib/retrofit/data/activity_order_list.dart

@ -13,7 +13,8 @@
class ActivityOrderList { class ActivityOrderList {
ActivityOrderList({ ActivityOrderList({
String storeName, String storeName,
String storeId,
String joinTime, String joinTime,
String productImg, String productImg,
String productName, String productName,
@ -27,6 +28,7 @@ class ActivityOrderList {
dynamic bargainMoney, dynamic bargainMoney,
dynamic howManyMoney,}){ dynamic howManyMoney,}){
_storeName = storeName; _storeName = storeName;
_storeId = storeId;
_joinTime = joinTime; _joinTime = joinTime;
_productImg = productImg; _productImg = productImg;
_productName = productName; _productName = productName;
@ -43,6 +45,7 @@ class ActivityOrderList {
ActivityOrderList.fromJson(dynamic json) { ActivityOrderList.fromJson(dynamic json) {
_storeName = json['storeName']; _storeName = json['storeName'];
_storeId = json['storeId'];
_joinTime = json['joinTime']; _joinTime = json['joinTime'];
_productImg = json['productImg']; _productImg = json['productImg'];
_productName = json['productName']; _productName = json['productName'];
@ -57,6 +60,7 @@ class ActivityOrderList {
_howManyMoney = json['howManyMoney']; _howManyMoney = json['howManyMoney'];
} }
String _storeName; String _storeName;
String _storeId;
String _joinTime; String _joinTime;
String _productImg; String _productImg;
String _productName; String _productName;
@ -71,6 +75,7 @@ class ActivityOrderList {
dynamic _howManyMoney; dynamic _howManyMoney;
String get storeName => _storeName; String get storeName => _storeName;
String get storeId => _storeId;
String get joinTime => _joinTime; String get joinTime => _joinTime;
String get productImg => _productImg; String get productImg => _productImg;
String get productName => _productName; String get productName => _productName;
@ -87,6 +92,7 @@ class ActivityOrderList {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final map = <String, dynamic>{}; final map = <String, dynamic>{};
map['storeName'] = _storeName; map['storeName'] = _storeName;
map['storeId'] = _storeId;
map['joinTime'] = _joinTime; map['joinTime'] = _joinTime;
map['productImg'] = _productImg; map['productImg'] = _productImg;
map['productName'] = _productName; map['productName'] = _productName;

29
lib/settlement/settlement_view/distribution.dart

@ -26,7 +26,7 @@ class DistributionMode extends StatefulWidget {
final String pageType; final String pageType;
DistributionMode(this.queryOrderInfo, this.queryAddress, this.storeInfo, DistributionMode(this.queryOrderInfo, this.queryAddress, this.storeInfo,
this.address, this.selectedNewAddress,this.pageType); this.address, this.selectedNewAddress, this.pageType);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -154,10 +154,13 @@ class _DistributionMode extends State<DistributionMode> {
flex: 1, flex: 1,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
setState(() { if (widget.pageType != null) {
selectedBtn = 1; SmartDialog.showToast("该功能暂未开放!",
widget.queryAddress(selectedBtn); alignment: Alignment.center);
}); return;
}
selectedBtn = 1;
widget.queryAddress(selectedBtn);
}, },
child: Container( child: Container(
height: 50.h, height: 50.h,
@ -177,6 +180,11 @@ class _DistributionMode extends State<DistributionMode> {
flex: 1, flex: 1,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
if (widget.pageType != null) {
selectedBtn = 2;
widget.queryAddress(selectedBtn);
return;
}
SmartDialog.showToast("该功能暂未开放!", SmartDialog.showToast("该功能暂未开放!",
alignment: Alignment.center); alignment: Alignment.center);
}, },
@ -308,11 +316,17 @@ class _DistributionMode extends State<DistributionMode> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Image.asset( (widget.pageType != null) ?
Icon(
Icons.local_shipping,
color: Color(0xFF727272),
size: 24,
):Image.asset(
"assets/image/icon_permission_location.png", "assets/image/icon_permission_location.png",
height: 24.h, height: 24.h,
width: 24.w, width: 24.w,
), ),
SizedBox(width: 5),
Text( Text(
widget?.address?.username ?? "", widget?.address?.username ?? "",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
@ -351,7 +365,8 @@ class _DistributionMode extends State<DistributionMode> {
}); });
}, },
child: Container( child: Container(
padding:EdgeInsets.symmetric(horizontal:15.w,vertical: 5.h), padding: EdgeInsets.symmetric(
horizontal: 15.w, vertical: 5.h),
child: Icon( child: Icon(
Icons.keyboard_arrow_right, Icons.keyboard_arrow_right,
size: 24, size: 24,

20
lib/store/shopping/shopping_goods_details.dart

@ -497,7 +497,10 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
"actProductId":actProductId, "actProductId":actProductId,
"actProductSkuId":skuId1, "actProductSkuId":skuId1,
}, },
); ).then((value) {
_onRefresh();
setState(() {});
});
} }
/// ///
@ -507,7 +510,6 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
"actRecordId": launchJoinAct.actRecordId, "actRecordId": launchJoinAct.actRecordId,
"limitNumber":limitNumber, "limitNumber":limitNumber,
"storeInfo":storeInfo, "storeInfo":storeInfo,
"skuId":skuId1
}); });
} }
@ -734,7 +736,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
SmartDialog.showToast("请先选择您要购买的商品!~"); SmartDialog.showToast("请先选择您要购买的商品!~");
return; return;
} }
queryLaunchAct(); // queryLaunchAct();
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -771,7 +773,11 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
toDownOrder(); if (count1 == 0) {
SmartDialog.showToast("请先选择您要购买的商品!~");
return;
}
queryLaunchAct();
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -827,7 +833,11 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
toDownOrder(); if (count1 == 0) {
SmartDialog.showToast("请先选择您要购买的商品!~");
return;
}
queryLaunchAct();
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,

53
lib/store/shopping/shopping_home/bargain_details.dart

@ -46,7 +46,6 @@ class _BargainDetails extends State<BargainDetails> {
double bargainNum = 0; double bargainNum = 0;
LaunchJoinAct launchJoinAct; LaunchJoinAct launchJoinAct;
StoreInfo storeInfo; StoreInfo storeInfo;
String skuId;
@override @override
void dispose() { void dispose() {
@ -58,13 +57,14 @@ class _BargainDetails extends State<BargainDetails> {
} }
} }
@override @override
void initState() { void initState() {
super.initState(); super.initState();
actRecordId = widget.arguments["actRecordId"]; actRecordId = widget.arguments["actRecordId"];
limitNumber = widget.arguments["limitNumber"]; limitNumber = widget.arguments["limitNumber"];
storeInfo = widget.arguments["storeInfo"]; storeInfo = widget.arguments["storeInfo"];
skuId = widget.arguments["skuId"];
startCountdownTimer(); startCountdownTimer();
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
String minToken = value.getString("minToken"); String minToken = value.getString("minToken");
@ -128,47 +128,21 @@ class _BargainDetails extends State<BargainDetails> {
} }
} }
///
queryLaunchAct() async {
BaseData baseData = await minService.launchAct({
"actProductId": activityActRecordDetails.actRecord.actProductId,
"actRecordId": 0,
"actTemplateId": activityActRecordDetails.actRecord.actTemplateId,
"actTimeId": activityActRecordDetails.actRecord.actTimeId,
"addressId":"",
"isDirectBuy":true,
"getType": 1,
"productId":activityActRecordDetails.actProduct.productId,
"skuId": skuId,
"skuPrice": activityActRecordDetails.actProduct.promotionPrice,
"templateType": 3
}).catchError((error) {
refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
setState(() {
launchJoinAct = baseData.data;
toOrder();
refreshController.refreshCompleted();
});
} else {
refreshController.refreshFailed();
}
}
/// ///
toOrder() async { toOrder() async {
await Navigator.of(context).pushNamed( await Navigator.of(context).popAndPushNamed(
'/router/settlement', '/router/settlement',
arguments: { arguments: {
"storeInfo": storeInfo, "storeInfo": storeInfo,
"pageType": 3, "pageType": "3",
"isDirectBuy":true, "isDirectBuy":true,
"productId": activityActRecordDetails.actProduct.productId, "productId": activityActRecordDetails.actProduct.productId,
"skuId":skuId, "skuId":activityActRecordDetails.skuId,
"buyNum": 1, "buyNum": 1,
"skuValue1":activityActRecordDetails.skuName, "skuValue1":activityActRecordDetails.skuName,
"orderId":launchJoinAct.orderId "orderId":activityActRecordDetails.actRecordJoinList[0].orderId,
"actProductId":activityActRecordDetails.actProduct.id,
"actProductSkuId":activityActRecordDetails.skuId,
}, },
); );
} }
@ -566,7 +540,7 @@ class _BargainDetails extends State<BargainDetails> {
(activityActRecordDetails?.actRecord?.joinNum ?? 0)) (activityActRecordDetails?.actRecord?.joinNum ?? 0))
GestureDetector( GestureDetector(
onTap: (){ onTap: (){
queryLaunchAct(); toOrder();
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -594,6 +568,15 @@ class _BargainDetails extends State<BargainDetails> {
), ),
), ),
)), )),
if ((activityActRecordDetails?.actRecord?.state ?? 0) == 3)
Text(
"恭喜您砍价成功",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
),
if (limitNumber != if (limitNumber !=
(activityActRecordDetails?.actRecord?.joinNum ?? 0)) (activityActRecordDetails?.actRecord?.joinNum ?? 0))
GestureDetector( GestureDetector(

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

File diff suppressed because it is too large Load Diff

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

@ -8,6 +8,7 @@ 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:huixiang/view_widget/no_data_view.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';
@ -137,7 +138,14 @@ class _GroupPageDetails extends State<GroupPageDetails> {
62.h - 62.h -
MediaQuery.of(context).padding.top, 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: (actRecordAndJoinlDTOList == null || actRecordAndJoinlDTOList?.length == 0)
? NoDataView(
src:"assets/image/ding_dan.png",
isShowBtn: false,
text:"目前暂无参团列表,可下单发起拼团哦~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w),
):ListView.builder(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
itemCount: actRecordAndJoinlDTOList?.length ?? 0, itemCount: actRecordAndJoinlDTOList?.length ?? 0,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,

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

@ -12,6 +12,7 @@ import 'package:huixiang/view_widget/classic_header.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -661,6 +662,14 @@ class _SearchPage extends State<SearchPage> with AutomaticKeepAliveClientMixin,
], ],
), ),
SizedBox(height: 16.h), SizedBox(height: 16.h),
(productListBeans == null || productListBeans?.length == 0)
? NoDataView(
src:"assets/image/ding_dan.png",
isShowBtn: false,
text:"该关键词未搜索到相关商品~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w),
):
GridView.builder( GridView.builder(
itemCount:productListBeans?.length ?? 0, itemCount:productListBeans?.length ?? 0,
shrinkWrap: true, shrinkWrap: true,

3
lib/store/shopping/shopping_home/shopping_home_page.dart

@ -99,8 +99,9 @@ class _ShoppingHomePage extends State<ShoppingHomePage>
homeRecommendList.clear(); homeRecommendList.clear();
homeRecommendList.addAll(baseData.data); homeRecommendList.addAll(baseData.data);
}); });
}else {
refreshController.refreshFailed();
} }
EasyLoading.dismiss();
} }
_onRefresh(){ _onRefresh(){

Loading…
Cancel
Save