Commit 426dd49b authored by 熊成伟's avatar 熊成伟

debug

parent 6095eb88
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
This diff is collapsed.
const { injectBabelPlugin, getLoader } = require('react-app-rewired'); const { injectBabelPlugin, getLoader } = require('react-app-rewired');
const {override} = require("customize-cra")
const path = require("path")
const rewirePostcss = require('react-app-rewire-postcss');
const px2rem = require('postcss-px2rem') const px2rem = require('postcss-px2rem')
const fileLoaderMatcher = function (rule) { const fileLoaderMatcher = function (rule) {
return rule.loader && rule.loader.indexOf(`file-loader`) != -1; return rule.loader && rule.loader.indexOf(`file-loader`) != -1;
} }
...@@ -13,6 +17,15 @@ module.exports = function override(config, env) { ...@@ -13,6 +17,15 @@ module.exports = function override(config, env) {
style: true, // use less for customized theme style: true, // use less for customized theme
}], config); }], config);
config = rewirePostcss(config,{
plugins: () => [
px2rem({
remUnit: 37.5,
exclude:/node-modules/
})
],
});
// customize theme // customize theme
config.module.rules[1].oneOf.unshift( config.module.rules[1].oneOf.unshift(
{ {
...@@ -28,10 +41,6 @@ module.exports = function override(config, env) { ...@@ -28,10 +41,6 @@ module.exports = function override(config, env) {
ident: 'postcss', ident: 'postcss',
plugins: () => [ plugins: () => [
require('postcss-flexbugs-fixes'), require('postcss-flexbugs-fixes'),
px2rem({
remUnit: 37.5,
exclude: /node-modules/
}),
autoprefixer({ autoprefixer({
browsers: [ browsers: [
'>1%', '>1%',
......
.search-notice-box{ .search-notice-box{
width: 100%; width: 100%;
height: 43.5px; height: 43.5px;
margin-bottom: 2px; margin-bottom: 1px;
display: flex; display: flex;
align-items: center; align-items: center;
} }
......
...@@ -3,12 +3,17 @@ import {SearchBar, Icon} from 'antd-mobile' ...@@ -3,12 +3,17 @@ import {SearchBar, Icon} from 'antd-mobile'
import './index.less' import './index.less'
const Index = () => { const Index = (props) => {
const topSearch = (val) => {
const input = document.getElementsByClassName("top-single-search").value;
console.log(val)
// props.onSearch(val)
}
return ( return (
<div className="search-box"> <div className="search-box">
<Icon type="search" size="xs" className="search-svg"/> <Icon type="search" size="xs" className="search-svg"/>
{/*<SearchBar/>*/} {/*<SearchBar/>*/}
<input className="top-single-search" placeholder="请输入关键字搜索" /> <input onChange={topSearch} className="top-single-search" placeholder="请输入关键字搜索" />
</div> </div>
); );
}; };
......
import React from 'react'; import React, {Component} from 'react';
import './index.less' import './index.less'
const CardItem = (peops) => { class CardItem extends Component {
state = {
addStatus: false
}
componentWillReceiveProps(nextProps, nextContext) {
if (this.props.addStatus !== nextProps.addStatus) {
this.setState({ addStatus: this.props.addStatus });
}
}
render() {
const {data, addCommon} = this.props;
return ( return (
<div className="card-item"> <div className="card-content" onClick={() => data.iconAdd ? addCommon() : null }>
<div className="card-item-content"> {data.text && (
<div className="card-item-content-img"> <div>
<img src={peops.data.icon} style={{ width: 35, height: 35 }} alt="" /> <div className="card-content-img">
<img src={data.icon} className="card-content-img-svg" alt="" />
</div> </div>
<div className="card-item-content-title"> <div className="card-content-title">
{peops.data.text} {data.text}
</div> </div>
</div> </div>
)}
</div> </div>
); );
}; }
}
export default CardItem; export default CardItem;
import React from 'react'; import React, {Component} from 'react';
import {Grid} from 'antd-mobile' import {Grid} from 'antd-mobile'
import './index.less' import './index.less'
import CardItem from './CardItem' import CardItem from './CardItem'
const data = Array.from(new Array(7)).map((_val, i) => ({ class Index extends Component {
render() {
const {title, type, addStatus, addCommon} = this.props
const emptyIcon = type === 'edit' ? {
text: '添加常用', icon: '', iconAdd: true
} : {};
//测试数据
const data = Array.from(new Array(7)).map((_val, i) => ({
icon: 'https://gw.alipayobjects.com/zos/rmsportal/nywPmnTAvTmLusPxHPSu.png', icon: 'https://gw.alipayobjects.com/zos/rmsportal/nywPmnTAvTmLusPxHPSu.png',
text: `name${i}`, text: `name${i}`,
})); }));
const Index = () => {
const empty = data.length % 3; const empty = data.length % 3;
empty > 0 && data.push({}, {}) empty === 0 && data.push(emptyIcon, {}, {});
empty === 1 && data.push(emptyIcon, {});
empty === 2 && data.push(emptyIcon);
return ( return (
<div> <div>
<div className="work-card-title"> <div className="work-card-title">
11111 {title}
</div> </div>
<div className="work-card-body"> <div className="work-card-body">
{data.map(item => ( {data.map((item, index) => (
<CardItem data={item}/> <CardItem
key={index}
data={item}
addStatus={addStatus}
addCommon={addCommon}
/>
))} ))}
</div> </div>
{/*<Grid*/}
{/*data={data}*/}
{/*columnNum={3}*/}
{/*renderItem={dataItem => (*/}
{/*<div style={{ padding: '12.5px' }}>*/}
{/*<img src={dataItem.icon} style={{ width: 35, height: 35 }} alt="" />*/}
{/*<div style={{ color: '#323232', fontSize: 13, marginTop: 18 }}>*/}
{/*收文管理*/}
{/*</div>*/}
{/*</div>*/}
{/*)}*/}
{/*/>*/}
</div> </div>
); );
}; }
}
export default Index; export default Index;
...@@ -2,25 +2,54 @@ ...@@ -2,25 +2,54 @@
display:flex; display:flex;
flex-direction: row; flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; //justify-content: center;
align-items: center; align-items: center;
//background: #ffffff;
} }
.work-card-title{
.card-item{ line-height: 43px;
width: 33.33%; border-radius: 6px 6px 0 0;
position: relative; padding-left: 20px;
background: #ffffff;
margin-bottom: 1px;
color: rgba(50, 50, 50, 0.6);
} }
.card-item-content{
padding: 26px 0; .card-content{
width: 114px;
height: 114px;
display: flex; display: flex;
flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-direction: column; background: #ffffff;
border: 1px salmon solid; margin-bottom: 1px;
//border: 1px solid rgba(38, 104, 255, 0.1);
} }
.card-item-content-img{ .work-card-body > .card-content:nth-child(3n + 2){
margin-bottom: 14px; margin-left: 1px;
}
.work-card-body > .card-content:nth-child(3n + 3){
margin-left: 1px;
}
.work-card-body > .card-content:last-child{
border-radius: 0 0 6px 0;
}
.work-card-body > .card-content:nth-last-child(3){
border-radius: 0 0 0 6px;
}
.card-content:active{
background: yellow;
} }
.card-item-content-title{
.card-content-img{
width: 35px;
height: 35px;
margin-bottom: 14px;
}
.card-content-img-svg{
width: 35px;
height: 35px;
}
.card-content-title{
} }
import React from 'react'; import React, {Component} from 'react';
import {WhiteSpace} from "antd-mobile"; import {WhiteSpace} from "antd-mobile";
import TopSearch from '../../components/TopSearch' import TopSearch from '../../components/TopSearch'
import WorkCard from '../../components/WorkCard' import WorkCard from '../../components/WorkCard'
const Work = () => { class Work extends Component {
state = {
addStatus: false
};
commonEdit = () => {
const {addStatus} = this.state;
this.setState({addStatus: !addStatus})
};
workSearch = (val) => {
console.log(val.target)
}
render() {
const {addStatus} = this.props
return ( return (
<div> <div>
<WhiteSpace/> <WhiteSpace/>
<TopSearch/> <TopSearch onSearch={this.workSearch}/>
<WhiteSpace/> <WhiteSpace/>
<WorkCard/> <WorkCard
type="edit"
title="常用板块"
addCommon={this.commonEdit}
addStatus={addStatus}
/>
<WhiteSpace/>
<WorkCard
title="事物管理"
addCommon={this.commonEdit}
addStatus={addStatus}
/>
</div> </div>
); );
}; }
}
export default Work; export default Work;
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