秒杀。京东bug,购物车bug

master
章文轩 4 years ago
parent c163f70f51
commit edd353fbf9

@ -1,3 +1,3 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
#include "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"

@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '9.3'
# platform :ios, '9.3'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

@ -473,6 +473,6 @@ SPEC CHECKSUMS:
webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44
PODFILE CHECKSUM: 80e178f7acd39d9ad7aacc7d6a4e9dea0cb945ea
PODFILE CHECKSUM: 8eecf180615377d7d7172e551af1ab922f54002e
COCOAPODS: 1.11.0

@ -133,6 +133,7 @@ class Data extends Object {
int brandId;
String goodsName;
String description;
@ -178,6 +179,7 @@ class Data extends Object {
Living living;
Seckill seckill;
int vendorId;
Data(
@ -207,7 +209,8 @@ class Data extends Object {
this.notice,
this.countryIcon,
this.living,
this.seckill
this.seckill,
this.vendorId
);
factory Data.fromJson(Map<String, dynamic> srcJson) =>

@ -77,6 +77,7 @@ Data _$DataFromJson(Map<String, dynamic> json) {
json['country_icon'],
json['living'] == null ? null : new Living.fromJson(json['living']),
json['sec_kill'] == null ? null : new Seckill.fromJson(json['sec_kill']),
json['vendorId'] as int,
);
}
@ -103,6 +104,7 @@ Map<String, dynamic> _$DataToJson(Data instance) => <String, dynamic>{
'country_icon': instance.countryIcon,
'living': instance.living,
'sec_kill':instance.seckill,
'vendorId':instance.vendorId
};
MainPhotos _$MainPhotosFromJson(Map<String, dynamic> json) {

@ -47,6 +47,8 @@ class Data {
int isFerme;
int storehouse;
String countryIcon;
int gysId;
SecKill secKill;
Data({
this.id,
this.goodsName,
@ -67,6 +69,8 @@ class Data {
this.isImport,
this.storehouse,
this.countryIcon,
this.gysId,
this.secKill
});
Data.fromJson(Map<String, dynamic> json) {
@ -88,6 +92,10 @@ class Data {
isFerme = json['isFerme'];
storehouse = json['storehouse'];
countryIcon = json['country_icon'];
gysId = json['gys_id'];
secKill = json['sec_kill'] != null
? new SecKill.fromJson(json['sec_kill'])
: null;
}
Map<String, dynamic> toJson() {
@ -107,6 +115,38 @@ class Data {
data['isFerme'] = this.isFerme;
data['storehouse'] = this.storehouse;
data['country_icon'] = this.countryIcon;
data['gys_id'] = this.gysId;
if (this.secKill != null) {
data['sec_kill'] = this.secKill.toJson();
}
return data;
}
}
class SecKill {
int secKill;
String secKillEndTime;
int secKillMinPrice;
int secKillCommission;
SecKill(
{this.secKill,
this.secKillEndTime,
this.secKillMinPrice,
this.secKillCommission});
SecKill.fromJson(Map<String, dynamic> json) {
secKill = json['sec_kill'];
secKillEndTime = json['sec_kill_end_time'];
secKillMinPrice = json['sec_kill_min_price'];
secKillCommission = json['sec_kill_commission'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['sec_kill'] = this.secKill;
data['sec_kill_end_time'] = this.secKillEndTime;
data['sec_kill_min_price'] = this.secKillMinPrice;
data['sec_kill_commission'] = this.secKillCommission;
return data;
}
}

@ -1,5 +1,7 @@
import 'package:recook/pages/home/promotion_time_tool.dart';
import 'goods_hot_sell_list_model.dart';
class GoodsSimpleListModel {
String code;
String msg;
@ -56,6 +58,7 @@ class GoodsSimple {
num gysId;
List<String> specialIcon;
String countryIcon;
SecKill secKill;
GoodsSimple(
{this.id,
this.goodsName,
@ -83,7 +86,8 @@ class GoodsSimple {
this.living,
this.gysId,
this.specialIcon,
this.countryIcon});
this.countryIcon,
this.secKill});
GoodsSimple.fromJson(Map<String, dynamic> json) {
id = json['id'];
@ -117,6 +121,9 @@ class GoodsSimple {
specialIcon =
json['spec_icon'] != null ? json['spec_icon'].cast<String>() : null;
countryIcon = json['country_icon'];
secKill = json['sec_kill'] != null
? new SecKill.fromJson(json['sec_kill'])
: null;
}
Map<String, dynamic> toJson() {
@ -150,6 +157,9 @@ class GoodsSimple {
data['gys_id'] = this.gysId;
data['spec_icon'] = this.specialIcon;
data['country_icon'] = this.countryIcon;
if (this.secKill != null) {
data['sec_kill'] = this.secKill.toJson();
}
return data;
}
@ -176,3 +186,4 @@ class Living {
return data;
}
}

@ -1,6 +1,7 @@
import 'package:flustars/flustars.dart';
import 'package:recook/pages/home/promotion_time_tool.dart';
import 'goods_hot_sell_list_model.dart';
import 'goods_simple_list_model.dart';
class PromotionGoodsListModel {
@ -126,6 +127,7 @@ class PromotionGoodsModel {
num gysId;
List<String> specialIcon;
String countryIcon;
SecKill secKill;
PromotionGoodsModel(
{this.goodsId,
@ -158,7 +160,8 @@ class PromotionGoodsModel {
this.specialSale,
this.gysId,
this.specialIcon,
this.countryIcon});
this.countryIcon,
this.secKill});
PromotionGoodsModel.fromJson(Map<String, dynamic> json) {
goodsId = json['goodsId'];
@ -197,6 +200,9 @@ class PromotionGoodsModel {
json['spec_icon'] != null ? json['spec_icon'].cast<String>() : null;
gysId = json['gys_id'];
countryIcon = json['country_icon'];
secKill = json['sec_kill'] != null
? new SecKill.fromJson(json['sec_kill'])
: null;
}
Map<String, dynamic> toJson() {
@ -236,6 +242,9 @@ class PromotionGoodsModel {
data['gys_id'] = this.gysId;
data['spec_icon'] = this.specialIcon;
data['country_icon'] = this.countryIcon;
if (this.secKill != null) {
data['sec_kill'] = this.secKill.toJson();
}
return data;
}

@ -42,8 +42,8 @@ class CommodityDetailPage extends StatefulWidget {
this.liveId = 0,
}) : super(key: key);
static setArguments(int goodsID, {int liveStatus, int roomId,int gysId,bool seckillout}) {
return {"goodsID": goodsID, 'liveStatus': liveStatus, 'roomId': roomId,'gysId':gysId,'seckillout':seckillout};
static setArguments(int goodsID, {int liveStatus, int roomId,bool seckillout}) {
return {"goodsID": goodsID, 'liveStatus': liveStatus, 'roomId': roomId,'seckillout':seckillout};
}
@override
@ -62,7 +62,7 @@ class _CommodityDetailPageState extends BaseStoreState<CommodityDetailPage>
GoodsDetailModel _goodsDetail;
int _liveStatus;
int _roomId;
num _gysId;
bool _seckillout;//
@ -72,8 +72,6 @@ class _CommodityDetailPageState extends BaseStoreState<CommodityDetailPage>
_goodsId = widget.arguments["goodsID"];
_liveStatus = widget.arguments["liveStatus"];
_roomId = widget.arguments["roomId"];
_gysId = widget.arguments["gysId"];
_seckillout = widget.arguments['seckillout']??false;
_tabController = TabController(length: 3, vsync: this);
@ -158,6 +156,7 @@ class _CommodityDetailPageState extends BaseStoreState<CommodityDetailPage>
child: CacheTabBarView(
controller: _tabController,
children: [
_goodsDetail!=null?
GoodsPage(
liveStatus: _liveStatus,
roomId: _roomId,
@ -172,7 +171,6 @@ class _CommodityDetailPageState extends BaseStoreState<CommodityDetailPage>
goodsId: _goodsId,
openSkuChoosePage: _openSkuChoosePage,
goodsDetail: _goodsDetail,
gysId: _gysId,
onScroll: (notification) {
// double maxScroll = notification.metrics.maxScrollExtent;
double offset = notification.metrics.pixels;
@ -185,7 +183,7 @@ class _CommodityDetailPageState extends BaseStoreState<CommodityDetailPage>
// _tabController.animateTo(1);
// }
},
),
):SizedBox(),
// DetailPage(
// goodsID: _goodsId,
// ),

@ -84,7 +84,6 @@ class GoodsPage extends StatefulWidget {
final int liveStatus;
final int roomId;
final num gysId;
const GoodsPage({
Key key,
@ -97,7 +96,6 @@ class GoodsPage extends StatefulWidget {
// this.liveId = 0,
this.liveStatus,
this.roomId,
this.gysId,
}) : super(key: key);
@override
@ -128,7 +126,7 @@ class _GoodsPageState extends BaseStoreState<GoodsPage> {
AddressDefaultModel _addressModel;
String _defaltAddress;
int _jDHaveGoods = -1;
int _seckillStatus = 0;// 0 1
// int _seckillStatus = 0;// 0 1
@override
bool get wantKeepAlive => true;
@ -136,8 +134,8 @@ class _GoodsPageState extends BaseStoreState<GoodsPage> {
@override
void initState() {
super.initState();
//gysid18002000
if (widget.gysId == 1800 || widget.gysId == 2000) {
//
if (widget.goodsDetail.data.vendorId == 1800 || widget.goodsDetail.data.vendorId == 2000) {
Future.delayed(Duration.zero, () async {
_addressList = await _getDefaultAddress();
if (_addressList != null) {
@ -156,12 +154,14 @@ class _GoodsPageState extends BaseStoreState<GoodsPage> {
});
}
}
//
});
}
});
}
//goodsDetail.data.vendorId18002000
GoodsDetailModelImpl.getDetailImages(widget.goodsId)
.then((GoodsDetailImagesModel model) {
if (model.code != HttpStatus.SUCCESS) {
@ -177,7 +177,7 @@ class _GoodsPageState extends BaseStoreState<GoodsPage> {
if (_context != null &&
widget.goodsDetail != null &&
widget.openSkuChoosePage.value) {
if (widget.gysId == 1800 || widget.gysId == 2000) {
if (widget.goodsDetail.data.vendorId == 1800 || widget.goodsDetail.data.vendorId == 2000) {
if (_jDHaveGoods == 1) {
_showSkuChoosePage(context);
} else {
@ -190,6 +190,7 @@ class _GoodsPageState extends BaseStoreState<GoodsPage> {
}
});
}
@override
@ -201,6 +202,7 @@ class _GoodsPageState extends BaseStoreState<GoodsPage> {
@override
Widget buildContext(BuildContext context, {store}) {
if (widget.goodsDetail != null) {
_skuCombinations();
_itemModels = _chooseValues();
}
@ -210,6 +212,8 @@ class _GoodsPageState extends BaseStoreState<GoodsPage> {
}
MediaQuery _buildBody(BuildContext context) {
_context = context;
return MediaQuery.removePadding(
key: myGlobals.scaffoldKey,
@ -245,6 +249,7 @@ class _GoodsPageState extends BaseStoreState<GoodsPage> {
}
List<Widget> _detailListWidget() {
List<Widget> children = [];
children.addAll(_goodHeadDetail());
children.addAll(_goodDetailImages());
@ -409,7 +414,7 @@ class _GoodsPageState extends BaseStoreState<GoodsPage> {
children: <Widget>[
_headPageView(),
GoodPriceView(
gysId: widget.gysId,
detailModel: widget.goodsDetail,
shareCallback: () {
String img = '';
@ -441,7 +446,7 @@ class _GoodsPageState extends BaseStoreState<GoodsPage> {
color: Colors.white,
child: _discountContent(context),
),
widget.gysId == 1800 || widget.gysId == 2000
widget.goodsDetail.data.vendorId == 1800 || widget.goodsDetail.data.vendorId == 2000
? Container(
margin: EdgeInsets.only(bottom: 13),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
@ -545,7 +550,7 @@ class _GoodsPageState extends BaseStoreState<GoodsPage> {
margin: EdgeInsets.only(top: 10),
child: GestureDetector(
onTap: () {
if (widget.gysId == 1800 || widget.gysId == 2000) {
if (widget.goodsDetail.data.vendorId == 1800 || widget.goodsDetail.data.vendorId == 2000) {
if (_jDHaveGoods == 1) {
_showSkuChoosePage(context);
} else {
@ -812,7 +817,7 @@ class _GoodsPageState extends BaseStoreState<GoodsPage> {
Expanded(
child: Row(
children: <Widget>[
widget.gysId == 1800
widget.goodsDetail.data.vendorId == 1800
? Text(
"京东仓发货 | ",
style: AppTextStyle.generate(13 * 2.sp,

@ -34,9 +34,26 @@ class BrandDetailGridItem extends StatelessWidget {
{Key key, this.goods, this.buyClick, this.onBrandClick})
: super(key: key);
static final Color colorGrey = Color(0xff999999);
@override
Widget build(BuildContext context) {
bool isSoldOut = goods.inventory <= 0 ? true : false;
bool sellout = false;
bool isSeckill = false;
if(this.goods.inventory>0){
sellout = false;
}else{
sellout = true;
}
if(this.goods.secKill!=null){
if(this.goods.secKill.secKill==1){
isSeckill = true;
sellout = true;
// seckill
}
}
double width = (MediaQuery.of(context).size.width - 10) / 2;
return ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(8)),
@ -63,7 +80,7 @@ class BrandDetailGridItem extends StatelessWidget {
Api.getResizeImgUrl(goods.mainPhotoUrl, 300)),
)),
Positioned(
child: isSoldOut
child: sellout
? ItemTagWidget.imageMaskWidget(
padding: 40, width: width - 80, height: width - 80)
: Container(),
@ -171,10 +188,20 @@ class BrandDetailGridItem extends StatelessWidget {
// Spacer(),
_saleNumberWidget(this.goods),
SizedBox(
height: 4 * 2.w,
height: 4.w,
),
Row(
children: [
isSeckill?Container(
alignment: Alignment.center,
child: Text(
"" + (this.goods.commission??0).toStringAsFixed(2),
style: TextStyle(
color: Color(0xFFC92219),
fontSize: 12 * 2.sp,
),
),
):
Text(
'¥${this.goods.originalPrice.toStringAsFixed(2)}',
style: TextStyle(
@ -270,7 +297,7 @@ class BrandDetailGridItem extends StatelessWidget {
child: CustomImageButton(
direction: Direction.horizontal,
height: 21,
title: this.goods.inventory <= 0 ? "已售完" : "自购",
title: sellout ? "已售完" : "自购",
style: TextStyle(
color: Colors.white,
fontSize: 13 * 2.sp,
@ -298,7 +325,7 @@ class BrandDetailGridItem extends StatelessWidget {
// : 0),
// topRight: Radius.circular(40),
// bottomRight: Radius.circular(40)),
backgroundColor: this.goods.inventory <= 0
backgroundColor: sellout
? AppColor.greyColor
: Color(0xFFC92219),
pureDisplay: true,
@ -317,11 +344,27 @@ class BrandDetailGridItem extends StatelessWidget {
}
_saleNumberWidget(GoodsSimple goods) {
bool sellout = false;
bool isSeckill = false;
if(this.goods.inventory>0){
sellout = false;
}else{
sellout = true;
}
if(this.goods.secKill!=null){
if(this.goods.secKill.secKill==1){
isSeckill = true;
sellout = true;
// seckill
}
}
return Container(
child: Stack(
children: <Widget>[
Row(
children: <Widget>[
isSeckill?SizedBox():
(goods.coupon != null && goods.coupon != 0)
? Container(
margin: EdgeInsets.only(right: 5),
@ -331,11 +374,16 @@ class BrandDetailGridItem extends StatelessWidget {
),
)
: SizedBox(),
isSeckill? Container(
padding: EdgeInsets.only(top:5.rw),
child: Image.asset(R.ASSETS_SECKILL_ICON_PNG,width: 69.rw,height: 20.rw,),
):
AppConfig.commissionByRoleLevel
? Container(
child: Stack(
alignment: Alignment.center,
children: <Widget>[
Container(
margin: EdgeInsets.symmetric(vertical: 2),
alignment: Alignment.center,
@ -354,6 +402,7 @@ class BrandDetailGridItem extends StatelessWidget {
),
),
),
AppConfig.getShowCommission()
? Container(
alignment: Alignment.center,
@ -383,7 +432,7 @@ class BrandDetailGridItem extends StatelessWidget {
buyClick();
} else {
AppRouter.push(context, RouteName.COMMODITY_PAGE,
arguments: CommodityDetailPage.setArguments(this.goods.id,gysId: this.goods.gysId));
arguments: CommodityDetailPage.setArguments(this.goods.id));
}
}

@ -188,7 +188,7 @@ class BrandLikeGridItem extends StatelessWidget {
TextSpan(
text: "券后 ¥ ",
style: AppTextStyle.generate(12 * 2.sp,
color: Color(0xFFFA6400),
color: Color(0xffc70404),
fontWeight: FontWeight.w500),
),
TextSpan(

@ -29,10 +29,9 @@ import 'package:recook/widgets/goods_item.dart';
class GoodPriceView extends StatefulWidget {
final GoodsDetailModel detailModel;
final VoidCallback shareCallback;
final gysId;
const GoodPriceView(
{Key key, this.detailModel, this.shareCallback, this.gysId})
{Key key, this.detailModel, this.shareCallback})
: super(key: key);
@override
@ -54,10 +53,7 @@ class _GoodPriceViewState extends State<GoodPriceView> {
if(widget.detailModel.data.seckill!=null){
_status = widget.detailModel.data.seckill.seckill_status;
_endTime = widget.detailModel.data.seckill.seckillEndTime;
print('--------------------');
print(DateTime.parse(_endTime));
print('--------------------');
_endTime= DateUtil.formatDate(DateTime.parse(_endTime), format: 'HH-mm-ss');
//_endTime= DateUtil.formatDate(DateTime.parse(_endTime), format: 'HH-mm-ss');
}
detailModel = widget.detailModel;
@ -75,7 +71,7 @@ class _GoodPriceViewState extends State<GoodPriceView> {
_detail(),
_label(),
//
widget.gysId == 1800 || widget.gysId == 2000 ?SizedBox(): _service() ,
widget.detailModel.data.vendorId == 1800 || widget.detailModel.data.vendorId == 2000 ?SizedBox(): _service() ,
],
);
}
@ -156,11 +152,10 @@ class _GoodPriceViewState extends State<GoodPriceView> {
"${_getDoubleText(minCommission)}-${_getDoubleText(maxCommission)}";
}
if(_status==1){
if(detailModel.data.sku != null && detailModel.data.sku.length > 0){
detailModel.data.sku.sort((left,right)=> left.discountPrice.compareTo(right.discountPrice));
price = detailModel.data.sku[0].discountPrice.toStringAsFixed(2);
commission = detailModel.data.sku[0].commission.toStringAsFixed(2);
}
price = detailModel.data.seckill.seckillMinPrice.toStringAsFixed(2)??'';
commission = detailModel.data.seckill.seckillCommission.toStringAsFixed(2)??'';
}
return _normalPriceWidget(
price, commission, originPrice, isTwoPrice, coupon);

@ -319,13 +319,16 @@ class _DetailBottomBarState extends State<DetailBottomBar> {
_twoButtonRow() {
String commission = '';
if(widget.goodsDetail != null){
if( widget.goodsDetail.data.seckill.seckill_status==1){
commission = widget.goodsDetail.data.seckill.seckillCommission.toStringAsFixed(2);
}else{
commission = widget.goodsDetail == null
? null
: widget.goodsDetail.data.price.min.commission.toStringAsFixed(2);
if(widget.goodsDetail.data.seckill!=null){
if( widget.goodsDetail.data.seckill.seckill_status==1){
commission = widget.goodsDetail.data.seckill.seckillCommission.toStringAsFixed(2);
}
}
}

@ -17,12 +17,12 @@ import 'package:recook/widgets/refresh_widget.dart';
import 'package:velocity_x/velocity_x.dart';
import 'cut_down_time_widget.dart';
import 'functions/SeckillFunctions.dart';
import 'model/SeckillModel.dart';
class SeckillActivityPage extends StatefulWidget {
final SeckillModel seckillModel;
SeckillActivityPage({
Key key, @required this.seckillModel,
Key key
}) : super(key: key);
@override
@ -36,6 +36,8 @@ class _SeckillActivityPageState extends State<SeckillActivityPage> {
String _endTime = '';
String _startTime = '';
num _peopleNum = 800;
SeckillModel _seckillModel;
GSRefreshController _refreshController =
GSRefreshController(initialRefresh: true);
@ -43,10 +45,7 @@ class _SeckillActivityPageState extends State<SeckillActivityPage> {
@override
void initState() {
super.initState();
_status = widget.seckillModel.status;
_endTime = widget.seckillModel.endTime;
_startTime = widget.seckillModel.startTime;
_peopleNum = widget.seckillModel.shoppingPeople;
}
@override
@ -91,41 +90,41 @@ class _SeckillActivityPageState extends State<SeckillActivityPage> {
bottom: _bottomWidgt(),
),
body: Container(
// decoration: BoxDecoration(
// gradient: LinearGradient(
// begin: Alignment.topCenter,
// end: Alignment.bottomCenter,
// colors: [
// Color(0xFFD5101A),
// Color(0x03FE2E39),
// ],
// stops: [0.0, 0.5],
// )),
child: _listWidget(),
),
);
body: RefreshWidget(
controller: _refreshController,
noData: '抱歉,没有找到商品',
onRefresh: () async {
_seckillModel = await SeckillFunc.getSeckillList();
if(_seckillModel!=null){
_status =_seckillModel.status;
_endTime = _seckillModel.endTime;
_startTime = _seckillModel.startTime;
_peopleNum = _seckillModel.shoppingPeople;
setState(() {});
}
_refreshController.refreshCompleted();
},
body: _listWidget()));
}
_listWidget() {
return Container(
child: widget.seckillModel.seckillGoodsList!=null?
return _seckillModel!=null?
ListView.builder(
itemBuilder: (_, index) {
return GestureDetector(
onTap: () {
AppRouter.push(context, RouteName.COMMODITY_PAGE,
arguments: CommodityDetailPage.setArguments(
widget.seckillModel.seckillGoodsList[index].goodsId));
_seckillModel.seckillGoodsList[index].goodsId));
},
child: _itemWidget(widget.seckillModel.seckillGoodsList[index]),
child: _itemWidget(_seckillModel.seckillGoodsList[index]),
);
},
itemCount: widget.seckillModel.seckillGoodsList.length,
):noDataView('没有找到商品'),
);
itemCount: _seckillModel.seckillGoodsList.length,
):noDataView('没有找到商品');
}
noDataView(String text, {Widget icon}) {
return Container(
@ -170,7 +169,7 @@ class _SeckillActivityPageState extends State<SeckillActivityPage> {
},
buildCtx: context,
model: data,
seckillModel: widget.seckillModel,
seckillModel: _seckillModel,
),
],
),

@ -72,8 +72,8 @@ class _ShoppingCartItemState extends State<ShoppingCartItem> {
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
!widget.model.isAllWaitPromotionStart() || widget.isEdit
? CustomImageButton(
// !widget.model.isAllWaitPromotionStart() || widget.isEdit?
CustomImageButton(
icon: Icon(
widget.model.selected
? AppIcons.icon_check_circle
@ -98,8 +98,8 @@ class _ShoppingCartItemState extends State<ShoppingCartItem> {
});
setState(() {});
},
)
: Container(),
),
// : Container(),
Container(
width: rSize(6),
),

@ -76,6 +76,7 @@ class _ShoppingCartPageState extends BaseStoreState<ShoppingCartPage>
_controller = MvpListViewController();
_selectedGoods = [];
_presenter.getShoppingCartList(UserManager.instance.user.info.id);
UserManager.instance.refreshShoppingCart.addListener(_refreshShoppingCart);
@ -308,13 +309,15 @@ class _ShoppingCartPageState extends BaseStoreState<ShoppingCartPage>
_checkAll = !_checkAll;
_selectedGoods.clear();
//
//
//
_controller.getData().forEach((brand) {
brand.selected = _checkAll;
brand.children.forEach((goods) {
if (_checkAll) {
if(goods.publishStatus!=0){//
_selectedGoods.add(goods);
}
}
goods.selected = _checkAll;
});
});

@ -509,11 +509,12 @@ class _OrderListItemState extends State<OrderListItem> {
borderRadius: BorderRadius.circular(2),
color: Color(0xffeff1f6),
),
constraints: BoxConstraints(maxWidth: 150.rw),//
padding: const EdgeInsets.symmetric(
vertical: 3, horizontal: 6),
child: Text(
"${goods.skuName}",
maxLines: 3,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: AppTextStyle.generate(11 * 2.sp,
color: Colors.grey[600],

@ -577,6 +577,7 @@ abstract class OrderDetailState<T extends StatefulWidget>
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
constraints: BoxConstraints(maxWidth: 150.rw),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: Color(0xffeff1f6),
@ -585,7 +586,7 @@ abstract class OrderDetailState<T extends StatefulWidget>
vertical: 3, horizontal: 6),
child: Text(
goods.skuName,
maxLines: 3,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: AppTextStyle.generate(11 * 2.sp,
color: Colors.grey[600],

@ -138,11 +138,10 @@ class _SettingItemListViewState extends ResumableState<SettingItemListView> {
//
SCTile.normalTile("秒杀(临时)", listener: () async {
SeckillModel seckillModel = new SeckillModel();
seckillModel = await SeckillFunc.getSeckillList();
if(seckillModel!=null){
Get.to(() => SeckillActivityPage(seckillModel:seckillModel));
}
Get.to(() => SeckillActivityPage());
//CRoute.push(context, PrivacyPageV2());
}),

@ -32,7 +32,7 @@ class _LaunchWidgetState extends BaseStoreState<LaunchWidget>
@override
void initState() {
super.initState();
PowerLogger.start(context, debug: AppConfig.debug);
PowerLogger.start(context, debug: true);//
WidgetsBinding.instance.addPostFrameCallback((callback) async {
await Future.delayed(Duration(milliseconds: 2450));
if (HiveStore.appBox.get('privacy_init') == null) {

@ -8,6 +8,7 @@ import 'package:recook/constants/header.dart';
import 'package:recook/manager/user_manager.dart';
import 'package:recook/models/goods_detail_model.dart';
import 'package:recook/models/goods_hot_sell_list_model.dart';
import 'package:recook/models/goods_simple_list_model.dart';
import 'package:recook/models/promotion_goods_list_model.dart';
@ -16,8 +17,6 @@ import 'package:recook/pages/home/classify/commodity_detail_page.dart';
import 'package:recook/pages/home/classify/mvp/goods_detail_model_impl.dart';
import 'package:recook/pages/home/promotion_time_tool.dart';
import 'package:recook/pages/seckill_activity/model/SeckillModel.dart';
import 'package:recook/pages/seckill_activity/model/SeckillModel.dart';
import 'package:recook/pages/seckill_activity/model/SeckillModel.dart';
import 'package:recook/utils/share_tool.dart';
import 'package:recook/utils/user_level_tool.dart';
import 'package:recook/widgets/custom_cache_image.dart';
@ -69,6 +68,7 @@ class GoodsItemWidget extends StatelessWidget {
final GifController gifController;
final num gysId;
final SeckillModel seckillModel;
final SecKill secKill;
const GoodsItemWidget({
@ -98,7 +98,7 @@ class GoodsItemWidget extends StatelessWidget {
this.specialIcon,
this.type,
this.countryIcon,
this.living, this.gifController, this.gysId, this.seckillModel,
this.living, this.gifController, this.gysId, this.seckillModel, this.secKill,
//this.special_sale,
}) : widgetType = GoodsItemType.NONE,
super(key: key);
@ -137,6 +137,8 @@ class GoodsItemWidget extends StatelessWidget {
countryIcon = model.countryIcon,
living = model.living,
gysId = model.gysId,
secKill = model.secKill,
//secKill = model.
super(key: key);
///Hot List
@ -152,7 +154,7 @@ class GoodsItemWidget extends StatelessWidget {
this.specialSale,
this.specialIcon,
this.type,
this.living, this.gifController, this.gysId, this.seckillModel,
this.living, this.gifController, this.seckillModel,
}) : goodsName = data.goodsName,
brandName = data.brandName,
brandPictureUrl = data.brandImg,
@ -172,6 +174,8 @@ class GoodsItemWidget extends StatelessWidget {
widgetType = GoodsItemType.HOT_LIST,
isImport = data.isImport,
countryIcon = data.countryIcon,
gysId = data.gysId,
secKill = data.secKill,
super(key: key);
///
@ -184,7 +188,7 @@ class GoodsItemWidget extends StatelessWidget {
@required this.buyClick,
PromotionGoodsModel model,
this.notShowAmount = false,
this.type, this.gifController, this.gysId, this.seckillModel,
this.type, this.gifController, this.seckillModel,
}) : goodsName = model.goodsName,
brandName = model.brandName,
brandPictureUrl = model.brandImg,
@ -205,6 +209,8 @@ class GoodsItemWidget extends StatelessWidget {
specialIcon = model.specialIcon,
countryIcon = model.countryIcon,
living = model.living,
gysId = model.gysId,
secKill = model.secKill,
super(key: key);
//
@ -220,7 +226,7 @@ class GoodsItemWidget extends StatelessWidget {
this.notShowAmount = false,
this.specialSale,
this.type, this.gifController,this.originalPrice, this.percent, this.coupon,this.isImport, this.specialIcon, this.promotionStatus, this.living, this.gysId,
this.type, this.gifController,this.originalPrice, this.percent, this.coupon,this.isImport, this.specialIcon, this.promotionStatus, this.living, this.gysId, this.secKill,
//this.special_sale,
}) : goodsName = model.goodsName,
brandName = model.brandName,
@ -492,6 +498,26 @@ class GoodsItemWidget extends StatelessWidget {
// }
_image() {
bool sellout = false;
if(this.widgetType == GoodsItemType.SECKILL){
if(this.salesVolume>=this.inventory){
sellout = true;
}else{
sellout = false;
}
}else{
if(this.inventory>0){
sellout = false;
}else{
sellout = true;
}
if(this.secKill!=null){
if(secKill.secKill==1){
sellout = true;
// seckill
}
}
}
double cir = 5;
return Container(
width: _height - 8,
@ -523,7 +549,7 @@ class GoodsItemWidget extends StatelessWidget {
left: 0,
bottom: 0,
child: Offstage(
offstage: this.inventory > 0&&(this.salesVolume<this.inventory||this.widgetType != GoodsItemType.SECKILL),
offstage: !sellout,
child: Container(
color: Colors.black38,
child: Center(
@ -651,8 +677,38 @@ class GoodsItemWidget extends StatelessWidget {
_inventoryView() {
//
bool seckillout = this.salesVolume>=this.inventory&&this.widgetType == GoodsItemType.SECKILL;
bool sellout = this.inventory <= 0;
// bool seckillout = this.salesVolume>=this.inventory&&(this.widgetType == GoodsItemType.SECKILL);
// bool sellout = this.inventory <= 0;
bool sellout = false;
bool isSeckill = false;
if(this.widgetType == GoodsItemType.SECKILL){
if(this.seckillModel!=null){
if(seckillModel.status==2){
isSeckill = true;// 2
}
else{
isSeckill = false;
}
}
if(this.salesVolume>=this.inventory){
sellout = true;
}else{
sellout = false;
}
}else{
if(this.inventory>0){
sellout = false;
}else{
sellout = true;
}
if(this.secKill!=null){
if(secKill.secKill==1){
isSeckill = true;
sellout = true;
// seckill
}
}
}
Color priceColor = Color(0xffc70404);
return Container(
height: 20 * 2.h,
@ -678,7 +734,7 @@ class GoodsItemWidget extends StatelessWidget {
children: [
ExtendedText.rich(TextSpan(children: [
TextSpan(
text: widgetType == GoodsItemType.SECKILL? "秒杀 ¥ ": "券后 ¥ ",
text: isSeckill&&this.widgetType == GoodsItemType.SECKILL? "秒杀 ¥ ": isSeckill&&this.widgetType != GoodsItemType.SECKILL?'¥':"券后 ¥ ",
style: AppTextStyle.generate(12 * 2.sp,
color: priceColor, fontWeight: FontWeight.w500),
),
@ -698,7 +754,7 @@ class GoodsItemWidget extends StatelessWidget {
width: 5,
)),
TextSpan(
text: widgetType == GoodsItemType.SECKILL?'':"¥${this.originalPrice.toStringAsFixed(0)}",
text: isSeckill?'':"¥${this.originalPrice.toStringAsFixed(0)}",
style: TextStyle(
decoration: TextDecoration.lineThrough,
decorationColor: Color(0xff898989),
@ -708,7 +764,7 @@ class GoodsItemWidget extends StatelessWidget {
)
])),
AppConfig.getShowCommission()&&this.widgetType==GoodsItemType.SECKILL
AppConfig.getShowCommission()&&(isSeckill)
? Container(
alignment: Alignment.center,
child: Text(
@ -807,7 +863,7 @@ class GoodsItemWidget extends StatelessWidget {
direction: Direction.horizontal,
height: 21,
//
title: sellout||seckillout ? "已售完" : "自购",
title: sellout?"已售完" : "自购",
style: TextStyle(
color: Colors.white,
@ -838,7 +894,7 @@ class GoodsItemWidget extends StatelessWidget {
// bottomRight: Radius.circular(40)),
backgroundColor:
//
sellout||seckillout ? AppColor.greyColor : _shareTextColor,
sellout? AppColor.greyColor : _shareTextColor,
pureDisplay: true,
),
@ -906,11 +962,34 @@ class GoodsItemWidget extends StatelessWidget {
// }
_saleNumberWidget() {
bool isSeckill = false;
if(this.widgetType == GoodsItemType.SECKILL){
if(this.seckillModel!=null){
if(seckillModel.status==2){
isSeckill = true;// 2
}
else{
isSeckill = false;
}
}
}else{
if(this.secKill!=null){
if(secKill.secKill==1){
isSeckill = true;
// seckill
}else{
isSeckill = false;
}
}
}
return Container(
child: Stack(
children: <Widget>[
Row(
children: <Widget>[
isSeckill?SizedBox():
(this.coupon != null && this.coupon != 0)
? Container(
margin: EdgeInsets.only(right: 5),
@ -920,7 +999,7 @@ class GoodsItemWidget extends StatelessWidget {
),
)
: SizedBox(),
this.widgetType==GoodsItemType.SECKILL?
isSeckill?
Container(
child: Image.asset(R.ASSETS_SECKILL_ICON_PNG,width: 69.rw,height: 20.rw,),
):
@ -1037,15 +1116,34 @@ class GoodsItemWidget extends StatelessWidget {
}
_buyEvent() {
bool seckillout = this.salesVolume>=this.inventory&&this.widgetType == GoodsItemType.SECKILL;
bool sellout = false;
if(this.widgetType == GoodsItemType.SECKILL){
if(this.salesVolume>=this.inventory){
sellout = true;
}else{
sellout = false;
}
}else{
if(this.inventory>0){
sellout = false;
}else{
sellout = true;
}
if(this.secKill!=null){
if(secKill.secKill==1){
sellout = true;
// seckill
}
}
}
if (buyClick != null) {
buyClick();
} else {
AppRouter.push(buildCtx, RouteName.COMMODITY_PAGE,
arguments: CommodityDetailPage.setArguments(
this.id,
gysId: gysId,
seckillout:seckillout
seckillout:sellout
// liveStatus: living == null ? null : living.status,
// roomId: living == null ? null : living.roomId
));

Loading…
Cancel
Save