File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11node_modules /
2+ * /dist /**
23.idea /
34.vscode /
45.idea /vcs.xml
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -14,15 +14,9 @@ export default function ShadowBox(props) {
1414 '4' :[ 40000 , 120000 , 200000 ] ,
1515 '5' :[ 100000 , 600000 , 1000000 ]
1616
17- } , path = {
18- pathname : '/simple' ,
19- query : {
20- level : props . level
21- }
22- } ;
17+ } , path = '/simple?level=' + props . level ;
2318 let word = '' ;
2419 if ( props . isSuccess ) {
25- console . log ( 'pass' , props . timePass ) ;
2620 const records = jokers [ props . level ] ;
2721 if ( props . timePass < records [ 0 ] ) {
2822 word = '大神啊,快膜拜 !' ;
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export default class Game extends React.Component {
5454 }
5555 timer ( offsetTime ) {
5656 const formatter = ( t ) => {
57- const res = t > 9 ? t : '0' + t
57+ const res = t > 9 ? t : '0' + t ;
5858 return res ;
5959 }
6060 let startTime = new Date ( ) . getTime ( ) , tPass = 0 , tOffset = offsetTime || 0 ;
Original file line number Diff line number Diff line change @@ -21,12 +21,13 @@ export default class Home extends React.Component {
2121 }
2222 }
2323 selectIndex ( e ) {
24- const path = {
24+ /* const path = {
2525 pathname: '/simple',
2626 query: {
2727 level: e
2828 }
29- }
29+ }*/
30+ const path = '/simple?level=' + e ;
3031 this . props . history . push ( path ) ;
3132 }
3233 closePicker ( ) {
@@ -36,37 +37,17 @@ export default class Home extends React.Component {
3637 this . setState ( { showPiker :true } )
3738 }
3839 render ( ) {
39- const routes = {
40- level3 : {
41- pathname : '/simple' ,
42- query : {
43- level : 3
44- }
45- } ,
46- level4 : {
47- pathname : '/simple' ,
48- query : {
49- level : 4
50- }
51- } ,
52- level5 : {
53- pathname : '/simple' ,
54- query : {
55- level : 5
56- }
57- }
58- }
5940 return (
6041 < div className = "home-page" >
6142 < h3 > < span > 欢迎来到</ span > </ h3 >
6243 < h2 > < span > 数字华容道</ span > </ h2 >
6344 < ul className = "level-items" >
64- < li > < Link to = { routes . level3 } > 3x3</ Link > </ li >
65- < li > < Link to = { routes . level4 } > 4x4</ Link > </ li >
66- < li > < Link to = { routes . level5 } > 5x5</ Link > </ li >
45+ < li > < Link to = '/simple?level=3' > 3x3</ Link > </ li >
46+ < li > < Link to = '/simple?level=4' > 4x4</ Link > </ li >
47+ < li > < Link to = '/simple?level=5' > 5x5</ Link > </ li >
6748 < li onClick = { this . showPicker } > 更< span > 多...</ span > </ li >
6849 </ ul >
69- < a herf = "http://closertb.site/" className = "about" >
50+ < a href = "http://closertb.site/" className = "about" >
7051 < svg >
7152 < use xlinkHref = "#aboutIcon" > </ use >
7253 </ svg >
Original file line number Diff line number Diff line change @@ -20,11 +20,18 @@ function Status(props) {
2020 </ div >
2121 ) ;
2222}
23-
23+ const translateKey = ( str ) => {
24+ var arr = str . substr ( 1 ) . split ( '&' ) , res = { } ;
25+ arr . forEach ( ( t ) => {
26+ let couple = t . split ( '=' ) ;
27+ res [ couple [ 0 ] ] = couple [ 1 ] ;
28+ } ) ;
29+ return res ;
30+ }
2431export default class Simple extends React . Component {
2532 constructor ( props ) {
2633 super ( props ) ;
27- this . level = this . props . location . query . level ;
34+ this . level = + translateKey ( this . props . location . search ) . level ;
2835 this . length = this . level * this . level ;
2936 this . state = {
3037 level : this . level ,
@@ -37,7 +44,6 @@ export default class Simple extends React.Component {
3744
3845 handleClick ( dir , index ) {
3946 } ;
40-
4147 render ( ) {
4248 const link = {
4349 pathname : '/game' ,
Original file line number Diff line number Diff line change 11const path = require ( 'path' ) ;
22const CleanWebpackPlugin = require ( 'clean-webpack-plugin' ) ;
33const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
4- //const ExtractTextPlugin = reqire('extract-text-webpack-plugin');
4+ const ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
5+
56const webpack = require ( 'webpack' ) ;
67module . exports = {
78 entry : './src/js/index.js' ,
@@ -34,22 +35,17 @@ module.exports = {
3435 }
3536 } , {
3637 test : / \. s c s s $ / ,
37- use : [
38- 'style-loader' ,
39- 'css-loader' ,
40- 'sass-loader' ]
41- /* ,
4238 use : ExtractTextPlugin . extract ( {
43- fallback: "style -loader", // 编译后用什么loader来提取css文件
44- use : "css -loader" // 指需要什么样的loader去编译文件,这里由于源文件是.css所以选择css-loader
45- })*/
39+ use : [ 'css -loader' , 'sass-loader' ] ,
40+ fallback : "style -loader"
41+ } )
4642 }
4743
4844 ]
4945 } ,
5046 plugins : [
5147 new CleanWebpackPlugin ( [ 'dist' ] ) ,
52- // new ExtractTextPlugin("style .css"),
48+ new ExtractTextPlugin ( "index .css" ) ,
5349 new HtmlWebpackPlugin ( { template : './index.html' } )
5450 ] ,
5551} ;
You can’t perform that action at this time.
0 commit comments