直播标签

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/price_model.dart';
import 'goods_simple_list_model.dart';
part 'goods_detail_model.g.dart';
/*
@ -173,34 +175,35 @@ class Data extends Object {
num isFerme;
num storehouse;
String countryIcon;
Living living;
Data(
this.id,
this.brandId,
this.goodsName,
this.description,
this.firstCategoryId,
this.secondCategoryId,
this.inventory,
this.salesVolume,
this.price,
this.video,
this.mainPhotos,
this.attributes,
this.sku,
this.promotion,
this.brand,
this.evaluations,
this.coupons,
this.isFavorite,
this.shoppingTrolleyCount,
this.recommends,
this.isImport,
this.isFerme,
this.storehouse,
this.notice,
this.countryIcon
);
this.id,
this.brandId,
this.goodsName,
this.description,
this.firstCategoryId,
this.secondCategoryId,
this.inventory,
this.salesVolume,
this.price,
this.video,
this.mainPhotos,
this.attributes,
this.sku,
this.promotion,
this.brand,
this.evaluations,
this.coupons,
this.isFavorite,
this.shoppingTrolleyCount,
this.recommends,
this.isImport,
this.isFerme,
this.storehouse,
this.notice,
this.countryIcon,
this.living);
factory Data.fromJson(Map<String, dynamic> srcJson) =>
_$DataFromJson(srcJson);

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

@ -73,53 +73,59 @@ class _GoodsReportPageState extends State<GoodsReportPage>
width: double.infinity,
margin: EdgeInsets.only(top: 10.rw),
padding: EdgeInsets.only(top: 10.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)),
],
),
30.hb,
Container(
height: 30.rw,
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.rw)),
color: Color(0xFFD5D5D5)),
alignment: Alignment.center,
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)),
],
),
30.hb,
Container(
height: 30.rw,
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.rw)),
color: Color(0xFFD5D5D5)),
alignment: Alignment.center,
// width: DeviceInfo.screenWidth,
child: TabBar(
onTap: (index) {
_tabController.index = index;
setState(() {});
},
//isScrollable: ,
// width: DeviceInfo.screenWidth,
child: TabBar(
onTap: (index) {
_tabController.index = index;
setState(() {});
},
//isScrollable: ,
labelPadding: EdgeInsets.all(0),
controller: _tabController,
indicator: const BoxDecoration(),
indicatorWeight: 0,
unselectedLabelColor: Colors.black54,
labelStyle: TextStyle(color: Colors.black54),
tabs: _tabList.map<Tab>((item) {
int index = _tabList.indexOf(item);
return _tabItem(item, index);
}).toList()),
labelPadding: EdgeInsets.all(0),
controller: _tabController,
indicator: const BoxDecoration(),
indicatorWeight: 0,
unselectedLabelColor: Colors.black54,
labelStyle: TextStyle(color: Colors.black54),
tabs: _tabList.map<Tab>((item) {
int index = _tabList.indexOf(item);
return _tabItem(item, index);
}).toList()),
),
],
),
),
Expanded(
child: TabBarView(

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

@ -18,14 +18,6 @@ class BarTableWidgetState extends State<BarTableWidget> {
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Text(
'本周',
style: TextStyle(
color: Color(0xFF333333),
fontSize: 16,
),
textAlign: TextAlign.center,
),
SizedBox(
height: 4,
),
@ -98,7 +90,7 @@ class BarTableWidgetState extends State<BarTableWidget> {
),
leftTitles: SideTitles(
showTitles: true,
interval: 200,//
interval: 200, //
getTextStyles: (context, value) => const TextStyle(
color: Color(
0xff939393,
@ -109,7 +101,7 @@ class BarTableWidgetState extends State<BarTableWidget> {
),
gridData: FlGridData(
show: true,
checkToShowHorizontalLine: (value) => value % 200 == 0,//
checkToShowHorizontalLine: (value) => value % 200 == 0, //
getDrawingHorizontalLine: (value) => FlLine(
color: const Color(0xffe7e8ec),
strokeWidth: 1,
@ -151,6 +143,4 @@ class BarTableWidgetState extends State<BarTableWidget> {
],
);
}
}

@ -51,49 +51,6 @@ class _ReportFormWidgetPagePageState extends State<ReportFormWidgetPage>
_buildListView() {
return ListView(
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(
width: double.infinity,
height: 320.rw,
@ -112,7 +69,7 @@ class _ReportFormWidgetPagePageState extends State<ReportFormWidgetPage>
color: Color(0xFF5484D8),
),
20.wb,
Text('累计销量',
Text('类目',
style: TextStyle(
color: Color(0xFF333333),
fontSize: 16.rsp,
@ -161,16 +118,6 @@ class _ReportFormWidgetPagePageState extends State<ReportFormWidgetPage>
child: BarTableWidget(),
),
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(

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

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

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

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

Loading…
Cancel
Save