@x-edu/live-player 0.0.30 → 0.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2689,7 +2689,7 @@ ___CSS_LOADER_EXPORT___.locals = {
2689
2689
 
2690
2690
  var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
2691
2691
  // Module
2692
- ___CSS_LOADER_EXPORT___.push([module.id, ".index-module_action_DHsbc{font-size:14px;line-height:22px;color:#1e62ec;border-radius:144.889px;border:1px solid #1e62ec;width:88px;height:32px;display:flex;align-items:center;justify-content:center;margin-top:8px}.index-module_action-has-subscribe_LYNor{border:1px solid #b7ccf9;color:#b7ccf9}", ""]);
2692
+ ___CSS_LOADER_EXPORT___.push([module.id, ".index-module_action_DHsbc{font-size:14px;line-height:22px;color:#1e62ec;border-radius:144.889px;border:1px solid #1e62ec;width:88px;height:32px;display:flex;align-items:center;justify-content:center;margin-top:8px}.index-module_action_DHsbc:hover{color:#4079ef;border:1px solid #4079ef}.index-module_action-has-subscribe_LYNor{border:1px solid #b7ccf9!important;color:#b7ccf9!important}", ""]);
2693
2693
  // Exports
2694
2694
  ___CSS_LOADER_EXPORT___.locals = {
2695
2695
  "action": "index-module_action_DHsbc",
@@ -59506,7 +59506,7 @@ function TabPane(_ref) {
59506
59506
  children = _ref.children;
59507
59507
 
59508
59508
  var _React$useState = external_commonjs_react_commonjs2_react_root_React_namespaceObject.useState(forceRender),
59509
- _React$useState2 = slicedToArray_slicedToArray(_React$useState, 2),
59509
+ _React$useState2 = esm_slicedToArray_slicedToArray(_React$useState, 2),
59510
59510
  visited = _React$useState2[0],
59511
59511
  setVisited = _React$useState2[1];
59512
59512
 
@@ -59535,7 +59535,7 @@ function TabPane(_ref) {
59535
59535
  tabIndex: active ? 0 : -1,
59536
59536
  "aria-labelledby": id && "".concat(id, "-tab-").concat(tabKey),
59537
59537
  "aria-hidden": !active,
59538
- style: objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, mergedStyle), style),
59538
+ style: _objectSpread2(_objectSpread2({}, mergedStyle), style),
59539
59539
  className: classnames_default()("".concat(prefixCls, "-tabpane"), active && "".concat(prefixCls, "-tabpane-active"), className)
59540
59540
  }, (active || visited || forceRender) && children);
59541
59541
  }
@@ -59575,7 +59575,7 @@ function parseTabList(children) {
59575
59575
  return toArray(children).map(function (node) {
59576
59576
  if ( /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_namespaceObject.isValidElement(node)) {
59577
59577
  var key = node.key !== undefined ? String(node.key) : undefined;
59578
- return objectSpread2_objectSpread2(objectSpread2_objectSpread2({
59578
+ return _objectSpread2(_objectSpread2({
59579
59579
  key: key
59580
59580
  }, node.props), {}, {
59581
59581
  node: node
@@ -59618,7 +59618,7 @@ function Tabs(_ref, ref) {
59618
59618
  onChange = _ref.onChange,
59619
59619
  onTabClick = _ref.onTabClick,
59620
59620
  onTabScroll = _ref.onTabScroll,
59621
- restProps = objectWithoutProperties_objectWithoutProperties(_ref, Tabs_excluded);
59621
+ restProps = _objectWithoutProperties(_ref, Tabs_excluded);
59622
59622
 
59623
59623
  var tabs = parseTabList(children);
59624
59624
  var rtl = direction === 'rtl';
@@ -59635,15 +59635,15 @@ function Tabs(_ref, ref) {
59635
59635
  tabPane: true
59636
59636
  };
59637
59637
  } else {
59638
- mergedAnimated = objectSpread2_objectSpread2({
59638
+ mergedAnimated = _objectSpread2({
59639
59639
  inkBar: true,
59640
59640
  tabPane: false
59641
- }, esm_typeof_typeof(animated) === 'object' ? animated : {});
59641
+ }, typeof_typeof(animated) === 'object' ? animated : {});
59642
59642
  } // ======================== Mobile ========================
59643
59643
 
59644
59644
 
59645
59645
  var _useState = (0,external_commonjs_react_commonjs2_react_root_React_namespaceObject.useState)(false),
59646
- _useState2 = slicedToArray_slicedToArray(_useState, 2),
59646
+ _useState2 = esm_slicedToArray_slicedToArray(_useState, 2),
59647
59647
  mobile = _useState2[0],
59648
59648
  setMobile = _useState2[1];
59649
59649
 
@@ -59660,7 +59660,7 @@ function Tabs(_ref, ref) {
59660
59660
  value: activeKey,
59661
59661
  defaultValue: defaultActiveKey
59662
59662
  }),
59663
- _useMergedState2 = slicedToArray_slicedToArray(_useMergedState, 2),
59663
+ _useMergedState2 = esm_slicedToArray_slicedToArray(_useMergedState, 2),
59664
59664
  mergedActiveKey = _useMergedState2[0],
59665
59665
  setMergedActiveKey = _useMergedState2[1];
59666
59666
 
@@ -59669,7 +59669,7 @@ function Tabs(_ref, ref) {
59669
59669
  return tab.key === mergedActiveKey;
59670
59670
  });
59671
59671
  }),
59672
- _useState4 = slicedToArray_slicedToArray(_useState3, 2),
59672
+ _useState4 = esm_slicedToArray_slicedToArray(_useState3, 2),
59673
59673
  activeIndex = _useState4[0],
59674
59674
  setActiveIndex = _useState4[1]; // Reset active key if not exist anymore
59675
59675
 
@@ -59694,7 +59694,7 @@ function Tabs(_ref, ref) {
59694
59694
  var _useMergedState3 = useControlledState(null, {
59695
59695
  value: id
59696
59696
  }),
59697
- _useMergedState4 = slicedToArray_slicedToArray(_useMergedState3, 2),
59697
+ _useMergedState4 = esm_slicedToArray_slicedToArray(_useMergedState3, 2),
59698
59698
  mergedId = _useMergedState4[0],
59699
59699
  setMergedId = _useMergedState4[1];
59700
59700
 
@@ -59733,7 +59733,7 @@ function Tabs(_ref, ref) {
59733
59733
  };
59734
59734
  var tabNavBar;
59735
59735
 
59736
- var tabNavBarProps = objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, sharedProps), {}, {
59736
+ var tabNavBarProps = _objectSpread2(_objectSpread2({}, sharedProps), {}, {
59737
59737
  editable: editable,
59738
59738
  locale: locale,
59739
59739
  moreIcon: moreIcon,
@@ -59757,11 +59757,11 @@ function Tabs(_ref, ref) {
59757
59757
  tabs: tabs,
59758
59758
  prefixCls: prefixCls
59759
59759
  }
59760
- }, /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_namespaceObject.createElement("div", esm_extends_extends({
59760
+ }, /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_namespaceObject.createElement("div", extends_extends({
59761
59761
  ref: ref,
59762
59762
  id: id,
59763
- className: classnames_default()(prefixCls, "".concat(prefixCls, "-").concat(mergedTabPosition), (_classNames = {}, defineProperty_defineProperty(_classNames, "".concat(prefixCls, "-mobile"), mobile), defineProperty_defineProperty(_classNames, "".concat(prefixCls, "-editable"), editable), defineProperty_defineProperty(_classNames, "".concat(prefixCls, "-rtl"), rtl), _classNames), className)
59764
- }, restProps), tabNavBar, /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_namespaceObject.createElement(TabPanelList, esm_extends_extends({
59763
+ className: classnames_default()(prefixCls, "".concat(prefixCls, "-").concat(mergedTabPosition), (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-mobile"), mobile), _defineProperty(_classNames, "".concat(prefixCls, "-editable"), editable), _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), rtl), _classNames), className)
59764
+ }, restProps), tabNavBar, /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_namespaceObject.createElement(TabPanelList, extends_extends({
59765
59765
  destroyInactiveTabPane: destroyInactiveTabPane
59766
59766
  }, sharedProps, {
59767
59767
  animated: mergedAnimated
@@ -60846,7 +60846,7 @@ Pagination.defaultProps = {
60846
60846
 
60847
60847
 
60848
60848
  var MiniSelect = function MiniSelect(props) {
60849
- return /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_namespaceObject.createElement(es_select, esm_extends_extends({
60849
+ return /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_namespaceObject.createElement(es_select, extends_extends({
60850
60850
  size: "small"
60851
60851
  }, props));
60852
60852
  };
@@ -60928,7 +60928,7 @@ var responsiveObserve = {
60928
60928
 
60929
60929
  function useBreakpoint() {
60930
60930
  var _useState = (0,external_commonjs_react_commonjs2_react_root_React_namespaceObject.useState)({}),
60931
- _useState2 = slicedToArray_slicedToArray(_useState, 2),
60931
+ _useState2 = esm_slicedToArray_slicedToArray(_useState, 2),
60932
60932
  screens = _useState2[0],
60933
60933
  setScreens = _useState2[1];
60934
60934
 
@@ -2689,7 +2689,7 @@ ___CSS_LOADER_EXPORT___.locals = {
2689
2689
 
2690
2690
  var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
2691
2691
  // Module
2692
- ___CSS_LOADER_EXPORT___.push([module.id, ".index-module_action_DHsbc{font-size:14px;line-height:22px;color:#1e62ec;border-radius:144.889px;border:1px solid #1e62ec;width:88px;height:32px;display:flex;align-items:center;justify-content:center;margin-top:8px}.index-module_action-has-subscribe_LYNor{border:1px solid #b7ccf9;color:#b7ccf9}", ""]);
2692
+ ___CSS_LOADER_EXPORT___.push([module.id, ".index-module_action_DHsbc{font-size:14px;line-height:22px;color:#1e62ec;border-radius:144.889px;border:1px solid #1e62ec;width:88px;height:32px;display:flex;align-items:center;justify-content:center;margin-top:8px}.index-module_action_DHsbc:hover{color:#4079ef;border:1px solid #4079ef}.index-module_action-has-subscribe_LYNor{border:1px solid #b7ccf9!important;color:#b7ccf9!important}", ""]);
2693
2693
  // Exports
2694
2694
  ___CSS_LOADER_EXPORT___.locals = {
2695
2695
  "action": "index-module_action_DHsbc",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-edu/live-player",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "main": "dist/XEduLivePlayer.common.js",
5
5
  "scripts": {
6
6
  "start": "cross-env SDP_ENV=local gms dev",
@@ -10,11 +10,17 @@
10
10
  align-items: center;
11
11
  justify-content: center;
12
12
  margin-top: 8px;
13
+
14
+ &:hover {
15
+ color: #4079EF;
16
+ border: 1px solid #4079EF;
17
+
18
+ }
13
19
  }
14
20
 
15
21
 
16
22
 
17
23
  .action-has-subscribe {
18
- border: 1px solid #B7CCF9;
19
- color: #B7CCF9
24
+ border: 1px solid #B7CCF9 !important;
25
+ color: #B7CCF9 !important;
20
26
  }
@@ -1,135 +1,135 @@
1
- import React, { useEffect, useState } from 'react'
2
- import dayjs from 'dayjs'
3
- import classNames from 'classnames'
4
- import { find } from 'lodash'
5
- import Avatar from '@/component/Avatar'
6
- import Icon from '@/component/Icon'
7
- import { formatLikesCount, formatUVCount } from '@/util/liveCountUtil'
8
- import { getResourceLikes } from '@/service/like'
9
- import Action from './Action'
10
- import DefaultCover from './img/live.png'
11
- import PlayImg from './img/play.svg'
12
- import dianZan from './img/like-fill.svg'
13
- import yiYue from './img/view-fill.svg'
14
- import videoSvg from './img/video.svg'
15
- import style from './index.module.less'
16
-
17
- const TagName = {
18
- 0: '直播预告',
19
- 1: '直播中',
20
- 2: '直播回放',
21
- 3: '直播中' // 实际是暂停
22
- }
23
-
24
- export default function ListItem({
25
- data,
26
- themeName,
27
- subscription,
28
- onDetailClick,
29
- handleLogin,
30
- isLogin,
31
- onSubscribe
32
- }) {
33
- const {
34
- live_id: liveId,
35
- live_name: liveName,
36
- begin_time: beginTime,
37
- // end_time: endTime,
38
- cover_url: coverUrl,
39
- status
40
- } = data
41
- const [liveExt, setLiveExt] = useState({})
42
- const [isSubscribe, setIsSubscribe] = useState(() => {
43
- if (status === 0) {
44
- // 开播前15分钟之外
45
- const subscriptionItem = find(subscription, {
46
- live_id: liveId
47
- })
48
- if (subscriptionItem?.is_subscribe) { // 已预约
49
- return true
50
- } else { // 未预约
51
- return false
52
- }
53
- } else {
54
- return false
55
- }
56
- })
57
-
58
- useEffect(() => {
59
- (async () => {
60
- const res = await getResourceLikes(liveId)
61
- setLiveExt(res || {})
62
- })()
63
- }, [])
64
-
65
- const handleDetailClick = async () => {
66
- if (data.login && !isLogin) {
67
- handleLogin(data)
68
- return
69
- }
70
- if (onDetailClick) {
71
- onDetailClick(data)
72
- } else {
73
- // 默认跳转中小学
74
- window.open(`https://basic.smartedu.cn/publicLive/${liveId}`)
75
- }
76
- }
77
-
78
- return (
79
- <div
80
- className={classNames(style.container, themeName)}
81
- onClick={handleDetailClick}
82
- >
83
- <div className={style.right}>
84
- <div className={style['right-top']}>
85
- <div className={style.title}>{liveName}</div>
86
- </div>
87
- <div className={style['right-bottom']}>
88
- <div className={`${style.time} ${status === 0 ? style['foreshow-time'] : ''} time-box`}>
89
- {isSubscribe ? <Icon type="web_icon_shijian_fill" className={`${style['time-icon']} checked-icon`} /> : <img src={videoSvg} className={style['time-icon']} />}
90
-
91
- {status === 2 ? (
92
- `${dayjs(beginTime).format('YYYY/MM/DD HH:mm')}`
93
- ) : (
94
- `${dayjs(beginTime).format('YYYY/MM/DD HH:mm')} 开始`
95
- )}
96
-
97
- <div className={style.like_sty}>
98
- <div className={style.icon_bottom}>
99
- <img src={yiYue} />
100
- {formatUVCount(liveExt.total_uv || 0)}
101
- </div>
102
- <div className={style.icon_bottom}>
103
- <img src={dianZan} alt="" />
104
- {formatLikesCount(liveExt.like_count || 0)}
105
- </div>
106
- </div>
107
- </div>
108
-
109
- <Action
110
- data={data}
111
- subscription={subscription}
112
- onActionDetailClick={handleDetailClick}
113
- handleLogin={handleLogin}
114
- isLogin={isLogin}
115
- onSubscribe={onSubscribe}
116
- setIsSubscribe={setIsSubscribe}
117
- status={status}
118
- />
119
-
120
- </div>
121
- </div>
122
- <div className={style.left}>
123
- <div className={classNames(style.tag, style[`tag${status}`])}>
124
- {status === 1 || status === 3 ? <img src={PlayImg} alt="" /> : null}
125
- {TagName[status]}
126
- </div>
127
- <Avatar
128
- src={coverUrl || DefaultCover}
129
- errorImg={DefaultCover}
130
- className={style.avatar}
131
- />
132
- </div>
133
- </div>
134
- )
135
- }
1
+ import React, { useEffect, useState } from 'react'
2
+ import dayjs from 'dayjs'
3
+ import classNames from 'classnames'
4
+ import { find } from 'lodash'
5
+ import Avatar from '@/component/Avatar'
6
+ import Icon from '@/component/Icon'
7
+ import { formatLikesCount, formatUVCount } from '@/util/liveCountUtil'
8
+ import { getResourceLikes } from '@/service/like'
9
+ import Action from './Action'
10
+ import DefaultCover from './img/live.png'
11
+ import PlayImg from './img/play.svg'
12
+ import dianZan from './img/like-fill.svg'
13
+ import yiYue from './img/view-fill.svg'
14
+ import videoSvg from './img/video.svg'
15
+ import style from './index.module.less'
16
+
17
+ const TagName = {
18
+ 0: '直播预告',
19
+ 1: '直播中',
20
+ 2: '直播回放',
21
+ 3: '直播中' // 实际是暂停
22
+ }
23
+
24
+ export default function ListItem({
25
+ data,
26
+ themeName,
27
+ subscription,
28
+ onDetailClick,
29
+ handleLogin,
30
+ isLogin,
31
+ onSubscribe
32
+ }) {
33
+ const {
34
+ live_id: liveId,
35
+ live_name: liveName,
36
+ begin_time: beginTime,
37
+ // end_time: endTime,
38
+ cover_url: coverUrl,
39
+ status
40
+ } = data
41
+ const [liveExt, setLiveExt] = useState({})
42
+ const [isSubscribe, setIsSubscribe] = useState(() => {
43
+ if (status === 0) {
44
+ // 开播前15分钟之外
45
+ const subscriptionItem = find(subscription, {
46
+ live_id: liveId
47
+ })
48
+ if (subscriptionItem?.is_subscribe) { // 已预约
49
+ return true
50
+ } else { // 未预约
51
+ return false
52
+ }
53
+ } else {
54
+ return false
55
+ }
56
+ })
57
+
58
+ useEffect(() => {
59
+ (async () => {
60
+ const res = await getResourceLikes(liveId)
61
+ setLiveExt(res || {})
62
+ })()
63
+ }, [])
64
+
65
+ const handleDetailClick = async () => {
66
+ if (data.login && !isLogin) {
67
+ handleLogin(data)
68
+ return
69
+ }
70
+ if (onDetailClick) {
71
+ onDetailClick(data)
72
+ } else {
73
+ // 默认跳转中小学
74
+ window.open(`https://basic.smartedu.cn/publicLive/${liveId}`)
75
+ }
76
+ }
77
+
78
+ return (
79
+ <div
80
+ className={classNames(style.container, themeName)}
81
+ onClick={handleDetailClick}
82
+ >
83
+ <div className={style.right}>
84
+ <div className={style['right-top']}>
85
+ <div className={style.title}>{liveName}</div>
86
+ </div>
87
+ <div className={style['right-bottom']}>
88
+ <div className={`${style.time} ${status === 0 ? style['foreshow-time'] : ''} time-box`}>
89
+ {isSubscribe ? <Icon type="web_icon_shijian_fill" className={`${style['time-icon']} checked-icon`} /> : <img src={videoSvg} className={style['time-icon']} />}
90
+
91
+ {status === 2 ? (
92
+ `${dayjs(beginTime).format('YYYY/MM/DD HH:mm')}`
93
+ ) : (
94
+ `${dayjs(beginTime).format('YYYY/MM/DD HH:mm')} 开始`
95
+ )}
96
+
97
+ <div className={style.like_sty}>
98
+ <div className={style.icon_bottom}>
99
+ <img src={yiYue} />
100
+ {formatUVCount(liveExt.total_uv || 0)}
101
+ </div>
102
+ <div className={style.icon_bottom}>
103
+ <img src={dianZan} alt="" />
104
+ {formatLikesCount(liveExt.like_count || 0)}
105
+ </div>
106
+ </div>
107
+ </div>
108
+
109
+ <Action
110
+ data={data}
111
+ subscription={subscription}
112
+ onActionDetailClick={handleDetailClick}
113
+ handleLogin={handleLogin}
114
+ isLogin={isLogin}
115
+ onSubscribe={onSubscribe}
116
+ setIsSubscribe={setIsSubscribe}
117
+ status={status}
118
+ />
119
+
120
+ </div>
121
+ </div>
122
+ <div className={style.left}>
123
+ <div className={classNames(style.tag, style[`tag${status}`])}>
124
+ {status === 1 || status === 3 ? <img src={PlayImg} alt="" /> : null}
125
+ {TagName[status]}
126
+ </div>
127
+ <Avatar
128
+ src={coverUrl || DefaultCover}
129
+ errorImg={DefaultCover}
130
+ className={style.avatar}
131
+ />
132
+ </div>
133
+ </div>
134
+ )
135
+ }