Merge branches 'dev_aliyun' and 'ysm1' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_sync_trustie
杨树明 5 years ago
commit 938cf51f2e

@ -9,20 +9,20 @@ delete require.cache[require.resolve('./paths')];
const NODE_ENV = process.env.NODE_ENV;
if (!NODE_ENV) {
throw new Error(
'The NODE_ENV environment variable is required but was not specified.'
);
throw new Error(
'The NODE_ENV environment variable is required but was not specified.'
);
}
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
var dotenvFiles = [
`${paths.dotenv}.${NODE_ENV}.local`,
`${paths.dotenv}.${NODE_ENV}`,
// Don't include `.env.local` for `test` environment
// since normally you expect tests to produce the same
// results for everyone
NODE_ENV !== 'test' && `${paths.dotenv}.local`,
paths.dotenv,
`${paths.dotenv}.${NODE_ENV}.local`,
`${paths.dotenv}.${NODE_ENV}`,
// Don't include `.env.local` for `test` environment
// since normally you expect tests to produce the same
// results for everyone
NODE_ENV !== 'test' && `${paths.dotenv}.local`,
paths.dotenv,
].filter(Boolean);
// Load environment variables from .env* files. Suppress warnings using silent
@ -31,13 +31,13 @@ var dotenvFiles = [
// https://github.com/motdotla/dotenv
// https://github.com/motdotla/dotenv-expand
dotenvFiles.forEach(dotenvFile => {
if (fs.existsSync(dotenvFile)) {
require('dotenv-expand')(
require('dotenv').config({
path: dotenvFile,
})
);
}
if (fs.existsSync(dotenvFile)) {
require('dotenv-expand')(
require('dotenv').config({
path: dotenvFile,
})
);
}
});
// We support resolving modules according to `NODE_PATH`.
@ -51,43 +51,43 @@ dotenvFiles.forEach(dotenvFile => {
// We also resolve them to make sure all tools using them work consistently.
const appDirectory = fs.realpathSync(process.cwd());
process.env.NODE_PATH = (process.env.NODE_PATH || '')
.split(path.delimiter)
.filter(folder => folder && !path.isAbsolute(folder))
.map(folder => path.resolve(appDirectory, folder))
.join(path.delimiter);
.split(path.delimiter)
.filter(folder => folder && !path.isAbsolute(folder))
.map(folder => path.resolve(appDirectory, folder))
.join(path.delimiter);
// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
// injected into the application via DefinePlugin in Webpack configuration.
const REACT_APP = /^REACT_APP_/i;
function getClientEnvironment(publicUrl) {
const raw = Object.keys(process.env)
.filter(key => REACT_APP.test(key))
.reduce(
(env, key) => {
env[key] = process.env[key];
return env;
},
{
// Useful for determining whether were running in production mode.
// Most importantly, it switches React into the correct mode.
NODE_ENV: process.env.NODE_ENV || 'development',
// Useful for resolving the correct path to static assets in `public`.
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
// This should only be used as an escape hatch. Normally you would put
// images into the `src` and `import` them in code to get their paths.
PUBLIC_URL: '/react/build/.',
}
);
// Stringify all values so we can feed into Webpack DefinePlugin
const stringified = {
'process.env': Object.keys(raw).reduce((env, key) => {
env[key] = JSON.stringify(raw[key]);
return env;
}, {}),
};
const raw = Object.keys(process.env)
.filter(key => REACT_APP.test(key))
.reduce(
(env, key) => {
env[key] = process.env[key];
return env;
},
{
// Useful for determining whether were running in production mode.
// Most importantly, it switches React into the correct mode.
NODE_ENV: process.env.NODE_ENV || 'development',
// Useful for resolving the correct path to static assets in `public`.
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
// This should only be used as an escape hatch. Normally you would put
// images into the `src` and `import` them in code to get their paths.
PUBLIC_URL: '/react/build/.',
}
);
// Stringify all values so we can feed into Webpack DefinePlugin
const stringified = {
'process.env': Object.keys(raw).reduce((env, key) => {
env[key] = JSON.stringify(raw[key]);
return env;
}, {}),
};
return { raw, stringified };
return { raw, stringified };
}
module.exports = getClientEnvironment;

@ -32,7 +32,7 @@ module.exports = {
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
// devtool: "cheap-module-eval-source-map",
// 开启调试
//devtool: "source-map", // 开启调试
devtool: "source-map", // 开启调试
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS.

@ -33,7 +33,7 @@ const env = getClientEnvironment(publicUrl);
// Assert this just to be safe.
// Development builds of React are slow and not intended for production.
if (env.stringified['process.env'].NODE_ENV !== '"production"') {
throw new Error('Production builds must have NODE_ENV=production.');
throw new Error('Production builds must have NODE_ENV=production.');
}
// Note: defined here because it will be used more than once.
@ -44,9 +44,9 @@ const cssFilename = './static/css/[name].[contenthash:8].css';
// However, our output is structured with css, js and media folders.
// To have this structure working with relative paths, we have to use custom options.
const extractTextPluginOptions = shouldUseRelativeAssetPaths
? // Making sure that the publicPath goes back to to build folder.
{ publicPath: Array(cssFilename.split('/').length).join('../') }
: {};
? // Making sure that the publicPath goes back to to build folder.
{ publicPath: Array(cssFilename.split('/').length).join('../') }
: {};
// This is the production configuration.
// It compiles slowly and is focused on producing a fast and minimal bundle.
@ -54,332 +54,331 @@ const extractTextPluginOptions = shouldUseRelativeAssetPaths
// 上线用的
// console.log('publicPath ', publicPath)
module.exports = {
// externals: {
// 'react': 'window.React'
// },
// Don't attempt to continue if there are any errors.
bail: true,
// We generate sourcemaps in production. This is slow but gives good results.
// You can exclude the *.map files from the build during deployment.
// devtool: shouldUseSourceMap ? 'nosources-source-map' : false, //正式版
devtool: shouldUseSourceMap ? 'source-map' : false,//测试版
// In production, we only want to load the polyfills and the app code.
entry: [require.resolve('./polyfills'), paths.appIndexJs],
output: {
// The build folder.
path: paths.appBuild,
// Generated JS file names (with nested folders).
// There will be one main bundle, and one file per asynchronous chunk.
// We don't currently advertise code splitting but Webpack supports it.
filename: './static/js/[name].[chunkhash:8].js',
chunkFilename: './static/js/[name].[chunkhash:8].chunk.js',
// We inferred the "public path" (such as / or /my-project) from homepage.
// cdn
// publicPath: 'https://shixun.educoder.net/react/build/', //publicPath, https://cdn.educoder.net
// publicPath: 'https://cdn-testeduplus2.educoder.net/react/build/', //publicPath, https://cdn.educoder.net
publicPath: '/react/build/', //publicPath, https://cdn.educoder.net
// Point sourcemap entries to original disk location (format as URL on Windows)
devtoolModuleFilenameTemplate: info =>
path
.relative(paths.appSrc, info.absoluteResourcePath)
.replace(/\\/g, '/'),
},
resolve: {
// This allows you to set a fallback for where Webpack should look for modules.
// We placed these paths second because we want `node_modules` to "win"
// if there are any conflicts. This matches Node resolution mechanism.
// https://github.com/facebookincubator/create-react-app/issues/253
modules: ['node_modules', paths.appNodeModules].concat(
// It is guaranteed to exist because we tweak it in `env.js`
process.env.NODE_PATH.split(path.delimiter).filter(Boolean)
),
// These are the reasonable defaults supported by the Node ecosystem.
// We also include JSX as a common component filename extension to support
// some tools, although we do not recommend using it, see:
// https://github.com/facebookincubator/create-react-app/issues/290
// `web` extension prefixes have been added for better support
// for React Native Web.
extensions: ['.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx'],
alias: {
"educoder": __dirname + "/../src/common/educoder.js",
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
'react-native': 'react-native-web',
},
plugins: [
// Prevents users from importing files from outside of src/ (or node_modules/).
// This often causes confusion because we only process files within src/ with babel.
// To fix this, we prevent you from importing files out of src/ -- if you'd like to,
// please link the files into your node_modules/ and let module-resolution kick in.
// Make sure your source files are compiled, as they will not be processed in any way.
new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]),
],
},
module: {
strictExportPresence: true,
rules: [
// TODO: Disable require.ensure as it's not a standard language feature.
// We are waiting for https://github.com/facebookincubator/create-react-app/issues/2176.
// { parser: { requireEnsure: false } },
// externals: {
// 'react': 'window.React'
// },
// Don't attempt to continue if there are any errors.
bail: true,
// We generate sourcemaps in production. This is slow but gives good results.
// You can exclude the *.map files from the build during deployment.
// devtool: shouldUseSourceMap ? 'nosources-source-map' : false, //正式版
devtool:false,//测试版
// In production, we only want to load the polyfills and the app code.
entry: [require.resolve('./polyfills'), paths.appIndexJs],
output: {
// The build folder.
path: paths.appBuild,
// Generated JS file names (with nested folders).
// There will be one main bundle, and one file per asynchronous chunk.
// We don't currently advertise code splitting but Webpack supports it.
filename: './static/js/[name].[chunkhash:8].js',
chunkFilename: './static/js/[name].[chunkhash:8].chunk.js',
// We inferred the "public path" (such as / or /my-project) from homepage.
// cdn
// publicPath: 'https://shixun.educoder.net/react/build/', //publicPath, https://cdn.educoder.net
// publicPath: 'https://cdn-testeduplus2.educoder.net/react/build/', //publicPath, https://cdn.educoder.net
publicPath: '/react/build/', //publicPath, https://cdn.educoder.net
// First, run the linter.
// It's important to do this before Babel processes the JS.
{
test: /\.(js|jsx|mjs)$/,
enforce: 'pre',
use: [
{
options: {
formatter: eslintFormatter,
eslintPath: require.resolve('eslint'),
// Point sourcemap entries to original disk location (format as URL on Windows)
devtoolModuleFilenameTemplate: info =>
path
.relative(paths.appSrc, info.absoluteResourcePath)
.replace(/\\/g, '/'),
},
resolve: {
// This allows you to set a fallback for where Webpack should look for modules.
// We placed these paths second because we want `node_modules` to "win"
// if there are any conflicts. This matches Node resolution mechanism.
// https://github.com/facebookincubator/create-react-app/issues/253
modules: ['node_modules', paths.appNodeModules].concat(
// It is guaranteed to exist because we tweak it in `env.js`
process.env.NODE_PATH.split(path.delimiter).filter(Boolean)
),
// These are the reasonable defaults supported by the Node ecosystem.
// We also include JSX as a common component filename extension to support
// some tools, although we do not recommend using it, see:
// https://github.com/facebookincubator/create-react-app/issues/290
// `web` extension prefixes have been added for better support
// for React Native Web.
extensions: ['.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx'],
alias: {
"educoder": __dirname + "/../src/common/educoder.js",
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
'react-native': 'react-native-web',
},
plugins: [
// Prevents users from importing files from outside of src/ (or node_modules/).
// This often causes confusion because we only process files within src/ with babel.
// To fix this, we prevent you from importing files out of src/ -- if you'd like to,
// please link the files into your node_modules/ and let module-resolution kick in.
// Make sure your source files are compiled, as they will not be processed in any way.
new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]),
],
},
module: {
strictExportPresence: true,
rules: [
// TODO: Disable require.ensure as it's not a standard language feature.
// We are waiting for https://github.com/facebookincubator/create-react-app/issues/2176.
// { parser: { requireEnsure: false } },
},
loader: require.resolve('eslint-loader'),
},
],
include: paths.appSrc,
},
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall
// back to the "file" loader at the end of the loader list.
oneOf: [
// "url" loader works just like "file" loader but it also embeds
// assets smaller than specified size as data URLs to avoid requests.
{
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
loader: require.resolve('url-loader'),
options: {
limit: 10000,
name: 'static/media/[name].[hash:8].[ext]',
},
},
// Process JS with Babel.
{
test: /\.(js|jsx|mjs)$/,
include: paths.appSrc,
loader: require.resolve('babel-loader'),
options: {
compact: true,
},
},
// The notation here is somewhat confusing.
// "postcss" loader applies autoprefixer to our CSS.
// "css" loader resolves paths in CSS and adds assets as dependencies.
// "style" loader normally turns CSS into JS modules injecting <style>,
// but unlike in development configuration, we do something different.
// `ExtractTextPlugin` first applies the "postcss" and "css" loaders
// (second argument), then grabs the result CSS and puts it into a
// separate file in our build process. This way we actually ship
// a single CSS file in production instead of JS code injecting <style>
// tags. If you use code splitting, however, any async bundles will still
// use the "style" loader inside the async code so CSS from them won't be
// in the main CSS file.
{
test: /\.css$/,
loader: ExtractTextPlugin.extract(
Object.assign(
{
fallback: {
loader: require.resolve('style-loader'),
options: {
hmr: false,
},
},
use: [
{
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
minimize: true,
sourceMap: shouldUseSourceMap,
},
},
{
loader: require.resolve('postcss-loader'),
options: {
// Necessary for external CSS imports to work
// https://github.com/facebookincubator/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
autoprefixer({
browsers: [
'>1%',
'last 4 versions',
'Firefox ESR',
'not ie < 9', // React doesn't support IE8 anyway
],
flexbox: 'no-2009',
}),
],
},
},
],
},
extractTextPluginOptions
)
),
// Note: this won't work without `new ExtractTextPlugin()` in `plugins`.
},
{
test: /\.scss$/,
use: [
require.resolve("style-loader"),
{
loader: require.resolve("css-loader"),
options: {
importLoaders: 1,
minimize: true,
sourceMap: shouldUseSourceMap,
},
},
{
loader: require.resolve("sass-loader")
}
],
},
// "file" loader makes sure assets end up in the `build` folder.
// When you `import` an asset, you get its filename.
// This loader doesn't use a "test" so it will catch all modules
// that fall through the other loaders.
{
loader: require.resolve('file-loader'),
// Exclude `js` files to keep "css" loader working as it injects
// it's runtime that would otherwise processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
exclude: [/\.(js|jsx|mjs)$/, /\.html$/, /\.json$/],
options: {
name: 'static/media/[name].[hash:8].[ext]',
},
},
// ** STOP ** Are you adding a new loader?
// Make sure to add the new loader(s) before the "file" loader.
],
},
],
},
plugins: [
// Makes some environment variables available in index.html.
// The public URL is available as %PUBLIC_URL% in index.html, e.g.:
// <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
// In production, it will be an empty string unless you specify "homepage"
// in `package.json`, in which case it will be the pathname of that URL.
new InterpolateHtmlPlugin(env.raw),
// Generates an `index.html` file with the <script> injected.
new HtmlWebpackPlugin({
inject: true,
template: paths.appHtml,
minify: {
removeComments: true,
collapseWhitespace: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeStyleLinkTypeAttributes: true,
keepClosingSlash: true,
minifyJS: true,
minifyCSS: true,
minifyURLs: true,
},
}),
// Makes some environment variables available to the JS code, for example:
// if (process.env.NODE_ENV === 'production') { ... }. See `./env.js`.
// It is absolutely essential that NODE_ENV was set to production here.
// Otherwise React will be compiled in the very slow development mode.
new webpack.DefinePlugin(env.stringified),
// Minify the code.
// new webpack.optimize.UglifyJsPlugin({
// compress: {
// warnings: false,
// // Disabled because of an issue with Uglify breaking seemingly valid code:
// // https://github.com/facebookincubator/create-react-app/issues/2376
// // Pending further investigation:
// // https://github.com/mishoo/UglifyJS2/issues/2011
// comparisons: false,
// },
// mangle: {
// safari10: true,
// },
// output: {
// comments: false,
// // Turned on because emoji and regex is not minified properly using default
// // https://github.com/facebookincubator/create-react-app/issues/2488
// ascii_only: true,
// },
// sourceMap: shouldUseSourceMap,
// }),
//正式版上线后打开去掉debuger和console
new ParallelUglifyPlugin({
cacheDir: '.cache/',
uglifyJS:{
output: {
comments: false
},
warnings: false,
compress: {
drop_debugger: true,
// First, run the linter.
// It's important to do this before Babel processes the JS.
{
test: /\.(js|jsx|mjs)$/,
enforce: 'pre',
use: [
{
options: {
formatter: eslintFormatter,
eslintPath: require.resolve('eslint'),
},
loader: require.resolve('eslint-loader'),
},
],
include: paths.appSrc,
},
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall
// back to the "file" loader at the end of the loader list.
oneOf: [
// "url" loader works just like "file" loader but it also embeds
// assets smaller than specified size as data URLs to avoid requests.
{
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
loader: require.resolve('url-loader'),
options: {
limit: 10000,
name: 'static/media/[name].[hash:8].[ext]',
},
},
// Process JS with Babel.
{
test: /\.(js|jsx|mjs)$/,
include: paths.appSrc,
loader: require.resolve('babel-loader'),
options: {
compact: true,
},
},
// The notation here is somewhat confusing.
// "postcss" loader applies autoprefixer to our CSS.
// "css" loader resolves paths in CSS and adds assets as dependencies.
// "style" loader normally turns CSS into JS modules injecting <style>,
// but unlike in development configuration, we do something different.
// `ExtractTextPlugin` first applies the "postcss" and "css" loaders
// (second argument), then grabs the result CSS and puts it into a
// separate file in our build process. This way we actually ship
// a single CSS file in production instead of JS code injecting <style>
// tags. If you use code splitting, however, any async bundles will still
// use the "style" loader inside the async code so CSS from them won't be
// in the main CSS file.
{
test: /\.css$/,
loader: ExtractTextPlugin.extract(
Object.assign(
{
fallback: {
loader: require.resolve('style-loader'),
options: {
hmr: false,
},
},
use: [
{
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
minimize: true,
sourceMap: shouldUseSourceMap,
},
},
{
loader: require.resolve('postcss-loader'),
options: {
// Necessary for external CSS imports to work
// https://github.com/facebookincubator/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
autoprefixer({
browsers: [
'>1%',
'last 4 versions',
'Firefox ESR',
'not ie < 9', // React doesn't support IE8 anyway
],
flexbox: 'no-2009',
}),
],
},
},
],
},
extractTextPluginOptions
)
),
// Note: this won't work without `new ExtractTextPlugin()` in `plugins`.
},
{
test: /\.scss$/,
use: [
require.resolve("style-loader"),
{
loader: require.resolve("css-loader"),
options: {
importLoaders: 1,
minimize: true,
sourceMap: shouldUseSourceMap,
},
},
{
loader: require.resolve("sass-loader")
}
],
},
// "file" loader makes sure assets end up in the `build` folder.
// When you `import` an asset, you get its filename.
// This loader doesn't use a "test" so it will catch all modules
// that fall through the other loaders.
{
loader: require.resolve('file-loader'),
// Exclude `js` files to keep "css" loader working as it injects
// it's runtime that would otherwise processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
exclude: [/\.(js|jsx|mjs)$/, /\.html$/, /\.json$/],
options: {
name: 'static/media/[name].[hash:8].[ext]',
},
},
// ** STOP ** Are you adding a new loader?
// Make sure to add the new loader(s) before the "file" loader.
],
},
],
},
plugins: [
// Makes some environment variables available in index.html.
// The public URL is available as %PUBLIC_URL% in index.html, e.g.:
// <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
// In production, it will be an empty string unless you specify "homepage"
// in `package.json`, in which case it will be the pathname of that URL.
new InterpolateHtmlPlugin(env.raw),
// Generates an `index.html` file with the <script> injected.
new HtmlWebpackPlugin({
inject: true,
template: paths.appHtml,
minify: {
removeComments: true,
collapseWhitespace: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeStyleLinkTypeAttributes: true,
keepClosingSlash: true,
minifyJS: true,
minifyCSS: true,
minifyURLs: true,
},
}),
// Makes some environment variables available to the JS code, for example:
// if (process.env.NODE_ENV === 'production') { ... }. See `./env.js`.
// It is absolutely essential that NODE_ENV was set to production here.
// Otherwise React will be compiled in the very slow development mode.
new webpack.DefinePlugin(env.stringified),
// Minify the code.
// new webpack.optimize.UglifyJsPlugin({
// compress: {
// warnings: false,
// // Disabled because of an issue with Uglify breaking seemingly valid code:
// // https://github.com/facebookincubator/create-react-app/issues/2376
// // Pending further investigation:
// // https://github.com/mishoo/UglifyJS2/issues/2011
// comparisons: false,
// },
// mangle: {
// safari10: true,
// },
// output: {
// comments: false,
// // Turned on because emoji and regex is not minified properly using default
// // https://github.com/facebookincubator/create-react-app/issues/2488
// ascii_only: true,
// },
// sourceMap: shouldUseSourceMap,
// }),
//正式版上线后打开去掉debuger和console
new ParallelUglifyPlugin({
cacheDir: '.cache/',
uglifyJS:{
output: {
comments: false
},
compress: {
drop_debugger: true,
drop_console: true
}
}
}),
// Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.
new ExtractTextPlugin({
filename: cssFilename,
}),
// Generate a manifest file which contains a mapping of all asset filenames
// to their corresponding output file so that tools can pick it up without
// having to parse `index.html`.
new ManifestPlugin({
fileName: 'asset-manifest.json',
}),
// Generate a service worker script that will precache, and keep up to date,
// the HTML & assets that are part of the Webpack build.
new SWPrecacheWebpackPlugin({
// By default, a cache-busting query parameter is appended to requests
// used to populate the caches, to ensure the responses are fresh.
// If a URL is already hashed by Webpack, then there is no concern
// about it being stale, and the cache-busting can be skipped.
dontCacheBustUrlsMatching: /\.\w{8}\./,
filename: 'service-worker.js',
logger(message) {
if (message.indexOf('Total precache size is') === 0) {
// This message occurs for every build and is a bit too noisy.
return;
}
if (message.indexOf('Skipping static resource') === 0) {
// This message obscures real errors so we ignore it.
// https://github.com/facebookincubator/create-react-app/issues/2612
return;
}
// console.log(message);
},
minify: true,
// For unknown URLs, fallback to the index page
navigateFallback: publicUrl + '/index.html',
// Ignores URLs starting from /__ (useful for Firebase):
// https://github.com/facebookincubator/create-react-app/issues/2237#issuecomment-302693219
navigateFallbackWhitelist: [/^(?!\/__).*/],
// Don't precache sourcemaps (they're large) and build asset manifest:
staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/],
}),
// Moment.js is an extremely popular library that bundles large locale files
// by default due to how Webpack interprets its code. This is a practical
// solution that requires the user to opt into importing specific locales.
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
// You can remove this if you don't use Moment.js:
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
],
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node: {
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty',
},
}
}
}),
// Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.
new ExtractTextPlugin({
filename: cssFilename,
}),
// Generate a manifest file which contains a mapping of all asset filenames
// to their corresponding output file so that tools can pick it up without
// having to parse `index.html`.
new ManifestPlugin({
fileName: 'asset-manifest.json',
}),
// Generate a service worker script that will precache, and keep up to date,
// the HTML & assets that are part of the Webpack build.
new SWPrecacheWebpackPlugin({
// By default, a cache-busting query parameter is appended to requests
// used to populate the caches, to ensure the responses are fresh.
// If a URL is already hashed by Webpack, then there is no concern
// about it being stale, and the cache-busting can be skipped.
dontCacheBustUrlsMatching: /\.\w{8}\./,
filename: 'service-worker.js',
logger(message) {
if (message.indexOf('Total precache size is') === 0) {
// This message occurs for every build and is a bit too noisy.
return;
}
if (message.indexOf('Skipping static resource') === 0) {
// This message obscures real errors so we ignore it.
// https://github.com/facebookincubator/create-react-app/issues/2612
return;
}
// console.log(message);
},
minify: true,
// For unknown URLs, fallback to the index page
navigateFallback: publicUrl + '/index.html',
// Ignores URLs starting from /__ (useful for Firebase):
// https://github.com/facebookincubator/create-react-app/issues/2237#issuecomment-302693219
navigateFallbackWhitelist: [/^(?!\/__).*/],
// Don't precache sourcemaps (they're large) and build asset manifest:
staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/],
}),
// Moment.js is an extremely popular library that bundles large locale files
// by default due to how Webpack interprets its code. This is a practical
// solution that requires the user to opt into importing specific locales.
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
// You can remove this if you don't use Moment.js:
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
],
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node: {
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty',
},
};

