Merge branch 'master' into release

* master:
  update tencent live flutter
  获取点赞数
master
laiiihz 5 years ago
commit affce8a9d1

@ -529,4 +529,6 @@ class LiveAPI {
///
static const String getLiveInfo = '/v1/live/live/info';
static const String liveLicense = '/v1/live/live/license';
}

@ -8,6 +8,8 @@ import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:oktoast/oktoast.dart';
import 'package:recook/constants/api.dart';
import 'package:recook/manager/http_manager.dart';
import 'package:recook/manager/user_manager.dart';
import 'package:recook/models/user_brief_info_model.dart';
import 'package:recook/models/user_model.dart';
@ -39,13 +41,6 @@ void main() async {
//im
TencentImPlugin.init(appid: '1400435566');
//
TencentLive.instance.init(
licenseUrl:
'http://license.vod2.myqcloud.com/license/v1/9bc083b7b7c2101699499d193c40921b/TXLiveSDK.licence',
licenseKey: 'cf903ae78afbb05b5128f8961bf08f64',
);
AppConfig.initial(useEncrypt: false
///
@ -122,6 +117,16 @@ class MyAppState extends State<MyApp> {
// ShareSDKRegister register = ShareSDKRegister();
// register.setupQQ("1109724223", "UGWklum7WWI03ll9");
// SharesdkPlugin.regist(register);
HttpManager.post(LiveAPI.liveLicense, {}).then((resultData) {
String key = resultData.data['data']['key'];
String licenseURL = resultData.data['data']['licenseUrl'];
//
TencentLive.instance.init(
licenseUrl: licenseURL,
licenseKey: key,
);
});
}
Future<void> initPlatformState() async {

@ -101,6 +101,12 @@ class _LivePageState extends State<LivePage> {
onCloudVideoCreated: (controller) async {
_livePusher = await LivePusher.create();
_livePusher.startPreview(controller);
_livePusher.setBeautyFilter(
BeautyFilter.NATURE,
whiteningLevel: 0,
beautyLevel: 0,
ruddyLevel: 0,
);
if (widget.resumeLive) {
_isStream = true;
liveItemId = widget.model.liveItemId;

@ -61,6 +61,8 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
List<GroupMemberEntity> _groupMembers = [];
int _praise = 0;
@override
void initState() {
super.initState();
@ -78,6 +80,7 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
else {
setState(() {
_streamInfoModel = model;
_praise = model.praise;
isAttention = _streamInfoModel.isFollow == 1;
});
TencentImPlugin.applyJoinGroup(
@ -158,6 +161,12 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
showDetailWindow = false;
});
break;
case 'Praise':
int extra = customParams['data']['addPraise'];
// int nowPraise = customParams['data']['praise'];
_praise += extra;
setState(() {});
break;
case 'Explain':
int goodsId = customParams['data']['goodsId'];
nowGoodList = _streamInfoModel.goodsLists.where((element) {
@ -184,6 +193,7 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
));
}
break;
case 'Notice':
chatObjects.insertAll(
0,
@ -345,7 +355,7 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
);
},
title: _streamInfoModel.nickname,
subTitle: '点赞数 ${_streamInfoModel.praise}',
subTitle: '点赞数 $_praise',
avatar: _streamInfoModel.headImgUrl,
),
Spacer(),

@ -51,8 +51,11 @@ class _GoodsListDialogState extends State<GoodsListDialog> {
return DraggableScrollableSheet(
minChildSize: 0.5,
maxChildSize: 0.9,
initialChildSize: 0.5,
expand: false,
builder: (context, scrollController) {
return Column(
mainAxisSize: MainAxisSize.max,
children: [
Material(
color: Colors.transparent,
@ -85,6 +88,7 @@ class _GoodsListDialogState extends State<GoodsListDialog> {
child: ListView.separated(
padding: EdgeInsets.zero,
controller: scrollController,
physics: BouncingScrollPhysics(),
itemBuilder: (context, index) {
return _buildGoodsCard(widget.models[index], index);
},
@ -417,33 +421,46 @@ showGoodsListDialog(
int initExplain,
int id,
}) {
showGeneralDialog(
showModalBottomSheet(
context: context,
pageBuilder: (context, animation, secondaryAnimation) {
return Align(
alignment: Alignment.bottomCenter,
child: GoodsListDialog(
models: models,
isLive: isLive,
onExplain: onExplain,
initExplain: initExplain,
id: id,
onLive: onLive,
),
builder: (context) {
return GoodsListDialog(
models: models,
isLive: isLive,
onExplain: onExplain,
initExplain: initExplain,
id: id,
onLive: onLive,
);
},
transitionBuilder: (context, animation, secondaryAnimation, child) {
return Transform.translate(
offset: Offset(
0, (1 - Curves.easeInOutCubic.transform(animation.value)) * 500),
child: child,
);
},
barrierColor: Colors.black26,
barrierLabel: 'label',
barrierDismissible: true,
transitionDuration: Duration(milliseconds: 500),
);
// showGeneralDialog(
// context: context,
// pageBuilder: (context, animation, secondaryAnimation) {
// return Align(
// alignment: Alignment.bottomCenter,
// child: GoodsListDialog(
// models: models,
// isLive: isLive,
// onExplain: onExplain,
// initExplain: initExplain,
// id: id,
// onLive: onLive,
// ),
// );
// },
// transitionBuilder: (context, animation, secondaryAnimation, child) {
// return Transform.translate(
// offset: Offset(
// 0, (1 - Curves.easeInOutCubic.transform(animation.value)) * 500),
// child: child,
// );
// },
// barrierColor: Colors.black26,
// barrierLabel: 'label',
// barrierDismissible: true,
// transitionDuration: Duration(milliseconds: 500),
// );
}
/**

@ -1022,10 +1022,12 @@ packages:
tencent_live_fluttify:
dependency: "direct main"
description:
name: tencent_live_fluttify
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.0+1"
path: "."
ref: HEAD
resolved-ref: cc34f13777b2eff58523fef3a96a827dc3bfda86
url: "http://test.akuhotel.com:8099/laiiihz/tencent_live_fluttify.git"
source: git
version: "1.0.0"
term_glyph:
dependency: transitive
description:

@ -181,7 +181,9 @@ dependencies:
#腾讯云点播上传SDK
flutter_txugcupload: ^0.0.2
#腾讯直播
tencent_live_fluttify: ^0.2.0+1
tencent_live_fluttify:
git:
url: http://test.akuhotel.com:8099/laiiihz/tencent_live_fluttify.git
#腾讯IM
#TODO 已经将错误提交到上游代码,后期请使用新版本
#more at https://github.com/JiangJuHong/FlutterTencentImPlugin/pull/101

Loading…
Cancel
Save