Browse Source

商城更改

zyh
w-R 3 years ago
parent
commit
5ab6129100
  1. 4
      lib/order/order_detail_page.dart
  2. 4
      lib/retrofit/min_api.dart
  3. 2
      lib/retrofit/min_api.g.dart
  4. 4
      lib/retrofit/retrofit_api.dart
  5. 2
      lib/retrofit/retrofit_api.g.dart
  6. 108
      lib/settlement/settlement.dart
  7. 15
      lib/settlement/settlement_model.dart
  8. 2
      lib/store/shopping/activity_prefecture_details.dart
  9. 625
      lib/store/shopping/shopping_goods_details.dart
  10. 78
      lib/store/shopping/shopping_home/bargain_details.dart
  11. 1
      lib/store/shopping/shopping_home/search_page.dart

4
lib/order/order_detail_page.dart

@ -350,9 +350,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
), ),
), ),
Text( Text(
S S.of(context).yuan_(orderInfo != null ? orderInfo.finalPayPrice : "0"),
.of(context)
.yuan_(orderInfo != null ? orderInfo.finalPayPrice : "0"),
style: TextStyle( style: TextStyle(
fontSize: 20.sp, fontSize: 20.sp,
color: Color(0xFF32A060), color: Color(0xFF32A060),

4
lib/retrofit/min_api.dart

@ -39,8 +39,8 @@ part 'min_api.g.dart';
// const baseUrl = "http://192.168.10.236:8765/app/";/// // const baseUrl = "http://192.168.10.236:8765/app/";///
const base_url = "http://192.168.10.66:8775/app/";/// const base_url = "http://192.168.10.96:8765/app/";///
const baseUrl = "http://192.168.10.66:8775/app/";/// const baseUrl = "http://192.168.10.96:8765/app/";///
// const base_url = "http://192.168.10.37:8766/app/"; // const base_url = "http://192.168.10.37:8766/app/";

2
lib/retrofit/min_api.g.dart

@ -9,7 +9,7 @@ part of 'min_api.dart';
class _MinApiService implements MinApiService { class _MinApiService implements MinApiService {
_MinApiService(this._dio, {this.baseUrl}) { _MinApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio'); ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://192.168.10.66:8775/app/'; baseUrl ??= 'http://192.168.10.96:8765/app/';
} }
final Dio _dio; final Dio _dio;

4
lib/retrofit/retrofit_api.dart

@ -71,8 +71,8 @@ part 'retrofit_api.g.dart';
// const baseUrl = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/";
const base_url = "http://192.168.10.66:8776/app/";/// const base_url = "http://192.168.10.96:8766/app/";///
const baseUrl = "http://192.168.10.66:8776/app/";/// const baseUrl = "http://192.168.10.96:8766/app/";///
@RestApi(baseUrl: baseUrl) @RestApi(baseUrl: baseUrl)
abstract class ApiService { abstract class ApiService {

2
lib/retrofit/retrofit_api.g.dart

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

108
lib/settlement/settlement.dart

@ -20,6 +20,7 @@ import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/data/wx_pay.dart'; import 'package:huixiang/retrofit/data/wx_pay.dart';
import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/settlement/settlement_model.dart';
import 'package:huixiang/settlement/settlement_view/activity_coupon_remarks.dart'; import 'package:huixiang/settlement/settlement_view/activity_coupon_remarks.dart';
import 'package:huixiang/settlement/settlement_view/distribution.dart'; import 'package:huixiang/settlement/settlement_view/distribution.dart';
import 'package:huixiang/settlement/settlement_view/pay_method.dart'; import 'package:huixiang/settlement/settlement_view/pay_method.dart';
@ -69,10 +70,14 @@ class _Settlement extends State<Settlement> {
String actProductId; String actProductId;
String actProductSkuId; String actProductSkuId;
ActivityDetails activityDetails; ActivityDetails activityDetails;
int bargainType = 0; BargainType bargainType = BargainType.BargainZBug;
LaunchJoinAct launchJoinAct; LaunchJoinAct launchJoinAct;
String skuPrice1; String skuPrice1;
int joinA = 0; JoinActivity joinA = JoinActivity.GoJoin;
String bargainOrderId;
String productSkuId;
int count1 = 0;
String productId;
@override @override
void initState() { void initState() {
@ -91,6 +96,10 @@ class _Settlement extends State<Settlement> {
bargainType = widget.arguments["bargainType"]; bargainType = widget.arguments["bargainType"];
skuPrice1 = widget.arguments["skuPrice1"]; skuPrice1 = widget.arguments["skuPrice1"];
joinA = widget.arguments["joinA"]; joinA = widget.arguments["joinA"];
bargainOrderId = widget.arguments["bargainOrderId"];
productSkuId = widget.arguments["productSkuId"];
count1 = widget.arguments["buyNum"];
productId = widget.arguments["productId"];
if (tableId == 0) { if (tableId == 0) {
placeOrder = true; placeOrder = true;
} }
@ -111,9 +120,11 @@ class _Settlement extends State<Settlement> {
selectedBtn, selectedBtn,
null, null,
0, 0,
widget.arguments["pid"], widget.arguments["pid"] ?? (productId?? ""),
productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1,
); );
} else if (coupons != null && coupons != "" || tableId <= 0) { } else if (coupons != null && coupons != "" || tableId <= 0) {
queryOrderInfo( queryOrderInfo(
@ -121,9 +132,11 @@ class _Settlement extends State<Settlement> {
selectedBtn, selectedBtn,
widget.arguments["cid"], widget.arguments["cid"],
0, 0,
null, productId?? null,
productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1,
); );
} else } else
queryOrderInfo( queryOrderInfo(
@ -131,9 +144,11 @@ class _Settlement extends State<Settlement> {
selectedBtn, selectedBtn,
null, null,
0, 0,
null, productId ?? "",
productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1,
); );
}); });
@ -150,8 +165,10 @@ class _Settlement extends State<Settlement> {
memberCouponId, memberCouponId,
orderId, orderId,
promotionId, promotionId,
productSkuId,
actProductId, actProductId,
actProductSkuId, actProductSkuId,
buyNum,
) async { ) async {
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({ BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({
"addressId": addressId, "addressId": addressId,
@ -159,8 +176,10 @@ class _Settlement extends State<Settlement> {
"memberCouponId": memberCouponId, "memberCouponId": memberCouponId,
"orderId": orderId, "orderId": orderId,
"promotionId": promotionId, "promotionId": promotionId,
"productSkuId":productSkuId,
"actProductId": actProductId, "actProductId": actProductId,
"actProductSkuId": actProductSkuId "actProductSkuId": actProductSkuId,
"buyNum":buyNum
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
@ -186,7 +205,7 @@ class _Settlement extends State<Settlement> {
minOrderInfo = baseData.data; minOrderInfo = baseData.data;
}); });
} else { } else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg ?? "", alignment: Alignment.center);
} }
} }
@ -200,9 +219,11 @@ class _Settlement extends State<Settlement> {
selectedBtn, selectedBtn,
null, null,
0, 0,
null, productId?? null,
productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1
); );
return; return;
} }
@ -252,9 +273,11 @@ class _Settlement extends State<Settlement> {
selectedBtn, selectedBtn,
null, null,
0, 0,
null, productId?? null,
productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1
); );
} }
} }
@ -276,9 +299,11 @@ class _Settlement extends State<Settlement> {
selectedBtn, selectedBtn,
null, null,
0, 0,
null, productId?? null,
productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1
); );
} }
} }
@ -288,32 +313,26 @@ class _Settlement extends State<Settlement> {
/// ///
queryLaunchAct() async { queryLaunchAct() async {
// if (minService == null)
// minService = MinApiService(
// Dio(),
// context: context,
// token: minToken,
// tenant: tenant,
// storeId: storeId,
// showLoading: false,
// );
BaseData baseData = await minService.launchAct({ BaseData baseData = await minService.launchAct({
"actProductId": activityDetails.actProduct.id, "actProductId": activityDetails.actProduct.id,
"actRecordId": 0, "actRecordId": 0,
"actTemplateId": activityDetails.actProduct.templateId, "actTemplateId": activityDetails.actProduct.templateId,
"actTimeId": activityDetails.actProduct.timeId, "actTimeId": activityDetails.actProduct.timeId,
"addressId": address == null ? null : address.id, "addressId": address == null ? null : address.id,
"isDirectBuy": (bargainType == 1 || bargainType == 2) ? false : true, "isDirectBuy": (bargainType == BargainType.BargainBug ||
bargainType == BargainType.CollageBug)
? false
: true,
"getType": selectedBtn, "getType": selectedBtn,
"productId": activityDetails.actProduct.productId, "productId": activityDetails.actProduct.productId,
"skuId": actProductSkuId ?? "", "skuId": actProductSkuId ?? "",
"skuPrice": skuPrice1, "skuPrice": settleOrderInfo.price,
"templateType": pageType, "templateType": pageType,
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
launchJoinAct = baseData.data; launchJoinAct = baseData.data;
if (bargainType == 1) { if (bargainType == BargainType.BargainBug) {
toBargain(); toBargain();
} else { } else {
activityPay(); activityPay();
@ -333,7 +352,10 @@ class _Settlement extends State<Settlement> {
"actTemplateId": activityDetails.actProduct.templateId, "actTemplateId": activityDetails.actProduct.templateId,
"actTimeId": activityDetails.actProduct.timeId, "actTimeId": activityDetails.actProduct.timeId,
"addressId": address == null ? null : address.id, "addressId": address == null ? null : address.id,
"isDirectBuy": (bargainType == 1 || bargainType == 2) ? false : true, "isDirectBuy": (bargainType == BargainType.BargainBug ||
bargainType == BargainType.CollageBug)
? false
: true,
"getType": selectedBtn, "getType": selectedBtn,
"productId": activityDetails.actProduct.productId, "productId": activityDetails.actProduct.productId,
"skuId": actProductSkuId ?? "", "skuId": actProductSkuId ?? "",
@ -517,7 +539,8 @@ class _Settlement extends State<Settlement> {
} }
} }
BaseData<WxPay> baseData = await minService.actPay({ BaseData<WxPay> baseData = await minService.actPay({
"orderId": launchJoinAct.orderId, "orderId":
bargainOrderId != null ? bargainOrderId : launchJoinAct.orderId,
"payChannel": placeOrderFirst.payChannel "payChannel": placeOrderFirst.payChannel
}).catchError((error) { }).catchError((error) {
print(error); print(error);
@ -541,18 +564,22 @@ class _Settlement extends State<Settlement> {
} }
} else { } else {
BaseData baseData = await minService.actPay({ BaseData baseData = await minService.actPay({
"orderId": launchJoinAct.orderId, "orderId":
bargainOrderId != null ? bargainOrderId : launchJoinAct.orderId,
"payChannel": payChannel "payChannel": payChannel
}).catchError((error) { }).catchError((error) {
print(error); print(error);
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
toOrderDetails(launchJoinAct.orderId); toOrderDetails(
bargainOrderId != null ? bargainOrderId : launchJoinAct.orderId);
} else { } else {
SmartDialog.show( SmartDialog.show(
widget: Tips( widget: Tips(
() { () {
toOrderDetails(launchJoinAct.orderId); toOrderDetails(bargainOrderId != null
? bargainOrderId
: launchJoinAct.orderId);
}, },
text: "${baseData.msg}", text: "${baseData.msg}",
)); ));
@ -627,9 +654,11 @@ class _Settlement extends State<Settlement> {
isTake, isTake,
memberCouponId, memberCouponId,
orderId, orderId,
promotionId, promotionId ?? (productId?? ""),
productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1
); );
}, queryAddress, storeInfo, address, }, queryAddress, storeInfo, address,
selectedAddress, pageType), selectedAddress, pageType),
@ -676,7 +705,8 @@ class _Settlement extends State<Settlement> {
tableId, tableId,
), ),
if (placeOrder) if (placeOrder &&
joinA != JoinActivity.BargainBug)
/// ///
PayMethod(payChannelCheck), PayMethod(payChannelCheck),
@ -718,7 +748,9 @@ class _Settlement extends State<Settlement> {
RoundButton( RoundButton(
width: 103.w, width: 103.w,
height: 54.h, height: 54.h,
text: placeOrder ? S.current.jiesuan : "下单", text: joinA == JoinActivity.BargainBug
? "发起砍价"
: (placeOrder ? S.current.jiesuan : "下单"),
textColor: Colors.white, textColor: Colors.white,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060), backgroup: Color(0xFF32A060),
@ -728,9 +760,11 @@ class _Settlement extends State<Settlement> {
), ),
callback: () { callback: () {
pageType != null pageType != null
? joinA == 0 ? bargainOrderId != null
? queryJoinAct() ? activityPay()
: queryLaunchAct() : joinA == JoinActivity.GoJoin
? queryJoinAct()
: queryLaunchAct()
: queryPlaceOrderFirst(); : queryPlaceOrderFirst();
}, },
), ),
@ -794,9 +828,11 @@ class _Settlement extends State<Settlement> {
selectedBtn, selectedBtn,
couponListBean != null ? couponListBean.id : null, couponListBean != null ? couponListBean.id : null,
0, 0,
null, productId?? null,
productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1
); );
} }
} }
@ -820,9 +856,11 @@ class _Settlement extends State<Settlement> {
selectedBtn, selectedBtn,
null, null,
0, 0,
promotion != null ? promotion.id : null, promotion != null ? promotion.id : (productId?? null),
productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1
); );
} }
} }

