We need to use the Layer.js Layer.config method here.
That
Layer.config ({ path: ' {garcia_js}layer/'//layer.js directory, which can be either an absolute directory or a relative directory });
The detailed code is as follows
Require ([' {garcia_js}layer/layer.js '],function(layer) {Layer.config ({path:' {garcia_js}layer/'//the directory where the Layer.js is located, either an absolute directory or a relative directory }); $ (document). On (' Click ', ' #checkButton ',function(){ varcode=$ ("Input[name= ' Checkcode ')"). Val (); if($ ("Input[name= ' Checkcode ')"). val () = = ") {layer.msg (' Please enter verification code ', {icon:7, Time:2000//2 seconds Off (default is 3 seconds if not configured) }); return false; } $.ajax ({URL:"{php echo $this->createweburl (' Yongjin ', Array (' Display ' = ' Search_order ')}", type:' Post ', DataType:' JSON ', data:{checkcode:$ ("Input[name= ' Checkcode ')"). Val ()}, Success:function(ret) {if(ret.errorcode==0) {layer.prompt ({formtype:3, Value:$.trim (code), title:' Please confirm the verification code ', }, function(value, index, elem) {$.ajax ({URL:"{php echo $this->createweburl (' Yongjin ', Array (' Display ' = ' change_status ')}", type:' Post ', DataType:' JSON ', data:{Checkcode:value}, Success:function(res) {if(res.errorcode==0{layer.msg (res.msg, {icon:1, Time:2000//2 seconds Off (default is 3 seconds if not configured) }); Location.reload ()}Else{layer.msg (res.msg, {icon:7, Time:2000//2 seconds Off (default is 3 seconds if not configured) }); }}) layer.close (index); }); }Else if(ret.errorcode==2{layer.msg (ret.msg, {icon:7, Time:2000//2 seconds Off (default is 3 seconds if not configured) }); }Else{layer.msg (ret.msg, {icon:7, Time:2000//2 seconds Off (default is 3 seconds if not configured) }); } } }) }); })
About Require.js introduced layer.js after the layer.css and other style files can not be introduced to solve