@ -161,6 +161,7 @@
"devDependencies": {
"@babel/runtime": "7.0.0-beta.51",
"babel-plugin-import": "^1.11.0",
"compression-webpack-plugin": "^1.1.12",
"concat": "^1.0.3",
"happypack": "^5.0.1",
"node-sass": "^4.12.0",

@ -1079,8 +1079,14 @@
<div class="name">下降</div>
<div class="code-name">&amp;#xe669;</div>
</li>
<li class="dib">
<li class="dib">
<span class="icon iconfont">&#xe800;</span>
<div class="name">复制</div>
<div class="code-name">&amp;#xe800;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe7f9;</span>
<div class="name">更多</div>
<div class="code-name">&amp;#xe7f9;</div>
@ -1337,7 +1343,31 @@
<div class="name">nenghaofenxi@1x</div>
<div class="code-name">&amp;#xe6be;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe6c1;</span>
<div class="name">detection@1x</div>
<div class="code-name">&amp;#xe6c1;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe6c2;</span>
<div class="name">community@1x</div>
<div class="code-name">&amp;#xe6c2;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe6c3;</span>
<div class="name">hosting@1x</div>
<div class="code-name">&amp;#xe6c3;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe6c4;</span>
<div class="name">project@1x</div>
<div class="code-name">&amp;#xe6c4;</div>
</li>
</ul>
<div class="article markdown">
<h2 id="unicode-">Unicode 引用</h2>
@ -2962,8 +2992,17 @@
<div class="code-name">.icon-xiajiang
</div>
</li>
<li class="dib">
<li class="dib">
<span class="icon iconfont icon-fuzhi1"></span>
<div class="name">
复制
</div>
<div class="code-name">.icon-fuzhi1
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-gengduo1"></span>
<div class="name">
更多
@ -3349,7 +3388,43 @@
<div class="code-name">.icon-nenghaofenxix
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-detectionx"></span>
<div class="name">
detection@1x
</div>
<div class="code-name">.icon-detectionx
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-communityx"></span>
<div class="name">
community@1x
</div>
<div class="code-name">.icon-communityx
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-hostingx2"></span>
<div class="name">
hosting@1x
</div>
<div class="code-name">.icon-hostingx2
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-projectx"></span>
<div class="name">
project@1x
</div>
<div class="code-name">.icon-projectx
</div>
</li>
</ul>
<div class="article markdown">
<h2 id="font-class-">font-class 引用</h2>
@ -4778,8 +4853,16 @@
<div class="name">下降</div>
<div class="code-name">#icon-xiajiang</div>
</li>
<li class="dib">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-fuzhi1"></use>
</svg>
<div class="name">复制</div>
<div class="code-name">#icon-fuzhi1</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-gengduo1"></use>
</svg>
@ -5122,6 +5205,38 @@
<div class="name">nenghaofenxi@1x</div>
<div class="code-name">#icon-nenghaofenxix</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-detectionx"></use>
</svg>
<div class="name">detection@1x</div>
<div class="code-name">#icon-detectionx</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-communityx"></use>
</svg>
<div class="name">community@1x</div>
<div class="code-name">#icon-communityx</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-hostingx2"></use>
</svg>
<div class="name">hosting@1x</div>
<div class="code-name">#icon-hostingx2</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-projectx"></use>
</svg>
<div class="name">project@1x</div>
<div class="code-name">#icon-projectx</div>
</li>
</ul>
<div class="article markdown">

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1230,6 +1230,13 @@
"unicode": "e669",
"unicode_decimal": 58985
},
{
"icon_id": "5255211",
"name": "复制",
"font_class": "fuzhi1",
"unicode": "e800",
"unicode_decimal": 59392
},
{
"icon_id": "5291605",
"name": "更多",
@ -1530,6 +1537,34 @@
"font_class": "nenghaofenxix",
"unicode": "e6be",
"unicode_decimal": 59070
},
{
"icon_id": "11408531",
"name": "detection@1x",
"font_class": "detectionx",
"unicode": "e6c1",
"unicode_decimal": 59073
},
{
"icon_id": "11409495",
"name": "community@1x",
"font_class": "communityx",
"unicode": "e6c2",
"unicode_decimal": 59074
},
{
"icon_id": "11409771",
"name": "hosting@1x",
"font_class": "hostingx2",
"unicode": "e6c3",
"unicode_decimal": 59075
},
{
"icon_id": "11410432",
"name": "project@1x",
"font_class": "projectx",
"unicode": "e6c4",
"unicode_decimal": 59076
}
]
}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 294 KiB

