Browse Source

动态发布更新;

商城活动商品选规格;
我的页面我的砍价秒杀订单列表详情;
zyh
w-R 3 years ago
parent
commit
715caaa401
  1. 2
      lib/community/release_dynamic.dart
  2. 2
      lib/mine/user_info_page.dart
  3. 113
      lib/order/bargain_group_order.dart
  4. 44
      lib/retrofit/data/activity_order_list.dart
  5. 2
      lib/retrofit/min_api.g.dart
  6. 2
      lib/retrofit/retrofit_api.dart
  7. 6
      lib/retrofit/retrofit_api.g.dart
  8. 1
      lib/store/shopping/activity_prefecture_details.dart
  9. 69
      lib/store/shopping/shopping_goods_details.dart
  10. 45
      lib/store/shopping/shopping_home/group_details.dart
  11. 22
      pubspec.lock
  12. 8
      pubspec.yaml

2
lib/community/release_dynamic.dart

@ -196,6 +196,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
BaseData<UploadResult> baseData = await apiService.upload( BaseData<UploadResult> baseData = await apiService.upload(
File(thumbnail), File(thumbnail),
123123123, 123123123,
dynamicType == 2
); );
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
UploadResult uploadResult = baseData.data; UploadResult uploadResult = baseData.data;
@ -207,6 +208,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
BaseData<UploadResult> baseData = await apiService.upload( BaseData<UploadResult> baseData = await apiService.upload(
file, file,
123123123, 123123123,
dynamicType == 2
); );
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
UploadResult uploadResult = baseData.data; UploadResult uploadResult = baseData.data;

2
lib/mine/user_info_page.dart

