php 如何引入layer,关于require.js引入layer.js后 layer.css等样式文件无法引入解决

require([‘{GARCIA_JS}layer/layer.js‘],function(layer){

layer.config({

path:‘{GARCIA_JS}layer/‘ //layer.js所在的目录,可以是绝对目录,也可以是相对目录

});

$(document).on(‘click‘,‘#checkButton‘,function(){var code=$("input[name=‘checkCode‘]").val();if($("input[name=‘checkCode‘]").val()==‘‘){

layer.msg(‘请输入核销码‘, {

icon:7,

time:2000 //2秒关闭(如果不配置,默认是3秒)

});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:‘请确认核销码‘,

},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秒关闭(如果不配置,默认是3秒)

});

location.reload()

}else{

layer.msg(res.msg, {

icon:7,

time:2000 //2秒关闭(如果不配置,默认是3秒)

});

}

}

})

layer.close(index);

});

}else if(ret.errorCode==2){

layer.msg(ret.msg, {

icon:7,

time:2000 //2秒关闭(如果不配置,默认是3秒)

});

}else{

layer.msg(ret.msg, {

icon:7,

time:2000 //2秒关闭(如果不配置,默认是3秒)

});

}

}

})

});

})

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>通过属性查询地图服务中的信息</title> <link rel="stylesheet" href="https://js.arcgis.com/3.39/esri/css/esri.css"> <!-- <link rel="stylesheet" type="text/css" href="./css/esri.css" /> --> <link rel="stylesheet" href="https://js.arcgis.com/3.40/esri/themes/calcite/dijit/calcite.css"> <script src="https://js.arcgis.com/3.41/"></script> <script> require(["esri/map", //加载地图组件 "dojo/dom", "dojo/on", "esri/InfoTemplate", "esri/graphic", "esri/geometry/Point",//加载点对象组件 "esri/symbols/SimpleMarkerSymbol", "esri/geometry/Extent",//加载范围组件 "esri/layers/FeatureLayer", //加载FeatureLayer地图组件 // "esri/dijit/FeatureTable", "esri/layers/WebTiledLayer", //加载切片地图组件 "esri/layers/ArcGISDynamicMapServiceLayer",//加载动态地图组件 "esri/symbols/SimpleFillSymbol", "esri/renderers/UniqueValueRenderer", "esri/tasks/query", "esri/tasks/QueryTask", "esri/Color", "dojo/domReady!" ], function (Map, dom, on, InfoTemplate, Graphic, Point, SimpleMarkerSymbol,Extent, FeatureLayer, WebTiledLayer, ArcGISDynamicMapServiceLayer, SimpleFillSymbol, UniqueValueRenderer, Query, QueryTask, Color, GeoJsonLayer) { //初始化地图容器 // map = new Map("map", { logo: false, slider: false }, {zoom: 8}); map = new Map("map", { center: [109.33789 , 29.57985], basemap: "satellite", zoom: 10, sliderStyle: "small", logo: false }); // 创建底图 var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"); map.addLayer(basemap,0); // 创建动态图层 var dynamicLayer = new ArcGISDynamicMapServiceLayer("http://116.62.63.94:6080/arcgis/rest/services/sanhuxiangtest/MapServer"); map.addLayer(dynamicLayer,99); }) </script> </head> <body class="tundra"> <div id="map" style="width:900px; height:580px; border:1px solid #000;"></div> 类别名称:<input class="nm" type="text"> </body> </html>
07-15

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值