After

Width:  |  Height:  |  Size: 303 KiB

@ -76,10 +76,10 @@ const Otherloginstart=Loadable({
loading: Loading,
})
const TestIndex = Loadable({
loader: () => import('./modules/test'),
loading: Loading,
})
// const TestIndex = Loadable({
// loader: () => import('./modules/test'),
// loading: Loading,
// })
const IndexWrapperComponent = Loadable({
loader: () => import('./modules/page/IndexWrapper'),
@ -91,23 +91,23 @@ const CommentComponent = Loadable({
loading: Loading,
})
const TestMaterialDesignComponent = Loadable({
loader: () => import('./modules/test/md/TestMaterialDesign'),
loading: Loading,
})
const TestCodeMirrorComponent = Loadable({
loader: () => import('./modules/test/codemirror/TestCodeMirror'),
loading: Loading,
})
// const TestMaterialDesignComponent = Loadable({
// loader: () => import('./modules/test/md/TestMaterialDesign'),
// loading: Loading,
// })
// const TestCodeMirrorComponent = Loadable({
// loader: () => import('./modules/test/codemirror/TestCodeMirror'),
// loading: Loading,
// })
const TestComponent = Loadable({
loader: () => import('./modules/test/TestRC'),
loading: Loading,
})
const TestUrlQueryComponent = Loadable({
loader: () => import('./modules/test/urlquery/TestUrlQuery'),
loading: Loading,
})
// const TestComponent = Loadable({
// loader: () => import('./modules/test/TestRC'),
// loading: Loading,
// })
// const TestUrlQueryComponent = Loadable({
// loader: () => import('./modules/test/urlquery/TestUrlQuery'),
// loading: Loading,
// })
const TPMIndexComponent = Loadable({
loader: () => import('./modules/tpm/TPMIndex'),
@ -254,10 +254,10 @@ const Interestpage = Loadable({
})
//众包创新
const ProjectPackages=Loadable({
loader: () => import('./modules/projectPackages/ProjectPackageIndex'),
loading: Loading,
})
// const ProjectPackages=Loadable({
// loader: () => import('./modules/projectPackages/ProjectPackageIndex'),
// loading: Loading,
// })
//竞赛
const NewCompetitions=Loadable({
@ -285,6 +285,16 @@ const Ecs = Loadable({
loading: Loading,
})
//团队竞赛报名
const Registration = Loadable({
loader: () => import('./modules/competition/Registration'),
loading: Loading,
});
//个人竞赛报名
const PersonalCompetit = Loadable({
loader: () => import('./modules/competition/personal/PersonalCompetit.js'),
loading: Loading,
});
class App extends Component {
constructor(props) {
super(props)
@ -477,8 +487,8 @@ class App extends Component {
return (<Topicbank {...this.props} {...props} {...this.state} />)
}
}></Route>
{/*众包创新*/}
<Route path={"/crowdsourcing"} component={ProjectPackages}/>
{/*/!*众包创新*!/*/}
{/*<Route path={"/crowdsourcing"} component={ProjectPackages}/>*/}
{/*竞赛*/}
<Route path={"/newcompetitions"} component={NewCompetitions}/>
{/*认证*/}
@ -531,7 +541,12 @@ class App extends Component {
return (<BanksIndex {...this.props} {...props} {...this.state} />)
}
}></Route>
<Route
path="/personalcompetit"
render={
(props) => (<PersonalCompetit {...this.props} {...props} {...this.state}></PersonalCompetit>)
}
/>
<Route
path="/changepassword"
render={
@ -583,11 +598,18 @@ class App extends Component {
>
</Route>
<Route path="/comment" component={CommentComponent}/>
<Route path="/testMaterial" component={TestMaterialDesignComponent}/>
<Route path="/test" component={TestIndex}/>
<Route path="/testCodeMirror" component={TestCodeMirrorComponent}/>
<Route path="/testRCComponent" component={TestComponent}/>
<Route path="/testUrlQuery" component={TestUrlQueryComponent}/>
{/*<Route path="/testMaterial" component={TestMaterialDesignComponent}/>*/}
{/*<Route path="/test" component={TestIndex}/>*/}
{/*<Route path="/testCodeMirror" component={TestCodeMirrorComponent}/>*/}
{/*<Route path="/testRCComponent" component={TestComponent}/>*/}
{/*<Route path="/testUrlQuery" component={TestUrlQueryComponent}/>*/}
<Route
path="/registration"
render={
(props) => (<Registration {...this.props} {...props} {...this.state}></Registration>)
}
/>
<Route path="/messages"
render={
(props)=>(<Messagerouting {...this.props} {...props} {...this.state}></Messagerouting>)
@ -601,6 +623,7 @@ class App extends Component {
render={
(props)=>(<Ecs {...this.props} {...props} {...this.state}></Ecs>)
}/>
<Route exact path="/"
// component={ShixunsHome}
render={

@ -0,0 +1,113 @@
import React, {Component} from 'react';
import competition from './comcss/competition.css';
// 团队竞赛报名大图
class CompetitionMaxImg extends React.Component {
constructor(props) {
super(props)
this.state = {
GetenrollmentAPI: undefined
}
}
componentDidMount() {
}
componentDidUpdate = (prevProps) => {
if (prevProps.GetenrollmentAPI != this.props.GetenrollmentAPI) {
// console.log("团队竞赛报名大图componentDidUpdate");
// console.log(this.props);
// console.log(this.props.GetenrollmentAPI);
this.setState({
GetenrollmentAPI: this.props.GetenrollmentAPI,
})
}
}
render() {
let {type, pint} = this.props;
return (
<div>
{
type === 1 || type === 2 ?
<div className="registrationback">
<p className="registrationbackp1">Educoder竞赛平台</p>
<p className="registrationbackp2">Educoder是一个面向计算机类的互联网IT教育和实战平台</p>
<p className="registrationbackp3">提供企业级工程实训以实现工程化专业教学的自动化和智能化</p>
<div className="registrationbackp2button">
<div className="registbut1">
<p onClick={() => this.props.Jointheteam()}>加入战队</p>
</div>
<div className="registbut2">
<p onClick={() => this.props.Createateam()}>创建战队</p>
</div>
</div>
</div>
:
type === 3 ?
<div className="registrationback">
<p className="registrationbackp1">Educoder竞赛平台</p>
<p className="registrationbackp4">高校智能课堂与综合实训平台</p>
<div className="registrationbackp2button2">
<div className="registbut11">
<p onClick={() => this.props.Jointheteam()}>加入战队</p>
</div>
<div className="registbut22">
<p onClick={() => this.props.Createateam()}>创建战队</p>
</div>
</div>
</div>
:
type === 4 || type === 5 ?
<div className="registrationback1">
<p className="registrationbackp11">Educoder竞赛平台</p>
<p className="registrationbackp22">高校智能课堂与综合实训平台</p>
<div className="registrationbackp2button3">
<div className="registbut111">
<p onClick={() => this.props.Jointheteam()}>加入战队</p>
</div>
<div className="registbut222">
<p onClick={() => this.props.Createateam()}>创建战队</p>
</div>
</div>
</div>
: type === 6 ?
<div className="registrationback">
<p className="registrationbackp1">Educoder竞赛平台</p>
<p className="registrationbackp2">Educoder是一个面向计算机类的互联网IT教育和实战平台</p>
<p className="registrationbackp3">提供企业级工程实训以实现工程化专业教学的自动化和智能化</p>
<div className="registrationbackp2button">
{
pint === 1 ?
<div className="registbut1">
<p>立即报名</p>
</div>
: pint === 2 ?
<div className="personreg1">
<p>已报名</p>
</div>
:
<div className="personreg1">
<p>报名已截止</p>
</div>
}
</div>
</div>
:
""
}
</div>
)
}
}
export default CompetitionMaxImg;

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

@ -0,0 +1,50 @@
import React, {Component} from 'react';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import competition from './comcss/competition.css';
import {Checkbox, Table, Pagination, Menu, Icon} from "antd";
// 团队竞赛报名无报名子组件团队 在线竞赛 > 全国高校计算机大赛-项目挑战>
import Rectanglex from "../../modules/competition/Rectanglex.png";
class RegisListview extends React.Component {
constructor(props) {
super(props)
}
render() {
return (
<div className="reglistviewdivs">
<div className="reglistviewdivss " style={{
width: "100%",
display: "flex",
justifyContent: " space-around",
alignItems: "center",
background: `url(${Rectanglex})`,
height: "50px",
backgroundPosition: "center",
backgroundSize: "110% 100%",
}}>
<p className="borders"
style={{fontSize: "16px", color: "#05101A", width: "79px", textAlign: "center"}}>创建者</p>
<p className="borders"
style={{fontSize: "16px", color: "#05101A", width: "160px", textAlign: "center"}}>战队名称</p>
<p className="borders"
style={{fontSize: "16px", color: "#05101A", width: "487px", textAlign: "center"}}>战队成员</p>
<p className="borders"
style={{fontSize: "16px", color: "#05101A", width: "134px", textAlign: "center"}}>学校</p>
<p className="borders"
style={{fontSize: "16px", color: "#05101A", width: "151px", textAlign: "center"}}>时间</p>
</div>
</div>
)
}
}
export default RegisListview;

@ -0,0 +1,106 @@
import React, {Component} from 'react';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import {SnackbarHOC, WordsBtn} from 'educoder';
import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
import competition from './comcss/competition.css';
import {Button} from 'antd';
// 团队竞赛报名无报名子组件团队 竞赛报名-已创建战队
class RegisListviewdata extends React.Component {
constructor(props) {
super(props)
}
render() {
return (
<div className="regitem">
<div className="regitemimg1 borders">
<div className="regitemimg2">
</div>
<p>小猫头像</p>
</div>
<div className="borders" style={{
marginTop: "29px",
marginLeft: "37px"
}}>
<p style={{
border: "1px solid",
color: "#05101A",
fontSize: "16px",
width: "160px",
textAlign: "center"
}}>重庆邮电大学</p>
</div>
<div className="borders" style={{
marginLeft: "37px",
display: "flex",
flexDirection: "initial",
width: "487px"
}}>
<div className="regitemimgs">
</div>
<div className="regitemimgs2">
</div>
<div className="regitemimgs2">
</div>
<div className="regitemimgs2">
</div>
<div className="regitemimgs2">
</div>
<div className="regitemimgs2">
</div>
<div className="regitemimgs22">
</div>
</div>
<div className="borders" style={{
marginLeft: "37px",
width: "134px",
marginTop: "29px",
}}>
<p style={{
color: "#05101A",
fontSize: "16px",
textAlign: "center"
}}>重庆邮电大学</p>
</div>
<div className="borders" style={{
marginLeft: "37px",
width: "151px",
marginTop: "29px",
}}>
<p style={{
color: "#999999",
fontSize: "16px",
textAlign: "center"
}}>2019-09-07 08:33</p>
</div>
</div>
)
}
}
export default RegisListviewdata;

@ -0,0 +1,34 @@
import React, {Component} from 'react';
import competition from './comcss/competition.css';
import Noentry from './Noentry.jpg';
// 团队竞赛报名无报名子组件
class RegisNodata extends React.Component {
constructor(props) {
super(props)
}
render() {
return (
<div className="bootom">
<div className="bootomimg" style={{
height: "80px",
width: "125px",
marginTop: "107px",
background: `url(${Noentry})`,
backgroundPosition: "center",
backgroundSize: "110% 100%",
}}>
</div>
<p className="bootomtext">暂无战队参与报名哦赶紧来成为第一个挑战的吧~</p>
</div>
)
}
}
export default RegisNodata;

@ -0,0 +1,404 @@
import React, {Component} from 'react';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import {SnackbarHOC, WordsBtn} from 'educoder';
import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
import competition from './comcss/competition.css';
import {Button, Pagination, message} from 'antd';
import Registrationitem from './Registrationitem';
import RegisNodata from './RegisNodata';
import CompetitionMaxImg from './CompetitionMaxImg';
import RegistrationSearch from './RegistrationSearch';
import RegisListview from './RegisListview';
import RegisListviewdata from './RegisListviewdata';
import PersonModal from './competmodal/PersonModal';
import MessagePersonModal from './competmodal/MessagePersonModal';
import PersonalModalteam from './competmodal/PersonalModalteam';
import PersonalCompetititem from './personal/PersonalCompetititem'
// 团队竞赛报名无报名
class Registration extends React.Component {
/***
*"personal": false, // 是否为个人赛
*"enroll_ended": false, // 报名是否截止
*"enrolled: false, // 是否已经报名
*"teacher_staff": { // 为空表示不支持老师报名
*"member_staff": { // 为空表示不支持学生报名
* **/
constructor(props) {
super(props)
this.state = {
test: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
loadingstate: false,
pages: 1,
limit: 20,
type: 1,
tmodalsType: false,
tmodalsTypes: false,
Newtit: true,
keyword: "",
page: 1,
per_page: 20,
data: [],
count: 0,
GetenrollmentAPI: undefined,
personal: false,
enroll_ended: false,
enrolled: false,
teacher_staff: null,
member_staff: null,
messagePer: "提示",
messagePerbool: false,
intpermessages: "确认"
}
}
componentDidMount() {
//console.log("componentDidMount Registration");
// ////console.log("调用子组件 ");
//console.log(this.props.isAdmin());
// ////console.log(this.props.isAdmin())
const {keyword, page, per_page} = this.state;
this.Getdata(keyword, page, per_page);
this.GetenrollmentAPI();
}
//获取报名配置API
GetenrollmentAPI = () => {
const url = `/competitions/${"gcc-course-2019"}/competition_staff.json`;
axios.get((url)).then((result) => {
if (result) {
if (result.data) {
////console.log("获取报名配置API");
////console.log(result);
this.setState({
GetenrollmentAPI: result.data,
personal: result.data.personal,
enroll_ended: result.data.enroll_ended,
enrolled: result.data.enrolled,
teacher_staff: result.data.teacher_staff,
member_staff: result.data.member_staff,
})
}
}
}).catch((error) => {
////console.log(error);
})
}
Getdata = (keyword, page, per_page) => {
//搜索关键字 keyword
//页数 page
//分页 per_page
const datas = {
keyword: keyword,
page: page,
per_page: per_page,
};
let url = `/competitions/${"gcc-course-2019"}/competition_teams.json`;
axios.get((url), {params: datas}).then((result) => {
if (result) {
if (result.data) {
////console.log(result);
if (result.data.count === 0) {
// 没有创建数据的
if (this.props.isAdmin() === true) {
//管理员
this.setState({
type: 4,
count: result.data.count,
})
} else {
//普通人
this.setState({
type: 1,
count: result.data.count,
})
}
} else {
//有数据的
if (this.props.isAdmin() === true) {
this.setState({
type: 5,
data: result.data.competition_teams,
count: result.data.count,
})
} else {
if (result.data.competition_teams[0].manage_permission === true) {
//学生true 为创建了竞赛
this.setState({
type: 2,
data: result.data.competition_teams,
count: result.data.count,
})
} else {
//学生true 加入了竞赛
this.setState({
type: 3,
data: result.data.competition_teams,
count: result.data.count,
})
}
}
}
}
}
}).catch((error) => {
////console.log(error);
})
}
paginationonChangestwo = (pageNumber) => {
this.setState({
pages: pageNumber,
loadingstate: true,
})
};
/**
* 加入战队
* */
Jointheteam = () => {
if (this.state.enrolled === true) {
//已经报名
this.setState({
messagePerbool: true,
intpermessages: "您已报名,无需重复报"
})
return;
}
if (this.state.enroll_ended === true) {
//报名截止
this.setState({
messagePerbool: true,
intpermessages: "报名已截止,无需报名"
})
return
}
if (this.props.isAdmin() === true) {
//老师
if (this.state.teacher_staff === null) {
//禁止老师
this.setState({
messagePerbool: true,
intpermessages: "已禁止老师报名"
})
return;
}
this.setState({
tmodalsTypes: true
})
} else {
//学生
if (this.state.member_staff === null) {
//禁止学生
this.setState({
messagePerbool: true,
intpermessages: "已禁止学生报名"
})
return;
}
this.setState({
tmodalsTypes: true
})
}
// this.setState({
// tmodalsTypes: true
// })
}
/**
* 创建战队
**/
Createateam = () => {
//
if (this.state.enrolled === true) {
//已经报名
this.setState({
messagePerbool: true,
intpermessages: "您已报名,无需重复报"
})
return;
}
if (this.state.enroll_ended === true) {
//报名截止
this.setState({
messagePerbool: true,
intpermessages: "报名已截止,无需报名"
})
return
}
if (this.props.isAdmin() === true) {
//老师
if (this.state.teacher_staff === null) {
//禁止老师
this.setState({
messagePerbool: true,
intpermessages: "已禁止老师报名"
})
return;
}
this.setState({
tmodalsType: true
})
} else {
//学生
if (this.state.member_staff === null) {
//禁止学生
this.setState({
messagePerbool: true,
intpermessages: "已禁止学生报名"
})
return;
}
this.setState({
tmodalsType: true
})
}
// this.setState({
// tmodalsType: true
// })
}
Tmoconfirm = (bool) => {
//boolfalse 取消 true 确认
this.setState({
tmodalsTypes: false
})
if (bool) {
//确认
} else {
//取消
}
}
Tmoconfirm1 = (bool) => {
//boolfalse 取消 true 确认
this.setState({
tmodalsType: false
})
if (bool) {
//确认
} else {
//取消
}
}
//自定义弹框按钮
messagePerboolbuton = () => {
this.setState({
messagePerbool: false
})
}
render() {
const {test, page, pages, limit, type, tmodalsType, tmodalsTypes, data} = this.state;
const listItems = test.map((item, index) =>
<RegisListviewdata></RegisListviewdata>
);
return (
<div className="newMain clearfix ">
<div className={"educontent mb20 persmstyle"} style={{width: "1200px", marginTop: "26px"}}>
<style>
{
`
html, body{
overflow: hidden;
height: 100%;
}
`
}
</style>
<MessagePersonModal messagePer={this.state.messagePer} {...this.props} {...this.state}
messagePerboolbuton={() => this.messagePerboolbuton()}></MessagePersonModal>
<PersonModal modalsType={tmodalsType} {...this.props} {...this.state} Newtit={true}
Tmoconfirm1={(bool) => this.Tmoconfirm1(bool)}></PersonModal>
<PersonalModalteam tmodalsTypes={tmodalsTypes} {...this.props} {...this.state}
Tmoconfirm={(bool) => this.Tmoconfirm(bool)}></PersonalModalteam>
<div className="educontent mb20 ">
<p className="clearfix mb20 mt10">
<a className="btn colorgrey fl hovercolorblue ">在线竞赛</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a
className=" btn colorgrey fl hovercolorblue ">全国高校计算机大赛-项目挑战</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">报名</WordsBtn>
</p>
</div>
{/*大图*/}
<CompetitionMaxImg type={type} Jointheteam={() => this.Jointheteam()}
{...this.props} {...this.state}
Createateam={() => this.Createateam()}></CompetitionMaxImg>
{/*大图结尾*/}
{/*没数据*/}
{
type === 1 ?
<RegisNodata></RegisNodata>
:
""
}
{
type === 2 || type === 3 || type === 5 ?
<PersonalCompetititem type={type} data={data}></PersonalCompetititem>
: ""
}
{
type === 4 || type === 5 ?
<RegistrationSearch></RegistrationSearch>
: ""
}
{/*<Registrationitem></Registrationitem>*/}
{
type === 4 || type === 5 ?
<RegisListview></RegisListview>
:
""
}
{type === 4 || type === 5 ?
listItems
:
""
}
{
type === 4 || type === 5 ?
<div className="edu-txt-center ysyslxh mt56 " style={{marginBottom: "192px",}}>
<Pagination showQuickJumper current={pages}
onChange={this.paginationonChangestwo} pageSize={limit}
total={30}></Pagination>
</div>
: ""
}
</div>
</div>
)
}
}
export default SnackbarHOC()(TPMIndexHOC(Registration));

@ -0,0 +1,55 @@
import React, {Component} from 'react';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import competition from './comcss/competition.css';
import {Checkbox, Input, Table, Pagination, Menu, Icon} from "antd";
const Search = Input.Search;
// 团队竞赛报名无报名子组件团队 在线竞赛 > 全国高校计算机大赛-项目挑战>
class RegistrationSearch extends React.Component {
constructor(props) {
super(props)
this.state = {
keywords: ""
}
}
setdatafunsval = (e) => {
this.setState({
keywords: e.target.value
})
};
setdatafuns = (value) => {
console.log("点击了搜索");
this.setState({
keywords: value
})
};
render() {
return (
<div className="searchhead">
<Search
className="packinputs"
value={this.state.keywords}
enterButton={<span>搜索</span>}
onInput={(e) => this.setdatafunsval(e)}
onSearch={(value) => this.setdatafuns(value)}/>
<p style={{color: "#07140E", fontSize: "16px", marginTop: "7px", marginLeft: "760px"}}>战队总数<span
style={{color: "#459BE5", fontSize: "16px"}}>271</span></p>
</div>
)
}
}
export default RegistrationSearch;

@ -0,0 +1,76 @@
import React, {Component} from 'react';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import {SnackbarHOC, WordsBtn} from 'educoder';
import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
import competition from './comcss/competition.css';
import {Button} from 'antd';
import RegisListviewdata from "./RegisListviewdata";
// 团队竞赛报名无报名子组件团队 竞赛报名-已创建战队
class Registrationitem extends React.Component {
constructor(props) {
super(props)
}
render() {
return (
<div className="regitem2">
<div className="perregitemimg1 ">
<div className="personregitemimg">
</div>
</div>
<div className="" style={{
marginTop: "19px",
marginLeft: "54px",
display: "flex",
flexDirection: "initial",
}}>
<p className="" style={{
color: "#05101A",
fontSize: "16px",
width: "160px",
textAlign: "center"
}}>小猫头像</p>
<p className="" style={{
color: "#459BE5",
fontSize: "16px",
textAlign: "center",
marginLeft: "25px",
}}>已报名</p>
</div>
<div className="" style={{
marginLeft: "632px",
width: "151px",
marginTop: "19px",
marginRight: "35px",
}}>
<p style={{
color: "#999999",
fontSize: "16px",
textAlign: "center",
}}>2019-09-07 08:33</p>
</div>
</div>
)
}
}
export default Registrationitem;

@ -0,0 +1,717 @@
/*All*/
.borders {
border: 0.5px solid;
}
.borders2 {
border: 1px solid #D9D9D9;
}
/*All*/
/*Registration.js*/
.registrationback {
height: 368px;
width: 1200px;
border: 0.5px solid;
display: flex;
display: -webkit-flex;
flex-direction: column;
align-items: center;
background: #0dcecb;
}
.registrationbackcenter {
display: flex;
display: -webkit-flex;
flex-direction: column;
align-items: center;
}
.registrationback1 {
height: 368px;
width: 1200px;
border: 0.5px solid;
display: flex;
flex-direction: column;
background: #0dcecb;
}
.registrationbackp1 {
color: #ffffff;
font-size: 42px;
margin-top: 80px;
line-height: 42px;
font-weight: bold;
}
.registrationbackp11 {
color: #ffffff;
font-size: 48px;
margin-top: 71px;
line-height: 48px;
font-weight: bold;
margin-left: 251px;
}
.registrationbackp2 {
color: #ffffff;
font-size: 18px;
margin-top: 16px;
line-height: 20px;
}
.registrationbackp22 {
margin-left: 251px;
color: #ffffff;
font-size: 36px;
margin-top: 25px;
line-height: 36px;
}
.registrationbackp3 {
color: #ffffff;
font-size: 18px;
line-height: 20px;
margin-top: 7px;
}
.registrationbackp4 {
color: #ffffff;
font-size: 26px;
margin-top: 25px;
line-height: 26px;
}
.registrationbackp5 {
color: #ffffff;
font-size: 26px;
margin-top: 25px;
}
.registrationbackp2button {
display: flex;
align-items: center;
margin-top: 36px;
}
.registrationbackp2button2 {
display: flex;
align-items: center;
margin-top: 40px;
}
.registrationbackp2button3 {
display: flex;
align-items: center;
margin-top: 44px;
margin-left: 251px;
}
.registbut1 {
margin-right: 46px;
text-align: center;
background: #ffffff;
height: 54px;
width: 156px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer
}
.personreg1 {
margin-right: 46px;
text-align: center;
background: #C3C1C1;
height: 54px;
width: 156px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer
}
.registbut11 {
margin-right: 46px;
text-align: center;
font-size: 16px;
color: #ffffff;
height: 48px;
width: 156px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
border: 1px;
border-style: solid;
border-color: #ffffff;
}
.registbut111 {
margin-right: 46px;
text-align: center;
color: #ffffff;
height: 41px;
width: 146px;
font-size: 16px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
border: 2px;
border-style: solid;
border-color: #ffffff;
}
.registbut1 p {
width: 100%;
height: 100%;
color: #05101A;
line-height: 54px;
font-size: 20px;
font-weight: bold;
cursor: pointer
}
.registbut11 p {
width: 100%;
height: 100%;
line-height: 48px;
}
.registbut22 p {
width: 100%;
height: 100%;
line-height: 48px;
}
.registbut2 p {
line-height: 54px;
width: 100%;
height: 100%;
color: #05101A;
font-size: 20px;
font-weight: bold;
cursor: pointer
}
.personreg1 p {
color: #ffffff;
font-size: 20px;
cursor: not-allowed;
}
.registbut111 p {
width: 100%;
height: 100%;
line-height: 41px;
}
.registbut222 p {
width: 100%;
height: 100%;
line-height: 41px;
}
.registbut2 {
text-align: center;
color: #05101A;
font-size: 20px;
background: #ffffff;
height: 54px;
width: 156px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer
}
.registbut22 {
text-align: center;
color: #ffffff;
font-size: 16px;
height: 48px;
width: 156px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
border: 1px;
border-style: solid;
border-color: #ffffff;
}
.registbut222 {
text-align: center;
color: #ffffff;
font-size: 16px;
height: 41px;
width: 146px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
border: 2px;
border-style: solid;
border-color: #ffffff;
}
.bootom {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.bootomimg {
height: 80px;
width: 125px;
margin-top: 107px;
}
.bootomtext {
color: #999999;
font-size: 16px;
margin-top: 33px;
}
/*Registration.js*/
/*Registrationitem.js*/
/*横向*/
.regitem {
display: flex;
flex-direction: initial;
border-bottom: 1px solid #EDEDED;
margin-top: 44px;
}
.regitem2 {
display: flex;
flex-direction: initial;
border-bottom: 1px solid #EDEDED;
margin-top: 19px;
}
/*垂直*/
.regitemimg1 {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-left: 17px;
}
.perregitemimg1 {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-left: 26px;
padding-bottom: 18px;
}
.regitemimg2 {
height: 78px;
width: 78px;
}
.personregitemimg {
border: 0.5px solid;
height: 64px;
width: 64px;
}
.regitemimg2 p {
border: 0.5px solid;
color: #999999;
font-size: 14px;
}
.regitemimgs {
width: 69px;
height: 69px;
margin-top: 3px;
}
.regitemimgs2 {
margin-top: 16px;
width: 49px;
height: 51px;
margin-left: 25px
}
.regitemimgs22 {
margin-top: 27px;
width: 28px;
height: 28px;
margin-left: 20px;
}
.regitemimgs3 {
/* border: 0.5px solid; */
height: 22px;
width: 22px;
font-size: 21px !important;
margin-top: 22px;
color: #1C91E8;
}
.regitemimgs4 {
width: 156px;
display: flex;
flex-direction: row-reverse;
margin-top: 18px;
}
.regitemimgs5 {
margin-left: 10px;
text-align: center;
background: #ffffff;
height: 40px;
width: 72px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
border: 1px;
border-style: solid;
border-color: #459BE5;
cursor: pointer
}
.regitemimgs6 {
text-align: center;
background: #ffffff;
height: 40px;
width: 72px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
border: 1px;
cursor: pointer;
border-style: solid;
border-color: #459BE5;
}
.regitemimgs5 p {
color: #459BE5;
font-size: 14px;
cursor: pointer
}
.regitemimgs6 p {
color: #459BE5;
font-size: 14px;
cursor: pointer
}
/*Registrationitem.js*/
/*RegistrationSearch.js*/
.searchhead {
display: flex;
flex-direction: initial;
margin-top: 24px;
}
.packinputs button {
background: #459BE5;
}
.packinputs {
width: 317px;
height: 34px;
}
/*RegistrationSearch.js*/
.reglistviewdiv {
display: flex;
flex-direction: initial;
margin-top: 25px;
}
/*RegisListview.js*/
.reglistviewdivs {
margin-top: 25px;
}
.reglistviewdivss {
display: flex;
flex-direction: initial;
}
.reglistviewdivss2 {
display: flex;
flex-direction: initial;
}
.reglistviewdivss2p {
width: 90px;
font-size: 12px;
color: #666666;
text-align: center;
}
.reglistviewdivss4p {
width: 90px;
font-size: 12px;
color: #666666;
text-align: center;
}
.reglistviewdivss5p {
width: 110px;
font-size: 12px;
color: #666666;
text-align: center;
}
.reglistviewdivss33p {
width: 25px;
font-size: 12px;
color: #666666;
text-align: center;
}
.reglistviewdivss3p {
width: 31px;
font-size: 12px;
color: #666666;
text-align: center;
}
reglistviewdivs2 {
margin-top: 27px;
}
/*RegisListview.js*/
/*RegisListviewdata.js*/
.reglistimg1 {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.reglistimg2 {
border: 0.5px solid;
height: 78px;
width: 78px;
}
/*RegisListviewdata.js*/
/*PersonModal.js*/
.permaindiv {
display: flex;
flex-direction: column;
}
.demo-loading-container {
position: absolute;
bottom: 40px;
width: 100%;
text-align: center;
}
.demo-infinite-container {
border-radius: 2px;
overflow: auto;
height: 215px;
width: 485px;
}
.demo-infinite-containerdiv {
margin-top: 12px;
}
.demo-infinite-containerdiv2 {
margin-top: 24px;
}
.backgroundspersondiv {
background: #ffffff;
}
.cpersondiv1 {
height: 161px;
width: 410px;
}
.demo-infinite-container2 {
border-radius: 2px;
overflow: auto;
height: 161px;
width: 410px;
}
.demo-infinite-container33 {
border-radius: 2px;
height: 161px;
width: 410px;
}
.cpersondiv1Items {
color: #05101A;
font-size: 12px;
}
.personbut1 {
background: #F2F2F2;
border-color: #F2F2F2;
margin-right: 26px;
width: 120px;
height: 38px;
color: #4A4A4A;
font-size: 16px;
border-radius: 3px;
cursor: pointer;
}
.personbut1 p {
width: 100%;
height: 100%;
text-align: center;
margin-top: 10px;
color: #4A4A4A;
font-size: 16px;
cursor: pointer;
}
.personbut2 {
background: #459BE5;
border-color: #459BE5;
margin-right: 26px;
width: 120px;
height: 38px;
color: #ffffff;
font-size: 16px;
border-radius: 3px;
cursor: pointer;
}
.personbut2 p {
width: 100%;
height: 100%;
text-align: center;
margin-top: 10px;
color: #ffffff;
font-size: 16px;
cursor: pointer;
}
/*PersonModal.js*/
/*PersonalModalteam.js*/
.personaldiv {
display: flex;
display: -webkit-flex;
flex-direction: column;
align-items: center;
}
.personaldivbutt1 {
background: #F2F2F2;
border-color: #F2F2F2;
margin-right: 23px;
width: 100px;
height: 38px;
color: #4A4A4A;
font-size: 16px;
border-radius: 3px;
cursor: pointer;
}
.personaldivbutt1 p {
width: 100%;
height: 100%;
text-align: center;
margin-top: 10px;
color: #666666;
font-size: 16px;
cursor: pointer;
}
.personaldivbutt2 {
background: #459BE5;
border-color: #459BE5;
width: 100px;
height: 38px;
color: #ffffff;
font-size: 16px;
border-radius: 3px;
cursor: pointer;
}
.personaldivbutt2 p {
width: 100%;
height: 100%;
text-align: center;
margin-top: 10px;
color: #ffffff;
font-size: 16px;
cursor: pointer;
}
.task-btn-orange {
background: #4CACFF !important;
color: #fff !important;
}
.task-btn {
cursor: pointer;
display: inline-block;
border: none;
padding: 0 12px;
letter-spacing: 1px;
text-align: center;
font-size: 14px;
height: 30px;
line-height: 30px;
border-radius: 2px;
}
/*PersonalModalteam.js*/

@ -0,0 +1,63 @@
import React, {Component} from 'react';
import {getImageUrl} from 'educoder';
import {Modal, Input, Spin, Tooltip, Icon, Dropdown, Button} from 'antd';
import axios from 'axios';
import competition from '../comcss/competition.css';
import Registrationitem from "../Registrationitem";
import InfiniteScroll from 'react-infinite-scroller';
// import PersonModaltion from "./PersonModaltion";
const {Search} = Input;
class MessagePersonModal extends React.Component {
constructor(props) {
super(props);
this.state = {}
}
render() {
const {
addonAfter, test, test3, Numberofteammentors, Thecurrentnumber, person1, person2
} = this.state;
//Modal
//keyboard是否支持键盘 esc 关闭
//closable 是否显示右上角的关闭按钮
//底部内容,当不需要默认底部按钮时,可以设为 footer={null}
//destroyOnClose 关闭时销毁 Modal 里的子元素
//centered 垂直居中展示 Modal
//visible 弹出框是否显示
return (
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title={this.props.messagePer}
centered={true}
visible={this.props.messagePerbool === undefined ? false : this.props.messagePerbool}
width="480px"
>
<div
style={{
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
}}
>
<div style={{width: "100%", textAlign: "center"}}
className="task-popup-text-center font-16 ">{this.props.intpermessages}</div>
<div style={{textAlign: "center", marginTop: "30px"}}
className="task-popup-text-center task-btn task-btn-orange"
onClick={() => this.props.messagePerboolbuton()}>确认
</div>
</div>
</Modal>
)
}
}
export default MessagePersonModal;

@ -0,0 +1,51 @@
import React, {Component} from 'react';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import competition from './comcss/competition.css';
import {Checkbox, Table, Pagination, Menu, Icon} from "antd";
// 团队竞赛报名无报名子组件团队 在线竞赛 > 全国高校计算机大赛-项目挑战>
import Rectanglex from "../../modules/competition/Rectanglex.png";
class PersonModaltion extends React.Component {
constructor(props) {
super(props)
}
render() {
return (
<div className="reglistviewdivs">
<div className="reglistviewdivss " style={{
width: "100%",
display: "flex",
justifyContent: " space-around",
alignItems: "center",
height: "50px",
backgroundPosition: "center",
backgroundSize: "110% 100%",
backgroundColor: "#E0E0E0",
}}>
<p className="borders"
style={{fontSize: "16px", color: "#05101A", textAlign: "center"}}>姓名</p>
<p className="borders"
style={{fontSize: "16px", color: "#05101A", textAlign: "center"}}>角色</p>
<p className="borders"
style={{fontSize: "16px", color: "#05101A", textAlign: "center"}}>单位</p>
<p className="borders"
style={{fontSize: "16px", color: "#05101A", textAlign: "center"}}>其他</p>
<p className="borders"
style={{fontSize: "16px", color: "#05101A", textAlign: "center"}}>操作</p>
</div>
</div>
)
}
}
export default PersonModaltion;

@ -0,0 +1,125 @@
import React, {Component} from 'react';
import {getImageUrl} from 'educoder';
import {Modal, Input, Spin, Tooltip, Icon, Dropdown, Button} from 'antd';
import axios from 'axios';
import competition from '../comcss/competition.css';
import Registrationitem from "../Registrationitem";
import InfiniteScroll from 'react-infinite-scroller';
// import PersonModaltion from "./PersonModaltion";
const {Search} = Input;
//立即申请试用
class PersonalModalteam extends Component {
constructor(props) {
super(props);
this.state = {
yslzxueshiskmcdm1: "",
}
}
Tmoconfirmto = () => {
let url = `/competitions/${"gcc-course-2019"}/competition_teams/join.json`;
axios.post(url, {
invite_code: this.state.yslzxueshiskmcdm1
}).then((result) => {
if (result) {
if (result.data) {
this.props.Tmoconfirm(true)
}
}
}).catch((error) => {
});
}
studentsonChange = (e) => {
this.setState({
yslzxueshiskmcdm1: e.target.value,
});
}
render() {
const {
addonAfter, test, test3, Numberofteammentors, Thecurrentnumber, person1, person2
} = this.state;
//Modal
//keyboard是否支持键盘 esc 关闭
//closable 是否显示右上角的关闭按钮
//底部内容,当不需要默认底部按钮时,可以设为 footer={null}
//destroyOnClose 关闭时销毁 Modal 里的子元素
//centered 垂直居中展示 Modal
//visible 弹出框是否显示
return (
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title="加入战队"
centered={true}
visible={this.props.tmodalsTypes === undefined ? false : this.props.tmodalsTypes}
width="600px"
heigth="300px"
>
<div className="personaldiv">
<div style={{
display: "flex",
flexDirection: "initial",
marginTop: "10px",
}}>
<p style={{
width: "67px",
fontSize: "16px",
color: '#05101A',
height: "40px",
lineHeight: "40px",
}}>
邀请码
</p>
<style>
{
`
.yslzxueshiskmcdm1 {
height: 40px !important;
width: 329px !important;
}
`
}
</style>
<Input className={"yslzxueshiskmcdm1"} value={this.state.yslzxueshiskmcdm1}
onChange={(e) => this.studentsonChange(e)} placeholder="请输入您的邀请码"/>
</div>
<div style={{
marginTop: "48px",
display: "flex",
alignItems: "center",
paddingBottom: "12px",
}}>
<div style={{
display: "flex",
justifyContent: "center",
width: "100%"
}}>
<div className="personaldivbutt1">
<p onClick={() => this.props.Tmoconfirm(false)}>取消</p>
</div>
<div className="personaldivbutt2">
<p onClick={() => this.Tmoconfirmto()}>确定</p>
</div>
</div>
</div>
</div>
</Modal>
)
}
}
export default PersonalModalteam;

@ -0,0 +1,97 @@
import React, {Component} from 'react';
import {SnackbarHOC, WordsBtn} from 'educoder';
import {TPMIndexHOC} from '../../tpm/TPMIndexHOC';
import competition from '../comcss/competition.css';
import {Button, Pagination,} from 'antd';
import CompetitionMaxImg from '../CompetitionMaxImg';
import Registrationitem from '../Registrationitem';
// 团队竞赛报名无报名
class PersonalCompetit extends React.Component {
constructor(props) {
super(props)
this.state = {
loadingstate: false,
page: 1,
limit: 20,
type: 6,
pint: 1,
test: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
}
}
paginationonChangestwo = (pageNumber) => {
this.setState({
page: pageNumber,
loadingstate: true,
})
}
render() {
const {test, page, limit, type, pint} = this.state;
const listItems = test.map((item, index) =>
<Registrationitem></Registrationitem>
);
return (
<div className="newMain clearfix ">
<div className={"educontent mb20"} style={{width: "1200px", marginTop: "26px"}}>
<div className="educontent mb20 ">
<p className="clearfix mb20 mt10">
<a className="btn colorgrey fl hovercolorblue ">在线竞赛</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a
className=" btn colorgrey fl hovercolorblue ">全国高校计算机大赛-项目挑战</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">报名</WordsBtn>
</p>
</div>
{/*大图*/}
{
type === 6 ?
<CompetitionMaxImg type={type} pint={pint}></CompetitionMaxImg>
:
""
}
{
pint === 1 || pint === 3 ?
<div style={{
marginTop: "22px"
}}>
<p>参赛总人数<span style={{color: "#459BE5"}}>132</span></p>
</div>
: ""}
{/*列表*/}
{
pint === 1 || pint === 3 ?
<div
style={{
marginTop: "31px"
}}
>
{
listItems
}
</div>
: ""}
{
pint === 1 || pint === 3 ?
<div className="edu-txt-center ysyslxh mt56 " style={{marginBottom: "192px",}}>
<Pagination showQuickJumper current={page}
onChange={this.paginationonChangestwo} pageSize={limit}
total={30}></Pagination>
</div>
: ""
}
</div>
</div>
)
}
}
export default SnackbarHOC()(TPMIndexHOC(PersonalCompetit));

@ -0,0 +1,195 @@
import React, {Component} from 'react';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import {SnackbarHOC, WordsBtn, getImageUrl} from 'educoder';
import {TPMIndexHOC} from '../../tpm/TPMIndexHOC';
import competition from '../comcss/competition.css';
import {Button} from 'antd';
// 团队竞赛报名无报名子组件团队 竞赛报名-已创建战队
class PersonalCompetititem extends React.Component {
constructor(props) {
super(props)
this.state = {
data: ""
}
}
componentDidMount() {
// //console.log(this.props.data)
this.setState({
data: this.props.data,
})
}
componentDidUpdate = (prevProps) => {
//
// if (prevProps.data != this.props.data) {
//
// }
}
render() {
const {data} = this.state;
//console.log("PersonalCompetititem");
//console.log(data);
//console.log(data[0]);
//console.log(data&&data[0].creator.image_url);
// const listItems = mydatas.map((item, index) =>
//
// );
return (
<div>
{
data && data[0] ? <div className="regitem">
<div className="regitemimg1 " style={{
marginBottom: "16px",
}}>
<img className="regitemimg2" src={getImageUrl("images/" + data[0].creator.image_url)}>
</img>
<p className="" style={{
color: "#999999",
fontSize: "14px",
width: "78px",
textAlign: "center"
}}>{data && data[0].name}</p>
</div>
<div className=" " style={{
marginTop: "29px",
marginLeft: "37px"
}}>
<p style={{
color: "#05101A",
fontSize: "16px",
width: "160px",
textAlign: "center"
}}>{data && data[0].school_name}</p>
</div>
<div className=" " style={{
marginLeft: "37px",
display: "flex",
flexDirection: "initial",
width: "487px"
}}>
{
data && data[0].team_members.map((item, index) => {
return (
index === 0 ?
<img className="regitemimgs" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 1 ?
<div className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</div>
: index === 2 ?
<div className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</div>
: index === 3 ?
<div className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</div>
: index === 4 ?
<div className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</div>
: index === 5 ?
<div className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</div>
:
<div className="regitemimgs22" src={getImageUrl("images/" + item.image_url)}>
</div>
)
})
}
</div>
<div className=" " style={{
marginLeft: "37px",
}}>
<p style={{
marginTop: "30px",
color: "#05101A",
fontSize: "16px",
}}>邀请码yngh5</p>
</div>
<i className="regitemimgs3 iconfont icon-fuzhi1 font-14 font-n"
style={{
marginLeft: "18px",
}}
>
</i>
{
this.props.type === 5 ?
<div className="regitemimgs4"
style={{
marginLeft: "32px",
}}
>
<div className="regitemimgs5">
<p>删除战队</p>
</div>
<div className="regitemimgs6">
<p>编辑战队</p>
</div>
</div>
: this.props.type === 2 ?
<div className="regitemimgs4"
style={{
marginLeft: "32px",
}}
>
<div className="regitemimgs5">
<p>战队详情</p>
</div>
<div className="regitemimgs6">
<p>退出战队</p>
</div>
</div>
:
this.props.type === 3 ?
<div className="regitemimgs4"
style={{
marginLeft: "32px",
}}
>
<div className="regitemimgs6">
<p>退出战队</p>
</div>
</div>
:
""
}
</div>
: ""
}
</div>
)
}
}
export default PersonalCompetititem;

@ -0,0 +1,216 @@
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { Menu, Icon, List, Avatar,Row, Col,Tag,Pagination} from 'antd';
import axios from 'axios';
import './Competitionsindex.css';
import NoneData from "../../courses/shixunHomework/shixunHomework";
import groups1 from './groups1.png';
import groups2 from './groups2.png';
import groups3 from './groups3.png';
const { SubMenu } = Menu;
const IconText = ({ type, text }) => (
<span>
<Icon type={type} style={{ marginRight: 8 }} />
{text}
</span>
);
class CompetitionsIndex extends Component{
constructor(props) {
super(props)
this.state={
current: 'all',
datas:undefined,
page:1,
category:undefined
}
}
componentDidMount(){
window.document.title = '竞赛';
let{category,page}=this.state;
this.getdata(category,page)
}
getdata=(category,page)=>{
const Url =`/competitions.json`;
axios.get(Url,{params:{
category:category,
page:page,
per_page:6,
}
}).then((response) => {
if(response.status===200){
this.setState({
datas:response.data.competitions,
count:response.data.count,
})
}
})
.catch(function (error) {
console.log(error);
});
}
handleClick = e => {
this.setState({
current: e.key,
});
let{category,page}=this.state;
this.getdata(e.key,page)
};
render() {
let {datas,page,count}=this.state;
return (
<div>
<div className="clearfix">
<div>
<div className="newMain clearfix">
<div className="courses-head pr">
<div className="edu-txt-center pathNavLine">
<div className="inline path-nav"></div>
</div>
</div>
<div className="competitionstitle mb20">
<div className="competitionstitle2">
<Menu onClick={this.handleClick} selectedKeys={[this.state.current]} mode="horizontal">
<Menu.Item key="all" className={"competitionmr50"}>
<span className={"competitionsvalue"}>全部</span>
</Menu.Item>
<Menu.Item key="nearly_published" className={"competitionmr50"}>
<span className={"competitionsvalue"}>即将发布</span>
</Menu.Item>
<Menu.Item key="progressing" className={"competitionmr50"}>
<span className={"competitionsvalue"}>进行中</span>
</Menu.Item>
<Menu.Item key="ended" className={"competitionmr50"}>
<span className={"competitionsvalue"}>往期比赛</span>
</Menu.Item>
</Menu>
</div>
</div>
<div className={"educontent clearfix mtf10 CompetitionsIndex "}>
<style>
{
`
.CompetitionsList{
position: relative;
max-height: 210px;
}
.competitonimg{
position: absolute;
right: -5px;
width: 80px;
top: 20px;
}
`
}
</style>
<List
itemLayout="vertical"
size="large"
dataSource={datas&&datas}
renderItem={(item,key) => (
<Link to={`/newcompetitions/${item.identifier}/common_header`}>
<div className={"CompetitionsList"} >
{item.description===null||item.description===undefined||item.description===""?<style>
{
`
.CompetitionsIndex .ant-list-vertical .ant-list-item-action{
margin-top:50px;
}
`
}
</style>:""}
<img className={"competitonimg"}
src={item.nearly_published===true?groups2:item.published===true?groups2:groups1} />
<List.Item
key={key}
actions={[
<span>竞赛时间: 2019-08-07 24: 002019-09-10 24: 00</span>,
<span>报名截止时间2019-08-07 08:10</span>,
]}
extra={
<div className={"pt50"} style={{"width":'305px'}}>
<Row gutter={16}>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexdadels">奖金</div>
</Col>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexdadels">浏览数</div>
</Col>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexdadels">报名数</div>
</Col>
</Row>
<Row gutter={16}>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexbottomvalue">¥{item.bonus}</div>
</Col>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexbottomvalue">{item.visits_count}</div>
</Col>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexbottomvalue">{item.member_count}</div>
</Col>
</Row>
</div>
}
>
<List.Item.Meta
title={<a><span className={"competitionstitles"}>{item.name}</span><span>{item.sub_title===null?"":<Tag className="competitionsrelative" color="#87d068">{
item.sub_title
}</Tag>}</span>
</a>}
/>
{item.description}
</List.Item>
</div>
</Link>
)
}
/>
{datas===undefined?'none':datas.task_count >6 ?<div className="mb40 edu-txt-center padding20-30"
>
<Pagination
showQuickJumper
defaultCurrent={1}
pageSize={6}
total={count===undefined?"":count}
current={page}
onChange={this.PaginationCourse}
/>
</div>:""}
{
datas===undefined?"":datas && datas.length===0? <NoneData></NoneData>:""
}
</div>
</div>
</div>
</div>
</div>
)
}
}
export default CompetitionsIndex;

@ -1,3 +1,4 @@
.teamsLayout{background: transparent !important;}
.courses-head{
width: 100%;
height: 300px;
@ -104,6 +105,12 @@
.competitionsrelative{
position: absolute;
/*top: 28px;*/
top: 28px;
}
.CompetitionsList:hover{
/*box-shadow: 0 2px 6px rgba(51,51,51,.09);*/
box-shadow:3px 4px 10px 2px rgba(229,229,229,0.5);
opacity: 1;
border-radius: 2px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

@ -0,0 +1,53 @@
.teamsLayout{background: transparent !important;}
.teamsLayout .teamsLayoutitle{
font-size:18px;
font-family:PingFangSC-Semibold,PingFang SC;
font-weight:600;
color:rgba(5,16,26,1);
line-height:25px;
margin-top: 10px;
margin-bottom: 10px;
}
.teamsLayoutTable .ant-table-bordered .ant-table-thead > tr > th, .ant-table-bordered .ant-table-tbody > tr > td {
border-right: 1px solid transparent !important;
}
.teamsLayoutTable .ant-table-body .ant-table-thead > tr> th:nth-last-child(1){
border-right: 1px solid #e8e8e8 !important;
}
.teamsLayoutTable .ant-table-body .ant-table-tbody > tr> td:nth-last-child(1){
border-right: 1px solid #e8e8e8 !important;
}
.teamsLayoutTable .ant-table-bordered .ant-table-thead > tr > th{
background:#EEEEEE;
font-size: 14px;
font-family: PingFangSC-Regular,PingFang SC;
font-weight: 400;
color: rgba(102,102,102,1);
line-height: 20px;
}
.teamsLayoutTable .ant-table-bordered .ant-table-tbody > tr > th{
background:#EEEEEE;
font-size:14px;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(5,16,26,1);
line-height:20px;
}
.teamsLayout .mt40{
margin-top: 40px !important;
}
.teamsLayoutheji{
color: #878787;
font-size: 16px;
}
.teamsLayoucolor-orange {
color: #ff6800!important;
font-size: 16px;
}

@ -0,0 +1,245 @@
import React, { Component } from 'react';
import { Breadcrumb,Layout,Table, Divider, Tag,Badge} from 'antd';
import axios from 'axios';
import NoneData from "../../courses/shixunHomework/shixunHomework";
import './Competitionteams.css';
const { Header, Footer, Sider, Content } = Layout;
class Competitionteams extends Component{
constructor(props) {
super(props)
this.state={
shixundata: undefined,
coursedata:undefined,
}
}
componentDidMount(){
window.document.title = '竞赛';
this.getshixundata();
this.getcoursedata();
}
getshixundata=()=>{
const Url =`/competitions/${this.props.match.params.identifier}/competition_teams/${this.props.match.params.competition_team_id}/shixun_detail.json`;
axios.get(Url).then((response) => {
if(response.status===200){
// let data={
// shixuns: [
// {
// creator: "黄井泉", // 创建者
// shixun_name: "单链表的学习与应用I", // 实训名称
// shixun_identifier: "mnf6b7z3",
// forked: false, // false:原创
// myshixuns_count: 179, // 学习人数
// forked_myshixun_count: 0, // 被fork发布的学习人数
// valid_count: 82, // 有效作品数
// score: 1320 // 应用值
// }
// ],
// shixun_count: 1, // 实训总计
// total_myshixun_count: 179, // 学习人数总计
// total_forked_myshixun_count: 0, // 被fork发布的学习人数总计
// total_valid_count: 82, // 有效作品数总计
// total_shixun_score: 1320 // 应用值总计
// }
let data=response.data;
let newarr=data.shixuns;
let newobj={
creator:"合计:",
shixun_name:data.shixun_count,
myshixuns_count:data.total_myshixun_count,
forked_myshixun_count:data.total_forked_myshixun_count,
valid_count:data.total_valid_count,
score:data.total_shixun_score
}
newarr.push(newobj)
this.setState({
shixundata:newarr
})
}
})
.catch(function (error) {
console.log(error);
});
}
getcoursedata=()=>{
const Url =`/competitions/${this.props.match.params.identifier}/competition_teams/${this.props.match.params.competition_team_id}/course_detail.json`;
axios.get(Url).then((response) => {
if(response.status===200){
// let data={
// courses: [
// {
// creator: "周海芳", // 创建者
// creator_login: "Nancy", // login
// course_name: "大学计算机基础2018年秋季",
// course_id: 1502,
// students_count: 122, // 学生数量
// shixun_homework_count: 8, // 发布的实训作业数量
// valid_count: 977, // 有效作品数
// score: 29810 // 应用值
// }
// ],
// total_course_count: 1, // 课堂总计
// total_students_count: 122, // 学生数总计
// total_shixun_homework_count: 8, // 实训作业数总计
// total_valid_count: 977, // 有效作品数总计
// total_course_score: 29810 // 应用值总计
// }
let data=response.data;
let newarr=data.courses;
let newobj={
creator:"合计:",
course_name:data.total_course_count,
students_count:data.total_students_count,
shixun_homework_count:data.total_shixun_homework_count,
valid_count:data.total_valid_count,
score:data.total_course_score
}
newarr.push(newobj)
this.setState({
coursedata:newarr
})
}
})
.catch(function (error) {
console.log(error);
});
}
render() {
const shixuncolumns = [
{
title: '创建者',
dataIndex: 'creator',
key: 'creator',
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoutheji":""}>{text}</div>,
},
{
title: '名称',
dataIndex: 'shixun_name',
key: 'shixun_name',
render: (text, record) =>
<div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}{record.forked===true?<Badge count={"原创"} style={{ backgroundColor: '#459BE5' }} />:""}</div>,
},
{
title: '学习人数',
dataIndex: 'myshixuns_count',
key: 'myshixuns_count',
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>,
},
{
title: '被fork发布的学习人数',
dataIndex: 'forked_myshixun_count',
key: 'forked_myshixun_count',
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>,
},
{
title: '有效作品数',
dataIndex: 'valid_count',
key: 'valid_count',
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>,
},
{
title: '应用值',
dataIndex: 'score',
key: 'score',
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>,
},
];
const coursecolumns = [
{
title: '创建者',
dataIndex: 'creator',
key: 'creator',
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoutheji":""}>{text}</div>,
},
{
title: '名称',
dataIndex: 'course_name',
key: 'course_name',
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>,
},
{
title: '学习人数',
dataIndex: 'students_count',
key: 'students_count',
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>,
},
{
title: '被fork发布的学习人数',
dataIndex: 'shixun_homework_count',
key: 'shixun_homework_count',
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>,
},
{
title: '有效作品数',
dataIndex: 'valid_count',
key: 'valid_count',
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>,
},
{
title: '应用值',
dataIndex: 'score',
key: 'score',
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>,
},
];
console.log(this.state.shixundata)
return (
<div className={"educontent clearfix mt20 "}>
<Breadcrumb separator=">">
<Breadcrumb.Item>全国高校计算机大赛战</Breadcrumb.Item>
<Breadcrumb.Item href="">报名</Breadcrumb.Item>
<Breadcrumb.Item href="">战队详情</Breadcrumb.Item>
</Breadcrumb>
<Layout className={"teamsLayout"}>
<Content className={"teamsLayoutitle"}>实训项目</Content>
<Content className={"teamsLayoutContent"}>
<Table className="teamsLayoutTable" columns={shixuncolumns} dataSource={this.state.shixundata} bordered pagination={false}/>
</Content>
<Content className={"teamsLayoutitle mt40"}>翻转课堂</Content>
<Content className={"teamsLayoutContents"}>
<Table className="teamsLayoutTable" columns={coursecolumns} dataSource={this.state.coursedata} bordered pagination={false}/>
</Content>
</Layout>
</div>
)
}
}
export default Competitionteams;

@ -0,0 +1,176 @@
.teamsLayout{background: transparent !important;}
.teamsLayout .ant-layout-sider{
background: transparent !important;
flex: 0 0 180px !important;
max-width: 180px !important;
min-width: 180px !important;
width: 180px !important;
}
.teamsLayout .teamsLayoutitle{
font-size:18px;
font-family:PingFangSC-Semibold,PingFang SC;
font-weight:600;
color:rgba(5,16,26,1);
line-height:25px;
margin-top: 10px;
margin-bottom: 10px;
}
.teamsLayoutTable .ant-table-bordered .ant-table-thead > tr > th, .ant-table-bordered .ant-table-tbody > tr > td {
border-right: 1px solid transparent !important;
}
.teamsLayoutTable .ant-table-body .ant-table-thead > tr> th:nth-last-child(1){
border-right: 1px solid #e8e8e8 !important;
}
.teamsLayoutTable .ant-table-body .ant-table-tbody > tr> td:nth-last-child(1){
border-right: 1px solid #e8e8e8 !important;
}
.teamsLayoutTable .ant-table-bordered .ant-table-thead > tr > th{
background:#EEEEEE;
font-size: 14px;
font-family: PingFangSC-Regular,PingFang SC;
font-weight: 400;
color: rgba(102,102,102,1);
line-height: 20px;
}
.teamsLayoutTable .ant-table-bordered .ant-table-tbody > tr > th{
background:#EEEEEE;
font-size:14px;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(5,16,26,1);
line-height:20px;
}
.teamsLayout .mt40{
margin-top: 40px !important;
}
.teamsLayoutheji{
color: #878787;
font-size: 16px;
}
.teamsLayoucolor-orange {
color: #ff6800!important;
font-size: 16px;
}
.CompetitionCommonbanner{
padding: 20px;
background:rgba(255,255,255,1);
box-shadow:3px 2px 12px 2px rgba(0,0,0,0.05);
}
.CompetitionCommonbannerfont{
height:100%;
}
.CompetitionCommonbannerfont .competitionbannerdiv:nth-child(1){
max-height:100px;
font-size:25px;
font-weight:400;
color:rgba(5,16,26,1);
}
.CompetitionCommonbannerfont .competitionbannerdiv:nth-child(2){
max-height: 70px;
font-size:16px;
font-weight:400;
/*color:rgba(155,155,155,1);*/
color:#05101A;
}
.CompetitionCommonbannerfont .competitionbannerdiv:nth-child(3){
max-height: 70px;
font-size: 16px;
font-weight: 400;
/*color: rgba(155,155,155,1);*/
color:#05101A;
}
.CompetitionCommonbannerfont .competitionbannerdiv:nth-child(4),.CompetitionCommonbannerfont .competitionbannerdiv:nth-child(4) button{
height: 50px;
background: rgba(76,172,255,1);
border-radius: 4px;
}
.Competitioncolor9b{
color: #9B9B9B;
}
.Competitioncolor77{
color: #777777;
font-size: 14px;
}
.Competitioncolor516{
font-size:24px;
color:rgba(5,16,26,1);
}
.Competitionfontsize22{
font-size:22px;
font-weight:500;
color:rgba(255,255,255,1);
}
.Competitionfontsize16{
font-size: 16px;
font-weight: 400;
color: rgba(102,102,102,1);
}
.ant-layout-sider {
position: relative;
min-width: 0;
background: #001529;
-webkit-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
}
.CompetitionMenu .ant-menu-item::after {
left: 0px !important;
right: auto;
border-right: 5px solid #4CACFF;
}
.CompetitionMenu .ant-menu-item{
height: 30px;
line-height: 30px;
background:none;
}
.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected {
background-color: transparent;
}
.CompetitionMenu .ant-menu-item:not(:last-child){
margin-bottom: 40px;
background: transparent;
color:#666;
}
.CompetitionMenu .ant-menu-item{
font-size: 18px;
}
.CompetitionMenu .ant-menu-item-selected {
color: rgba(76,172,255,1) !important;
}
.CompetitionMenu{
width: 145px;
background: transparent;
border: 1px solid rgba(239,239,239,1);
padding-top: 20px;
padding-bottom: 40px !important;
}
.teamsLayoutleft{
background: transparent !important;
}

@ -0,0 +1,126 @@
import React, { Component } from 'react';
import { Breadcrumb,Layout,Table, Divider, Tag,Badge,Row, Col,Button, Menu, Icon} from 'antd';
import axios from 'axios';
import {markdownToHTML} from 'educoder';
import NoneData from "../../courses/shixunHomework/shixunHomework";
import './CompetitionCommon.css';
const { Header, Footer, Sider, Content } = Layout;
class CompetitionCommon extends Component{
constructor(props) {
super(props)
this.state={
data:undefined
}
}
componentDidMount(){
window.document.title = '竞赛';
this.getbannerdata()
}
getbannerdata=()=>{
let url=`/competitions/${this.props.match.params.identifier}/common_header.json`;
axios.get(url).then((response) => {
if(response.status===200){
this.setState({
data:response.data
})
}
}).catch((error) => {
console.log(error)
})
}
render() {
let {data}=this.state;
console.log(data)
return (
data===undefined?"":<div className={"educontent clearfix mt20 "}>
<Breadcrumb separator=">">
<Breadcrumb.Item href="">在线竞赛</Breadcrumb.Item>
<Breadcrumb.Item href="">全国高校计算机大赛</Breadcrumb.Item>
</Breadcrumb>
<div className={"mt10"}>
<Row className={"CompetitionCommonbanner"}>
<Col span={15}>banner</Col>
<Col className={"CompetitionCommonbannerfont"} span={9}>
<Col className={"competitionbannerdiv"}>{data&&data.name}</Col>
<Col className={"competitionbannerdiv mt10"}>
<Col className={"Competitioncolor9b"}>竞赛时间</Col>
<Col>{data&&data.start_time}{data&&data.end_time}</Col>
</Col>
<Col className={"competitionbannerdiv mt20"}>
<Row gutter={16}>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexdadels Competitioncolor77">奖金</div>
</Col>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexdadels Competitioncolor77">浏览数</div>
</Col>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexdadels Competitioncolor77">报名数</div>
</Col>
</Row>
<Row gutter={16}>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">¥{data&&data.bonus}</div>
</Col>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">{data&&data.visits_count}</div>
</Col>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">{data&&data.member_count}</div>
</Col>
</Row>
</Col>
<Col className={"competitionbannerdiv mt20"}>
<Button type="primary" block className={"Competitionfontsize22"}>
立即报名
</Button>
</Col>
<Col className={"mt10 Competitionfontsize16"}>{data&&data.enroll_end_time===null?"":"报名截止时间:"+data&&data.enroll_end_time}</Col>
</Col>
</Row>
</div>
<Layout className={'teamsLayout mt40'}>
<Sider>
<Menu mode="inline" className="CompetitionMenu" defaultSelectedKeys={['1']}>
{data&&data.competition_modules.map((item,key)=>{
return(
<Menu.Item key={item.position}>
<span>{item.name}</span>
</Menu.Item>
)
})}
</Menu>
</Sider>
<Layout className={"teamsLayoutleft"}>
<Content className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML("").replace(/▁/g, "▁▁▁")}}>
</Content>
</Layout>
</Layout>
</div>
)
}
}
export default CompetitionCommon;

@ -4,25 +4,39 @@ import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import Loading from '../../Loading'
import Loading from '../../Loading';
import Loadable from 'react-loadable';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC'
import { SnackbarHOC } from 'educoder'
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { SnackbarHOC } from 'educoder';
//新版竞赛首页
const CompetitionsIndex = Loadable({
loader: () => import('./competitimain/CompetitionsIndex'),
loader: () => import('./Competitimain/CompetitionsIndex'),
loading: Loading,
})
//竞赛详情页
const CompetitionCommon=Loadable({
loader: () => import('./Competitioncommon/CompetitionCommon'),
loading: Loading,
})
//战队详情
const CompetitionTeams = Loadable({
loader: () => import('./Competition_teams/Competitionteams'),
loading: Loading,
})
class Competitions extends Component {
constructor(props) {
super(props)
}
componentDidMount(){
window.document.title = '竞赛'
window.document.title = '竞赛';
}
render() {
@ -31,14 +45,28 @@ class Competitions extends Component {
<div className="newMain clearfix">
<Switch>
{/*新版竞赛首页*/}
{/*新版竞赛战队详情*/}
<Route path="/newcompetitions/:identifier/competition_teams/:competition_team_id"
render={
(props) => (<CompetitionTeams {...this.props} {...props} {...this.state} />)
}
></Route>
{/*新版竞赛详情页面*/}
<Route path="/newcompetitions/:identifier/common_header"
render={
(props) => (<CompetitionCommon {...this.props} {...props} {...this.state} />)
}
></Route>
{/*新版竞赛首页*/}
<Route path="/newcompetitions"
render={
(props) => (<CompetitionsIndex {...this.props} {...props} {...this.state} />)
}
></Route>
</Switch>
</div>

@ -1,191 +0,0 @@
import React, { Component } from 'react';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { Menu, Icon, List, Avatar,Row, Col,Tag,Pagination} from 'antd';
import axios from 'axios';
import './Competitionsindex.css';
import NoneData from "../../courses/shixunHomework/shixunHomework";
const { SubMenu } = Menu;
const IconText = ({ type, text }) => (
<span>
<Icon type={type} style={{ marginRight: 8 }} />
{text}
</span>
);
class CompetitionsIndex extends Component{
constructor(props) {
super(props)
this.state={
current: 'all',
datas:undefined,
page:1
}
}
componentDidMount(){
window.document.title = '竞赛';
let{page}=this.state;
const Url =`/competitions.json`;
axios.get(Url,{params:{
page:page
}
}).then((response) => {
if(response.status===200){
this.setState({
datas:response.data.competitions,
count:response.data.count,
})
}
})
.catch(function (error) {
console.log(error);
});
}
handleClick = e => {
console.log('click ', e);
this.setState({
current: e.key,
});
};
render() {
let {datas,page,count}=this.state;
// bonus: 0
// current_stage: {name: "正赛 第一阶段", start_time: "2019-10-11 00:00:00", end_time: "2019-11-01 00:00:00"}
// description: null
// end_time: "2019-11-01 00:00:00"
// enroll_end_time: "2019-10-31 00:00:00"
// id: 7
// identifier: "gcc-annotation-2019"
// image: null
// member_count: 540
// name: "第二届全国绿色计算系列大赛"
// nearly_published: false
// published: true
// single_stage: false
// start_time: "2019-07-01 00:00:00"
// sub_title: "代码标注组"
// visits_count: 10181
return (
<div>
<div className="clearfix">
<div>
<div className="newMain clearfix">
<div className="courses-head pr">
<div className="edu-txt-center pathNavLine">
<div className="inline path-nav"></div>
</div>
</div>
<div className="competitionstitle mb20">
<div className="competitionstitle2">
<Menu onClick={this.handleClick} selectedKeys={[this.state.current]} mode="horizontal">
<Menu.Item key="all" className={"competitionmr50"}>
<span className={"competitionsvalue"}>全部</span>
</Menu.Item>
<Menu.Item key="nearly_published" className={"competitionmr50"}>
<span className={"competitionsvalue"}>即将发布</span>
</Menu.Item>
<Menu.Item key="progressing" className={"competitionmr50"}>
<span className={"competitionsvalue"}>进行中</span>
</Menu.Item>
<Menu.Item key="ended" className={"competitionmr50"}>
<span className={"competitionsvalue"}>往期比赛</span>
</Menu.Item>
</Menu>
</div>
</div>
<div className={"educontent clearfix mtf10 CompetitionsIndex "}>
<List
itemLayout="vertical"
size="large"
dataSource={datas&&datas}
renderItem={(item,key) => (
<List.Item
key={key}
actions={[
<span>竞赛时间: 2019-08-07 24: 002019-09-10 24: 00</span>,
<span>报名截止时间2019-08-07 08:10</span>,
]}
extra={
<div className={"pt50"} style={{"width":'305px'}}>
<Row gutter={16}>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexdadels">奖金</div>
</Col>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexdadels">浏览数</div>
</Col>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexdadels">报名数</div>
</Col>
</Row>
<Row gutter={16}>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexbottomvalue">¥4500</div>
</Col>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexbottomvalue">351</div>
</Col>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexbottomvalue">351</div>
</Col>
</Row>
</div>
}
>
<List.Item.Meta
title={<a><span className={"competitionstitles"}>{item.name}</span><span>{item.sub_title===null?"":<Tag className="competitionsrelative" color="#87d068">{
item.sub_title
}</Tag>}</span>
</a>}
/>
{item.description}
</List.Item>
)}
/>
<div className="mb40 edu-txt-center padding20-30"
// style={
// // {
// // display: datas===undefined?'none':datas.task_count >15 ? 'block':'none'
// // }
// }
>
<Pagination
showQuickJumper
defaultCurrent={1}
pageSize={8}
total={count===undefined?"":count}
current={page}
onChange={this.PaginationCourse}
/>
</div>
{
datas===undefined?"":datas && datas.length===0? <NoneData></NoneData>:""
}
</div>
</div>
</div>
</div>
</div>
)
}
}
export default CompetitionsIndex;

File diff suppressed because one or more lines are too long

@ -1079,8 +1079,14 @@
<div class="name">下降</div>
<div class="code-name">&amp;#xe669;</div>
</li>
<li class="dib">
<li class="dib">
<span class="icon iconfont">&#xe800;</span>
<div class="name">复制</div>
<div class="code-name">&amp;#xe800;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe7f9;</span>
<div class="name">更多</div>
<div class="code-name">&amp;#xe7f9;</div>
@ -1337,7 +1343,31 @@
<div class="name">nenghaofenxi@1x</div>
<div class="code-name">&amp;#xe6be;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe6c1;</span>
<div class="name">detection@1x</div>
<div class="code-name">&amp;#xe6c1;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe6c2;</span>
<div class="name">community@1x</div>
<div class="code-name">&amp;#xe6c2;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe6c3;</span>
<div class="name">hosting@1x</div>
<div class="code-name">&amp;#xe6c3;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe6c4;</span>
<div class="name">project@1x</div>
<div class="code-name">&amp;#xe6c4;</div>
</li>
</ul>
<div class="article markdown">
<h2 id="unicode-">Unicode 引用</h2>
@ -2962,8 +2992,17 @@
<div class="code-name">.icon-xiajiang
</div>
</li>
<li class="dib">
<li class="dib">
<span class="icon iconfont icon-fuzhi1"></span>
<div class="name">
复制
</div>
<div class="code-name">.icon-fuzhi1
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-gengduo1"></span>
<div class="name">
更多
@ -3349,7 +3388,43 @@
<div class="code-name">.icon-nenghaofenxix
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-detectionx"></span>
<div class="name">
detection@1x
</div>
<div class="code-name">.icon-detectionx
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-communityx"></span>
<div class="name">
community@1x
</div>
<div class="code-name">.icon-communityx
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-hostingx2"></span>
<div class="name">
hosting@1x
</div>
<div class="code-name">.icon-hostingx2
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-projectx"></span>
<div class="name">
project@1x
</div>
<div class="code-name">.icon-projectx
</div>
</li>
</ul>
<div class="article markdown">
<h2 id="font-class-">font-class 引用</h2>
@ -4778,8 +4853,16 @@
<div class="name">下降</div>
<div class="code-name">#icon-xiajiang</div>
</li>
<li class="dib">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-fuzhi1"></use>
</svg>
<div class="name">复制</div>
<div class="code-name">#icon-fuzhi1</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-gengduo1"></use>
</svg>
@ -5122,6 +5205,38 @@
<div class="name">nenghaofenxi@1x</div>
<div class="code-name">#icon-nenghaofenxix</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-detectionx"></use>
</svg>
<div class="name">detection@1x</div>
<div class="code-name">#icon-detectionx</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-communityx"></use>
</svg>
<div class="name">community@1x</div>
<div class="code-name">#icon-communityx</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-hostingx2"></use>
</svg>
<div class="name">hosting@1x</div>
<div class="code-name">#icon-hostingx2</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-projectx"></use>
</svg>
<div class="name">project@1x</div>
<div class="code-name">#icon-projectx</div>
</li>
</ul>
<div class="article markdown">

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1230,6 +1230,13 @@
"unicode": "e669",
"unicode_decimal": 58985
},
{
"icon_id": "5255211",
"name": "复制",
"font_class": "fuzhi1",
"unicode": "e800",
"unicode_decimal": 59392
},
{
"icon_id": "5291605",
"name": "更多",
@ -1530,6 +1537,34 @@
"font_class": "nenghaofenxix",
"unicode": "e6be",
"unicode_decimal": 59070
},
{
"icon_id": "11408531",
"name": "detection@1x",
"font_class": "detectionx",
"unicode": "e6c1",
"unicode_decimal": 59073
},
{
"icon_id": "11409495",
"name": "community@1x",
"font_class": "communityx",
"unicode": "e6c2",
"unicode_decimal": 59074
},
{
"icon_id": "11409771",
"name": "hosting@1x",
"font_class": "hostingx2",
"unicode": "e6c3",
"unicode_decimal": 59075
},
{
"icon_id": "11410432",
"name": "project@1x",
"font_class": "projectx",
"unicode": "e6c4",
"unicode_decimal": 59076
}
]
}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 294 KiB

After

Width:  |  Height:  |  Size: 303 KiB

Loading…
Cancel
Save