diff --git a/lib/constants/api.dart b/lib/constants/api.dart index 743eeb0..65fe5fe 100644 --- a/lib/constants/api.dart +++ b/lib/constants/api.dart @@ -514,4 +514,7 @@ class LiveAPI { ///举报 static const String report = '/v1/live/live/report/submit'; + + ///购买通知 + static const String buyGoodsInform = '/v1/live/live/im/buy_goods'; } diff --git a/lib/pages/live/live_stream/live_blur_page.dart b/lib/pages/live/live_stream/live_blur_page.dart index db82989..795038b 100644 --- a/lib/pages/live/live_stream/live_blur_page.dart +++ b/lib/pages/live/live_stream/live_blur_page.dart @@ -192,6 +192,7 @@ class _LiveBlurPageState extends State { ), rHBox(55), Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ _buildColumn('${widget.look}', '观看人数'), _buildColumn('${widget.praise}', '获赞'), diff --git a/lib/pages/live/live_stream/live_page.dart b/lib/pages/live/live_stream/live_page.dart index 058d45b..34da1e5 100644 --- a/lib/pages/live/live_stream/live_page.dart +++ b/lib/pages/live/live_stream/live_page.dart @@ -508,6 +508,33 @@ class _LivePageState extends State { break; case ListenerTypeEnum.GroupTips: + if (params is String) { + dynamic parseParams = jsonDecode(params); + if (parseParams['tipsType'] == 'Join') { + showToastWidget( + Container( + margin: EdgeInsets.all(rSize(15)), + alignment: Alignment.center, + padding: EdgeInsets.symmetric(horizontal: rSize(10)), + height: rSize(26), + decoration: BoxDecoration( + color: Color(0xFFDC5353), + borderRadius: BorderRadius.circular(rSize(13)), + ), + child: Text( + '${parseParams['opUser']}来了', + style: TextStyle( + color: Colors.white, + fontSize: rSP(13), + ), + ), + ), + position: ToastPosition.top, + ); + } else if (parseParams['tipsType'] == 'Quit') { + //exit + } + } break; case ListenerTypeEnum.RecvReceipt: break; diff --git a/lib/pages/live/live_stream/live_stream_view_page.dart b/lib/pages/live/live_stream/live_stream_view_page.dart index 8f1fc59..4e5d237 100644 --- a/lib/pages/live/live_stream/live_stream_view_page.dart +++ b/lib/pages/live/live_stream/live_stream_view_page.dart @@ -121,6 +121,28 @@ class _LiveStreamViewPageState extends State { print(customParams); dynamic data = customParams['data']; switch (customParams['type']) { + case 'BuyGoods': + showToastWidget( + Container( + margin: EdgeInsets.all(rSize(15)), + alignment: Alignment.center, + padding: EdgeInsets.symmetric(horizontal: rSize(10)), + height: rSize(26), + decoration: BoxDecoration( + color: Color(0xFFF4BC22), + borderRadius: BorderRadius.circular(rSize(13)), + ), + child: Text( + '${customParams['data']['content']}', + style: TextStyle( + color: Colors.white, + fontSize: rSP(13), + ), + ), + ), + position: ToastPosition.top, + ); + break; case 'UnExplain': setState(() { showDetailWindow = false; @@ -164,7 +186,30 @@ class _LiveStreamViewPageState extends State { case ListenerTypeEnum.GroupTips: if (params is String) { dynamic parseParams = jsonDecode(params); - print(parseParams['tipsType']); + if (parseParams['tipsType'] == 'Join') { + showToastWidget( + Container( + margin: EdgeInsets.all(rSize(15)), + alignment: Alignment.center, + padding: EdgeInsets.symmetric(horizontal: rSize(10)), + height: rSize(26), + decoration: BoxDecoration( + color: Color(0xFFDC5353), + borderRadius: BorderRadius.circular(rSize(13)), + ), + child: Text( + '${parseParams['opUser']}来了', + style: TextStyle( + color: Colors.white, + fontSize: rSP(13), + ), + ), + ), + position: ToastPosition.top, + ); + } else if (parseParams['tipsType'] == 'Quit') { + //exit + } } break; diff --git a/lib/pages/live/live_stream/show_goods_list.dart b/lib/pages/live/live_stream/show_goods_list.dart index dbd2e20..bc8ca1b 100644 --- a/lib/pages/live/live_stream/show_goods_list.dart +++ b/lib/pages/live/live_stream/show_goods_list.dart @@ -361,6 +361,10 @@ class _GoodsListDialogState extends State { model.id, )); else { + HttpManager.post(LiveAPI.buyGoodsInform, { + "liveItemId": widget.id, + "goodsId": model.id, + }); showModalBottomSheet( context: context, builder: (context) {