Commit aced5637 by lixiaofeng

Merge remote-tracking branch 'remotes/origin/HEAD' into share-app/lxf

2 parents 031bc3c5 eb22d5b0
......@@ -163,7 +163,7 @@
"\t\t\t<hr class=\"layui-bg-gray\">"
}
for(var i=0;i<photo.length;i++){
photo[i].photoPath = "http://114.55.43.0:16907/v1/point/getFile?ak=30bdc45ee00940cda7917d134fdb1523&filePath="+photo[i].photoPath
photo[i].photoPath = saas.url + "/v1/point/getFile?ak=30bdc45ee00940cda7917d134fdb1523&filePath="+photo[i].photoPath
strImg += "<img src="+photo[i].photoPath+" class=\"item\"/>"
Imgarr.push(photo[i].photoPath)
}
......
//网点id
var pointId = localStorage.getItem('pointId');
$(function(){
var delParent;
var defaults = {
fileType : ["jpg","png","bmp","jpeg"], // 上传文件的类垿
fileSize : 1024 * 1024 * 10 // 上传文件的大尿 10M
......@@ -124,19 +128,25 @@ function saveReturn(){
console.log("file数据"+file);
var formData = new FormData();
formData.append('file', file);
$.ajax({
url: "/home/about",
type: "post",
data: formData,
contentType: false,
processData: false,
mimeType: "multipart/form-data",
success: function (data) {
console.log("返回正确数据"+data);
},
error: function (data) {
console.log("错误返回数据"+data);
}
});
// $.ajax({
// url: "/home/about",
// type: "post",
// data: formData,
// contentType: false,
// processData: false,
// mimeType: "multipart/form-data",
// success: function (data) {
//
// console.log("返回正确数据"+data);
// },
// error: function (data) {
// console.log("错误返回数据"+data);
// }
// });
var url = "/v1/point/uploadPhoto?ak=" + saas.url + "&pointId=" + pointId;
saas.upLoadHttpRequest(url,formData,function (data) {
console.log("返回正确数据"+data);
},function (error) {
console.log("错误返回数据"+error);
});
}
\ No newline at end of file
......@@ -129,8 +129,10 @@ var main = {
//注销控件
// main.dragFeature.deactivate();
main.drawPoint.deactivate();
// var point = this.pointFeature.geometry.getCentroid();
// console.log(point.x+","+point.y);
//获取当前feature坐标
var geometry = main.currentPoint.geometry.getCentroid();
//修改网点坐标
main.updatePoint(geometry.x,geometry.y);
}
},
addMarker: function (pointX,pointY,code,iconPath) {
......@@ -163,14 +165,14 @@ var main = {
main.currentPoint = eventArgs.feature;
main.vectorLayer.removeAllFeatures();
main.vectorLayer.addFeatures(main.currentPoint);
var geometry = eventArgs.feature.geometry.getCentroid();
main.updatePoint(geometry.x,geometry.y);
// var geometry = eventArgs.feature.geometry.getCentroid();
// main.updatePoint(geometry.x,geometry.y);
},
updatePoint: function (x,y) {
var method = "/point/updatePoint";
var parameter = {
custom_id:"{\"fieldName\":\"名称\",\"fieldValue\":\"网点1\"}",
infos:"{\"fieldName\":\"名称\",\"fieldValue\":\"网点1\"}",
infos:"[{\"fieldName\":\"名称\",\"fieldValue\":\"网点1\"}]",
x:x,
y:y,
coord_type:"gcj02mc"
......
......@@ -37,5 +37,18 @@ var saas = {
error: errorComplate,
};
$.ajax(config);
},
upLoadHttpRequest: function (method, formData, successComplate, errorComplate) {
var config = {
url:saas.url + method,
type: "post",
data: formData,
contentType: false,
processData: false,
mimeType: "multipart/form-data",
success: successComplate,
error: errorComplate,
};
$.ajax(config);
}
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!