Commit 816c728b by zhangleyuan

Merge branch 'master' into feature/zhangleyuan/20210812/opzi-organize

parents 83845478 9fc06fe3
...@@ -3,7 +3,7 @@ export const BRAND: any = process.env.BRAND; ...@@ -3,7 +3,7 @@ export const BRAND: any = process.env.BRAND;
const BrandNameMap: any = { const BrandNameMap: any = {
xiaomai: '小麦企学院', xiaomai: '小麦企学院',
syoo: '云课堂' syoo: '商有云课堂'
} }
const BrandIconMap: any = { const BrandIconMap: any = {
...@@ -43,7 +43,10 @@ const XF_RWM_MAP: any = { ...@@ -43,7 +43,10 @@ const XF_RWM_MAP: any = {
syoo: 'https://image.xiaomaiketang.com/xm/Z2X2GTmKdj.png' syoo: 'https://image.xiaomaiketang.com/xm/Z2X2GTmKdj.png'
} }
const LiveNameMap: any = {
xiaomai: '小麦直播',
syoo: '商有直播'
}
export const brandName: string = BrandNameMap[BRAND]; export const brandName: string = BrandNameMap[BRAND];
...@@ -54,5 +57,6 @@ export const path: string = PATH_MAP[BRAND]; ...@@ -54,5 +57,6 @@ export const path: string = PATH_MAP[BRAND];
export const live: string = LIVE_SHARE_MAP[BRAND]; export const live: string = LIVE_SHARE_MAP[BRAND];
export const corpType: string = CorpType_MAP[BRAND]; export const corpType: string = CorpType_MAP[BRAND];
export const xfrwm: string = XF_RWM_MAP[BRAND] export const xfrwm: string = XF_RWM_MAP[BRAND]
export const brandLiveName: string = LiveNameMap[BRAND]
window.brandName = BrandNameMap[BRAND]; window.brandName = BrandNameMap[BRAND];
import React, { useState, useRef, useEffect, useContext } from 'react'
import { Route, withRouter } from 'react-router-dom';
import Breadcrumbs from "@/components/Breadcrumbs";
import moment from 'moment'
import { Form, Alert, Input, Button, InputNumber, DatePicker, Select, Radio, message, Modal } from 'antd';
import Service from "@/common/js/service";
import User from "@/common/js/user";
declare var wx: any;
const { Option } = Select;
const courseType = {
0: '通用直播',
1: '小班课',
2: '大班课',
3: '企业培训',
4: '活动直播'
}
function CerateQWCourse(props: any) {
const [courseName, setCourseName] = useState('');
const [liveDuration, setLiveDuration] = useState(60);
const [liveStart, setLiveStart] = useState(0);
const [type, setType] = useState('0');
function handleSave() {
const param = {
courseName,
description: '直播的简介,最多支持300个字节直播的简介,最多支持300个字节直播的简介,最多支持300个字节直播的简介,最多支持300个字节直播的简介,最多支持300个字节直播的简介,最多支持300个字节',
liveDuration: liveDuration * 60 * 100,
liveStart,
remindTime: 1000 * 60 * 10,
storeId: User.getStoreId(),
storeUserId: User.getStoreUserId(),
type: parseInt(type)
}
Service.Hades('anon/hades/wxWorkCreateLiveDemo', param).then((res) => {
wx.invoke('startLiving', {
"livingId": res.result,
}, function (res: any) {
if (res.err_msg == "startLiving:ok") {
// livingId = res.livingId;
}
});
})
}
return <div className="page createQWCourse ">
<Breadcrumbs navList={props.type === 'edit' ? "编辑考试" : "新建直播课"} goBack={props.history.goBack} />
<div className="box">
<div className="form">
<div className="title">直播信息</div>
<Form
labelCol={{ span: 3 }}
wrapperCol={{ span: 14 }}
layout="horizontal"
>
<Form.Item label="课程名称"
required>
<Input value={courseName} onChange={(e) => { setCourseName(e.target.value) }} style={{ width: 200 }} ></Input>
</Form.Item>
<Form.Item label="持续时长"
required>
<InputNumber value={liveDuration} max={1440} min={1} onChange={(value: any) => { setLiveDuration(parseInt(value) as any) }} style={{ width: 100 }} />
</Form.Item>
<Form.Item label="开始时间"
required>
<DatePicker
format="YYYY/MM/DD HH:mm"
value={liveStart ? moment(Number(liveStart)) : null}
style={{ width: 200 }}
placeholder="开始时间"
showTime
onChange={(date: any) => { setLiveStart(date ? date.valueOf() : 0) }}
/>
</Form.Item>
<Form.Item label="直播的类型"
required>
<Select value={type} placeholder="请选直播的类型" style={{ width: 200 }} onChange={(val) => {
setType(val)
}} >
{
Object.keys(courseType).map((key: any) => {
return <Option value={key}>{(courseType as any)[key]}</Option>
})
}
</Select>
</Form.Item>
</Form>
</div>
</div>
<div className="footer">
<Button onClick={props.history.goBack}>取消</Button>
<Button type="primary" onClick={handleSave}>保存</Button>
</div>
</div>
}
export default withRouter(CerateQWCourse);
\ No newline at end of file
...@@ -214,7 +214,7 @@ function CreateWorkWXCourse() { ...@@ -214,7 +214,7 @@ function CreateWorkWXCourse() {
if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) { if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) {
Modal.warning({ Modal.warning({
title: '服务已到期', title: '服务已到期',
content: '当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买', content: `当前企业购买的${window.brandName}服务已到期,如需继续使用学院功能,请尽快续费购买`,
okText: '我知道了', okText: '我知道了',
}); });
return; return;
...@@ -441,7 +441,7 @@ function CreateWorkWXCourse() { ...@@ -441,7 +441,7 @@ function CreateWorkWXCourse() {
<Breadcrumbs navList={type === 'add' ? '新建直播课' : '编辑直播课'} goBack={handleGoBack} /> <Breadcrumbs navList={type === 'add' ? '新建直播课' : '编辑直播课'} goBack={handleGoBack} />
<div className='box'> <div className='box'>
<div className='show-tips'> <div className='show-tips'>
<ShowTips message='请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利' /> <ShowTips message={`请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,${window.brandName}保有依据国家规定及平台规则进行处理的权利`} />
</div> </div>
<div className='add-live-page__form'> <div className='add-live-page__form'>
<div className='basic-info__wrap'> <div className='basic-info__wrap'>
......
...@@ -14,6 +14,7 @@ import moment from 'moment' ...@@ -14,6 +14,7 @@ import moment from 'moment'
import StoreService from '@/domains/store-domain/storeService' import StoreService from '@/domains/store-domain/storeService'
import User from '@/common/js/user' import User from '@/common/js/user'
import './LiveCourseFilter.less' import './LiveCourseFilter.less'
import { brandLiveName } from '@/domains/brand/constants'
const { Search } = Input const { Search } = Input
const { Option } = Select const { Option } = Select
...@@ -325,7 +326,7 @@ class LiveCourseFilter extends React.Component { ...@@ -325,7 +326,7 @@ class LiveCourseFilter extends React.Component {
</span> </span>
}> }>
<Option value='WECHAT'>企微直播</Option> <Option value='WECHAT'>企微直播</Option>
<Option value='TENCENT'>小麦直播</Option> <Option value='TENCENT'>{brandLiveName}</Option>
</Select> </Select>
</div> </div>
)} )}
......
...@@ -26,6 +26,7 @@ import RelatedPlanModal from '../modal/RelatedPlanModal'; ...@@ -26,6 +26,7 @@ import RelatedPlanModal from '../modal/RelatedPlanModal';
import ShareLiveModal from '../modal/ShareLiveModal'; import ShareLiveModal from '../modal/ShareLiveModal';
import Bus from '@/core/bus'; import Bus from '@/core/bus';
import './LiveCourseList.less'; import './LiveCourseList.less';
import { brandLiveName } from '@/domains/brand/constants';
const { confirm } = Modal const { confirm } = Modal
const courseStateShow = { const courseStateShow = {
...@@ -234,7 +235,7 @@ class LiveCourseList extends React.Component { ...@@ -234,7 +235,7 @@ class LiveCourseList extends React.Component {
key: 'couseCatalog', key: 'couseCatalog',
dataIndex: 'couseCatalog', dataIndex: 'couseCatalog',
render: (val, item) => { render: (val, item) => {
return <div>{item.thirdPartType === "WECHAT" ? "企微直播":"小麦直播"}</div>; return <div>{item.thirdPartType === "WECHAT" ? "企微直播":`${brandLiveName}`}</div>;
}, },
}, },
{ {
...@@ -367,7 +368,7 @@ class LiveCourseList extends React.Component { ...@@ -367,7 +368,7 @@ class LiveCourseList extends React.Component {
(item.teacherId === User.getUserId() || _.pluck(item.admins, 'adminId').includes(User.getUserId())) && ( (item.teacherId === User.getUserId() || _.pluck(item.admins, 'adminId').includes(User.getUserId())) && (
<> <>
{ {
isMac()?( isMac() && item.thirdPartType === "WECHAT" ? (
<Tooltip title="请使用windows电脑进入直播间" placement="left"> <Tooltip title="请使用windows电脑进入直播间" placement="left">
<div style={{fontSize:"14px",color:"#999999"}}> <div style={{fontSize:"14px",color:"#999999"}}>
进入直播间 进入直播间
......
import React, { useState } from "react"; import React, { useState } from "react";
import "./LiveModeSelect.less" import "./LiveModeSelect.less"
import { createPortal } from "react-dom"; import { createPortal } from "react-dom";
import { brandLiveName } from "@/domains/brand/constants";
interface LiveModeSelectProps { interface LiveModeSelectProps {
isShow: boolean; isShow: boolean;
...@@ -32,8 +33,8 @@ export default function LiveModeSelect(props: LiveModeSelectProps) { ...@@ -32,8 +33,8 @@ export default function LiveModeSelect(props: LiveModeSelectProps) {
<div className="content"> <div className="content">
<div className="item xiaomai-logo"> <div className="item xiaomai-logo">
<div className="logo"></div> <div className="logo"></div>
<div className="item-title">小麦直播</div> <div className="item-title">{brandLiveName}</div>
<div className="des">通过小麦企学院“PC客户<br/>端”进行直播</div> <div className="des">通过{window.brandName}“PC客户<br/>端”进行直播</div>
<div className="button" onClick={handleSelect0}>立即创建</div> <div className="button" onClick={handleSelect0}>立即创建</div>
</div> </div>
<div className="item qiwei-logo"> <div className="item qiwei-logo">
......
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