Commit 02b96ece authored by baixian's avatar baixian

优化

parent 47a4d1c5
......@@ -18,5 +18,5 @@
</head>
<body>
<div id="root"></div>
<script type="text/javascript" src="/dist/main.1af2e7.js"></script></body>
<script type="text/javascript" src="/dist/main.c254f9.js"></script></body>
</html>
\ No newline at end of file
import { routerRedux } from 'dva/router';
import { message, Modal } from 'antd';
import moment from 'moment';
import { delay } from 'redux-saga';
import * as uploader from '../services/uploader';
import * as thememgtajax from '../services/thememgt';
......@@ -1662,7 +1663,7 @@ export default {
});
setTimeout(loadmessage);
if (themeDetailData.code == 200 && themeDetailData.data) {
newcalendarDays = getBetweenDays(themeDetailData.data.calendar_set.start_time, themeDetailData.data.calendar_set.end_time);
newcalendarDays = getBetweenDays(moment(themeDetailData.data.calendar_set.start_time).format('YYYY-MM-DD 00:00'), moment(themeDetailData.data.calendar_set.end_time).format('YYYY-MM-DD 00:00'));
const newRestDays = [];
themeDetailData.data.calendar_set.rest_dates.split(',').forEach((ele) => {
const dayArr = ele.split('-').map((e, index) => {
......
......@@ -428,14 +428,6 @@ export default {
pathname: '/sjd/addLive',
}));
},
* goStartLive({ payload }, { put, select }) {
yield put({
type: 'updateState',
payload: {
downloadVisible: true,
},
});
},
* goEdit({ payload }, { put, select }) {
const { id } = payload;
yield put(routerRedux.push({
......
......@@ -105,7 +105,7 @@ class DownloadModal extends React.Component {
<div className={pageStyle.stepOne} style={{ marginTop: 16 }}>
<span>2</span>网页端地
<div className={pageStyle.copyWrap} style={{ marginTop: 0, marginLeft: 47 }}>
<div className={pageStyle.copyBox} id="copy3">https://www.baidu.com/</div>
<div className={pageStyle.copyBox} id="copy3">{`https://clock-h5.wp53.cn/livecoursedesc/${liveUrlData.id}`}</div>
<div className={pageStyle.copyButton} data-clipboard-target="#copy3" id="btnCopyLink3">复制</div>
</div>
</div>
......
import React from 'react';
import { Modal, Icon } from 'antd';
import { Modal, Icon, message } from 'antd';
import QRCode from 'qrcode.react';
import ClipboardJS from 'clipboard';
import { imagify } from '../../../utils/index';
import pageStyle from './QrcodeShow.less';
class QrcodeShow extends React.Component {
......@@ -10,7 +11,10 @@ class QrcodeShow extends React.Component {
};
}
componentDidMount() { // 挂载
this.clipboard = new ClipboardJS('#btnCopyLink'); // 点击按钮复制到粘贴板
this.clipboard.on('success', () => {
message.success('复制成功', 0.3);
});
}
componentWillUnmount() { // 卸载
......@@ -54,6 +58,10 @@ class QrcodeShow extends React.Component {
previewQrcode && <QRCode className={pageStyle.qrCodeImage} id="qrid" value={previewQrcode} />
}
<div className={pageStyle.download} onClick={this.download}>保存图片至桌面</div>
<div className={pageStyle.copyWrap}>
<div className={pageStyle.copyBox} id="copy">{previewQrcode}</div>
<div className={pageStyle.copyButton} data-clipboard-target="#copy" id="btnCopyLink">复制</div>
</div>
</div>
</div>
</div>
......
......@@ -35,6 +35,7 @@
// overflow: hidden;
max-width: 520px;
width: calc(100% - 10px);
padding-bottom: 20px;
}
.boxHeader {
height: 150px;
......@@ -79,3 +80,49 @@
padding: 20px 0;
cursor: pointer;
}
.copyWrap {
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center;
justify-content: center;
.copyRight {
width: 42px;
margin-right: 20px;
height: 17px;
font-family: PingFangSC-Regular;
font-weight: 400;
color: #353535;
line-height: 17px;
}
.copyBox {
padding: 0 8px;
width: 388px;
background: #F5F7FA;
border-radius: 4px 0 0 4px;
border: 1px solid #eeeeee;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
height: 36px;
font-size: 14px;
font-weight: 400;
color: #808080;
line-height: 34px;
}
.copyButton {
font-size: 14px;
width: 64px;
height: 36px;
background: #3699FF;
border-radius: 0px 4px 4px 0px;
color: white;
display: -webkit-flex;
display: flex;
-webkit-justify-content: center;
justify-content: center;
-webkit-align-items: center;
align-items: center;
cursor: pointer;
}
}
import React from 'react';
import { Icon } from 'antd';
import { Player } from 'video-react';
import videojs from 'video.js';
import componentStyle from './VideoPlay.less';
import { imagify } from '../../../utils';
let myVideo;
class VideoPlay extends React.Component {
constructor(props) {
super(props);
this.state = {
};
videojs.addLanguage('zh-CN', {
Play: '播放',
Pause: '暂停',
'Current Time': '当前时间',
Duration: '时长',
'Remaining Time': '剩余时间',
'Stream Type': '媒体流类型',
LIVE: '直播',
Loaded: '加载完毕',
Progress: '进度',
Fullscreen: '全屏',
'Non-Fullscreen': '退出全屏',
Mute: '静音',
Unmute: '取消静音',
'Playback Rate': '播放速度',
Subtitles: '字幕',
'subtitles off': '关闭字幕',
Captions: '内嵌字幕',
'captions off': '关闭内嵌字幕',
Chapters: '节目段落',
'Close Modal Dialog': '关闭弹窗',
Descriptions: '描述',
'descriptions off': '关闭描述',
'Audio Track': '音轨',
'You aborted the media playback': '视频播放被终止',
'A network error caused the media download to fail part-way.': '网络错误导致视频下载中途失败。',
'The media could not be loaded, either because the server or network failed or because the format is not supported.': '视频因格式不支持或者服务器或网络的问题无法加载。',
'The media playback was aborted due to a corruption problem or because the media used features your browser did not support.': '由于视频文件损坏或是该视频使用了你的浏览器不支持的功能,播放终止。',
'No compatible source was found for this media.': '无法找到此视频兼容的源。',
'The media is encrypted and we do not have the keys to decrypt it.': '视频已加密,无法解密。',
'Play Video': '播放视频',
Close: '关闭',
'Modal Window': '弹窗',
'This is a modal window': '这是一个弹窗',
'This modal can be closed by pressing the Escape key or activating the close button.': '可以按ESC按键或启用关闭按钮来关闭此弹窗。',
', opens captions settings dialog': ', 开启标题设置弹窗',
', opens subtitles settings dialog': ', 开启字幕设置弹窗',
', opens descriptions settings dialog': ', 开启描述设置弹窗',
', selected': ', 选择',
'captions settings': '字幕设定',
'Audio Player': '音频播放器',
'Video Player': '视频播放器',
Replay: '重播',
'Progress Bar': '进度条',
'Volume Level': '音量',
'subtitles settings': '字幕设定',
'descriptions settings': '描述设定',
Text: '文字',
White: '白',
Black: '黑',
Red: '红',
Green: '绿',
Blue: '蓝',
Yellow: '黄',
Magenta: '紫红',
Cyan: '青',
Background: '背景',
Window: '视窗',
Transparent: '透明',
'Semi-Transparent': '半透明',
Opaque: '不透明',
'Font Size': '字体尺寸',
'Text Edge Style': '字体边缘样式',
None: '无',
Raised: '浮雕',
Depressed: '压低',
Uniform: '均匀',
Dropshadow: '下阴影',
'Font Family': '字体库',
'Proportional Sans-Serif': '比例无细体',
'Monospace Sans-Serif': '单间隔无细体',
'Proportional Serif': '比例细体',
'Monospace Serif': '单间隔细体',
Casual: '舒适',
Script: '手写体',
'Small Caps': '小型大写字体',
Reset: '重置',
'restore all settings to the default values': '恢复全部设定至预设值',
Done: '完成',
'Caption Settings Dialog': '字幕设定视窗',
'Beginning of dialog window. Escape will cancel and close the window.': '开始对话视窗。离开会取消及关闭视窗',
'End of dialog window.': '结束对话视窗',
'Now Playing': '正在播放',
'Up Next': '下一个播放',
'Untitled Video': '无标题视频',
});
}
componentDidMount() {
const { src, poster } = this.props;
const options = {
playbackRates: [0.5, 1, 1.5, 2, 4, 8, 16],
poster: imagify(poster),
language: 'zh-CN',
};
myVideo = videojs('myVideo', options, (onPlayerReady) => {
myVideo.src(src);
myVideo.load();
});
}
componentWillUpdate() {
}
cancelCropper = () => {
}
sureCropper = () => {
}
rotateLeft = () => {
}
rotateRight = () => {
}
closeImgPreview = () => {
componentWillUnmount() {
myVideo.dispose(); // 销毁videojs 不然下次打开是原生的Video
}
render() {
const { src, closeVideoPlay } = this.props;
return (
<div className={`${componentStyle.VideoPlayBox} VideoPlayBox`}>
<Icon type="close-circle" className={componentStyle.closeIcon} onClick={closeVideoPlay} />
<Player className={componentStyle.videoitem}>
<source src={src} />
</Player>
<div className={componentStyle.videoitem}>
<video
id="myVideo"
controls
preload="metadata"
className="video-js"
style={{
width: '100%',
height: '90%',
}}
>
</video>
</div>
</div>
);
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -226,7 +226,7 @@ class LiveClass extends React.Component {
type: 'liveclass/updateState',
payload: {
previewQrcodeShow: true,
previewQrcode: `${record.id}`,
previewQrcode: `https://clock-h5.wp53.cn/livecoursedesc/${record.id}`,
},
});
}
......@@ -244,7 +244,7 @@ class LiveClass extends React.Component {
const { dispatch } = this.props;
console.log(record, 'record');
if (record.replay_url.url == '') {
message.warning('转码中,请稍后', 0.5);
message.warning('转码中,请稍后查看', 0.5);
return;
}
dispatch({
......@@ -262,7 +262,7 @@ class LiveClass extends React.Component {
payload: {
lookVideoShow: false,
lookVideoPoster: '',
lookVideoUrl: [],
lookVideoUrl: '',
},
});
}
......@@ -355,7 +355,7 @@ class LiveClass extends React.Component {
<Divider type="vertical" />
<span className="hreflink" onClick={() => this.goShare(record)}>分享直播间</span>
{
(record.status != 3 && record.live_status != 4) && <span className="hreflink" onClick={() => this.goStartLive(record)}><Divider type="vertical" />去直播</span>
(record.status != 2 && record.live_status != 4) && <span className="hreflink" onClick={() => this.goStartLive(record)}><Divider type="vertical" />去直播</span>
}
{
(record.live_status == 4 && record.need_replay == 1) && <span className="hreflink" onClick={() => this.goLook(record)}><Divider type="vertical" />直播回放</span>
......@@ -438,6 +438,7 @@ class LiveClass extends React.Component {
visible={downloadVisible}
close={this.closeDownload}
liveUrlData={liveUrlData}
previewQrcode={previewQrcode}
/>
<QrcodeShow
previewQrcodeShow={previewQrcodeShow}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment