Commit 2cd028d3 authored by duanledexianxianxian's avatar duanledexianxianxian 😁

init

parents
Pipeline #186 failed with stages
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
[Makefile]
indent_style = tab
BROWSER=none
ESLINT=1
{
"extends": "eslint-config-umi"
}
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/npm-debug.log*
/yarn-error.log
/yarn.lock
/package-lock.json
# production
/dist
# misc
.DS_Store
# umi
.umi
.umi-production
**/*.md
**/*.svg
**/*.ejs
**/*.html
package.json
.umi
.umi-production
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100,
"overrides": [
{
"files": ".prettierrc",
"options": { "parser": "json" }
}
]
}
const serverUrl = "http://127.0.0.1:8080";
// const serverUrl = "http://platform.kuopu.net:9008";
export default {
proxy: {
"/api": {
target: serverUrl, //转发接口地址
changeOrigin: true,
pathRewrite: { "^": "" },
},
},
define: {
KIM_ENV_SERVER_URL: serverUrl,
KIM_ENV_FILE_SERVER_URL: serverUrl,
},
};
import pageRouter from './router.config';
import defaultSettings from './defaultSettings'; // https://umijs.org/config/
import path from 'path';
// ref: https://umijs.org/config/
export default {
treeShaking: true,
routes: pageRouter,
alias: {
src: path.resolve(__dirname, '../src'),
components: path.resolve(__dirname, '../src/components'),
utils: path.resolve(__dirname, '../src/utils'),
assets: path.resolve(__dirname, '../src/assets'),
themes: path.resolve(__dirname, '../src/themes'),
public: path.resolve(__dirname, '../public'),
},
urlLoaderExcludes: [/.svg$/],
chainWebpack(config) {
config.module
.rule('svg')
.test(/.svg$/)
.use('svg-sprite-loader')
.loader('svg-sprite-loader');
},
plugins: [
// ref: https://umijs.org/plugin/umi-plugin-react.html
[
'umi-plugin-react',
{
antd: true, // 启用后自动配置babel-plugin-import
dva: true,
dynamicImport: { webpackChunkName: true },
title: 'yikao-react',
dll: true,
routes: {
exclude: [
/models\//,
/services\//,
/model\.(t|j)sx?$/,
/service\.(t|j)sx?$/,
/components\//,
],
},
},
],
],
};
const serverUrl = "http://platform.kuopu.net:9008";
export default {
proxy: {
"/api": {
target: serverUrl, //转发接口地址
changeOrigin: true,
pathRewrite: { "^": "" },
},
},
define: {
KIM_ENV_SERVER_URL: serverUrl,
KIM_ENV_FILE_SERVER_URL: serverUrl,
},
};
const serverUrl = "http://platform.kuopu.net:9008";
export default {
proxy: {
"/api": {
target: serverUrl, //转发接口地址
},
},
define: {
KIM_ENV_FILE_SERVER_URL: serverUrl,
KIM_ENV_SERVER_URL: serverUrl,
},
};
/**
* 路由配置
*/
export default [
{
path: '/user',
key: '1',
component: '../layouts/UserLayout',
routes: [
{
key: '11',
name: 'sign-up',
path: '/user/sign-up',
component: './user/signUp',
},
],
},
{
path: '/demo',
key: '2',
component: '../layouts/BlankLayout',
routes: [
{
key: '22',
path: '/demo',
component: './demo',
},
],
},
{
path: '/',
key: '3',
component: '../layouts/SecurityLayout',
routes: [
{
key: '31',
component: '../layouts/BasicLayout',
routes: [
{
key: '311',
path: '/exam',
// isFull: true, 全屏显示
component: './exam',
},
{
key: '312',
path: '/video',
component: './video',
},
{
key: '313',
path: '/profile',
component: './profile',
},
{
key: '314',
path: '/exam/hospitalFinalExam',
// isFull: true, 全屏显示
component: './exam/hospitalFinalExam',
},
],
},
],
},
];
{
"private": true,
"scripts": {
"start": "cross-env UMI_UI=none UMI_ENV=dev umi dev",
"build": "umi build",
"test": "umi test",
"lint": "eslint {src,mock,tests}/**/*.{js,jsx} --fix",
"precommit": "lint-staged"
},
"dependencies": {
"antd-mobile": "^2.3.1",
"dva": "^2.6.0-beta.6",
"path-to-regexp": "^2.4.0",
"react": "^16.8.6",
"react-dom": "^16.8.6"
},
"devDependencies": {
"babel-eslint": "^9.0.0",
"babel-plugin-import": "^1.13.0",
"cross-env": "^6.0.0",
"eslint": "^5.4.0",
"eslint-config-umi": "^1.4.0",
"eslint-plugin-flowtype": "^2.50.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.11.1",
"husky": "^0.14.3",
"lint-staged": "^7.2.2",
"react-test-renderer": "^16.7.0",
"svg-sprite-loader": "^4.2.6",
"umi": "^2.7.7",
"umi-plugin-react": "^1.8.4"
},
"lint-staged": {
"*.{js,jsx}": [
"eslint --fix",
"git add"
]
},
"engines": {
"node": ">=8.0.0"
}
}
<svg t="1587993303296" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2910" width="200" height="200"><path d="M512 998.4c-19.2 0-38.4-12.8-38.4-19.2C454.4 966.4 128 640 83.2 595.2 32 537.6 0 467.2 0 396.8s32-147.2 83.2-198.4c51.2-51.2 121.6-83.2 198.4-83.2 76.8 0 147.2 32 198.4 83.2C492.8 211.2 505.6 224 512 236.8c6.4-12.8 19.2-25.6 32-38.4 51.2-51.2 121.6-83.2 198.4-83.2 76.8 0 147.2 32 198.4 83.2C992 249.6 1024 320 1024 396.8c0 76.8-32 147.2-83.2 198.4C896 640 569.6 966.4 550.4 979.2 550.4 985.6 531.2 998.4 512 998.4z" p-id="2911"></path></svg>
\ No newline at end of file
<svg t="1587994188315" class="icon" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4547" width="200" height="200"><path d="M1016.1904 93.352c-7.7152-8.776-19.96-12.7344-31.7152-9.552L23.1664 343.5216c-11.3072 3.0608-19.8992 12.0816-22.4288 23.5104-2.5104 11.4288 1.4896 23.2256 10.4704 30.776L239.008 589.1184l104.5536 290.456c4.1232 11.3872 14.552 19.4704 26.4704 20.5712l3.1232 0.1632c10.96 0 21.2448-5.8784 26.8576-15.3472l63.0016-106.2064 181.2496 154.984c5.632 4.8576 12.8976 7.552 20.368 7.552 2.6944 0 5.1424-0.2864 7.3056-0.8576 9.7152-2.3264 17.8368-9.224 21.7152-18.5312l327.968-795.856C1026.192 115.1072 1024.0688 102.2496 1016.1904 93.352zM617.0784 426.992l-119.6976 158.7792c-5.0608 6.6944-7.2048 14.9392-6.0416 23.2256 1.1632 8.2864 5.4896 15.6336 12.2048 20.736 13.3264 10 33.8176 7.1024 43.8784-6.2048L745.8992 360.256c8.7344-11.6736 8.368-27.6336-0.8576-38.736-9.0608-11.0208-25.3072-14.5312-37.96-8.2864l-439.44 214.6576c-0.8368 0.408-1.632 0.8576-2.4288 1.3472L97.4736 388.3792l841.9792-227.4336L652.1408 858.024l-176.6976-151.1472c-5.6736-4.816-12.9184-7.5104-20.3888-7.5104-1.6128 0-3.2448 0.1632-5.1424 0.4496-9.1424 1.5104-17.1024 6.9792-21.7968 14.8976l-48.0832 81.0224-77.4304-215.1488L617.0784 426.992z" p-id="4548"></path></svg>
\ No newline at end of file
export const dva = {
config: {
onError(err) {
err.preventDefault();
console.error(err.message);
},
},
};
import React from 'react';
const Icon = ({ type, className = '', size = 'md', ...restProps }) => (
<svg
className={`am-icon am-icon-${type.default.id} am-icon-${size} ${className}`}
{...restProps}
>
<use xlinkHref={`#${type.default.id}`} />
</svg>
);
export default Icon;
import defaultSettings from "../config/defaultSettings";
export default {
...defaultSettings,
request: {
...defaultSettings.request,
// eslint-disable-next-line
baseUrl: KIM_ENV_SERVER_URL,
},
// eslint-disable-next-line
fileServerUrl: KIM_ENV_FILE_SERVER_URL,
};
@import '~antd-mobile/lib/style/themes/default.less';
html,
body,
#root {
height: 100%;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol';
}
body {
margin: 0;
/* IOS 禁止微信调整字体大小 */
-webkit-text-size-adjust: 100%;
* {
box-sizing: border-box;
}
}
.flex-row-just-between {
display: flex;
justify-content: space-between;
}
.flex-column-just-between {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
import React from 'react';
import HomeLayout from './HomeLayout';
import BlankLayout from './BlankLayout';
const Index = (props) => {
console.log(props);
const item = props.route.routes.find(x => props.location.pathname === x.path);
if (item && item.isFull) {
console.log('full layout');
return <BlankLayout>{props.children}</BlankLayout>;
}
return (
<>
<HomeLayout {...props}>{props.children}</HomeLayout>
</>
);
};
export default Index;
.root{
}
\ No newline at end of file
import React from "react";
const Layout = ({ children }) => <>{children}</>;
export default Layout;
import React, { useState } from 'react';
import styles from './HomeLayout.less';
import { TabBar } from 'antd-mobile';
import router from 'umi/router';
import { getActiveMenu } from '@/utils';
const menus = [
{
title: '首页',
key: 'exam',
path: '/exam',
icon: '/images/exam.png',
selectedIcon: '/images/exam-inactive.png',
},
{
title: '视频教程',
key: 'video',
path: '/video',
icon: '/images/video.png',
selectedIcon: '/images/video-inactive.png',
},
{
title: '个人中心',
key: 'profile',
path: '/profile',
icon: '/images/profile.png',
selectedIcon: '/images/profile-inactive.png',
},
];
const Index = ({ children, location: { pathname } }) => {
console.log(pathname);
const menu = getActiveMenu(menus, pathname);
const [selectedTab, setSelectedTab] = useState((menu && menu.key) || 'home');
const rendTabBarContent = () => {
return menus.map(({ title, key, path, icon, selectedIcon }) => (
<TabBar.Item
title={title}
key={key}
icon={
<div
style={{
width: '22px',
height: '22px',
background: `url(${selectedIcon}) center center / 21px 21px no-repeat`,
}}
/>
}
selectedIcon={
<div
style={{
width: '22px',
height: '22px',
background: `url(${icon}) center center / 21px 21px no-repeat`,
}}
/>
}
selected={selectedTab === key}
onPress={() => {
setSelectedTab(key);
router.push(path);
}}
>
{children}
</TabBar.Item>
));
};
return (
<div className={styles.root}>
<TabBar unselectedTintColor="#999999" tintColor="#176aff" barTintColor="white">
{rendTabBarContent()}
</TabBar>
</div>
);
};
export default Index;
.root{
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
\ No newline at end of file
import React from "react";
import { Redirect } from "umi";
import config from "@/config";
class SecurityLayout extends React.Component {
render() {
const { children, location } = this.props;
// TODO 暂时先这么处理
const isLogin = true;
const { pathname = "/" } = location || {};
if (!isLogin) {
return (
<Redirect
to={{
pathname: "/user/login",
state: {
redirect: pathname,
},
}}
/>
);
}
if (isLogin && pathname === "/") {
return <Redirect to={config.homePage} />;
}
return children;
}
}
export default SecurityLayout;
import styles from './UserLayout.less';
function UserLayout(props) {
return (
<div className={styles.root}>
{props.children}
</div>
);
}
export default UserLayout;
\ No newline at end of file
.root {
height: 100%;
}
import BasicLayout from '..';
import renderer from 'react-test-renderer';
describe('Layout: BasicLayout', () => {
it('Render correctly', () => {
const wrapper = renderer.create(<BasicLayout />);
expect(wrapper.root.children.length).toBe(1);
const outerLayer = wrapper.root.children[0];
expect(outerLayer.type).toBe('div');
const title = outerLayer.children[0];
expect(title.type).toBe('h1');
expect(title.children[0]).toBe('Yay! Welcome to umi!');
});
});
import styles from './index.less';
function BasicLayout(props) {
return (
<div className={styles.root}>
<h1 className={styles.title}>Yay! Welcome to umi!</h1>
{props.children}
</div>
);
}
export default BasicLayout;
import Index from '..';
import renderer from 'react-test-renderer';
describe('Page: index', () => {
it('Render correctly', () => {
const wrapper = renderer.create(<Index />);
expect(wrapper.root.children.length).toBe(1);
const outerLayer = wrapper.root.children[0];
expect(outerLayer.type).toBe('div');
expect(outerLayer.children.length).toBe(2);
});
});
import React, { Fragment } from 'react';
const Index = () => {
return (
<Fragment>
hello wolrd
</Fragment>
);
}
export default Index;
import React from 'react';
import List from './components/list'
const Index = () => {
const dataSource = [
{
id: 1,
image: '/images/exam1.png',
title: '2020版中西医结合执业助理医师 模拟试',
like: 0,
share: 1,
},
{
id: 2,
image: '/images/exam1.png',
title: '2020版中西医结合执业助理医师 模拟试',
like: 0,
share: 0,
},
{
id: 3,
image: '/images/exam1.png',
title: '2020版中西医结合执业助理医师 模拟试',
like: 1,
share: 1,
},
];
const onClickLike = id => {
console.log(id);
};
const onClickShare = id => {
console.log(id);
};
const onClickButton = id => {
console.log(id);
};
const opt={
dataSource,
buttonLable:"立即答题",
onClickLike,
onClickShare,
onClickButton
}
return (
<>
<List {...opt}></List>
</>
);
}
export default Index;
\ No newline at end of file
import React from 'react';
import { Button } from 'antd-mobile';
import Icon from 'components/Icon';
import styles from './item.less';
const Index = ({
id,
image,
title,
like,
share,
buttonLable,
onClickLike,
onClickShare,
onClickButton,
showCnt=true
}) => {
const showCntStyle={display:showCnt?'flex':'none'}
const showActionStyle={"flexDirection":showCnt?'row':'row-reverse'}
return (
<div className={styles.root}>
<img src={image} alt="" />
<div className={styles.right}>
<div className={styles.title}>{title}</div>
<div className={styles.action} style={showActionStyle}>
<div className={styles.like} style={showCntStyle}>
<Icon
onClick={() => onClickLike(id)}
size="xxs"
color={`${like === 1 ? '#ff7b7b' : '#cccccc'}`}
type={require('public/images/like.svg')}
/>
<div className={styles.label}>收藏</div>
</div>
<div className={styles.share} style={showCntStyle}>
<Icon
onClick={() => onClickShare(id)}
size="xxs"
color={`${share === 1 ? '#ff7b7b' : '#cccccc'}`}
type={require('public/images/share.svg')}
/>
<div className={styles.label}>分享</div>
</div>
<Button type="primary" onClick={() => onClickButton(id)}>
{buttonLable}
</Button>
</div>
</div>
</div>
);
};
export default Index;
@import '~@/themes/vars.less';
.root {
:global {
.am-button {
height: 24px;
line-height: 24px;
width: 64px;
border-radius: 10px;
font-size: 12px;
}
}
display: flex;
justify-content: space-between;
padding: @space-xxxs @space-xxs;
img {
border-radius: 5px;
width: 120px;
height: 92px;
}
.right {
display: flex;
flex-direction: column;
justify-content: space-between;
padding-left: @space-xxxs;
.title {
font-size: @space-sm;
font-weight: 500;
color: @item-title-color;
}
.action {
display: flex;
justify-content: space-between;
.label {
line-height: 24px;
padding-left: @space-xxxs;
}
svg {
margin-top: @space-xxxxs;
}
.share {
display: flex;
justify-content: space-between;
}
.like {
display: flex;
justify-content: space-between;
}
}
}
}
import React from 'react';
import { SearchBar } from 'antd-mobile';
import Item from './item';
import styles from './list.less';
const Index = ({ dataSource=[], buttonLable, onClickLike, onClickShare, onClickButton,showCnt }) => {
const renderItem = () => {
return dataSource.map(x => (
<Item
{...x}
showCnt={showCnt}
buttonLable={buttonLable}
onClickLike={onClickLike}
onClickShare={onClickShare}
onClickButton={onClickButton}
/>
));
};
return (
<div className={styles.root}>
<div className="search">
<SearchBar placeholder="Search" maxLength={8} />
<div>{renderItem()}</div>
</div>
</div>
);
};
export default Index;
@import "~@/themes/vars.less";
.root{
font-size: @font-size-sm;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
\ No newline at end of file
import React from 'react';
import { Tabs } from 'antd-mobile';
import BasicList from './basic';
import KeyList from './key';
import PracticeList from './practice';
import styles from './hospitalFinalExam.less';
const tabs = [{ title: '基本题型' }, { title: '重点题型' }, { title: '模拟考试' }];
const tabStyle = {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
height: '100%',
backgroundColor: '#fff',
};
const Index = () => {
return (
<div className={styles.root}>
<Tabs
tabs={tabs}
initialPage={1}
onChange={(tab, index) => {
console.log('onChange', index, tab);
}}
onTabClick={(tab, index) => {
console.log('onTabClick', index, tab);
}}
>
<div style={tabStyle}>
<BasicList />
</div>
<div style={tabStyle}>
<KeyList />
</div>
<div style={tabStyle}>
<PracticeList />
</div>
</Tabs>
</div>
);
};
export default Index;
.root{
height: 100%;
}
\ No newline at end of file
import React from 'react';
import styles from './index.less';
import router from 'umi/router';
const Index = ({ day }) => {
const goHospitalExam = () => {
return router.push('/exam/hospitalFinalExam');
};
return (
<div className={styles.root}>
<div className={styles.header}>
<div className={styles.notice}>
<div>
<img src="./images/notice.png" alt="" />
</div>
<div className={styles.title}>
距离研究生考试还有
<span>{day}</span>天
</div>
</div>
</div>
<div className={styles.menus}>
<div className={styles.row}>
<div className={styles.col} onClick={goHospitalExam}>
<img src="./images/hospital-final-exam.png" alt=""></img>
<div>医学生期末考试</div>
</div>
<div className={styles.col}>
<img src="./images/graduate-exam.png" alt=""></img>
<div>研究生考试</div>
</div>
</div>
<div className={styles.row}>
<div className={styles.col}>
<img src="./images/professional-doctor-exam.png" alt=""></img>
<div>住院医生规培</div>
</div>
<div className={styles.col}>
<img src="./images/resident-regulation.png" alt=""></img>
<div>执业医生考试</div>
</div>
</div>
<div className={styles.row}>
<div className={styles.col}>
<img src="./images/health-manager.png" alt=""></img>
<div>健康管理师</div>
</div>
<div className={styles.col}>
{/* <img src="./images/health-manager.png" alt=""></img>
<div>健康管理师</div> */}
</div>
</div>
</div>
</div>
);
};
export default Index;
@import '~@/themes/vars.less';
.root{
height: 100%;
background-color: #f0f2f5;
font-size: @font-size-md;
.header {
height: 217px;
background: url("../../../public/images/exam-header.png") center center no-repeat;
position: relative;
.notice {
position: absolute;
left: 5%;
right: 5%;
bottom: -22px;
line-height: 44px; /*让黄色div中的文字内容垂直居中*/
border-radius: 4px;
border: #176aff;
background-color: @color-background;
display: flex;
margin: @space-xxxs;
box-shadow: 0px 2px 12px 0px rgba(23, 106, 255, 0.16);
img {
margin-left: @space-sm;
vertical-align: middle;
line-height: 44px;
height: 28px;
width: 28px;
}
.title {
margin-left: @space-sm;
span {
color: #ffc541;
}
}
}
}
.menus{
padding-top: @space-32;
img{
width: 48px;
height: 48px;
margin-bottom: @space-xxxs;
}
.row{
display: flex;
justify-content: space-around;
text-align: center;
padding-top: @space-md;
.col{
width: 50%;
}
}
}
}
\ No newline at end of file
import React from 'react';
import List from './components/list'
const Index = () => {
const dataSource = [
{
id: 1,
image: '/images/exam1.png',
title: '2020版中西医结合执业助理医师 模拟试',
like: 0,
share: 1,
},
{
id: 2,
image: '/images/exam1.png',
title: '2020版中西医结合执业助理医师 模拟试',
like: 0,
share: 0,
},
{
id: 3,
image: '/images/exam1.png',
title: '2020版中西医结合执业助理医师 模拟试',
like: 1,
share: 1,
},
];
const onClickLike = id => {
console.log(id);
};
const onClickShare = id => {
console.log(id);
};
const onClickButton = id => {
console.log(id);
};
const opt={
dataSource,
buttonLable:"立即答题",
onClickLike,
onClickShare,
onClickButton
}
return (
<>
<List {...opt}></List>
</>
);
}
export default Index;
\ No newline at end of file
import React from 'react';
import List from './components/list'
const Index = () => {
const dataSource = [
{
id: 1,
image: '/images/exam1.png',
title: '2020版中西医结合执业助理医师 模拟试',
like: 0,
share: 1,
},
{
id: 2,
image: '/images/exam1.png',
title: '2020版中西医结合执业助理医师 模拟试',
like: 0,
share: 0,
},
{
id: 3,
image: '/images/exam1.png',
title: '2020版中西医结合执业助理医师 模拟试',
like: 1,
share: 1,
},
];
const onClickLike = id => {
console.log(id);
};
const onClickShare = id => {
console.log(id);
};
const onClickButton = id => {
console.log(id);
};
const opt={
dataSource,
buttonLable:"期末考试",
showCnt:false,
onClickLike,
onClickShare,
onClickButton
}
return (
<>
<List {...opt}></List>
</>
);
}
export default Index;
\ No newline at end of file
.normal {
font-family: Georgia, sans-serif;
margin-top: 4em;
text-align: center;
}
.welcome {
height: 512px;
background: url(../assets/yay.jpg) no-repeat center 0;
background-size: 512px 512px;
}
.list {
font-size: 1.2em;
margin: 1.8em 0 0;
list-style: none;
line-height: 1.5em;
}
.list code {
background: #f7f7f7;
}
import styles from './index.css';
import { Button, WhiteSpace, WingBlank } from 'antd-mobile';
export default function() {
return (
<div className={styles.normal}>
<Button>default</Button><WhiteSpace />
</div>
);
}
import React from "react";
import styles from "./index.less";
const Index = () => {
return <div className={styles.root}>个人中心</div>;
};
export default Index;
.root{
}
\ No newline at end of file
import React from 'react';
import { Picker, List, Button } from 'antd-mobile';
import styles from './index.less';
import router from 'umi/router';
const Index = () => {
const seasons = [
[
{
label: '2013',
value: '2013',
},
{
label: '2014',
value: '2014',
},
],
[
{
label: '',
value: '',
},
{
label: '',
value: '',
},
],
];
const handSubmit=(e)=>{
router.push('/demo');
}
return (
<div className={styles.root}>
<div>
<Picker data={seasons} title="选择学校" cascade={false} extra="请选择">
<List.Item arrow="horizontal">选择学校</List.Item>
</Picker>
<Picker data={seasons} title="选择专业" cascade={false} extra="请选择">
<List.Item arrow="horizontal">选择专业</List.Item>
</Picker>
</div>
<div className={styles.action}>
<Button type="primary" onClick={handSubmit}>选择完毕</Button>
</div>
</div>
);
};
export default Index;
@import "~@/themes/vars.less";
.root{
height: 100%;
.action{
width: 70%;
margin: 30% auto;
}
:global{
.am-button{
border-radius: 25px;
}
.am-list-item .am-list-line{
.am-list-content{
color: @text-pick-placehoder-color;
}
.am-list-extra{
color: @text-pick-title-color;
}
.am-list-arrow {
color: @text-pick-title-color;
}
}
}
}
\ No newline at end of file
import React from "react";
import styles from "./index.less";
const Index = () => {
return <div className={styles.root}>视频列表</div>;
};
export default Index;
.root{
}
\ No newline at end of file
// 字色
//3a73e9
//3367D6
@color-primary: #3367d6; // 主色
@color-primary-active: #3367d6; // 主色
@color-primary-disable: #bec5d4; // 主色
@color-primary-sup: #374583; // 图标色
@color-border: #e3e7ef; // 边框
@color-background: #f4f5f7; // 背景颜色
@color-success: #3cd99d; // 辅助色-成功
@color-error: #ff5c6a; // 辅助色-异常
@color-warning: #ffbc19; // 辅助色-警告
@color-second: #37c2cf;
@text-title-color: #202f75; // 标题颜色
@text-content-color: #374583; // 正文颜色
@text-prompt-color: #b3b9c4; // 提示颜色
@text-pick-placehoder-color: #dadada; //pick placehoder颜色
@text-pick-title-color: #2372fe; //pick title颜色
@table-background-color: #f4f5f7; // 表单背景
@table-active-color: #e6ecf2; // 表单选中
@content-background-color: #ffffff;
@item-title-color:#202030;// 列表项标题
// 字号
@font-size-xlg: 22px; // 大标题
@font-size-lg: 29px; // 标题
@font-size-xmd: 16px; // 副标题
@font-size-md: 14px; // 主字体
@font-size-sm: 12px; // 说明 描述
@font-size-zs: 10px; // 说明 描述
// 圆角
@radius-sm: 2.2px;
@radius-md: 4px;
@radius-lg: 8px;
// 间距
@space-32: 32px;
@space-lg: 24px;
@space-xmd: 22px;
@space-md: 20px;
@space-sm: 16px;
@space-xs: 14px;
@space-xxs: 12px;
@space-xxxs: 8px;
@space-xxxxs: 4px;
@space-zero: 0px;
import pathRegexp from "path-to-regexp";
/**
* props.route.routes
* @param router [{}]
* @param pathname string
*/
export const getActiveMenu = (menus = [], pathname) => {
for(let i=0;i<menus.length;i++){
const menu=menus[i]
if(menu.path && pathRegexp(`${menu.path}/(.*)`).test(`${pathname}/`)){
return menu
}
}
return undefined;
};
/**
* 不是真实的 webpack 配置,仅为兼容 webstorm 和 intellij idea 代码跳转
* ref: https://github.com/umijs/umi/issues/1109#issuecomment-423380125
*/
module.exports = {
resolve: {
alias: {
'@': require('path').resolve(__dirname, 'src'),
},
},
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment