Commit b52d2874 by guomingpang

Merge branch 'dev' of…

Merge branch 'dev' of ssh://xmgit.ixm5.cn:10022/xiaomai-cloud-class/xiaomai-cloud-class-web into dev
parents 1eb551e7 5a0b1d53
......@@ -72,6 +72,7 @@ function getClientEnvironment(publicUrl) {
// Useful for determining whether we’re running in production mode.
// Most importantly, it switches React into the correct mode.
NODE_ENV: process.env.NODE_ENV || 'development',
BRAND: process.env.BRAND || 'xiaomai',
DEPLOY_ENV: process.env.DEPLOY_ENV,
// Useful for resolving the correct path to static assets in `public`.
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
......
......@@ -93,6 +93,7 @@
"style-loader": "0.23.1",
"terser-webpack-plugin": "2.3.8",
"ts-pnp": "1.1.6",
"better-npm-run": "^0.1.0",
"typescript": "^4.0.2",
"underscore": "^1.10.2",
"url-loader": "2.3.0",
......@@ -111,12 +112,30 @@
"start:rc": "cross-env DEPLOY_ENV=rc node scripts/start.js",
"start:gray": "cross-env DEPLOY_ENV=gray node scripts/start.js",
"start:prod": "cross-env DEPLOY_ENV=prod node scripts/start.js",
"build:dev": "cross-env DEPLOY_ENV=dev node --max_old_space_size=4096 scripts/build.js",
"start:syoo": "better-npm-run start:syoo",
"build:dev": "cross-env DEPLOY_ENV=dev node scripts/build.js",
"build:dev1": "cross-env DEPLOY_ENV=dev node scripts/build.js",
"build:rc": "cross-env DEPLOY_ENV=rc node scripts/build.js",
"build:gray": "cross-env DEPLOY_ENV=gray node scripts/build.js",
"build:syoo": "better-npm-run build:syoo",
"build:prod": "cross-env DEPLOY_ENV=prod node scripts/build.js"
},
"betterScripts": {
"start:syoo": {
"command": "node scripts/start.js",
"env": {
"DEPLOY_ENV": "",
"BRAND": "syoo"
}
},
"build:syoo": {
"command": "node scripts/build.js",
"env": {
"DEPLOY_ENV": "prod",
"BRAND": "syoo"
}
}
},
"eslintConfig": {
"extends": "react-app"
},
......
......@@ -104,11 +104,12 @@
const appTermEnum = getParameterByName('appTermEnum');
const code = getParameterByName('code');
const ticket = getParameterByName('ticket');
const corpType = getParameterByName('corpType');
if (!code) {
postJSON('hades/anon/hades/getCorpTrainSuiteId', {}, (res) => {
GetJSON('hades/anon/hades/getCorpTrainSuiteId', (res) => {
const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${res.result}&redirect_uri=${encodeURIComponent(location.href)}&response_type=code&scope=snsapi_privateinfo&state=STATE#wechat_redirect`
location.href = url
})
......@@ -133,7 +134,20 @@
}
function GetJSON(url, callback) {
const ajaxOptions = {
type: 'GET',
url: BASIC_HOST_MAP[env] + url+`?corpType=${corpType}`,
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
timeout: 20000,
success(res, status, xhr) {
callback(res)
},
};
$.ajax(ajaxOptions)
}
......
......@@ -8,7 +8,7 @@
*/
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosPromise, AxiosError } from 'axios';
import { message, Modal } from 'antd';
import { corpType } from '@/domains/brand/constants'
import { BASIC_HOST, TIME_OUT, USER_TYPE, VERSION, PROJECT } from '@/domains/basic-domain/constants';
import User from './user';
......@@ -24,12 +24,12 @@ interface FetchOptions {
requestType: string, // 请求类型 form为表单类型 json为json类型,默认json类型
reject: boolean,
}
interface HeadersType{
storeId?:any,
storeUserId?:any,
userId?:any,
xmtoken?:any,
enterpriseId?:string|null
interface HeadersType {
storeId?: any,
storeUserId?: any,
userId?: any,
xmtoken?: any,
enterpriseId?: string | null
}
class Axios {
static post(
......@@ -40,17 +40,17 @@ class Axios {
): Promise<any> {
const _url = `${url}?storeId=${User.getStoreId()}&token=${User.getToken()}&storeUserId=${User.getStoreUserId()}&userId=${User.getUserId()}`;
return new Promise((resolve, reject) => {
let headerObject:HeadersType={};
if(User.getStoreId()){
let headerObject: HeadersType = {};
if (User.getStoreId()) {
headerObject.storeId = User.getStoreId();
}
if(User.getStoreUserId()){
if (User.getStoreUserId()) {
headerObject.storeUserId = User.getStoreUserId();
}
if(User.getUserId()){
if (User.getUserId()) {
headerObject.userId = User.getUserId();
}
if(User.getToken()){
if (User.getToken()) {
headerObject.xmtoken = User.getToken();
}
if (User.getEnterpriseId()) {
......@@ -92,8 +92,8 @@ class Axios {
const { message: ResMessage, success, resultMsg, code: resultCode } = response.data;
if (resultCode === "CROP_DEPLOY_PAST_BETTER") {
Modal.warning({
title:"服务已到期",
content: "当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买",
title: "服务已到期",
content: `当前企业购买的${window.brandName}服务已到期,如需继续使用学院功能,请尽快续费购买`,
okText: "我知道了"
})
} else if (success || resultCode === 0) {
......@@ -104,7 +104,7 @@ class Axios {
return Promise.reject(response.data);
}, (error): AxiosPromise => {
const requestStatus = error.request.status
switch (requestStatus){
switch (requestStatus) {
case 401:
User.removeUserId();
User.removeToken();
......@@ -130,7 +130,9 @@ class Axios {
if (method === 'GET') {
config = Object.assign({ params, url: `${BASIC_HOST}${_url}`, method });
} else {
config = Object.assign({ data: params, url: `${BASIC_HOST}${_url}`, method });
console.log(corpType)
config = Object.assign({ data: { corpType, ...(params || {}) }, url: `${BASIC_HOST}${_url}`, method });
console.log(config,'config')
}
instance(config).then((res: AxiosResponse): void => {
......
......@@ -7,10 +7,11 @@
* @FilePath: /wheat-web-demo/src/domains/basic-domain/constants.ts
*/
import { MapInterface } from '@/domains/basic-domain/interface'
import { path,live } from '@/domains/brand/constants'
// 默认是 dev 环境
const ENV: string = process.env.DEPLOY_ENV || 'dev'
console.log('process.env.DEPLOY_ENV', process)
console.log('process.env.DEPLOY_ENV', process.env, ENV, 'hjkkkk')
const BASIC_HOST_MAP: MapInterface = {
dev: 'https://dev-heimdall.xiaomai5.com/',
dev1: 'https://dev1-heimdall.xiaomai5.com/',
......@@ -23,7 +24,7 @@ const PATH_MAP: MapInterface = {
dev1: 'https://dev.xiaomai5.com/xiaomai-cloud-class-web/h5.html',
rc: 'https://rc.xiaomai5.com/xiaomai-cloud-class-web/h5.html',
gray: 'https://res.xiaomai0.com/xiaomai-cloud-class-web/gray/h5.html',
prod: 'https://res.xiaomai0.com/xiaomai-cloud-class-web/h5.html',
prod: path,
}
export const YZ_APPId = "yozoqvpO2Hvz8346";
......
export const BRAND: any = process.env.BRAND;
const BrandNameMap: any = {
xiaomai: '小麦企学院',
syoo: '云课堂'
}
const BrandIconMap: any = {
xiaomai: 'https://image.xiaomaiketang.com/xm/bFkRBz7teA.png',
syoo: 'https://image.xiaomaiketang.com/xm/PfDseQHZtB.png'
}
const BrandLogoMap: any = {
xiaomai: 'https://image.xiaomaiketang.com/xm/6k8PPCmywG.png',
syoo: 'https://image.xiaomaiketang.com/xm/T7NRKwrfQE.png'
}
const BrandBannerMap: any = {
xiaomai: 'https://image.xiaomaiketang.com/xm/CDCcdAdaPs.png',
syoo: 'https://image.xiaomaiketang.com/xm/DzMHpX7GWF.png'
}
const PATH_MAP: any = {
prod: 'https://res.xiaomai0.com/xiaomai-cloud-class-web/h5.html',
syoo: 'https://res.xiaomai0.com/xiaomai-cloud-class-web/h5.html',
}
const LIVE_SHARE_MAP: any = {
xiaomai: 'https://res.xiaomai0.com/store-live/index.html#/',
syoo: 'https://res.xiaomai0.com/store-live/index.html#/',
}
const CorpType_MAP: any = {
xiaomai: 'X_MAI',
syoo: 'S_YOU',
}
export const brandName: string = BrandNameMap[BRAND];
export const brandIcon: string = BrandIconMap[BRAND];
export const brandLogo: string = BrandLogoMap[BRAND];
export const brandBanner: string = BrandBannerMap[BRAND];
export const path: string = PATH_MAP[BRAND];
export const live: string = LIVE_SHARE_MAP[BRAND];
export const corpType: string = CorpType_MAP[BRAND];
window.brandName = BrandNameMap[BRAND];
......@@ -7,6 +7,7 @@
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
import { MapInterface } from '@/domains/basic-domain/interface'
import { path, live } from '@/domains/brand/constants'
const ENV: string = process.env.DEPLOY_ENV || 'dev';
const appIdMap: MapInterface = {
......@@ -14,7 +15,7 @@ const appIdMap: MapInterface = {
dev1: 'wx3ea60e78ddfa277e',
rc: 'wx5c5a1fb71ecab7bc',
gray: "wx3dda02036493ada6", // 小麦校讯通
prod: 'wx3dda02036493ada6'
prod: 'wx3dda02036493ada6',
}
const shareUrlMap: MapInterface = {
......@@ -22,7 +23,7 @@ const shareUrlMap: MapInterface = {
'dev1': 'https://dev.xiaomai5.com/share/show?appid=',
'rc': 'https://rc.xiaomai5.com/share/show?appid=',
'prod': 'https://prod.xiaomai5.com/share/show?appid=',
'gray': 'https://prod.xiaomai5.com/share/show?appid='
'gray': 'https://prod.xiaomai5.com/share/show?appid=',
}
const LIVE_SHARE_MAP: MapInterface = {
......@@ -30,7 +31,7 @@ const LIVE_SHARE_MAP: MapInterface = {
dev1: 'https://dev.xiaomai5.com/store-live/index.html#/',
rc: 'https://rc.xiaomai5.com/store-live/index.html#/',
gray: 'https://res.xiaomai0.com/store-live/gray/index.html#/',
prod: 'https://res.xiaomai0.com/store-live/index.html#/',
prod: live,
}
......
......@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-08-24 12:20:57
* @LastEditors: Please set LastEditors
* @LastEditTime: 2021-07-19 15:48:51
* @LastEditTime: 2021-08-02 17:00:14
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
-->
......@@ -22,7 +22,8 @@
content="小麦企学院,企业培训,员工培训,企业大学,企业内训,企业外训,培训计划,培训素材,企培,企训,素材库,培训课程,培训任务,直播课,线上课,图文课,线下活动,知识库,作业,考试,排行榜,培训类别管理,定制培训计划,管理数据,学习数据,企学院,资料共享,培训数字化,数字化培训,培训工具,在线培训,线上培训,培训saas,培训管理,企业微信培训,对客培训,客户培训,直播培训,互联网培训,新员工培训,管理培训,管理者培训,工人培训,制造业培训,餐饮培训,服务业培训,零售培训,门店培训,工厂培训,车间培训,培训补贴,人事培训,财务培训,职场培训,企业学院平台,教育企业学院,教育企业平台,教育平台学院,企业学习,酷学院,小鹅通,企业学院,云学堂,时代光华,云课堂,魔学院,云大学,米知云,授课学堂"
/>
<!-- <link rel="apple-touch-icon" href="../src/common/images/logo.png" /> -->
<link rel="shortcut icon" href="https://image.xiaomaiketang.com/xm/c4KiP2epBP.png" />
<!-- <link rel="shortcut icon" href="https://image.xiaomaiketang.com/xm/c4KiP2epBP.png" /> -->
<!-- <link rel="shortcut icon" href="https://image.xiaomaiketang.com/xm/WGWCtxiGzE.png"> -->
<!--
manifest.json provides metadata used when your web app is installed on a
......
......@@ -23,12 +23,24 @@ import '@/core/xmTD';
import User from '@/common/js/user';
import Service from "@/common/js/service";
import BaseService from '@/domains/basic-domain/baseService';
import {brandName,BRAND,brandIcon} from '@/domains/brand/constants'
declare var getParameterByName: any;
declare var window: any;
window.currentStoreUserInfo = {}
const history = createHashHistory();
document.title=brandName;
var iconUrl ='https://image.xiaomaiketang.com/xm/WGWCtxiGzE.png'
if(BRAND !='xiaomai'){
iconUrl =brandIcon
}
var linkzh = document.createElement('link');
linkzh.setAttribute('rel',"shortcut icon");
linkzh.setAttribute('href',iconUrl);
document.head.appendChild(linkzh);
window.RCHistory = _.extend({}, history, {
push: (obj: any) => {
history.push(obj)
......
......@@ -26,7 +26,7 @@ export default function LimitTip(props:{total:number,type:string,tip:() => React
{
isOver ? (
<>
<div style={{marginLeft:"14px",display:"inline-block"}}>当前企业使用人数已达到上限 (<span style={{color:"#333333",fontWeight:"bold"}}>{limitUser}</span>人),将无法添加新员工、新学员,如需增加人数限制,请联系小麦企学院服务平台。</div>
<div style={{marginLeft:"14px",display:"inline-block"}}>{`当前企业使用人数已达到上限 (<span style={{color:"#333333",fontWeight:"bold"}}>{limitUser}</span>人),将无法添加新员工、新学员,如需增加人数限制,请联系${window.brandName}服务平台。`}</div>
<ContactWidget trigger="hover" placement="bottom">
<div className="renew-text">立即续费<span className="icon iconfont" style={{fontSize:"10px"}}>&#59291;</span></div>
</ContactWidget>
......
......@@ -279,7 +279,7 @@ class AddLive extends React.Component {
if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) {
Modal.warning({
title: '服务已到期',
content: '当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买',
content: `当前企业购买的${window.brandName}服务已到期,如需继续使用学院功能,请尽快续费购买`,
okText: '我知道了',
});
return;
......@@ -541,7 +541,7 @@ class AddLive extends React.Component {
<Breadcrumbs navList={type == 'add' ? '新建直播课' : '编辑直播课'} goBack={this.handleGoBack} />
<div className='box'>
<div className='show-tips'>
<ShowTips message='请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利' />
<ShowTips message={`请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,${window.brandName}保有依据国家规定及平台规则进行处理的权利`} />
</div>
<div className='add-live-page__form'>
<div className='basic-info__wrap'>
......
......@@ -280,7 +280,7 @@ class AddGraphicsCourse extends React.Component {
if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) {
Modal.warning({
title: '服务已到期',
content: '当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买',
content: `当前企业购买的${window.brandName}服务已到期,如需继续使用学院功能,请尽快续费购买`,
okText: '我知道了',
})
return
......@@ -423,7 +423,7 @@ class AddGraphicsCourse extends React.Component {
<div className='box'>
<div className='show-tips'>
<ShowTips message='请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利' />
<ShowTips message={`请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,${window.brandName}保有依据国家规定及平台规则进行处理的权利`} />
</div>
<div className='form'>
......
......@@ -313,11 +313,6 @@ class GraphicsCourseList extends React.Component {
//改变上架状态
changeShelfState = (index, item, checked) => {
let _shelfState = checked ? 'YES' : 'NO'
// if(_shelfState==='NO'){
// _shelfState = "YES";
// }else{
// _shelfState = "NO"
// }
const params = {
courseId: item.id,
shelfState: _shelfState,
......
......@@ -373,7 +373,7 @@ class AddOfflineCourse extends React.Component {
if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) {
Modal.warning({
title: '服务已到期',
content: '当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买',
content: `当前企业购买的${window.brandName}服务已到期,如需继续使用学院功能,请尽快续费购买`,
okText: '我知道了',
})
return
......@@ -711,7 +711,7 @@ class AddOfflineCourse extends React.Component {
<div className='box'>
<div className='show-tips'>
<ShowTips message='请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利' />
<ShowTips message={`请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,${window.brandName}保有依据国家规定及平台规则进行处理的权利`} />
</div>
<div className='form'>
......
/*
* @Author: 吴文洁
* @Date: 2020-08-05 10:07:47
* @LastEditors: yuananting
* @LastEditTime: 2021-07-23 14:26:26
* @LastEditors: Please set LastEditors
* @LastEditTime: 2021-08-02 17:00:46
* @Description: 线上课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
import React from 'react'
import { Button, Input, message, Modal, Tooltip, Form, Popconfirm, Menu, Dropdown } from 'antd'
import { FileTypeIcon, FileVerifyMap } from '@/common/constants/academic/lessonEnum'
import { CourseCatalogSelect } from '@/modules/common'
import ShowTips from '@/components/ShowTips'
import Breadcrumbs from '@/components/Breadcrumbs'
import moment from 'moment'
import AddVideoIntro from './components/AddVideoIntro'
import SelectStudent from '../modal/select-student'
import SelectPrepareFileModal from '../../prepare-lesson/modal/SelectPrepareFileModal'
import PreviewCourseModal from '../modal/PreviewCourseModal'
import StoreService from '@/domains/store-domain/storeService'
import CourseService from '@/domains/course-domain/CourseService'
import Service from '@/common/js/service'
import User from '@/common/js/user'
import _ from 'underscore'
import Upload from '@/core/upload'
import { randomString } from '@/domains/basic-domain/utils'
import ImgClipModal from '@/components/ImgClipModal'
import $ from 'jquery'
import './AddVideoCourse.less'
import Bus from '@/core/bus'
const { TextArea } = Input
const EDIT_BOX_KEY = Math.random()
const fieldNames = { label: 'categoryName', value: 'id', children: 'sonCategoryList' }
import React from 'react';
import { Button, Input, message, Modal, Tooltip, Form, Popconfirm, Menu, Dropdown } from 'antd';
import { FileTypeIcon } from '@/common/constants/academic/lessonEnum';
import { CourseCatalogSelect } from '@/modules/common';
import ShowTips from '@/components/ShowTips';
import Breadcrumbs from '@/components/Breadcrumbs';
import moment from 'moment';
import AddVideoIntro from './components/AddVideoIntro';
import SelectStudent from '../modal/select-student';
import SelectPrepareFileModal from '../../prepare-lesson/modal/SelectPrepareFileModal';
import PreviewCourseModal from '../modal/PreviewCourseModal';
import CourseService from '@/domains/course-domain/CourseService';
import Service from '@/common/js/service';
import User from '@/common/js/user';
import _ from 'underscore';
import Upload from '@/core/upload';
import { randomString } from '@/domains/basic-domain/utils';
import ImgClipModal from '@/components/ImgClipModal';
import $ from 'jquery';
import './AddVideoCourse.less';
import Bus from '@/core/bus';
const { TextArea } = Input;
const EDIT_BOX_KEY = Math.random();
//添加课程时课程默认的一些值
const defaultShelfState = 'YES'
const defaultShelfState = 'YES';
const defaultScheduleMedia = [
{
contentType: 'INTRO',
......@@ -43,23 +41,23 @@ const defaultScheduleMedia = [
mediaContent: '',
key: EDIT_BOX_KEY,
},
]
const whetherVisitorsJoin = 'NO'
];
const whetherVisitorsJoin = 'NO';
let cutFlag = false
let cutFlag = false;
const SUPPORT_WORD_PDF = [
'application/msword',
'application/wps-writer',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/pdf',
'application/wps-office.pdf',
]
];
class AddVideoCourse extends React.Component {
constructor(props) {
super(props)
super(props);
const id = getParameterByName('id')
const pageType = getParameterByName('type')
const id = getParameterByName('id');
const pageType = getParameterByName('type');
this.state = {
id, // 线上课ID,编辑的时候从URL上带过来
......@@ -95,81 +93,59 @@ class AddVideoCourse extends React.Component {
mediaNameAlias: '', // 任一视频重命名的名称(气泡框)
selectTypeList: ['MP4'],
accept: 'video/mp4',
}
};
}
componentWillMount() {
const { id, pageType } = this.state
const { id, pageType } = this.state;
if (pageType === 'edit') {
this.handleFetchScheudleDetail(id)
this.handleFetchScheudleDetail(id);
}
Bus.bind('editorLimit', (editorTextLength) => {
this.setState({
editorTextLength,
})
})
});
});
}
handleChangeCatalogList = (value, label) => {
this.setState({ categoryId: value, categoryName: label[0] })
}
this.setState({ categoryId: value, categoryName: label[0] });
};
// catalogChange = (value, _categoryName) => {
// const categoryName = _.pluck(_categoryName, 'categoryName').join('-')
// const changeValueLength = value.length
// switch (changeValueLength) {
// case 1:
// this.setState({ categoryId: value[0], categoryName })
// break
// case 2:
// this.setState({ categoryId: value[1], categoryName })
// break
// default:
// this.setState({ categoryId: null })
// break
// }
// }
// 获取线上课详情
handleFetchScheudleDetail = (courseId) => {
CourseService.videoScheduleDetail({
courseId,
}).then((res) => {
const { result = {} } = res || {}
const { courseName, shelfState, whetherVisitorsJoin, courseMediaVOS, categoryId, courseChapterVOList = [] } = result
let coverId
let coverUrl
let scheduleMedia = []
let scheduleVideoUrl
let hasIntro
const { result = {} } = res || {};
const { courseName, shelfState, whetherVisitorsJoin, courseMediaVOS, categoryId, courseChapterVOList = [] } = result;
let coverId;
let coverUrl;
let scheduleMedia = [];
let scheduleVideoUrl;
let hasIntro;
courseMediaVOS.map((item) => {
switch (item.contentType) {
case 'COVER':
coverId = item.mediaContent
coverUrl = item.mediaUrl
break
coverId = item.mediaContent;
coverUrl = item.mediaUrl;
break;
case 'INTRO':
hasIntro = true
this.getTextDetail('introduce', item.mediaUrl)
break
hasIntro = true;
this.getTextDetail('introduce', item.mediaUrl);
break;
default:
break
break;
}
return item
})
// let categoryName
// if (categoryTwoName) {
// categoryName = `${categoryOneName}-${categoryTwoName}`
// } else {
// categoryName = `${categoryOneName}`
// }
return item;
});
const _courseChapterVOList = courseChapterVOList.map((item) => {
item.mediaName = item.name
item.resourceId = item.id
return item
})
item.mediaName = item.name;
item.resourceId = item.id;
return item;
});
this.setState({
loadintroduce: !hasIntro,
......@@ -182,9 +158,9 @@ class AddVideoCourse extends React.Component {
whetherVisitorsJoin,
categoryId,
courseChapterList: _courseChapterVOList,
})
})
}
});
});
};
getTextDetail = (key, url) => {
$.ajax({
......@@ -193,13 +169,13 @@ class AddVideoCourse extends React.Component {
url,
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
success: (res) => {
this.setState({ [key]: res, [`load${key}`]: true })
this.setState({ [key]: res, [`load${key}`]: true });
},
})
}
});
};
handleGoBack = () => {
const { coverId, courseName, scheduleMedia, courseChapterList, categoryId, shelfState, whetherVisitorsJoin } = this.state
const { coverId, courseName, scheduleMedia, courseChapterList, categoryId, shelfState, whetherVisitorsJoin } = this.state;
if (
!courseChapterList.length ||
!_.isEqual(scheduleMedia, defaultScheduleMedia) ||
......@@ -218,29 +194,29 @@ class AddVideoCourse extends React.Component {
onOk: () => {
window.RCHistory.push({
pathname: `/video-course`,
})
});
},
})
});
} else {
window.RCHistory.push({
pathname: `/video-course`,
})
}
});
}
};
// 修改表单
handleChangeForm = (field, value, coverUrl) => {
this.setState({
[field]: value,
coverUrl: coverUrl ? coverUrl : this.state.coverUrl,
})
}
});
};
// 显示选择学员弹窗
handleShowSelectStuModal = () => {
this.setState({ studentModal: true })
this.setState({ studentModal: true });
const { studentList, selectedStuList } = this.state
const { studentList, selectedStuList } = this.state;
const studentModal = (
<SelectStudent
showTabs={true}
......@@ -251,35 +227,35 @@ class AddVideoCourse extends React.Component {
close={() => {
this.setState({
studentModal: null,
})
});
}}
/>
)
this.setState({ studentModal })
}
);
this.setState({ studentModal });
};
handleSelectStudent = (studentIds) => {
let studentList = []
let studentList = [];
_.each(studentIds, (item) => {
studentList.push({ studentId: item })
})
this.setState({ studentList })
this.setState({ studentModal: false })
}
studentList.push({ studentId: item });
});
this.setState({ studentList });
this.setState({ studentModal: false });
};
// 显示预览弹窗
handleShowPreviewModal = () => {
const { coverUrl, scheduleVideoUrl, courseName, scheduleMedia, introduce, courseChapterList, categoryName } = this.state
const { coverUrl, scheduleVideoUrl, courseName, scheduleMedia, introduce, courseChapterList, categoryName } = this.state;
const courseBasinInfo = {
coverUrl,
scheduleVideoUrl,
courseName,
}
};
const courseIntroInfo = {
liveCourseMediaRequests: scheduleMedia,
introduce,
categoryName,
}
};
const previewCourseModal = (
<PreviewCourseModal
......@@ -289,35 +265,35 @@ class AddVideoCourse extends React.Component {
close={() => {
this.setState({
previewCourseModal: null,
})
});
}}
courseChapterList={courseChapterList}
/>
)
);
this.setState({ previewCourseModal })
}
this.setState({ previewCourseModal });
};
// 选择视频
handleSelectVideo = (addFolderIds, selectedFileList) => {
this.setState({
showSelectFileModal: false,
})
});
let { courseChapterList } = this.state
let _courseChapterList = [...courseChapterList]
let { courseChapterList } = this.state;
let _courseChapterList = [...courseChapterList];
if (selectedFileList.length + courseChapterList.length > 20) {
message.warning(`最多只能上传20个文件`)
return
message.warning(`最多只能上传20个文件`);
return;
}
selectedFileList.map((file, index) => {
const { ossUrl, resourceId, folderName, folderFormat, folderSize } = file
const _mediaName = folderName.replace(`.${_.last(folderName.split('.')).toLowerCase()}`, '')
console.log('folderFormat', folderFormat)
const { ossUrl, resourceId, folderName, folderFormat, folderSize } = file;
const _mediaName = folderName.replace(`.${_.last(folderName.split('.')).toLowerCase()}`, '');
console.log('folderFormat', folderFormat);
if (folderFormat === 'MP4' || folderFormat === 'video/mp4') {
const videoDom = document.createElement('video')
videoDom.src = ossUrl
const videoDom = document.createElement('video');
videoDom.src = ossUrl;
videoDom.onloadedmetadata = () => {
_courseChapterList.push({
mediaContent: resourceId,
......@@ -328,13 +304,13 @@ class AddVideoCourse extends React.Component {
resourceId,
mediaUrl: ossUrl,
sort: _courseChapterList.length,
})
});
this.setState({
courseChapterList: _courseChapterList,
})
}
});
};
} else if (folderFormat === 'WORD' || folderFormat === 'PDF' || SUPPORT_WORD_PDF.indexOf(folderFormat) > -1) {
const suffix = _.last(folderName.split('.')).toUpperCase()
const suffix = _.last(folderName.split('.')).toUpperCase();
_courseChapterList.push({
mediaContent: resourceId,
contentType: 'SCHEDULE',
......@@ -343,47 +319,47 @@ class AddVideoCourse extends React.Component {
resourceId,
mediaUrl: ossUrl,
sort: _courseChapterList.length,
})
});
this.setState({
courseChapterList: _courseChapterList,
})
}
})
});
}
});
};
// 校验课节名称
handleValidateChapterName = (chapterName) => {
let hasError = false
let hasError = false;
return new Promise((resolve) => {
if (!chapterName) {
this.setState({
chapterNameValidateStatus: 'error',
chapterNameHelpMsg: '请输入课节名称',
})
hasError = true
resolve(false)
return false
});
hasError = true;
resolve(false);
return false;
}
if (chapterName.length > 40) {
this.setState({
chapterNameValidateStatus: 'error',
chapterNameHelpMsg: '不要超过40字',
})
hasError = true
resolve(false)
return false
});
hasError = true;
resolve(false);
return false;
}
if (!hasError) {
resolve(true)
resolve(true);
this.setState({
chapterNameValidateStatus: '',
chapterNameHelpMsg: '',
})
}
})
});
}
});
};
// 保存
handleSubmit = () => {
......@@ -393,8 +369,8 @@ class AddVideoCourse extends React.Component {
title: '服务已到期',
content: '当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买',
okText: '我知道了',
})
return
});
return;
}
const {
......@@ -411,7 +387,7 @@ class AddVideoCourse extends React.Component {
introduce,
courseChapterList,
editorTextLength,
} = this.state
} = this.state;
const commonParams = {
// videoName,
......@@ -426,75 +402,75 @@ class AddVideoCourse extends React.Component {
whetherVisitorsJoin,
courseType: 'VOICE',
courseChapterList,
}
};
// 校验必填字段:课程名称, 课程视频
this.handleValidate(courseName, courseChapterList, categoryId, scheduleMedia, editorTextLength).then((res) => {
if (!res) return
if (!res) return;
Upload.uploadTextToOSS(introduce, `${randomString()}.txt`, (introduceId) => {
this.submitRemote({ id, pageType, commonParams: { ...commonParams, introduceId } })
})
})
}
this.submitRemote({ id, pageType, commonParams: { ...commonParams, introduceId } });
});
});
};
submitRemote = ({ id, pageType, commonParams }) => {
if (pageType === 'add') {
Service.Hades('public/hades/createVideoSchedule', commonParams).then((res) => {
if (!res) return
message.success('新建成功')
if (!res) return;
message.success('新建成功');
window.RCHistory.push({
pathname: `/video-course`,
})
})
});
});
} else {
const editParams = {
courseId: id,
...commonParams,
}
};
Service.Hades('public/hades/editVideoSchedule', editParams).then((res) => {
if (!res) return
message.success('保存成功')
if (!res) return;
message.success('保存成功');
window.RCHistory.push({
pathname: `/video-course`,
})
})
}
});
});
}
};
handleValidate = (courseName, courseChapterList, categoryId, scheduleMedia, editorTextLength) => {
return new Promise((resolve) => {
if (!courseName) {
message.warning('请输入课程名称')
resolve(false)
return false
message.warning('请输入课程名称');
resolve(false);
return false;
}
if (!courseChapterList.length) {
message.warning('请上传课节')
resolve(false)
return false
message.warning('请上传课节');
resolve(false);
return false;
}
if (!categoryId) {
message.warning('请选择课程分类')
resolve(false)
return false
message.warning('请选择课程分类');
resolve(false);
return false;
}
if (editorTextLength > 1000) {
message.warning('课程简介超过字数限定')
resolve(false)
return
}
resolve(true)
})
message.warning('课程简介超过字数限定');
resolve(false);
return;
}
resolve(true);
});
};
handleSelectCover = (file) => {
if (!file) {
message.info('请选择文件!')
return
message.info('请选择文件!');
return;
}
this.setState({
visible: true,
imageFile: file,
})
}
});
};
//获取resourceId
getSignature = (blob, fileName) => {
Upload.uploadBlobToOSS(blob, 'cover' + new Date().valueOf(), null, 'signInfo').then((signInfo) => {
......@@ -505,77 +481,77 @@ class AddVideoCourse extends React.Component {
visible: false,
},
() => this.updateCover()
)
})
}
);
});
};
updateCover = () => {
const { coverClicpPath, coverId } = this.state
const { coverClicpPath, coverId } = this.state;
this.setState({
showSelectCoverModal: false,
coverUrl: coverClicpPath,
coverId: coverId,
})
}
});
};
handleRenameCourseChapter = (chapterId, chapterIndex) => {
const { mediaNameAlias } = this.state
const { mediaNameAlias } = this.state;
this.handleValidateChapterName(mediaNameAlias).then((res) => {
// 校验不通过不能点确定保存修改课节名称
if (!res) {
return message.warning('重命名失败')
return message.warning('重命名失败');
}
let { courseChapterList } = this.state
let _courseChapterList = []
let { courseChapterList } = this.state;
let _courseChapterList = [];
_courseChapterList = courseChapterList.map((item, index) => {
if (item.resourceId === chapterId && chapterIndex === index) {
item.mediaName = mediaNameAlias
item.visible = false
item.mediaName = mediaNameAlias;
item.visible = false;
}
return item
})
return item;
});
this.setState({
courseChapterList: _courseChapterList,
chapterNameValidateStatus: '',
chapterNameHelpMsg: '',
mediaNameAlias: '',
})
})
}
});
});
};
handleChangePopConfirmVisible = (chapterId, chapterNameIndex, visible) => {
let { courseChapterList } = this.state
let _courseChapterList = []
let { courseChapterList } = this.state;
let _courseChapterList = [];
_courseChapterList = courseChapterList.map((item, index) => {
if (item.resourceId === chapterId && chapterNameIndex === index) {
item.visible = visible
item.visible = visible;
} else {
item.visible = false
item.visible = false;
}
return item
})
return item;
});
this.setState({
courseChapterList: _courseChapterList,
})
}
});
};
handleDeleteCourseChapter = (chapterId, chapterIndex) => {
console.log('chapterId---', chapterId, chapterIndex)
let { courseChapterList } = this.state
console.log('chapterId---', chapterId, chapterIndex);
let { courseChapterList } = this.state;
let _courseChapterList = courseChapterList.filter((item, index) => {
return item.resourceId !== chapterId || (item.resourceId === chapterId && chapterIndex !== index)
})
return item.resourceId !== chapterId || (item.resourceId === chapterId && chapterIndex !== index);
});
_courseChapterList.map((item, index) => {
item.sort = index
})
item.sort = index;
});
this.setState({
courseChapterList: _courseChapterList,
})
}
});
};
renderChapterTitle = (item) => {
const { chapterNameValidateStatus, chapterNameHelpMsg } = this.state
const { chapterNameValidateStatus, chapterNameHelpMsg } = this.state;
return (
<div className='course-chapter-title-popover'>
......@@ -594,54 +570,54 @@ class AddVideoCourse extends React.Component {
mediaNameAlias: e.target.value.trim(),
},
() => {
this.handleValidateChapterName(this.state.mediaNameAlias)
this.handleValidateChapterName(this.state.mediaNameAlias);
}
)
);
}}
/>
</Form.Item>
</Form>
</div>
)
}
);
};
// 上下移动
handleChangeIndex = (isUp, sortIndex) => {
const { courseChapterList } = this.state
const { courseChapterList } = this.state;
// 第一个上移和最后一个下移不能使用
if ((isUp && sortIndex === 0) || (!isUp && sortIndex === courseChapterList.length - 1)) {
return
return;
}
let _courseChapterList = [...courseChapterList]
const temp = courseChapterList[sortIndex]
let _courseChapterList = [...courseChapterList];
const temp = courseChapterList[sortIndex];
// 若上移
if (isUp) {
_courseChapterList[sortIndex - 1] = temp
_courseChapterList[sortIndex - 1].sort = sortIndex - 1
_courseChapterList[sortIndex] = courseChapterList[sortIndex - 1]
_courseChapterList[sortIndex].sort = sortIndex
_courseChapterList[sortIndex - 1] = temp;
_courseChapterList[sortIndex - 1].sort = sortIndex - 1;
_courseChapterList[sortIndex] = courseChapterList[sortIndex - 1];
_courseChapterList[sortIndex].sort = sortIndex;
} else {
// 若下移
_courseChapterList[sortIndex + 1] = temp
_courseChapterList[sortIndex + 1].sort = sortIndex + 1
_courseChapterList[sortIndex] = courseChapterList[sortIndex + 1]
_courseChapterList[sortIndex].sort = sortIndex
_courseChapterList[sortIndex + 1] = temp;
_courseChapterList[sortIndex + 1].sort = sortIndex + 1;
_courseChapterList[sortIndex] = courseChapterList[sortIndex + 1];
_courseChapterList[sortIndex].sort = sortIndex;
}
this.setState({
courseChapterList: _courseChapterList,
})
}
});
};
renderTypemenu = () => {
return (
<Menu>
<Menu.Item>
<span
onClick={() => {
this.selectFileType('VIDEO')
this.selectFileType('VIDEO');
}}>
视频文件
</span>
......@@ -649,34 +625,34 @@ class AddVideoCourse extends React.Component {
<Menu.Item>
<span
onClick={() => {
this.selectFileType('WORD_PDF')
this.selectFileType('WORD_PDF');
}}>
资料文件
</span>
</Menu.Item>
</Menu>
)
}
);
};
selectFileType = (type) => {
const { courseChapterList } = this.state
const { courseChapterList } = this.state;
if (courseChapterList.length >= 20) {
message.warning(`最多只能上传20个文件`)
return
message.warning(`最多只能上传20个文件`);
return;
}
if (type === 'VIDEO') {
this.setState({
showSelectFileModal: true,
selectTypeList: ['MP4'],
accept: 'video/mp4',
})
});
} else {
this.setState({
showSelectFileModal: true,
selectTypeList: ['DOC', 'DOCX', 'PDF'],
accept: '.doc,.docx,.pdf',
})
}
});
}
};
renderToolTipTitle = () => {
return (
......@@ -684,8 +660,8 @@ class AddVideoCourse extends React.Component {
<p>视频支持mp4格式,大小不超过2G;</p>
<p>文件支持PDF、docx、doc格式,大小不超过100M</p>
</div>
)
}
);
};
render() {
const {
......@@ -709,9 +685,9 @@ class AddVideoCourse extends React.Component {
imageFile,
selectTypeList,
accept,
} = this.state
const defaultCover = 'https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png'
const isDefaultCover = coverUrl === defaultCover || coverUrl == null
} = this.state;
const defaultCover = 'https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png';
const isDefaultCover = coverUrl === defaultCover || coverUrl == null;
return (
<div className='page add-video-course-page'>
......@@ -719,7 +695,7 @@ class AddVideoCourse extends React.Component {
<div className='box'>
<div className='show-tips'>
<ShowTips message='请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利' />
<ShowTips message={`请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,${window.brandName}保有依据国家规定及平台规则进行处理的权利`} />
</div>
<div className='form'>
......@@ -731,7 +707,7 @@ class AddVideoCourse extends React.Component {
maxLength={40}
style={{ width: 240 }}
onChange={(e) => {
this.handleChangeForm('courseName', e.target.value)
this.handleChangeForm('courseName', e.target.value);
}}
/>
</div>
......@@ -814,15 +790,15 @@ class AddVideoCourse extends React.Component {
chapterNameValidateStatus: '',
chapterNameHelpMsg: '',
mediaNameAlias: '',
})
});
}}
onCancel={() => this.handleChangePopConfirmVisible(item.resourceId, index, false)}>
<div
className='rename'
onClick={() => {
this.setState({ mediaNameAlias: item.mediaName }, () => {
this.handleChangePopConfirmVisible(item.resourceId, index, true)
})
this.handleChangePopConfirmVisible(item.resourceId, index, true);
});
}}>
重命名
</div>
......@@ -833,7 +809,7 @@ class AddVideoCourse extends React.Component {
</div>
</div>
</div>
)
);
})}
</div>
</div>
......@@ -846,7 +822,7 @@ class AddVideoCourse extends React.Component {
<div>
<Button
onClick={() => {
this.setState({ showSelectCoverModal: true })
this.setState({ showSelectCoverModal: true });
}}>{`${pageType === 'add' && !coverUrl ? '上传' : '修改'}封面`}</Button>
<span
className={`span ${coverUrl ? 'defalut-span' : ''}`}
......@@ -854,7 +830,7 @@ class AddVideoCourse extends React.Component {
this.setState({
coverUrl: '',
coverId: '',
})
});
}}>
使用默认图
</span>
......@@ -874,7 +850,7 @@ class AddVideoCourse extends React.Component {
<CourseCatalogSelect
value={categoryId}
onChange={(value, label) => {
this.handleChangeCatalogList(value, label)
this.handleChangeCatalogList(value, label);
}}
/>
</div>
......@@ -919,7 +895,7 @@ class AddVideoCourse extends React.Component {
diskList={diskList}
addVideo={true}
onClose={() => {
this.setState({ showSelectFileModal: false })
this.setState({ showSelectFileModal: false });
}}
onSelect={this.handleSelectVideo}
/>
......@@ -934,7 +910,7 @@ class AddVideoCourse extends React.Component {
tooltip='支持文件类型:jpg、jpeg、png'
isOpen={showSelectCoverModal}
onClose={() => {
this.setState({ showSelectCoverModal: false })
this.setState({ showSelectCoverModal: false });
}}
onSelect={this.handleSelectCover}
/>
......@@ -945,14 +921,14 @@ class AddVideoCourse extends React.Component {
imgUrl={imageFile.ossUrl}
onConfirm={this.getSignature}
onClose={() => {
this.setState({ visible: false })
this.setState({ visible: false });
}}
/>
)}
{this.state.previewCourseModal}
</div>
)
);
}
}
export default AddVideoCourse
export default AddVideoCourse;
......@@ -13,7 +13,7 @@ export default function HomeTip() {
const [surplusDay, setSurplusDay] = useState(0)
const versionInfo = useContext(VersionContext)
useEffect(()=> {
useEffect(() => {
if (versionInfo) {
setIsOverNum(versionInfo.userNum === -1 ? false : versionInfo.whetherReachUserNum)
setSurplusDay(versionInfo.surplusDayTime)
......@@ -25,7 +25,7 @@ export default function HomeTip() {
}
}
},[versionInfo])
}, [versionInfo])
return (
<div className="home-tip">
......@@ -36,7 +36,7 @@ export default function HomeTip() {
{
isOverNum && (
<div className="content">
<span className="icon iconfont" style={{color:"#FF4F4F",marginRight:"8px"}}>&#xe61d;</span>温馨提示:企业使用人数已达上限,将无法新增员工、学员,如需增加人数限制,请联系小麦企学院服务平台。
<span className="icon iconfont" style={{ color: "#FF4F4F", marginRight: "8px" }}>&#xe61d;</span>{`温馨提示:企业使用人数已达上限,将无法新增员工、学员,如需增加人数限制,请联系${window.brandName}服务平台。`}
<ContactWidget placement="bottom" trigger="hover"><div className="renew-btn">立即续费</div></ContactWidget>
</div>
)
......@@ -44,7 +44,7 @@ export default function HomeTip() {
{
tipType === 2 && (
<div className="content">
<span className="icon iconfont" style={{color:"#FF4F4F",marginRight:"8px"}}>&#xe61d;</span>版本到期提醒:当前企业购买的小麦企学院服务已于{moment(versionInfo?.validEndTimeST).format("YYYY-MM-DD HH:mm:ss")}到期,到期后仍可访问,但功能不可使用,建议尽快续费购买哦~
<span className="icon iconfont" style={{ color: "#FF4F4F", marginRight: "8px" }}>&#xe61d;</span>版本到期提醒:当前企业购买的{`${window.brandName}`}服务已于{moment(versionInfo?.validEndTimeST).format("YYYY-MM-DD HH:mm:ss")}到期,到期后仍可访问,但功能不可使用,建议尽快续费购买哦~
<ContactWidget placement="bottom" trigger="hover"><div className="renew-btn">立即续费</div></ContactWidget>
</div>
)
......@@ -52,7 +52,7 @@ export default function HomeTip() {
{
tipType === 1 && (
<div className="content">
<span className="icon iconfont" style={{color:"#FF4F4F",marginRight:"8px"}}>&#xe61d;</span>当前企业购买的小麦企学院服务仅剩{surplusDay}天(于{expirationTime}到期),为了不影响使用,建议尽快续费购买哦~
<span className="icon iconfont" style={{ color: "#FF4F4F", marginRight: "8px" }}>&#xe61d;</span>当前企业购买的{`${window.brandName}`}服务仅剩{surplusDay}天(于{expirationTime}到期),为了不影响使用,建议尽快续费购买哦~
<ContactWidget placement="bottom" trigger="hover"><div className="renew-btn">立即续费</div></ContactWidget>
</div>
)
......@@ -62,4 +62,4 @@ export default function HomeTip() {
}
</div>
)
}
\ No newline at end of file
}
\ No newline at end of file
......@@ -22,7 +22,6 @@ import "./KnowledgeBaseList.less";
const DEFAULT_SIZE_UNIT = 1000 * 1000 // 将B转换成M
const { confirm } = Modal
const ENV = process.env.DEPLOY_ENV || "dev"
class KnowledgeBaseList extends React.Component {
constructor(props) {
......
......@@ -19,7 +19,6 @@ import "./LiveList.less";
import CourseService from "@/domains/course-domain/CourseService";
import User from "@/common/js/user";
const ENV = process.env.DEPLOY_ENV || "dev";
class VideoList extends React.Component {
constructor(props) {
......
......@@ -281,7 +281,7 @@ function AddPlan() {
<Breadcrumbs navList={type == 'add' ? '新建培训计划' : '编辑培训计划'} goBack={handleGoBack} />
<div className='box'>
<div className='show-tips'>
<ShowTips message='请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利' />
<ShowTips message={`请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,${window.brandName}保有依据国家规定及平台规则进行处理的权利`} />
</div>
<div className='add-plan-page__form'>
<div className='basic-info__wrap'>
......
......@@ -34,7 +34,7 @@ class ScanFileModal extends React.Component {
style={{ width: 632, objectFit: "cover" }}
/>
)}
{fileType === "VIDEO" && (
{(fileType ==="VIDEO" || fileType === "MP4") && (
<div>
<Player
src={item.mediaUrl || item.ossAddress || item.ossUrl}
......
......@@ -5,6 +5,7 @@ import BaseService from "@/domains/basic-domain/baseService";
import User from "@/common/js/user";
import { LIVE_SHARE } from "@/domains/course-domain/constants";
import { Modal, message } from 'antd';
import { brandLogo } from '@/domains/brand/constants'
import './CollegeManagePage.less';
import storage from '@/common/js/storage';
......@@ -19,8 +20,8 @@ function ExpirationPopover(props) {
const [showType, setShowType] = useState(0); //0不显示,1剩余30天,2小于等于7天,3已过期
useEffect(()=> {
if (props.surplusDayTime === 0 ) {
useEffect(() => {
if (props.surplusDayTime === 0) {
//已过期
let loginflag = storage.get("expiration_tip_login")
if (loginflag === null || loginflag === "true") {
......@@ -31,7 +32,7 @@ function ExpirationPopover(props) {
}
//即将过期
if (props.surplusDayTime === 30 || props.surplusDayTime <= 7) {
let daysflag = storage.get("expiration_tip"+User.getUserId()+"_days")
let daysflag = storage.get("expiration_tip" + User.getUserId() + "_days")
if (daysflag === null || daysflag !== moment().format("YYYYMMDD")) {
setShowType(2)
}
......@@ -53,11 +54,11 @@ function ExpirationPopover(props) {
// }
// }
},[props.endTime,props.surplusDayTime])
}, [props.endTime, props.surplusDayTime])
function iknow() {
storage.set("expiration_tip_login",false)
storage.set("expiration_tip"+User.getUserId()+"_days",moment().format("YYYYMMDD"))
storage.set("expiration_tip_login", false)
storage.set("expiration_tip" + User.getUserId() + "_days", moment().format("YYYYMMDD"))
/*
if (props.surplusDayTime === 0 ) {
//已过期
......@@ -79,15 +80,15 @@ function ExpirationPopover(props) {
return (
<>
{
showType === 0 ? ("") :(
showType === 0 ? ("") : (
<div className="expirationpopover">
<div className="dialog">
<div className="title">{props.surplusDayTime === 0 ? "服务已到期":"服务到期提醒"}</div>
<div className="title">{props.surplusDayTime === 0 ? "服务已到期" : "服务到期提醒"}</div>
{
showType === 3 ? (
<div className="tip-text">当前企业购买的小麦企学院服务已于<span style={{color:"#FF4F4F"}}>{moment(props.endTime).format("YYYY-MM-DD HH:mm:ss")}</span>到期,到期后仍可访问,但功能不可使用,建议尽快续费购买哦~</div>
<div className="tip-text">当前企业购买的{`${window.brandName}`}服务已于<span style={{ color: "#FF4F4F" }}>{moment(props.endTime).format("YYYY-MM-DD HH:mm:ss")}</span>到期,到期后仍可访问,但功能不可使用,建议尽快续费购买哦~</div>
) : (
<div className="tip-text">当前企业购买的小麦企学院服务 <span style={{color:"#FF4F4F"}}>仅剩{props.surplusDayTime}</span>(于<span>{moment(props.endTime).format("YYYY-MM-DD")}</span>到期),为了不影响使用,建议尽快续费购买哦~</div>
<div className="tip-text">当前企业购买的{`${window.brandName}`}服务 <span style={{ color: "#FF4F4F" }}>仅剩{props.surplusDayTime}</span>(于<span>{moment(props.endTime).format("YYYY-MM-DD")}</span>到期),为了不影响使用,建议尽快续费购买哦~</div>
)
}
......@@ -95,7 +96,7 @@ function ExpirationPopover(props) {
<img src="https://cdn.xiaomai5.com/qixueyuankehu.png" alt=""></img>
<div className="des">微信/企业微信扫码咨询</div>
</div>
<div className="phone"><svg style={{position:"relative",top:"2px",marginRight:"4px"}} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M512.651 3.78c-281.433 0-509.21 228.324-509.21 509.209 0 281.43 228.325 509.203 509.21 509.203 281.427 0 509.202-228.317 509.202-509.203 0.55-280.885-227.775-509.21-509.202-509.21z m198.205 743.553c-36.14 36.136-169.737 1.641-302.24-130.312-131.953-131.959-165.902-266.104-129.768-301.695 31.211-31.21 68.99-85.417 125.939-14.782 56.943 70.629 29.016 90.34-3.291 122.647-22.449 22.448 24.642 79.392 73.37 128.125 49.283 48.73 105.678 95.818 128.126 73.368 32.306-32.305 52.017-60.23 122.646-3.288 71.182 56.949 16.426 95.276-14.782 125.937z" p-id="4409" fill="#999999"></path></svg>
<div className="phone"><svg style={{ position: "relative", top: "2px", marginRight: "4px" }} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M512.651 3.78c-281.433 0-509.21 228.324-509.21 509.209 0 281.43 228.325 509.203 509.21 509.203 281.427 0 509.202-228.317 509.202-509.203 0.55-280.885-227.775-509.21-509.202-509.21z m198.205 743.553c-36.14 36.136-169.737 1.641-302.24-130.312-131.953-131.959-165.902-266.104-129.768-301.695 31.211-31.21 68.99-85.417 125.939-14.782 56.943 70.629 29.016 90.34-3.291 122.647-22.449 22.448 24.642 79.392 73.37 128.125 49.283 48.73 105.678 95.818 128.126 73.368 32.306-32.305 52.017-60.23 122.646-3.288 71.182 56.949 16.426 95.276-14.782 125.937z" p-id="4409" fill="#999999"></path></svg>
咨询电话:19157875632</div>
<div className="button" onClick={iknow}>我知道了</div>
</div>
......@@ -115,9 +116,9 @@ export default class CollegeManagePage extends React.Component {
list: [],
enterpriseId: User.getEnterpriseId(),
isAdmin: false,
createStoreList:[],
joinStoreList:[],
surplusDayTime:365, //剩余天数
createStoreList: [],
joinStoreList: [],
surplusDayTime: 365, //剩余天数
endTime: 0, //有效截至时间
};
}
......@@ -142,7 +143,7 @@ export default class CollegeManagePage extends React.Component {
getVersion() {
BaseService.getLesseeVersionMsg()
.then(res=> {
.then(res => {
User.setVersion(res.result)
User.setExpirationTime(res.result.validEndTime)
this.setState({
......@@ -166,13 +167,13 @@ export default class CollegeManagePage extends React.Component {
User.setStoreId(mainStore.id);
User.setStoreUserId(mainStore.storeUserId);
}
const createStoreList = list.filter((item)=>{
const createStoreList = list.filter((item) => {
return item.userRole === 'StoreManager'
})
const joinStoreList = list.filter((item)=>{
const joinStoreList = list.filter((item) => {
return item.userRole !== 'StoreManager'
})
this.setState({createStoreList:createStoreList,joinStoreList:joinStoreList})
this.setState({ createStoreList: createStoreList, joinStoreList: joinStoreList })
});
}
checkCollege(item, bool) {
......@@ -218,12 +219,12 @@ export default class CollegeManagePage extends React.Component {
}
handleLogout() {
BaseService.logout({identifier:User.getIdentifier()}).then((res) => {
BaseService.logout({ identifier: User.getIdentifier() }).then((res) => {
User.removeUserId();
User.removeToken();
User.removeEnterpriseId();
User.clearUserInfo();
const htmlUrl = `${LIVE_SHARE}store/index?id=${User.getCustomerStoreId()||User.getStoreId()}&userId=${User.getUserId()}&from=work_weixin`;
const htmlUrl = `${LIVE_SHARE}store/index?id=${User.getCustomerStoreId() || User.getStoreId()}&userId=${User.getUserId()}&from=work_weixin`;
window.location.href = htmlUrl;
});
}
......@@ -239,10 +240,10 @@ export default class CollegeManagePage extends React.Component {
} = this.state;
return (
<div className="college-manage-page">
<ExpirationPopover surplusDayTime={this.state.surplusDayTime} endTime={this.state.endTime}/>
<ExpirationPopover surplusDayTime={this.state.surplusDayTime} endTime={this.state.endTime} />
<div className="college-header">
<div className="box">
<img className="box-image" src="https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png" />
<img className="box-image" src={brandLogo} />
<div className="user">
<img className="image" src={avatar} />
<span className="name">{name}</span>
......@@ -294,7 +295,7 @@ export default class CollegeManagePage extends React.Component {
}}
>
<div className="header">
<img className="image" src={item.logo || "https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png"} />
<img className="image" src={item.logo || brandLogo} />
<span className="tag">{roleMap[item.userRole]}</span>
</div>
<div className="title">{item.storeName}</div>
......@@ -348,7 +349,7 @@ export default class CollegeManagePage extends React.Component {
}
</div>
</div>
{ joinStoreList.length > 0 &&
{joinStoreList.length > 0 &&
<div className="join-container">
<div className="title-box">
<span className="title">我加入的({joinStoreList.length})</span>
......@@ -371,7 +372,7 @@ export default class CollegeManagePage extends React.Component {
}}
>
<div className="header">
<img className="image" src={item.logo || "https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png"} />
<img className="image" src={item.logo || brandLogo} />
<span className="tag">{roleMap[item.userRole]}</span>
</div>
<div className="title">{item.storeName}</div>
......
......@@ -6,6 +6,7 @@ import BaseService from "@/domains/basic-domain/baseService";
import User from "@/common/js/user";
import Breadcrumbs from "@/components/Breadcrumbs";
import ImgClipModal from '@/components/ImgClipModal'
import { brandLogo } from '@/domains/brand/constants'
import './CreateCollege.less';
let cutFlag = false;
......@@ -16,7 +17,7 @@ export default class CreateCollege extends React.Component {
super(props);
this.state = {
avatar: 'https://image.xiaomaiketang.com/xm/rJeQaZxtc7.png',
logo: 'https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png',
logo: brandLogo,
name: '',
enterpriseId: User.getEnterpriseId(),
imageFile: null, // 需要被截取的图片
......@@ -111,7 +112,7 @@ export default class CreateCollege extends React.Component {
<div className="college-manage-page">
<div className="college-header">
<div className="box">
<img className="box-image" src="https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png" />
<img className="box-image" src={brandLogo} />
</div>
</div>
<div className="breadcrumb-wrap">
......@@ -134,7 +135,7 @@ export default class CreateCollege extends React.Component {
className="icon iconfont"
onClick={() => {
this.setState({
logo: 'https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png',
logo: brandLogo,
visible: false,
})
}}
......
......@@ -9,7 +9,7 @@ import BaseService from '@/domains/basic-domain/baseService';
import storage from '@/common/js/storage';
import axios from 'axios';
import _ from 'underscore';
import user from '@/common/js/user';
import {brandLogo,brandBanner} from '@/domains/brand/constants'
const { TabPane } = Tabs;
function Login(props) {
......@@ -156,12 +156,12 @@ function Login(props) {
return (
<div className='login-page'>
<div className='logo-img-box'>
<img src='https://image.xiaomaiketang.com/xm/6k8PPCmywG.png' className='logo-img' />
<img src={brandLogo} className='logo-img' />
</div>
<div className='login-main'>
<div className='left-banner'>
<div className='img-box'>
<img src='https://image.xiaomaiketang.com/xm/CDCcdAdaPs.png' alt='' />
<img src={brandBanner} alt='' />
</div>
</div>
<div className='login-box'>
......
......@@ -12,6 +12,7 @@ import classNames from 'classnames';
import User from "@/common/js/user"
import _ from 'underscore';
import tBus from '@/core/tbus'
import { brandLogo } from '@/domains/brand/constants'
import "./Menu.less";
import { display } from 'html2canvas/dist/types/css/property-descriptors/display';
import ContactWidget from '@/components/ContactWidget';
......@@ -157,7 +158,7 @@ function Aside(props: any) {
if (User.getToken()) {
StoreService.getStoreDetail({ storeId: User.getStoreId() }).then((res) => {
if (_.isEmpty(res.result.logo)) {
setTopLogoUrl('https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png');
setTopLogoUrl(brandLogo);
} else {
setTopLogoUrl(res.result.logo);
}
......
......@@ -3,8 +3,9 @@ import qrcode from '@/libs/qrcode/qrcode.js';
import Service from '@/common/js/service';
import User from '@/common/js/user';
import { PATH } from '@/domains/basic-domain/constants';
import { corpType } from '@/domains/brand/constants'
import './WechatLogin.less';
const Logo = require('@/common/images/logo.png');
import { brandName, BRAND, brandIcon, brandLogo } from '@/domains/brand/constants'
declare var location: any;
declare var window: any;
export default function WechatLogin(props: any) {
......@@ -26,13 +27,13 @@ export default function WechatLogin(props: any) {
if (status === 0) {
Service.Hades('anon/hades/getTicket', {}).then((res: any) => {
setTicket(res.result);
const redirect = `${PATH}?ticket=${res.result}&appTermEnum=XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN&env=${process.env.DEPLOY_ENV || 'dev'}`;
const redirect = `${PATH}?ticket=${res.result}&appTermEnum=XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN&env=${process.env.DEPLOY_ENV || 'dev'}&corpType=${corpType}`;
const qrcodeWrapDom: any = document.querySelector('#qrcode');
let qrnode = new qrcode({
text: redirect,
correctLevel: 2,
size: 180,
image: 'https://image.xiaomaiketang.com/xm/bFkRBz7teA.png',
image: brandIcon,
imageSize: 50,
});
qrcodeWrapDom.innerHTML = '';
......
......@@ -266,7 +266,7 @@ function EmployeesManagePage() {
function handleDeleteWorkWechatEmployeeConfirm(record: RecordTypes) {
return confirm({
title: "你确定要删除此员工吗?",
content: "管理员需在企业微信后台的“小麦企学院”应用管理中移除此员工,此员工才无法继续登陆小麦企学院",
content:`管理员需在企业微信后台的“${window.brandName}”应用管理中移除此员工,此员工才无法继续登陆${window.brandName}`,
icon: (
<span className="icon iconfont default-confirm-icon">&#xe839; </span>
),
......
......@@ -30,7 +30,7 @@
text-align: center;
margin-top: 100%;
.empty-tree-btn {
color: #2966FF;
color: #2966ff;
cursor: pointer;
}
}
......@@ -39,8 +39,6 @@
font-weight: 400;
color: #666666;
width: 234px;
// overflow-x: scroll;
// overflow-y: hidden;
.anticon {
color: #999999;
}
......@@ -52,7 +50,7 @@
white-space: nowrap;
}
.ant-tree-node-content-wrapper.ant-tree-node-selected {
color: #2966FF;
color: #2966ff;
}
}
.ant-tree-treenode-selected:hover::before,
......
......@@ -84,7 +84,7 @@ function AddExam(props: any) {
tenantId: User.getStoreId(),
source: 0,
}
Service.Hades('public/hades/queryExamPageList', param).then(res=> {
Service.Hades('public/hades/queryExamPageList', param).then(res => {
const { result = {} } = res;
setExamList(result.records || [])
})
......@@ -155,7 +155,7 @@ function AddExam(props: any) {
return
}
if(checkExist(param.examName)) {
if (checkExist(param.examName)) {
message.warning('此考试名称已存在');
return
}
......@@ -275,8 +275,8 @@ function AddExam(props: any) {
// 校验考试名称是否存在
function checkExist(examName: any) {
var result:any = null;
examList.length > 0 && examList.forEach((item:any) => {
var result: any = null;
examList.length > 0 && examList.forEach((item: any) => {
if (result != null) {
return result;
}
......@@ -315,7 +315,7 @@ function AddExam(props: any) {
<div className="box">
<div className="show-tips">
<ShowTips message="请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利" />
<ShowTips message={`请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,${window.brandName}保有依据国家规定及平台规则进行处理的权利`} />
</div> <div className="form">
<div className="title">基本信息</div>
<Form
......@@ -324,7 +324,7 @@ function AddExam(props: any) {
layout="horizontal"
>
<Form.Item label="考试名称"
validateStatus={(check && (!examName || (examName.length > 40 || checkExist(examName)) )) ? 'error' : ''}
validateStatus={(check && (!examName || (examName.length > 40 || checkExist(examName)))) ? 'error' : ''}
help={check && (!examName ? '请输入考试名称' : (examName.length > 40 ? '考试名称最多40字' : (checkExist(examName) && '此考试名称已存在')))}
required>
......
......@@ -826,7 +826,7 @@ class OperatePaper extends Component {
<Spin spinning={loading}>
<div className='box'>
<div className='show-tips'>
<ShowTips message='请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利' />
<ShowTips message={`请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,${window.brandName}保有依据国家规定及平台规则进行处理的权利`} />
</div>
<Form ref={this.formRef} style={{ marginTop: 24, marginBottom: '85px' }}>
<Form.Item
......
......@@ -303,7 +303,7 @@ class OperateQuestion extends Component {
/>
<div className="box">
<div className="show-tips">
<ShowTips message="请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利" />
<ShowTips message={`请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,${window.brandName}保有依据国家规定及平台规则进行处理的权利`} />
</div>
<Tabs
style={{ marginTop: 32 }}
......
......@@ -53,7 +53,7 @@ class BatchImportQuestionModal extends Component {
if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) {
Modal.warning({
title:"服务已到期",
content: "当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买",
content: `当前企业购买的${window.brandName}服务已到期,如需继续使用学院功能,请尽快续费购买`,
okText: "我知道了"
})
return
......
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