直播标签

master
章文轩 4 years ago
parent 629bba1f74
commit a3e9cd2a8a

@ -6,6 +6,8 @@ import 'package:recook/constants/header.dart';
import 'package:recook/models/base_model.dart'; import 'package:recook/models/base_model.dart';
import 'package:recook/models/price_model.dart'; import 'package:recook/models/price_model.dart';
import 'goods_simple_list_model.dart';
part 'goods_detail_model.g.dart'; part 'goods_detail_model.g.dart';
/* /*
@ -173,6 +175,7 @@ class Data extends Object {
num isFerme; num isFerme;
num storehouse; num storehouse;
String countryIcon; String countryIcon;
Living living;
Data( Data(
this.id, this.id,
@ -199,8 +202,8 @@ class Data extends Object {
this.isFerme, this.isFerme,
this.storehouse, this.storehouse,
this.notice, this.notice,
this.countryIcon this.countryIcon,
); this.living);
factory Data.fromJson(Map<String, dynamic> srcJson) => factory Data.fromJson(Map<String, dynamic> srcJson) =>
_$DataFromJson(srcJson); _$DataFromJson(srcJson);

@ -75,6 +75,7 @@ Data _$DataFromJson(Map<String, dynamic> json) {
? null ? null
: Notice.fromJson(json['notice'] as Map<String, dynamic>), : Notice.fromJson(json['notice'] as Map<String, dynamic>),
json['country_icon'], json['country_icon'],
json['living'] == null ? null : new Living.fromJson(json['living']),
); );
} }
@ -99,6 +100,7 @@ Map<String, dynamic> _$DataToJson(Data instance) => <String, dynamic>{
'isFavorite': instance.isFavorite, 'isFavorite': instance.isFavorite,
'shoppingTrolleyCount': instance.shoppingTrolleyCount, 'shoppingTrolleyCount': instance.shoppingTrolleyCount,
'country_icon': instance.countryIcon, 'country_icon': instance.countryIcon,
'living': instance.living,
}; };
MainPhotos _$MainPhotosFromJson(Map<String, dynamic> json) { MainPhotos _$MainPhotosFromJson(Map<String, dynamic> json) {

@ -73,10 +73,13 @@ class _GoodsReportPageState extends State<GoodsReportPage>
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(top: 10.rw), margin: EdgeInsets.only(top: 10.rw),
padding: EdgeInsets.only(top: 10.rw), padding: EdgeInsets.only(top: 10.rw),
child: (Column(
children: [
Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(6.rw))), borderRadius: BorderRadius.all(Radius.circular(6.rw))),
child: (Column( child: Column(
children: [ children: [
Row( Row(
children: [ children: [
@ -121,6 +124,9 @@ class _GoodsReportPageState extends State<GoodsReportPage>
return _tabItem(item, index); return _tabItem(item, index);
}).toList()), }).toList()),
), ),
],
),
),
Expanded( Expanded(
child: TabBarView( child: TabBarView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),

@ -243,7 +243,7 @@ class _GoodsReportWidgetPageState extends State<GoodsReportWidgetPage>
color: Color(0xFF2C5EB3), color: Color(0xFF2C5EB3),
aspectRato: 0.3, aspectRato: 0.3,
aboveStrokeWidth: 5.rw), aboveStrokeWidth: 5.rw),
30.hb, 40.hb,
Text( Text(
'', '',
style: TextStyle( style: TextStyle(
@ -260,7 +260,7 @@ class _GoodsReportWidgetPageState extends State<GoodsReportWidgetPage>
color: Color(0xFFC31B20), color: Color(0xFFC31B20),
aspectRato: 0.7, aspectRato: 0.7,
aboveStrokeWidth: 5.rw), aboveStrokeWidth: 5.rw),
30.hb, 40.hb,
Text( Text(
'', '',
style: TextStyle( style: TextStyle(

@ -18,14 +18,6 @@ class BarTableWidgetState extends State<BarTableWidget> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[ children: <Widget>[
Text(
'本周',
style: TextStyle(
color: Color(0xFF333333),
fontSize: 16,
),
textAlign: TextAlign.center,
),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
@ -151,6 +143,4 @@ class BarTableWidgetState extends State<BarTableWidget> {
], ],
); );
} }
} }

@ -51,49 +51,6 @@ class _ReportFormWidgetPagePageState extends State<ReportFormWidgetPage>
_buildListView() { _buildListView() {
return ListView( return ListView(
children: [ children: [
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10.rw),
padding: EdgeInsets.only(top: 10.rw),
height: 470.rw,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(6.rw))),
child: (Column(
children: [
Row(
children: [
Container(
width: 3.rw,
height: 15.rw,
color: Color(0xFF5484D8),
),
20.wb,
Text('产品参数',
style: TextStyle(
color: Color(0xFF333333),
fontSize: 16.rsp,
fontWeight: FontWeight.bold)),
],
),
40.hb,
_buildParameterText('品牌', '作家有出', '名称', '30cm多功能低压炒锅'),
_buildParameterText('净重', '约2.54kg', '材质', '铝合金基材,玻璃,硅胶,傲视不锈钢'),
_buildParameterText('尺寸', '约30cm*9.5cm', '适合炉灶', '通用'),
50.hb,
Container(
width: double.infinity,
height: 200.rw,
alignment: Alignment.center,
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_NEW_1X1_A_PNG,
image: Api.getImgUrl('/photo/15961790346127.png'),
height: 200.rw,
width: 200.rw,
),
)
],
))),
Container( Container(
width: double.infinity, width: double.infinity,
height: 320.rw, height: 320.rw,
@ -112,7 +69,7 @@ class _ReportFormWidgetPagePageState extends State<ReportFormWidgetPage>
color: Color(0xFF5484D8), color: Color(0xFF5484D8),
), ),
20.wb, 20.wb,
Text('累计销量', Text('类目',
style: TextStyle( style: TextStyle(
color: Color(0xFF333333), color: Color(0xFF333333),
fontSize: 16.rsp, fontSize: 16.rsp,
@ -161,16 +118,6 @@ class _ReportFormWidgetPagePageState extends State<ReportFormWidgetPage>
child: BarTableWidget(), child: BarTableWidget(),
), ),
40.hb, 40.hb,
Text('地图分布',
style: TextStyle(
color: Color(0xFF333333),
fontSize: 16.rsp,
fontWeight: FontWeight.bold)),
Container(
width: double.infinity,
padding: EdgeInsets.only(left: 15.rw),
height: 300.rw,
child: MapWidget()),
], ],
))), ))),
Container( Container(

@ -151,8 +151,6 @@ class _CommodityDetailPageState extends BaseStoreState<CommodityDetailPage>
GoodsPage( GoodsPage(
liveStatus: _liveStatus, liveStatus: _liveStatus,
roomId: _roomId, roomId: _roomId,
isLive: widget.isLive,
liveId: widget.liveId,
openbrandList: () { openbrandList: () {
// _goodsDetail.data.brandId; // _goodsDetail.data.brandId;
AppRouter.push( AppRouter.push(

@ -70,8 +70,8 @@ class GoodsPage extends StatefulWidget {
final ValueNotifier<bool> openSkuChoosePage; final ValueNotifier<bool> openSkuChoosePage;
final void Function() openbrandList; // final void Function() openbrandList; //
final bool isLive; // final bool isLive;
final int liveId; // final int liveId;
final int liveStatus; final int liveStatus;
final int roomId; final int roomId;
@ -82,8 +82,9 @@ class GoodsPage extends StatefulWidget {
this.openSkuChoosePage, this.openSkuChoosePage,
this.goodsDetail, this.goodsDetail,
this.openbrandList, this.openbrandList,
this.isLive = false, // this.isLive = false,
this.liveId = 0, this.liveStatus, this.roomId, // this.liveId = 0,
this.liveStatus, this.roomId,
}) : super(key: key); }) : super(key: key);
@override @override
@ -425,7 +426,7 @@ class _GoodsPageState extends BaseStoreState<GoodsPage> {
// images.add(widget.goodsDetail.data.video); // images.add(widget.goodsDetail.data.video);
// } // }
images.addAll(widget.goodsDetail.data.mainPhotos); images.addAll(widget.goodsDetail.data.mainPhotos);
return ImagePageView(images: images,liveStatus:widget.liveStatus,roomId:widget.roomId,onScrolled: (index) {}); return ImagePageView(images: images,living:widget.goodsDetail.data.living,onScrolled: (index) {});
} }
/// ///
@ -1363,16 +1364,14 @@ class _GoodsPageState extends BaseStoreState<GoodsPage> {
} }
if (skuModel.selectedIndex == 1) { if (skuModel.selectedIndex == 1) {
ReToast.loading(text: ''); ReToast.loading(text: '');
if (widget.liveId != 0) if (widget.goodsDetail.data.living.status != 0||widget.goodsDetail.data.living.roomId!=0)
HttpManager.post(LiveAPI.buyGoodsInform, { HttpManager.post(LiveAPI.buyGoodsInform, {
"liveItemId": widget.liveId, "liveItemId":widget.goodsDetail.data.living.roomId,
"goodsId": widget.goodsId, "goodsId": widget.goodsId,
}); });
_createOrder( _createOrder(
skuModel, skuModel,
context, context,
isLive: widget.isLive,
liveId: widget.liveId,
); );
return; return;
} else { } else {
@ -1430,7 +1429,7 @@ class _GoodsPageState extends BaseStoreState<GoodsPage> {
skuModel.sku.id, skuModel.sku.id,
skuModel.des, skuModel.des,
skuModel.num, skuModel.num,
liveId: isLive ? liveId : null, // liveId: isLive ? liveId : null,
); );
if (order.code != HttpStatus.SUCCESS) { if (order.code != HttpStatus.SUCCESS) {
// Toast.showError(order.msg); // Toast.showError(order.msg);

@ -12,10 +12,12 @@ import 'package:get/get.dart';
import 'package:recook/constants/api.dart'; import 'package:recook/constants/api.dart';
import 'package:recook/constants/header.dart'; import 'package:recook/constants/header.dart';
import 'package:recook/models/goods_detail_model.dart'; import 'package:recook/models/goods_detail_model.dart';
import 'package:recook/models/goods_simple_list_model.dart';
import 'package:recook/pages/live/live_stream/live_stream_view_page.dart'; import 'package:recook/pages/live/live_stream/live_stream_view_page.dart';
import 'package:recook/widgets/custom_cache_image.dart'; import 'package:recook/widgets/custom_cache_image.dart';
import 'package:recook/widgets/pic_swiper.dart'; import 'package:recook/widgets/pic_swiper.dart';
import 'package:recook/widgets/seckill_activity_widget/live_animate_widget.dart'; import 'package:recook/widgets/seckill_activity_widget/live_animate_widget.dart';
import 'package:recook/widgets/toast.dart';
import 'package:recook/widgets/video_view.dart'; import 'package:recook/widgets/video_view.dart';
typedef OnScrolledListener = Function(int index); typedef OnScrolledListener = Function(int index);
@ -24,16 +26,15 @@ class ImagePageView extends StatefulWidget {
final OnScrolledListener onScrolled; final OnScrolledListener onScrolled;
final List<dynamic> images; final List<dynamic> images;
final int liveStatus; final Living living;
final int roomId;
// final Video video; // final Video video;
ImagePageView({ ImagePageView({
Key key, Key key,
this.onScrolled, this.onScrolled,
this.images, this.images,
this.liveStatus, this.living,
this.roomId,
}) : assert(images != null && images.length > 0, "images 不能为空"); }) : assert(images != null && images.length > 0, "images 不能为空");
@override @override
@ -122,13 +123,19 @@ class _ImagePageViewState extends State<ImagePageView> {
BorderRadius.horizontal(left: Radius.circular(20))), BorderRadius.horizontal(left: Radius.circular(20))),
child: _imageCount(), child: _imageCount(),
)), )),
widget.liveStatus == 1 widget.living.status == 1
? Positioned( ? Positioned(
top: 32.rw, top: 60.rw,
right: 35.rw, right: 35.rw,
child: GestureDetector( child: InkWell(
onTap: () { onTap: widget.living.roomId != 0
Get.to(LiveStreamViewPage(id: widget.roomId)); ? () {
Get.to(
LiveStreamViewPage(id: widget.living.roomId));
}
: () {
Toast.showError('找不到该直播间!');
print('1');
}, },
child: Container( child: Container(
width: 50.rw, width: 50.rw,
@ -138,19 +145,20 @@ class _ImagePageViewState extends State<ImagePageView> {
color: Colors.white), color: Colors.white),
child: Column( child: Column(
children: [ children: [
5.hb, 10.hb,
Container( Container(
width: 40.rw, width: 35.rw,
height: 40.rw, height: 35.rw,
alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFFF0000), color: Color(0xFFFF0000),
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(40.rw))), BorderRadius.all(Radius.circular(40.rw))),
child: LiveAnimateWidget( child: LiveAnimateWidget(
size: 80.w, size: 50.w,
), ),
), ),
5.hb, 10.hb,
Text( Text(
'直播中', '直播中',
style: TextStyle( style: TextStyle(
@ -162,6 +170,30 @@ class _ImagePageViewState extends State<ImagePageView> {
), ),
) )
: SizedBox(), : SizedBox(),
widget.living.status == 1
? Positioned(
top: 50.rw,
right: 35.rw,
child: InkWell(
onTap: widget.living.roomId != 0
? () {
Get.to(
LiveStreamViewPage(id: widget.living.roomId));
}
: () {
Toast.showError('找不到该直播间!');
print('2');
},
child: Container(
width: 60.rw,
height: 70.rw,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(7.rw)),
color: Colors.transparent),
),
),
)
: SizedBox(),
]), ]),
), ),
); );

@ -924,8 +924,9 @@ class GoodsItemWidget extends StatelessWidget {
} else { } else {
AppRouter.push(buildCtx, RouteName.COMMODITY_PAGE, AppRouter.push(buildCtx, RouteName.COMMODITY_PAGE,
arguments: CommodityDetailPage.setArguments(this.id, arguments: CommodityDetailPage.setArguments(this.id,
liveStatus: living == null ? null : living.status, // liveStatus: living == null ? null : living.status,
roomId: living == null ? null : living.roomId)); // roomId: living == null ? null : living.roomId
));
} }
} }

@ -20,11 +20,10 @@ class _LiveAnimateWidgetState extends State<LiveAnimateWidget> {
return Container( return Container(
width: widget.size ?? 50.w, width: widget.size ?? 50.w,
height: widget.size ?? 50.w, height: widget.size ?? 50.w,
decoration: BoxDecoration(
color: Colors.transparent, color: Colors.transparent,
// decoration: BoxDecoration( borderRadius: BorderRadius.circular((widget.size ?? 50.w) / 2),
// color: Colors.red, ),
// borderRadius: BorderRadius.circular((widget.size ?? 50.w) / 2),
// ),
child: Row( child: Row(
children: [ children: [
LiveAnimate( LiveAnimate(

Loading…
Cancel
Save