@@ -250,42 +250,63 @@ class TpickerEx extends Component {
250250 if ( index === 0 ) {
251251 that . state . Cdata1 [ 1 ] = [ ] ;
252252 that . state . Cdata1 [ 2 ] = [ ] ;
253+ that . state . Cdata1 [ 3 ] = [ ] ;
253254 this . forceUpdate ( ) ;
254255 return ;
255256 }
256257 console . debug ( cateMap [ index - 1 ] ) ;
257258 let url = ip + cateMap [ index - 1 ] ;
258- this . setState ( { loadingState : [ false , true , true ] } ) ;
259+ this . setState ( { loadingState : [ false , true , true , true ] } ) ;
259260 fetch ( url )
260261 . then ( ( res ) => {
261262 return res . json ( ) ;
262263 } ) . then ( ( data ) => {
263264 that . state . Cdata1 [ 1 ] = data . data ;
264265 that . state . Cdata1 [ 2 ] = [ ] ;
265- this . state . loadingState = [ false , false , false ] ;
266+ that . state . Cdata1 [ 3 ] = [ ] ;
267+ this . state . loadingState = [ false , false , false , false ] ;
266268 this . forceUpdate ( ) ;
267269 } ) ;
268270 }
269271 if ( wheelNumber === 1 ) {
270272 if ( index === 0 ) {
271273 that . state . Cdata1 [ 2 ] = [ ] ;
274+ that . state . Cdata1 [ 3 ] = [ ] ;
272275 this . forceUpdate ( ) ;
273276 return ;
274277 }
275278 let url = ip + cateMap [ index - 1 ] ;
276- this . setState ( { loadingState : [ false , false , true ] } ) ;
279+ this . setState ( { loadingState : [ false , false , true , true ] } ) ;
277280 fetch ( url )
278281 . then ( ( res ) => {
279282 return res . json ( ) ;
280283 } ) . then ( ( data ) => {
281284 that . state . Cdata1 [ 2 ] = data . data ;
282- this . state . loadingState = [ false , false , false ] ;
285+ that . state . Cdata1 [ 3 ] = [ ] ;
286+ this . state . loadingState = [ false , false , false , false ] ;
287+ this . forceUpdate ( ) ;
288+ } ) ;
289+ }
290+ if ( wheelNumber === 2 ) {
291+ if ( index === 0 ) {
292+ that . state . Cdata1 [ 3 ] = [ ] ;
293+ this . forceUpdate ( ) ;
294+ return ;
295+ }
296+ let url = ip + cateMap [ index - 1 ] ;
297+ this . setState ( { loadingState : [ false , false , false , true ] } ) ;
298+ fetch ( url )
299+ . then ( ( res ) => {
300+ return res . json ( ) ;
301+ } ) . then ( ( data ) => {
302+ that . state . Cdata1 [ 3 ] = data . data ;
303+ this . state . loadingState = [ false , false , false , false ] ;
283304 this . forceUpdate ( ) ;
284305 } ) ;
285306 }
286307 }
287308 _handle ( level , data ) {
288- this . setState ( { Cdata1 : [ data , [ ] , [ ] ] } ) ;
309+ this . setState ( { Cdata1 : [ data , [ ] , [ ] , [ ] ] } ) ;
289310 }
290311 _handle2 ( level , data , index ) {
291312 this . state . Cdata [ 1 ] = data ;
@@ -384,7 +405,7 @@ class TpickerEx extends Component {
384405 < Text style = { styles . demoValue } > Cascade Picker value: { this . state . str4 } </ Text >
385406 < CascadePicker
386407 inputValue = { this . state . str5 }
387- level = { 3 }
408+ level = { 4 }
388409 selectedValue = { this . state . choseValue }
389410 data = { this . state . Cdata1 }
390411 onWheelChange = { ( value , index , wheelNumber ) => { this . _getLevel3 ( value , index , wheelNumber ) ; } }
0 commit comments