复制链接,微信分享,视频封面选择,图文显示,佣金控制显示,

master
laiiihz 5 years ago
parent 2a68a03f77
commit 8c2d3a408d

@ -241,7 +241,10 @@ class _ActivityPreviewPageState extends State<ActivityPreviewPage> {
child: Row(
children: [
LiveUserBar(
initAttention: widget.model.isPraise == 1,
initAttention: widget.userModel.userId ==
UserManager.instance.user.info.id
? true
: widget.model.isPraise == 1,
onAttention: () {
HttpManager.post(
LiveAPI.addFollow,

@ -568,7 +568,7 @@ class _LivePageState extends State<LivePage> with WidgetsBindingObserver {
context: context,
builder: (context) {
return Material(
color: Colors.black,
color: Colors.white,
child: Row(
children: [
CustomImageButton(
@ -580,7 +580,7 @@ class _LivePageState extends State<LivePage> with WidgetsBindingObserver {
liveId: liveItemId,
title:
'好友${_streamInfoModel.nickname}正在瑞库客直播,快来一起看看😘',
des: '',
des: '让消费服务生活,让生活充满精致',
headUrl: _streamInfoModel.headImgUrl,
);
} else {
@ -601,7 +601,30 @@ class _LivePageState extends State<LivePage> with WidgetsBindingObserver {
Text(
'微信分享',
style: TextStyle(
color: Colors.white,
color: Color(0xFF333333),
fontSize: rSP(14),
),
),
],
),
),
CustomImageButton(
onPressed: () {
Navigator.pop(context);
ShareTool().clipBoard(liveId: liveItemId);
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset(
ShareToolIcon.copyurl,
width: rSize(40),
height: rSize(40),
),
Text(
'复制链接',
style: TextStyle(
color: Color(0xFF333333),
fontSize: rSP(14),
),
),
@ -679,56 +702,56 @@ class _LivePageState extends State<LivePage> with WidgetsBindingObserver {
},
));
}),
_buildVerticalButton(R.ASSETS_LIVE_ALL_SHARE_PNG, '分享', () {
showModalBottomSheet(
context: context,
builder: (context) {
return Material(
color: Colors.black,
child: Row(
children: [
CustomImageButton(
onPressed: () {
if (UserManager.instance.haveLogin) {
Navigator.pop(context);
ShareTool().liveShare(
context,
liveId: liveItemId,
title:
'好友${_streamInfoModel.nickname}正在瑞库客直播,快来一起看看😘',
des: '',
headUrl: _streamInfoModel.headImgUrl,
);
} else {
showToast('未登陆,请先登陆');
CRoute.push(context, UserPage());
}
},
padding: EdgeInsets.all(rSize(15)),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset(
R.ASSETS_SHARE_BOTTOM_SHARE_BOTTOM_WECHAT_PNG,
height: rSize(40),
width: rSize(40),
),
rHBox(10),
Text(
'微信分享',
style: TextStyle(
color: Colors.white,
fontSize: rSP(14),
),
),
],
),
),
],
),
);
});
}),
// _buildVerticalButton(R.ASSETS_LIVE_ALL_SHARE_PNG, '分享', () {
// showModalBottomSheet(
// context: context,
// builder: (context) {
// return Material(
// color: Colors.black,
// child: Row(
// children: [
// CustomImageButton(
// onPressed: () {
// if (UserManager.instance.haveLogin) {
// Navigator.pop(context);
// ShareTool().liveShare(
// context,
// liveId: liveItemId,
// title:
// '好友${_streamInfoModel.nickname}正在瑞库客直播,快来一起看看😘',
// des: '',
// headUrl: _streamInfoModel.headImgUrl,
// );
// } else {
// showToast('未登陆,请先登陆');
// CRoute.push(context, UserPage());
// }
// },
// padding: EdgeInsets.all(rSize(15)),
// child: Column(
// mainAxisSize: MainAxisSize.min,
// children: [
// Image.asset(
// R.ASSETS_SHARE_BOTTOM_SHARE_BOTTOM_WECHAT_PNG,
// height: rSize(40),
// width: rSize(40),
// ),
// rHBox(10),
// Text(
// '微信分享',
// style: TextStyle(
// color: Colors.white,
// fontSize: rSP(14),
// ),
// ),
// ],
// ),
// ),
// ],
// ),
// );
// });
// }),
],
),
),
@ -747,15 +770,23 @@ class _LivePageState extends State<LivePage> with WidgetsBindingObserver {
title: UserManager.instance.user.info.nickname,
subTitle: '点赞数$_praise',
onTapAvatar: () {
showLiveChild(
context,
initAttention: true,
title: _streamInfoModel.nickname,
fans: _liveBaseInfoModel.fans,
follows: _liveBaseInfoModel.follows,
headImg: _liveBaseInfoModel.headImgUrl,
id: _liveBaseInfoModel.userId,
);
HttpManager.post(LiveAPI.baseInfo, {
'findUserId': _streamInfoModel.userId,
}).then((resultData) {
if (resultData?.data['data'] != null) {
_liveBaseInfoModel =
LiveBaseInfoModel.fromJson(resultData.data['data']);
}
showLiveChild(
context,
initAttention: true,
title: _streamInfoModel.nickname,
fans: _liveBaseInfoModel.fans,
follows: _liveBaseInfoModel.follows,
headImg: _liveBaseInfoModel.headImgUrl,
id: _liveBaseInfoModel.userId,
);
});
},
avatar:
Api.getImgUrl(UserManager.instance.user.info.headImgUrl),

@ -307,12 +307,11 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
reconnectToLive() {
_liveTimer?.cancel();
_liveTimer = Timer(Duration(milliseconds: 5000), () {
_livePlayer.isPlaying().then((value) {
setState(() {
_waitSignal = !value;
});
setState(() {
_waitSignal = true;
});
// _livePlayer.push
_livePlayer.stopPlay();
_livePlayer.startPlay(_streamInfoModel.playUrl, type: PlayType.RTMP);
});
}
@ -426,7 +425,9 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
print('');
},
onEventPlayBegin: () {
print('1');
setState(() {
_waitSignal = false;
});
},
onEventPlayEnd: () {
print('`');

@ -227,25 +227,27 @@ class _GoodsListDialogState extends State<GoodsListDialog> {
children: [
SmallCouponWidget(number: num.parse(model.coupon)),
rWBox(4),
Container(
height: rSize(18),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(rSize(1)),
border: Border.all(
color: Color(0xFFCC1B4F),
width: rSize(0.5),
),
),
child: Text(
'${model.commission}',
style: TextStyle(
color: Color(0xFFCC1B4F),
fontSize: rSP(12),
height: 1,
),
),
),
AppConfig.getShowCommission()
? Container(
height: rSize(18),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(rSize(1)),
border: Border.all(
color: Color(0xFFCC1B4F),
width: rSize(0.5),
),
),
child: Text(
'${model.commission}',
style: TextStyle(
color: Color(0xFFCC1B4F),
fontSize: rSP(12),
height: 1,
),
),
)
: SizedBox(),
Spacer(),
Text(
'剩余',

@ -32,12 +32,7 @@ class LiveChatBox extends StatefulWidget {
class _LiveChatBoxState extends State<LiveChatBox> {
@override
Widget build(BuildContext context) {
final Color color = Color.fromRGBO(
180 + Random().nextInt(55),
180 + Random().nextInt(55),
180 + Random().nextInt(55),
1,
);
final Color color = Colors.white;
return Container(
padding: EdgeInsets.symmetric(vertical: rSize(5 / 2)),
alignment: Alignment.centerLeft,
@ -61,6 +56,7 @@ class _LiveChatBoxState extends State<LiveChatBox> {
style: TextStyle(
color: Colors.white,
fontSize: rSP(13),
fontWeight: FontWeight.bold,
),
),
]),

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:recook/constants/header.dart';
import 'package:recook/constants/styles.dart';
import 'package:recook/manager/user_manager.dart';
import 'package:recook/pages/business/focus/child_focus_page.dart';
import 'package:recook/pages/business/recommend/child_recommend_page.dart';
import 'package:recook/pages/live/sub_page/live_stream_page.dart';
import 'package:recook/pages/live/sub_page/user_home_page.dart';
@ -104,7 +105,7 @@ class _DiscoveryPageState extends State<DiscoveryPage>
children: [
LiveStreamPage(),
VideoPage(),
RecommendPage(),
FocusPage(),
],
)),
],

@ -1,7 +1,9 @@
import 'package:extended_image/extended_image.dart';
import 'package:flutter/material.dart';
import 'package:recook/constants/api.dart';
import 'package:recook/constants/header.dart';
import 'package:recook/manager/http_manager.dart';
import 'package:recook/pages/goods/small_coupon_widget.dart';
import 'package:recook/pages/home/classify/commodity_detail_page.dart';
import 'package:recook/pages/live/models/goods_window_model.dart';
import 'package:recook/pages/user/widget/recook_check_box.dart';
@ -43,6 +45,7 @@ class _GoodsWindowPageState extends State<GoodsWindowPage> {
@override
Widget build(BuildContext context) {
return RecookScaffold(
whiteBg: true,
title: '商品橱窗',
body: Column(
children: [
@ -211,7 +214,7 @@ class _GoodsWindowPageState extends State<GoodsWindowPage> {
_buildGoodsCard(GoodsList model) {
return Container(
padding: EdgeInsets.symmetric(vertical: rSize(15 / 2)),
height: rSize(86 + 15.0),
height: rSize(120 + 15.0),
child: FlatButton(
splashColor: Colors.black26,
onPressed: _isManager
@ -242,8 +245,8 @@ class _GoodsWindowPageState extends State<GoodsWindowPage> {
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_NEW_1X1_A_PNG,
image: Api.getImgUrl(model.mainPhotoUrl),
height: rSize(86),
width: rSize(86),
height: rSize(120),
width: rSize(120),
),
),
rWBox(10),
@ -261,6 +264,113 @@ class _GoodsWindowPageState extends State<GoodsWindowPage> {
fontSize: rSP(14),
),
),
Container(
width: double.infinity,
height: 25,
color: Colors.white,
child: Row(
children: <Widget>[
Container(
width: 13 * 1.5,
height: 13 * 1.5,
child: TextUtils.isEmpty(model.brandImg)
? SizedBox()
: ExtendedImage.network(
Api.getImgUrl(model.brandImg),
fit: BoxFit.fill,
),
),
SizedBox(
width: 4,
),
Text(
TextUtils.isEmpty(model.brandName)
? ""
: model.brandName,
style: TextStyle(
color: Color(0xffc70404),
fontSize: ScreenAdapterUtils.setSp(12),
),
),
],
),
),
Container(
child: Stack(
children: <Widget>[
Row(
children: <Widget>[
(model.coupon != null && model.coupon != '0')
? Container(
margin: EdgeInsets.only(right: 5),
child: SmallCouponWidget(
height: 18,
number: num.parse(model.coupon),
),
)
: SizedBox(),
AppConfig.commissionByRoleLevel
? Container(
child: Stack(
alignment: Alignment.center,
children: <Widget>[
Container(
margin:
EdgeInsets.symmetric(vertical: 2),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
border: Border.all(
color: Color(0xffec294d),
width: 0.5,
)),
padding: EdgeInsets.symmetric(
horizontal: 3),
child: Text(
"" + model.commission,
style: TextStyle(
color: Colors.white.withAlpha(0),
fontSize:
ScreenAdapterUtils.setSp(12),
),
),
),
AppConfig.getShowCommission()
? Container(
alignment: Alignment.center,
child: Text(
"" + model.commission,
style: TextStyle(
color: Color(0xffeb0045),
fontSize: ScreenAdapterUtils
.setSp(12),
),
),
)
: SizedBox(),
],
),
)
: SizedBox(),
Spacer(),
],
),
Positioned(
right: 0,
bottom: 0,
top: 0,
child: Text(
"已售${model.salesVolume}",
style: TextStyle(
color: Color(0xff595757),
fontSize: ScreenAdapterUtils.setSp(12),
),
),
),
],
),
),
Spacer(),
Row(
children: [
@ -271,15 +381,17 @@ class _GoodsWindowPageState extends State<GoodsWindowPage> {
fontSize: rSP(14),
),
),
model.commission == '0'
? SizedBox()
: Text(
'/赚${model.commission}',
style: TextStyle(
color: Color(0xFFC92219),
fontSize: rSP(14),
),
),
AppConfig.getShowCommission()
? model.commission == '0'
? SizedBox()
: Text(
'/赚${model.commission}',
style: TextStyle(
color: Color(0xFFC92219),
fontSize: rSP(14),
),
)
: SizedBox(),
],
),
],

@ -1,6 +1,7 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:oktoast/oktoast.dart';
import 'package:recook/constants/constants.dart';
import 'package:recook/constants/header.dart';
import 'package:recook/pages/live/video/upload_video_page.dart';
@ -80,6 +81,9 @@ class _VideoAdvancePageState extends State<VideoAdvancePage> {
.then((file) {
if (file != null) {
_coverFile = File(file.path);
showToast('封面选择完成');
} else {
showToast('未选择封面');
}
});
},

@ -52,9 +52,11 @@ class RecookDateUtil {
bool get isYesterday => isSameMonth && now.day == (dateTime.day + 1);
String get humanDate {
if (isSameMinute)
return '${now.second - dateTime.second}秒前';
else if (isSameHour)
// if (isSameMinute)
// return '${now.second - dateTime.second}秒前';
// else
if (isSameMinute && dateTime.second < 60) return '刚刚';
if (isSameHour)
return '${now.minute - dateTime.minute}分钟前';
else if (isToday)
return '${now.hour - dateTime.hour}小时前';

@ -93,6 +93,19 @@ class ShareTool {
);
}
clipBoard({
BuildContext context,
@required int liveId,
}) {
String baseUrl = "${AppConfig.debug ? WebApi.testLiveUrl : WebApi.liveUrl}";
ClipboardData data = new ClipboardData(text: '$baseUrl$liveId');
Clipboard.setData(data);
Toast.showCustomSuccess(
'链接复制成功',
delayedDuration: Duration(seconds: 0),
);
}
goodsShare(BuildContext context,
{String goodsName = "",
String goodsDescription = "",

Loading…
Cancel
Save