15
lib/settlement/settlement_model.dart

@ -0,0 +1,15 @@
enum BargainType {
BargainZBug,
BargainBug,
CollageBug,
}
enum JoinActivity {
GoJoin,
CollageBug,
CollageZBug,
BargainZBug,
MZBug,
MBug,
BargainBug,
}

2
lib/store/shopping/activity_prefecture_details.dart

@ -873,7 +873,7 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
color: Color(0xFFFFCD00), color: Color(0xFFFFCD00),
), ),
child: Text( child: Text(
"最高可砍${double.parse(productList?.productPrice ?? "0") - double.parse(productList?.promotionPrice ?? "0")}", "最高可砍${(double.parse(productList?.productPrice ?? "0") - double.parse(productList?.promotionPrice ?? "0")).toStringAsFixed(2)}",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,

625
lib/store/shopping/shopping_goods_details.dart

@ -18,6 +18,7 @@ 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/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/settlement/settlement_model.dart';
import 'package:huixiang/store/store_view/product_sku.dart'; import 'package:huixiang/store/store_view/product_sku.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';
@ -80,9 +81,9 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
int tempM = 0; int tempM = 0;
int tempS = 0; int tempS = 0;
LaunchJoinAct launchJoinAct; LaunchJoinAct launchJoinAct;
int bargainType = 0; BargainType bargainType = BargainType.BargainZBug;
String indexP; String indexP;
int joinA = 0; JoinActivity joinA = JoinActivity.GoJoin;
@override @override
void dispose() { void dispose() {
@ -105,8 +106,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
limitTime = widget.arguments["limitTime"]; limitTime = widget.arguments["limitTime"];
bannerImg = widget.arguments["bannerImg"]; bannerImg = widget.arguments["bannerImg"];
productId = widget.arguments["productId"]; productId = widget.arguments["productId"];
if (pageType == "1") startCountdownTimer();
startCountdownTimer();
debugPrint("store_param tenant:$tenant storeId:$storeId"); debugPrint("store_param tenant:$tenant storeId:$storeId");
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
@ -251,7 +251,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
} }
} }
/// // ///
// queryLaunchAct() async { // queryLaunchAct() async {
// if (minService == null) // if (minService == null)
// minService = MinApiService( // minService = MinApiService(
@ -270,7 +270,10 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
// "actTemplateId": activityDetails.actProduct.templateId, // "actTemplateId": activityDetails.actProduct.templateId,
// "actTimeId": activityDetails.actProduct.timeId, // "actTimeId": activityDetails.actProduct.timeId,
// "addressId": "", // "addressId": "",
// "isDirectBuy": (bargainType == 1 || bargainType == 2) ? false : true, // "isDirectBuy": (bargainType == BargainType.BargainBug ||
// bargainType == BargainType.CollageBug)
// ? false
// : true,
// "getType": 3, // "getType": 3,
// "productId": // "productId":
// pageType == null ? productId : activityDetails.actProduct.productId, // pageType == null ? productId : activityDetails.actProduct.productId,
@ -283,42 +286,12 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
// if (baseData != null && baseData.isSuccess) { // if (baseData != null && baseData.isSuccess) {
// setState(() { // setState(() {
// launchJoinAct = baseData.data; // launchJoinAct = baseData.data;
// toBargain(); // toBargain();
// refreshController.refreshCompleted(); // refreshController.refreshCompleted();
// }); // });
// } else { // } else {
// if((activityDetails?.actProduct?.productStock ?? 0) == 0) // if ((activityDetails?.actProduct?.productStock ?? 0) == 0)
// SmartDialog.showToast("活动商品售罄",alignment: Alignment.center); // SmartDialog.showToast("活动商品售罄", alignment: Alignment.center);
// refreshController.refreshFailed();
// }
// }
//
// ///
// queryJoinAct() async {
// BaseData baseData = await minService.joinAct({
// "actProductId": pageType == null
// ? miNiDetail.productSkuVOList[0].id
// : activityDetails.actProduct.id,
// "actRecordId": indexP,
// "actTemplateId": activityDetails.actProduct.templateId,
// "actTimeId": activityDetails.actProduct.timeId,
// "addressId": "",
// "isDirectBuy": pageType == "3" ? false : true,
// "getType": 1,
// "productId":
// pageType == null ? productId : activityDetails.actProduct.productId,
// "skuId": skuId1,
// "skuPrice": skuPrice1,
// "templateType": pageType,
// }).catchError((error) {
// refreshController.refreshFailed();
// });
// if (baseData != null && baseData.isSuccess) {
// launchJoinAct = baseData.data;
// toOrder();
// refreshController.refreshCompleted();
// } else {
// SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
// refreshController.refreshFailed(); // refreshController.refreshFailed();
// } // }
// } // }
@ -468,7 +441,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
if (isDispose) return; if (isDispose) return;
setState(() { setState(() {
var tempDateTime = var tempDateTime =
DateTime.parse(activityDetails.endTime).difference(DateTime.now()); DateTime.parse(activityDetails.endTime).difference(DateTime.now());
if (tempDateTime.inSeconds < 0) { if (tempDateTime.inSeconds < 0) {
tempDay = 0; tempDay = 0;
tempHour = 0; tempHour = 0;
@ -520,6 +493,23 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
); );
} }
///
toGoods() async {
if (count1 == 0) {
SmartDialog.showToast("请先选择您要购买的商品!~");
return;
}
await Navigator.of(context).pushNamed(
'/router/settlement',
arguments: {
"storeInfo": storeInfo,
"productId": miNiDetail.id,
"productSkuId": skuId1,
"buyNum": count1,
},
);
}
/// ///
toOrder() async { toOrder() async {
await Navigator.of(context).pushNamed( await Navigator.of(context).pushNamed(
@ -534,14 +524,13 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
"skuId": skuId1, "skuId": skuId1,
"buyNum": count1, "buyNum": count1,
"skuValue1": skuValue1, "skuValue1": skuValue1,
// "orderId": launchJoinAct.orderId,
"actProductId": actProductId, "actProductId": actProductId,
"actProductSkuId": skuId1, "actProductSkuId": skuId1,
"activityDetails":activityDetails, "activityDetails": activityDetails,
"bargainType":bargainType, "bargainType": bargainType,
"skuPrice1":skuPrice1, "skuPrice1": skuPrice1,
"joinA":joinA, "joinA": joinA,
"indexP":indexP "indexP": indexP
}, },
).then((value) { ).then((value) {
_onRefresh(); _onRefresh();
@ -549,15 +538,15 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
}); });
} }
/// // ///
toBargain() async { // toBargain() async {
await Navigator.of(context) // await Navigator.of(context)
.pushNamed('/router/bargain_details', arguments: { // .pushNamed('/router/bargain_details', arguments: {
"actRecordId": launchJoinAct.actRecordId, // "actRecordId": launchJoinAct.actRecordId,
"limitNumber": limitNumber, // "limitNumber": limitNumber,
"storeInfo": storeInfo, // "storeInfo": storeInfo,
}); // });
} // }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -631,7 +620,9 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
color: Colors.white, color: Colors.white,
margin: EdgeInsets.only(bottom: 72.h), margin: EdgeInsets.only(bottom: 72.h),
child: Html( child: Html(
data: pageType != null ? (activityDetails?.actProduct?.detail ?? "") : (miNiDetail?.detail ?? ""), data: pageType != null
? (activityDetails?.actProduct?.detail ?? "")
: (miNiDetail?.detail ?? ""),
customImageRenders: { customImageRenders: {
networkSourceMatcher(): networkImageRender( networkSourceMatcher(): networkImageRender(
loadingWidget: () { loadingWidget: () {
@ -777,11 +768,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
if (count1 == 0) { toGoods();
SmartDialog.showToast("请先选择您要购买的商品!~");
return;
}
// queryLaunchAct();
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -818,7 +805,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
joinA=4; joinA = JoinActivity.MZBug;
if (count1 == 0) { if (count1 == 0) {
SmartDialog.showToast("请先选择您要购买的商品!~"); SmartDialog.showToast("请先选择您要购买的商品!~");
return; return;
@ -879,7 +866,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
joinA=5; joinA = JoinActivity.MBug;
if (count1 == 0) { if (count1 == 0) {
SmartDialog.showToast("请先选择您要购买的商品!~"); SmartDialog.showToast("请先选择您要购买的商品!~");
return; return;
@ -951,8 +938,8 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
bargainType = 0; bargainType = BargainType.BargainZBug;
joinA=3; joinA = JoinActivity.BargainZBug;
if (count1 == 0) { if (count1 == 0) {
SmartDialog.showToast("请先选择您要购买的商品!~"); SmartDialog.showToast("请先选择您要购买的商品!~");
return; return;
@ -1013,7 +1000,8 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
bargainType = 1; bargainType = BargainType.BargainBug;
joinA = JoinActivity.BargainBug;
if (count1 == 0) { if (count1 == 0) {
SmartDialog.showToast("请先选择您要购买的商品!~"); SmartDialog.showToast("请先选择您要购买的商品!~");
return; return;
@ -1085,7 +1073,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
joinA = 2; joinA = JoinActivity.CollageZBug;
if (count1 == 0) { if (count1 == 0) {
SmartDialog.showToast("请先选择您要购买的商品!~"); SmartDialog.showToast("请先选择您要购买的商品!~");
return; return;
@ -1146,8 +1134,8 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
bargainType = 2; bargainType = BargainType.CollageBug;
joinA = 1; joinA = JoinActivity.CollageBug;
if (count1 == 0) { if (count1 == 0) {
SmartDialog.showToast("请先选择您要购买的商品!~"); SmartDialog.showToast("请先选择您要购买的商品!~");
return; return;
@ -1252,12 +1240,8 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.centerLeft, begin: Alignment.centerLeft,
end: Alignment.centerRight, end: Alignment.centerRight,
colors: [ colors: [Color(0xFF32A057), Color(0xFF61CE6B)])),
Color(0xFF32A057), child: Row(
Color(0xFF61CE6B)
])),
child:
Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@ -1276,7 +1260,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
text: pageType == null text: pageType == null
? (miNiDetail?.price ?? "") ? (miNiDetail?.price ?? "")
: (activityDetails?.actProduct?.promotionPrice ?? : (activityDetails?.actProduct?.promotionPrice ??
""), ""),
style: TextStyle( style: TextStyle(
fontSize: 28.sp, fontSize: 28.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
@ -1287,8 +1271,8 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
), ),
SizedBox(width: 4.w), SizedBox(width: 4.w),
Expanded(child: Expanded(
Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -1306,250 +1290,266 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
pageType == null pageType == null
? Text( ? Text(
"已售${miNiDetail?.sellCount ?? 0}", "已售${miNiDetail?.sellCount ?? 0}",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 10.sp,
color: Colors.white,
),
)
: (pageType == "1"
? Row(
children: [
Container(
margin: EdgeInsets.only(right: 2),
padding: EdgeInsets.only(left: 2, right: 2),
height: 15.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: Color(0xFFFFFFFF),
),
child: Text(
"${limitNumber ?? 0}人团",
style: TextStyle( style: TextStyle(
fontSize: 9.sp, fontWeight: MyFontWeight.medium,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF45B35F),
),
),
),
Text(
"已团${(activityDetails?.actProduct?.sellCount ?? 0)}",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 11.sp,
color: Colors.white,
),
),
],
)
: (pageType == "3"
? Row(
children: [
Container(
margin: EdgeInsets.only(right: 2),
padding:
EdgeInsets.only(left: 2, right: 2),
height: 15.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
color: Color(0xFFFFFFFF),
),
child: Text(
"最高可砍${double.parse(activityDetails?.actProduct?.productPrice ?? "0") - double.parse(activityDetails?.actProduct?.promotionPrice ?? "0")}",
style: TextStyle(
fontSize: 9.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF45B35F),
),
),
),
Text(
"已砍${(activityDetails?.actProduct?.sellCount ?? 0)}",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 11.sp,
color: Colors.white,
),
),
],
)
: Text(
"已秒${activityDetails?.actProduct?.sellCount ?? 0}",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 10.sp,
color: Colors.white,
),
)))
],
)),
pageType != null ?
(pageType == "2" ?
Row(
children: [
MImage(
activityDetails?.actProduct?.rightImg ?? "",
width:72,
height:30.h,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
Container(
width:91,
height:50,
color: Color(0xFFB1F6CD),
margin: EdgeInsets.only(left: 15),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"距离结束",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 10.sp, fontSize: 10.sp,
color: Color(0xFF32A060), color: Colors.white,
), ),
), )
SizedBox(height: 3), : (pageType == "1"
Row( ? Row(
mainAxisAlignment: MainAxisAlignment.center, children: [
crossAxisAlignment: CrossAxisAlignment.center, Container(
children: [ margin: EdgeInsets.only(right: 2),
InkWell( padding: EdgeInsets.only(left: 2, right: 2),
onTap: () { height: 15.h,
setState(() {}); alignment: Alignment.center,
}, decoration: BoxDecoration(
child: Container( borderRadius: BorderRadius.circular(2),
width: 13, color: Color(0xFFFFFFFF),
height: 14, ),
alignment: Alignment.center, child: Text(
decoration: BoxDecoration( "${limitNumber ?? 0}人团",
color: Color(0xFF32A060), style: TextStyle(
borderRadius: BorderRadius.circular(1)), fontSize: 9.sp,
child: Text( fontWeight: MyFontWeight.semi_bold,
tempDay.toString(), color: Color(0xFF45B35F),
style: TextStyle( ),
color: Colors.white,
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
), ),
), ),
), Text(
), "已团${(activityDetails?.actProduct?.sellCount ?? 0)}",
Padding(
padding: EdgeInsets.only(left: 2.w, right: 2.w),
child: Text(
":",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 10.sp,
color: Color(0xFF32A060),
),
),
),
InkWell(
onTap: () {
setState(() {});
},
child: Container(
width: 13,
height: 14,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(1)),
child: Text(
tempHour.toString(),
style: TextStyle( style: TextStyle(
color: Colors.white,
fontSize: 10.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
fontSize: 11.sp,
color: Colors.white,
), ),
), ),
), ],
), )
Padding( : (pageType == "3"
padding: EdgeInsets.only(left: 2.w, right: 2.w), ? Row(
child: Text( children: [
":", Container(
style: TextStyle( margin: EdgeInsets.only(right: 2),
fontWeight: MyFontWeight.medium, padding:
fontSize: 10.sp, EdgeInsets.only(left: 2, right: 2),
color: Color(0xFF32A060), height: 15.h,
), alignment: Alignment.center,
), decoration: BoxDecoration(
),InkWell( borderRadius:
onTap: () { BorderRadius.circular(2),
setState(() {}); color: Color(0xFFFFFFFF),
}, ),
child: Container( child: Text(
width: 13, "最高可砍${(double.parse(activityDetails?.actProduct?.productPrice ?? "0") - double.parse(activityDetails?.actProduct?.promotionPrice ?? "0")).toStringAsFixed(2)}",
height: 14, style: TextStyle(
alignment: Alignment.center, fontSize: 9.sp,
decoration: BoxDecoration( fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060), color: Color(0xFF45B35F),
borderRadius: BorderRadius.circular(1)), ),
child: Text( ),
tempM.toString(), ),
Text(
"已砍${(activityDetails?.actProduct?.sellCount ?? 0)}",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 11.sp,
color: Colors.white,
),
),
],
)
: Text(
"已秒${activityDetails?.actProduct?.sellCount ?? 0}",
style: TextStyle( style: TextStyle(
color: Colors.white,
fontSize: 10.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
fontSize: 10.sp,
color: Colors.white,
), ),
), )))
), ],
), )),
Padding( pageType != null
padding: EdgeInsets.only(left: 2.w, right: 2.w), ? (pageType == "2"
child: Text( ? Row(
":", children: [
style: TextStyle( MImage(
fontWeight: MyFontWeight.medium, activityDetails?.actProduct?.rightImg ?? "",
fontSize: 10.sp, width: 72,
color: Color(0xFF32A060), height: 30.h,
), fit: BoxFit.cover,
), errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
), ),
InkWell( Container(
onTap: () { width: 91,
setState(() {}); height: 50,
}, color: Color(0xFFB1F6CD),
child: Container( margin: EdgeInsets.only(left: 15),
width: 13, child: Column(
height: 14, mainAxisAlignment: MainAxisAlignment.center,
alignment: Alignment.center, crossAxisAlignment: CrossAxisAlignment.center,
decoration: BoxDecoration( children: [
color: Color(0xFF32A060), Text(
borderRadius: BorderRadius.circular(1)), "距离结束",
child: Text( style: TextStyle(
tempS.toString(), fontWeight: MyFontWeight.semi_bold,
style: TextStyle( fontSize: 10.sp,
color: Colors.white, color: Color(0xFF32A060),
fontSize: 10.sp, ),
fontWeight: MyFontWeight.medium,
), ),
), SizedBox(height: 3),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
InkWell(
onTap: () {
setState(() {});
},
child: Container(
width: 13,
height: 14,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius:
BorderRadius.circular(1)),
child: Text(
tempDay.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
),
),
),
),
Padding(
padding: EdgeInsets.only(
left: 2.w, right: 2.w),
child: Text(
":",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 10.sp,
color: Color(0xFF32A060),
),
),
),
InkWell(
onTap: () {
setState(() {});
},
child: Container(
width: 13,
height: 14,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius:
BorderRadius.circular(1)),
child: Text(
tempHour.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
),
),
),
),
Padding(
padding: EdgeInsets.only(
left: 2.w, right: 2.w),
child: Text(
":",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 10.sp,
color: Color(0xFF32A060),
),
),
),
InkWell(
onTap: () {
setState(() {});
},
child: Container(
width: 13,
height: 14,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius:
BorderRadius.circular(1)),
child: Text(
tempM.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
),
),
),
),
Padding(
padding: EdgeInsets.only(
left: 2.w, right: 2.w),
child: Text(
":",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 10.sp,
color: Color(0xFF32A060),
),
),
),
InkWell(
onTap: () {
setState(() {});
},
child: Container(
width: 13,
height: 14,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius:
BorderRadius.circular(1)),
child: Text(
tempS.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
),
),
),
),
],
)
],
), ),
), )
],) ],
],), )
) : Padding(
],):Padding(padding:EdgeInsets.only(right:16), padding: EdgeInsets.only(right: 16),
child: child: MImage(
MImage( activityDetails?.actProduct?.rightImg ?? "",
activityDetails?.actProduct?.rightImg ?? "", width: 72,
width:72, height: 30.h,
height:30.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", ),
),)) : Container(), ))
: Container(),
], ],
), ),
), ),
@ -1577,7 +1577,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
Container( Container(
margin: EdgeInsets.only(right: 8), margin: EdgeInsets.only(right: 8),
padding: EdgeInsets.only(left:3, right:3), padding: EdgeInsets.only(left: 3, right: 3),
height: 17.h, height: 17.h,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -1601,7 +1601,9 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
height: 8.h, height: 8.h,
), ),
Text( Text(
pageType == null ? (miNiDetail?.shortName ?? "") : (activityDetails?.actProduct?.shortName ?? ""), pageType == null
? (miNiDetail?.shortName ?? "")
: (activityDetails?.actProduct?.shortName ?? ""),
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
@ -1763,7 +1765,8 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
Expanded( Expanded(
child: Text( child: Text(
(skuValue1 ?? "请选择規格") + (count1 > 0 ? "x${count1}" : ""), (skuValue1 ?? "请选择規格") +
(count1 > 0 ? "x${count1.toInt()}" : ""),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
style: TextStyle( style: TextStyle(
@ -1981,7 +1984,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
joinA = 0; joinA = JoinActivity.GoJoin;
indexP = actRecordAndJoinlDTOList.actRecord.id; indexP = actRecordAndJoinlDTOList.actRecord.id;
if (count1 == 0) { if (count1 == 0) {
SmartDialog.showToast("请先选择您要购买的商品!~"); SmartDialog.showToast("请先选择您要购买的商品!~");

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

@ -134,14 +134,14 @@ class _BargainDetails extends State<BargainDetails> {
arguments: { arguments: {
"storeInfo": storeInfo, "storeInfo": storeInfo,
"pageType": "3", "pageType": "3",
"isDirectBuy":true, "isDirectBuy": true,
"productId": activityActRecordDetails.actProduct.productId, "productId": activityActRecordDetails.actProduct.productId,
"skuId":activityActRecordDetails.skuId, "skuId": activityActRecordDetails.skuId,
"buyNum": 1, "buyNum": 1,
"skuValue1":activityActRecordDetails.skuName, "skuValue1": activityActRecordDetails.skuName,
"orderId":activityActRecordDetails.actRecordJoinList[0].orderId, "bargainOrderId": activityActRecordDetails.actRecordJoinList[0].orderId,
"actProductId":activityActRecordDetails.actProduct.id, "actProductId": activityActRecordDetails.actProduct.id,
"actProductSkuId":activityActRecordDetails.skuId, "actProductSkuId": activityActRecordDetails.skuId,
}, },
); );
} }
@ -339,8 +339,8 @@ class _BargainDetails extends State<BargainDetails> {
color: Color(0xFF9476F7), color: Color(0xFF9476F7),
), ),
child: Text( child: Text(
(limitNumber != ((activityActRecordDetails?.actRecord?.joinNum ?? 0) !=
(activityActRecordDetails?.actRecord?.joinNum ?? 0)) (activityActRecordDetails?.successNumber ?? 0))
? "已砍${bargainNum.toStringAsFixed(2)}" ? "已砍${bargainNum.toStringAsFixed(2)}"
: "砍价成功", : "砍价成功",
style: TextStyle( style: TextStyle(
@ -535,37 +535,39 @@ class _BargainDetails extends State<BargainDetails> {
), ),
], ],
), ),
if ((activityActRecordDetails?.actRecord?.state ?? 0) == 1) if ((activityActRecordDetails?.actRecord?.joinNum ?? 0) ==
(activityActRecordDetails?.successNumber ?? 0) &&
(activityActRecordDetails?.actRecord?.state ?? 0) != 3)
GestureDetector( GestureDetector(
onTap: (){ onTap: () {
toOrder(); toOrder();
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
width: double.infinity, width: double.infinity,
height: 54.h, height: 54.h,
margin: EdgeInsets.only(left: 6.w), margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF9476F7), color: Color(0xFF9476F7),
borderRadius: BorderRadius.circular(27), borderRadius: BorderRadius.circular(27),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withAlpha(12), color: Colors.black.withAlpha(12),
offset: Offset(0, 3), offset: Offset(0, 3),
blurRadius: 14, blurRadius: 14,
spreadRadius: 0, spreadRadius: 0,
),
],
), ),
], child: Text(
), "立即购买",
child: Text( style: TextStyle(
"立即购买", fontSize: 16.sp,
style: TextStyle( fontWeight: MyFontWeight.medium,
fontSize: 16.sp, color: Colors.white,
fontWeight: MyFontWeight.medium, ),
color: Colors.white, ),
), )),
),
)),
if ((activityActRecordDetails?.actRecord?.state ?? 0) == 3) if ((activityActRecordDetails?.actRecord?.state ?? 0) == 3)
Text( Text(
"恭喜您砍价成功", "恭喜您砍价成功",
@ -575,8 +577,8 @@ class _BargainDetails extends State<BargainDetails> {
color: Colors.black, color: Colors.black,
), ),
), ),
if (limitNumber != if ((activityActRecordDetails?.actRecord?.joinNum ?? 0) !=
(activityActRecordDetails?.actRecord?.joinNum ?? 0)) (activityActRecordDetails?.successNumber ?? 0))
GestureDetector( GestureDetector(
child: Container( child: Container(
width: double.infinity, width: double.infinity,

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

@ -145,6 +145,7 @@ class _SearchPage extends State<SearchPage> with AutomaticKeepAliveClientMixin,
await minService.findMiNiGroupList({ await minService.findMiNiGroupList({
"id":widget.arguments["storeId"], "id":widget.arguments["storeId"],
"searchKey" :text, "searchKey" :text,
}).catchError((error) {
}).catchError((error) { }).catchError((error) {
refreshController.refreshFailed(); refreshController.refreshFailed();
}); });

Loading…
Cancel
Save