@ -356,7 +356,7 @@ class _UserInfoPage extends State<UserInfoPage> {
/// ///
fileUpload() async { fileUpload() async {
if (filePath != null && filePath != "" && await File(filePath).exists()) { if (filePath != null && filePath != "" && await File(filePath).exists()) {
BaseData<UploadResult> baseData = await apiService.upload(File(filePath), 123123123).catchError((onError) {}); BaseData<UploadResult> baseData = await apiService.upload(File(filePath), 123123123,false).catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
UploadResult uploadResult = baseData.data; UploadResult uploadResult = baseData.data;
modifyInfo["headimg"] = uploadResult.url; modifyInfo["headimg"] = uploadResult.url;

113
lib/order/bargain_group_order.dart

@ -2,9 +2,11 @@ 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:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.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/exchange_order.dart'; import 'package:huixiang/retrofit/data/exchange_order.dart';
import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/min_api.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';
@ -37,6 +39,9 @@ class _BargainGroupOrder extends State<BargainGroupOrder>
super.initState(); super.initState();
} }
///
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
@ -118,24 +123,55 @@ class ExchangeHistoryList extends StatefulWidget {
} }
class _ExchangeHistoryList extends State<ExchangeHistoryList> { class _ExchangeHistoryList extends State<ExchangeHistoryList> {
ApiService apiService; MinApiService minService;
List<ActivityOrderList> activityOrderList = [];
RefreshController _refreshController = RefreshController _refreshController =
RefreshController(initialRefresh: false); RefreshController(initialRefresh: false);
@override @override
void initState() { void initState() {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) {
apiService = ApiService(Dio(), String minToken = value.getString("minToken");
context: context, token: value.getString('token')), String tenant = value.getString("tenant");
}); String storeId = value.getString("storeId");
minService = MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
);
queryShowMyActList();
});
}
queryShowMyActList() async {
BaseData<List<ActivityOrderList>> baseData =
await minService.showMyActList({
"state":0,
"type" :1,
}).catchError((error) {
_refreshController.loadFailed();
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
_refreshController.refreshCompleted();
setState(() {
activityOrderList.clear();
if(baseData.data.length > 0)
activityOrderList.addAll(baseData.data);
});
} else {
_refreshController.refreshFailed();
}
} }
int pageNum = 1; // int pageNum = 1;
_refresh() { _refresh() {
pageNum = 1; // pageNum = 1;
queryShowMyActList();
} }
@override @override
@ -151,21 +187,20 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
), ),
controller: _refreshController, controller: _refreshController,
onRefresh: _refresh, onRefresh: _refresh,
// onLoading: queryHistory, onLoading: queryShowMyActList,
child: child:
// orders == null || orders.length == 0 (activityOrderList?.length ?? 0) < 0
// ? NoDataView( ? NoDataView(
// isShowBtn: false, isShowBtn: false,
// text: "还没有订单,快去下一单吧~", text: "还没有订单,快去下一单吧~",
// fontSize: 16.sp, fontSize: 16.sp,
// margin: EdgeInsets.only(top: 120.h), margin: EdgeInsets.only(top: 120.h),
// ) )
// : :
ListView.builder( ListView.builder(
// itemCount: orders == null ? 0 : orders.length, itemCount: activityOrderList?.length ?? 0,
itemCount: 5,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return bargainOrder(); return bargainOrder(activityOrderList[position]);
}, },
), ),
); );
@ -187,7 +222,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
return orderStatus; return orderStatus;
} }
Widget bargainOrder() { Widget bargainOrder(ActivityOrderList activityOrderList) {
return Container( return Container(
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 8.h), margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 8.h),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -235,8 +270,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
margin: EdgeInsets.only(left: 6.w, top: 12.h), margin: EdgeInsets.only(left: 6.w, top: 12.h),
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text( child: Text(
// (orderInfo != null) ? orderInfo.storeName : "", activityOrderList?.storeName ?? "",
"一心回乡商城",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14.sp, fontSize: 14.sp,
@ -260,7 +294,8 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
// orderInfo.sendStatus, // orderInfo.sendStatus,
// orderInfo.isTakeOut) // orderInfo.isTakeOut)
// : "", // : "",
"还差¥23.4砍价成功", // "还差¥{activityOrderList?.howManyMoney ?? ""}砍价成功",
"还差${activityOrderList?.howManyMore ?? 0}人拼团成功",
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -286,7 +321,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
S.of(context).xiadanshijian_("下单时间:2020.01.20 10:50:22"), S.of(context).xiadanshijian_(activityOrderList?.joinTime ?? ""),
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 10.sp,
color: Color(0xFF727272), color: Color(0xFF727272),
@ -302,18 +337,13 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// MImage( MImage(
// "", activityOrderList?.productImg ?? "",
// width: 81.w, width: 81.w,
// height: 81.h, height: 81.h,
// fit: BoxFit.cover, fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.png", errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png", fadeSrc: "assets/image/default_1.png",
// ),
Image.asset(
"assets/image/icon_story_td.png",
width: 81,
height: 81,
), ),
SizedBox( SizedBox(
width: 10, width: 10,
@ -324,7 +354,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"[生态小农]山林放养鸡蛋30枚/盒", activityOrderList?.storeName ?? "",
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
@ -334,7 +364,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
), ),
), ),
Text( Text(
"套盒装", activityOrderList?.productSkuName ?? "",
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 10.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
@ -357,7 +387,8 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
TextSpan( TextSpan(
children: [ children: [
TextSpan( TextSpan(
text: "已砍至:", // text: "已砍至:",
text: S.of(context).heji,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -365,7 +396,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
), ),
), ),
TextSpan( TextSpan(
text: "58.2", text:activityOrderList?.orderSum ?? "0",
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,

44
lib/retrofit/data/activity_order_list.dart

@ -3,9 +3,11 @@
/// productImg : "https://pos.upload.gznl.top/1179/2021/11/e50b00a1-09a2-4bab-b71f-e26e80006459.png" /// productImg : "https://pos.upload.gznl.top/1179/2021/11/e50b00a1-09a2-4bab-b71f-e26e80006459.png"
/// productName : "无花果礼盒" /// productName : "无花果礼盒"
/// productSkuName : "" /// productSkuName : ""
/// actRecordstate : 4 /// actRecordId : "1479399513473941504"
/// actRecordJoinState : null /// actRecordState : 4
/// howManyMore : null /// actRecordJoinState : false
/// howManyMore : 2
/// orderSum : null
/// bargainMoney : null /// bargainMoney : null
/// howManyMoney : null /// howManyMoney : null
@ -16,9 +18,11 @@ class ActivityOrderList {
String productImg, String productImg,
String productName, String productName,
String productSkuName, String productSkuName,
int actRecordstate, String actRecordId,
dynamic actRecordJoinState, int actRecordState,
dynamic howManyMore, bool actRecordJoinState,
int howManyMore,
dynamic orderSum,
dynamic bargainMoney, dynamic bargainMoney,
dynamic howManyMoney,}){ dynamic howManyMoney,}){
_storeName = storeName; _storeName = storeName;
@ -26,9 +30,11 @@ class ActivityOrderList {
_productImg = productImg; _productImg = productImg;
_productName = productName; _productName = productName;
_productSkuName = productSkuName; _productSkuName = productSkuName;
_actRecordstate = actRecordstate; _actRecordId = actRecordId;
_actRecordState = actRecordState;
_actRecordJoinState = actRecordJoinState; _actRecordJoinState = actRecordJoinState;
_howManyMore = howManyMore; _howManyMore = howManyMore;
_orderSum = orderSum;
_bargainMoney = bargainMoney; _bargainMoney = bargainMoney;
_howManyMoney = howManyMoney; _howManyMoney = howManyMoney;
} }
@ -39,9 +45,11 @@ class ActivityOrderList {
_productImg = json['productImg']; _productImg = json['productImg'];
_productName = json['productName']; _productName = json['productName'];
_productSkuName = json['productSkuName']; _productSkuName = json['productSkuName'];
_actRecordstate = json['actRecordstate']; _actRecordId = json['actRecordId'];
_actRecordState = json['actRecordState'];
_actRecordJoinState = json['actRecordJoinState']; _actRecordJoinState = json['actRecordJoinState'];
_howManyMore = json['howManyMore']; _howManyMore = json['howManyMore'];
_orderSum = json['orderSum'];
_bargainMoney = json['bargainMoney']; _bargainMoney = json['bargainMoney'];
_howManyMoney = json['howManyMoney']; _howManyMoney = json['howManyMoney'];
} }
@ -50,9 +58,11 @@ class ActivityOrderList {
String _productImg; String _productImg;
String _productName; String _productName;
String _productSkuName; String _productSkuName;
int _actRecordstate; String _actRecordId;
dynamic _actRecordJoinState; int _actRecordState;
dynamic _howManyMore; bool _actRecordJoinState;
int _howManyMore;
dynamic _orderSum;
dynamic _bargainMoney; dynamic _bargainMoney;
dynamic _howManyMoney; dynamic _howManyMoney;
@ -61,9 +71,11 @@ class ActivityOrderList {
String get productImg => _productImg; String get productImg => _productImg;
String get productName => _productName; String get productName => _productName;
String get productSkuName => _productSkuName; String get productSkuName => _productSkuName;
int get actRecordstate => _actRecordstate; String get actRecordId => _actRecordId;
dynamic get actRecordJoinState => _actRecordJoinState; int get actRecordState => _actRecordState;
dynamic get howManyMore => _howManyMore; bool get actRecordJoinState => _actRecordJoinState;
int get howManyMore => _howManyMore;
dynamic get orderSum => _orderSum;
dynamic get bargainMoney => _bargainMoney; dynamic get bargainMoney => _bargainMoney;
dynamic get howManyMoney => _howManyMoney; dynamic get howManyMoney => _howManyMoney;
@ -74,9 +86,11 @@ class ActivityOrderList {
map['productImg'] = _productImg; map['productImg'] = _productImg;
map['productName'] = _productName; map['productName'] = _productName;
map['productSkuName'] = _productSkuName; map['productSkuName'] = _productSkuName;
map['actRecordstate'] = _actRecordstate; map['actRecordId'] = _actRecordId;
map['actRecordState'] = _actRecordState;
map['actRecordJoinState'] = _actRecordJoinState; map['actRecordJoinState'] = _actRecordJoinState;
map['howManyMore'] = _howManyMore; map['howManyMore'] = _howManyMore;
map['orderSum'] = _orderSum;
map['bargainMoney'] = _bargainMoney; map['bargainMoney'] = _bargainMoney;
map['howManyMoney'] = _howManyMoney; map['howManyMoney'] = _howManyMoney;
return map; return map;

2
lib/retrofit/min_api.g.dart

@ -561,7 +561,7 @@ class _MinApiService implements MinApiService {
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{}); _data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('actTemplate/launchAct', final _result = await _dio.request<Map<String, dynamic>>('actTemplate/showMyActList',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'POST', method: 'POST',

2
lib/retrofit/retrofit_api.dart

@ -165,7 +165,7 @@ abstract class ApiService {
@POST("/file/upload") @POST("/file/upload")
@MultiPart() @MultiPart()
Future<BaseData<UploadResult>> upload( Future<BaseData<UploadResult>> upload(
@Part(name: "file") File data, @Part(name: "folderId") int folderId); @Part(name: "file") File data, @Part(name: "folderId") int folderId,bool isVideo);
/// ///
@GET( @GET(

6
lib/retrofit/retrofit_api.g.dart

@ -17,15 +17,17 @@ class _ApiService implements ApiService {
String baseUrl; String baseUrl;
@override @override
Future<BaseData<UploadResult>> upload(data, folderId) async { Future<BaseData<UploadResult>> upload(data, folderId,bool isVideo) async {
ArgumentError.checkNotNull(data, 'data'); ArgumentError.checkNotNull(data, 'data');
ArgumentError.checkNotNull(folderId, 'folderId'); ArgumentError.checkNotNull(folderId, 'folderId');
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = FormData(); final _data = FormData();
String fileName = data.path.split(Platform.pathSeparator).last; String fileName = data.path.split(Platform.pathSeparator).last;
if(!fileName.contains(".jpeg") && !fileName.contains(".mp4") && !fileName.contains(".png")) if(!isVideo && !fileName.contains(".jpeg") && !fileName.contains(".png"))
fileName += ".jpeg"; fileName += ".jpeg";
else if(isVideo && !fileName.contains(".mp4"))
fileName += ".mp4";
_data.files.add(MapEntry( _data.files.add(MapEntry(
'file', 'file',
MultipartFile.fromFileSync(data.path, MultipartFile.fromFileSync(data.path,

1
lib/store/shopping/activity_prefecture_details.dart

@ -632,6 +632,7 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
'/router/shopping_goods_details', '/router/shopping_goods_details',
arguments: { arguments: {
"actProductId": productList[position].id, "actProductId": productList[position].id,
"productId":productList[position].productId,
"type":pageType, "type":pageType,
"storeId": storeId, "storeId": storeId,
"tenant": tenant, "tenant": tenant,

69
lib/store/shopping/shopping_goods_details.dart

@ -13,21 +13,15 @@ import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/activity_details.dart'; 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/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';
import 'package:huixiang/retrofit/data/user_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/retrofit/retrofit_api.dart';
import 'package:huixiang/store/store_view/product_sku.dart'; import 'package:huixiang/store/store_view/product_sku.dart';
import 'package:huixiang/store/store_view/store_order_list.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_footer.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:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -67,15 +61,16 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
List<Activity> activitys; List<Activity> activitys;
ProductSkuVOListBean productSku; ProductSkuVOListBean productSku;
String actProductId; String actProductId;
String productId;
String pageType = "1"; String pageType = "1";
ActivityDetails activityDetails; ActivityDetails activityDetails;
int limitNumber = 0; int limitNumber = 0;
int limitTime = 0; int limitTime = 0;
String bannerImg; String bannerImg;
// String pName; String pName;
// String pid; String pid;
// String cName; String cName;
// String cid; String cid;
bool isDispose = false; bool isDispose = false;
Timer _timer; Timer _timer;
String testTime = "2021-12-30 10:00:00"; String testTime = "2021-12-30 10:00:00";
@ -101,6 +96,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
limitNumber = widget.arguments["limitNumber"]; limitNumber = widget.arguments["limitNumber"];
limitTime = widget.arguments["limitTime"]; limitTime = widget.arguments["limitTime"];
bannerImg = widget.arguments["bannerImg"]; bannerImg = widget.arguments["bannerImg"];
productId =widget.arguments["productId"];
startCountdownTimer(); startCountdownTimer();
debugPrint("store_param tenant:$tenant storeId:$storeId"); debugPrint("store_param tenant:$tenant storeId:$storeId");
@ -144,10 +140,9 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
if (pageType == null) { if (pageType == null) {
queryMiNiDetail(id); queryMiNiDetail(id);
} else { } else {
queryMiNiDetail(productId);
queryViewProduct(actProductId, pageType); queryViewProduct(actProductId, pageType);
} }
EasyLoading.dismiss(); EasyLoading.dismiss();
} }
}); });
@ -363,6 +358,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
var callback = ((timer) { var callback = ((timer) {
if (isDispose) return; if (isDispose) return;
setState(() { setState(() {
if((activityDetails?.actRecordAndJoinlDTOList) != null)
activityDetails.actRecordAndJoinlDTOList.forEach((element) { activityDetails.actRecordAndJoinlDTOList.forEach((element) {
var tempDateTime = var tempDateTime =
DateTime.parse(element.actRecord.endTime).difference(DateTime.now()); DateTime.parse(element.actRecord.endTime).difference(DateTime.now());
@ -383,6 +379,44 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
_timer = Timer.periodic(oneSec, callback); _timer = Timer.periodic(oneSec, callback);
} }
///
toDownOrder() async {
// int num = count();
if (count1 == 0) {
SmartDialog.showToast("请先选择您要购买的商品!~");
return;
}
await Navigator.of(context).pushNamed(
'/router/settlement',
arguments: {
"storeInfo": storeInfo,
"tableId": tableId,
// "parentCode": parentCode,
// "parentId": parentId,
"pName":pName,
"pid":pid,
"cName":cName,
"cid":cid,
"shoppingCartSkuItemList": [
{
"buyNum": count1,
"id": skuId1,
"productId": miNiDetail.id,
"productName": miNiDetail.productName,
"skuName": skuValue1,
"storeId": storeId,
"skuPrice": productSku.skuPrice,
"skuStock": productSku.skuStock,
"tableId": tableId,
},
],
// "numberOfPeople": numberOfPeople,
},
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -420,6 +454,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
buildColumn(), buildColumn(),
/// ///
if (pageType == "1")
groupOption(), groupOption(),
/// ///
@ -602,7 +637,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
// toDownOrder(); toDownOrder();
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -1325,7 +1360,11 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
showStoreSelector(miNiDetail, id, 1); if(pageType == null){
showStoreSelector(miNiDetail, id, 1);
}else {
showStoreSelector(miNiDetail, productId, 1);
}
}); });
}, },
child: Icon( child: Icon(
@ -1519,7 +1558,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
), ),
Text( Text(
"剩余${(actRecordAndJoinlDTOList.actRecord.tempDay != 0)?actRecordAndJoinlDTOList.actRecord.tempDay : ""}:${actRecordAndJoinlDTOList.actRecord.tempHour}:${actRecordAndJoinlDTOList.actRecord.tempM}:${actRecordAndJoinlDTOList.actRecord.tempS}", "剩余${(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,

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

@ -39,6 +39,17 @@ class _GroupDetails extends State<GroupDetails> {
int tempM = 0; int tempM = 0;
int tempS = 0; int tempS = 0;
@override
void dispose() {
super.dispose();
if (refreshController != null) refreshController.dispose();
isDispose = true;
if (_timer != null) {
_timer.cancel();
}
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -70,7 +81,7 @@ class _GroupDetails extends State<GroupDetails> {
if (isDispose) return; if (isDispose) return;
setState(() { setState(() {
var tempDateTime = var tempDateTime =
DateTime.parse(activityActRecordDetails.actRecord.endTime).difference(DateTime.now()); DateTime.parse(activityActRecordDetails?.actRecord?.endTime).difference(DateTime.now());
if (tempDateTime.inSeconds < 0) { if (tempDateTime.inSeconds < 0) {
tempDay = 0; tempDay = 0;
tempHour = 0; tempHour = 0;
@ -104,12 +115,6 @@ class _GroupDetails extends State<GroupDetails> {
} }
} }
@override
void dispose() {
super.dispose();
if (refreshController != null) refreshController.dispose();
}
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
@override @override
@ -150,7 +155,9 @@ class _GroupDetails extends State<GroupDetails> {
header: MyHeader(), header: MyHeader(),
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
onRefresh: () { onRefresh: () {
setState(() {}); setState(() {
queryShowOneAct(actRecordId);
});
}, },
child: SingleChildScrollView( child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
@ -373,7 +380,8 @@ class _GroupDetails extends State<GroupDetails> {
height: 28, height: 28,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFD2D2D2), // color: Color(0xFFD2D2D2),
color: Color(0xFFF8961E),
borderRadius: BorderRadius.circular(4)), borderRadius: BorderRadius.circular(4)),
child: Text( child: Text(
tempDay.toString(), tempDay.toString(),
@ -392,7 +400,8 @@ class _GroupDetails extends State<GroupDetails> {
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Color(0xFFD2D2D2), // color: Color(0xFFD2D2D2),
color: Color(0xFFF8961E),
), ),
)), )),
], ],
@ -404,7 +413,8 @@ class _GroupDetails extends State<GroupDetails> {
height: 28, height: 28,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFD2D2D2), // color: Color(0xFFD2D2D2),
color: Color(0xFFF8961E),
borderRadius: BorderRadius.circular(4)), borderRadius: BorderRadius.circular(4)),
child: Text( child: Text(
tempHour.toString(), tempHour.toString(),
@ -423,7 +433,8 @@ class _GroupDetails extends State<GroupDetails> {
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Color(0xFFD2D2D2), // color: Color(0xFFD2D2D2),
color: Color(0xFFF8961E),
), ),
)), )),
InkWell( InkWell(
@ -433,7 +444,8 @@ class _GroupDetails extends State<GroupDetails> {
height: 28, height: 28,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFD2D2D2), // color: Color(0xFFD2D2D2),
color: Color(0xFFF8961E),
borderRadius: BorderRadius.circular(4)), borderRadius: BorderRadius.circular(4)),
child: Text( child: Text(
tempM.toString(), tempM.toString(),
@ -452,7 +464,8 @@ class _GroupDetails extends State<GroupDetails> {
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Color(0xFFD2D2D2), // color: Color(0xFFD2D2D2),
color: Color(0xFFF8961E),
), ),
)), )),
InkWell( InkWell(
@ -462,7 +475,8 @@ class _GroupDetails extends State<GroupDetails> {
height: 28, height: 28,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFD2D2D2), // color: Color(0xFFD2D2D2),
color: Color(0xFFF8961E),
borderRadius: BorderRadius.circular(4)), borderRadius: BorderRadius.circular(4)),
child: Text( child: Text(
tempS.toString(), tempS.toString(),
@ -608,6 +622,7 @@ class _GroupDetails extends State<GroupDetails> {
// ], // ],
// )), // )),
// ), // ),
//
// InkWell( // InkWell(
// onTap: () { // onTap: () {
// setState(() { // setState(() {

22
pubspec.lock

@ -482,7 +482,7 @@ packages:
name: path_provider_linux name: path_provider_linux
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.4" version: "2.1.5"
path_provider_platform_interface: path_provider_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -496,7 +496,7 @@ packages:
name: path_provider_windows name: path_provider_windows
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.4" version: "2.0.5"
pedantic: pedantic:
dependency: transitive dependency: transitive
description: description:
@ -629,7 +629,7 @@ packages:
name: shared_preferences_linux name: shared_preferences_linux
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.3" version: "2.0.4"
shared_preferences_macos: shared_preferences_macos:
dependency: transitive dependency: transitive
description: description:
@ -650,14 +650,14 @@ packages:
name: shared_preferences_web name: shared_preferences_web
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.2" version: "2.0.3"
shared_preferences_windows: shared_preferences_windows:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_windows name: shared_preferences_windows
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.3" version: "2.0.4"
sharesdk_plugin: sharesdk_plugin:
dependency: "direct main" dependency: "direct main"
description: description:
@ -743,12 +743,10 @@ packages:
tpns_flutter_plugin: tpns_flutter_plugin:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." name: tpns_flutter_plugin
ref: "V1.1.2" url: "https://pub.flutter-io.cn"
resolved-ref: b814d62f4b82422459f786671f23dd535062d503 source: hosted
url: "git://github.com/TencentCloud/TPNS-Flutter-Plugin" version: "1.0.8"
source: git
version: "1.1.2"
transformer_page_view: transformer_page_view:
dependency: transitive dependency: transitive
description: description:
@ -846,7 +844,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.5" version: "2.0.6"
wakelock: wakelock:
dependency: transitive dependency: transitive
description: description:

8
pubspec.yaml

@ -19,10 +19,10 @@ dependencies:
keframe: ^2.0.2 #滑动组件卡顿优化 keframe: ^2.0.2 #滑动组件卡顿优化
tpns_flutter_plugin: tpns_flutter_plugin: 1.0.8
git: # git:
url: git://github.com/TencentCloud/TPNS-Flutter-Plugin # url: git://github.com/TencentCloud/TPNS-Flutter-Plugin
ref: V1.1.2 # ref: V1.0.7
like_button: ^2.0.2 like_button: ^2.0.2
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2

Loading…
Cancel
Save