Commit 71fbd94b by 白杨

网点界面

1 parent 3057d888
......@@ -85,23 +85,38 @@
<script src="src/js/main.js"></script>
<script>
var name = localStorage.getItem('name')
var phone = localStorage.getItem('phone')
$('.confirm').on('click',function (e) {
var value = $('input').val()
if(!value){
alert('请输入字段!');
return
}
$.ajax({
type: "POST",
url:saas.customUrl + "/point/updatePoint",
data:{
custom_id:"{\"fieldName\":\"名称\",\"fieldValue\":\"网点1\"}",
infos:"[{\"fieldName\":"+ name +",\"fieldValue\":"+ value +"}]"
},
success:function (data) {
console.log(data)
// $.ajax({
// type: "POST",
// url:saas.customUrl + "/point/updatePoint",
// data:{
// custom_id:"{\"fieldName\":\"手机号\",\"fieldValue\":\""+phone+"\"}",
// infos:"[{\"fieldName\":"+ name +",\"fieldValue\":"+ value +"}]"
// },
// success:function (data) {
// console.log(data)
// }
// })
var method = "/point/updatePoint";
var parameter = {
custom_id:"{\"fieldName\":\"手机号\",\"fieldValue\":\""+phone+"\"}",
infos:"[{\"fieldName\":"+ name +",\"fieldValue\":"+ value +"}]"
};
saas.customHttpRequest(method,parameter,function (data) {
if(data.code == "s001"){
alert('字段修改成功');
}
})
},function (error) {
});
})
$('.back').on('click',function () {
window.history.back()
......
......@@ -163,7 +163,7 @@
"\t\t\t<hr class=\"layui-bg-gray\">"
}
for(var i=0;i<photo.length;i++){
photo[i].photoPath = saas.url + "/v1/point/getFile?ak=30bdc45ee00940cda7917d134fdb1523&filePath="+photo[i].photoPath
photo[i].photoPath = saas.url + "/v1/point/getFile?ak="+saas.ak+"&filePath="+photo[i].photoPath
strImg += "<img src="+photo[i].photoPath+" class=\"item\"/>"
Imgarr.push({photoPath:photo[i].photoPath,id:photo[i].id})
}
......
......@@ -78,7 +78,7 @@
<div class="div-password">
<label>请输入手机号:</label>
<div style="margin-top: 10px;">
<input type="text">
<input type="text" id="txt_phone">
<button id="btn_test">提取</button>
</div>
</div>
......
......@@ -87,7 +87,7 @@ $(function(){
delParent.remove()
$.ajax({
type: "POST",
url: "http://114.55.43.0:16907/v1/point/deletePhoto?ak=30bdc45ee00940cda7917d134fdb1523&fileId="+delImgId,
url: saas.url + "/v1/point/deletePhoto?ak="+saas.ak+"&fileId="+delImgId,
success: function(msg){
console.log(msg)
}
......
......@@ -5,7 +5,11 @@ var index = {
});
},
mainReturn: function () {
//跳转主界面
window.location.href="main.html";
var txt = $('#txt_phone').val();
if( txt != ""){
localStorage.setItem('phone',txt);
//跳转主界面
window.location.href="main.html";
}
}
}
\ No newline at end of file
......@@ -65,9 +65,10 @@ var main = {
// this.getInfoSuccess(11);
},
validate:function () {
var phone = localStorage.getItem('phone');
var method = "/v1/point/search";
var parameter = {
custom_id:"{\"fieldName\":\"名称\",\"fieldValue\":\"网点1\"}"
custom_id:"{\"fieldName\":\"手机号\",\"fieldValue\":\"" + phone+ "\"}"
};
saas.saasHttpRequest(method,parameter,this.validateSuccess,this.validateError);
},
......@@ -169,15 +170,20 @@ var main = {
// main.updatePoint(geometry.x,geometry.y);
},
updatePoint: function (x,y) {
var phone = localStorage.getItem('phone');
var method = "/point/updatePoint";
var parameter = {
custom_id:"{\"fieldName\":\"名称\",\"fieldValue\":\"网点1\"}",
infos:"[{\"fieldName\":\"名称\",\"fieldValue\":\"网点1\"}]",
custom_id:"{\"fieldName\":\"手机号\",\"fieldValue\":\"" + phone+ "\"}",
infos:"[{\"fieldName\":\"手机号\",\"fieldValue\":\""+phone+"\"}]",
x:x,
y:y,
coord_type:"gcj02mc"
};
saas.customHttpRequest(method,parameter,this.getInfoSuccess,this.getInfoError);
saas.customHttpRequest(method,parameter,function (data) {
},function (error) {
});
}
}
var saas = {
// url: "http://saasapi.dituhui.com",
url: "http://114.55.43.0:16907",
customUrl:"http://localhost:8080",
// ak:"ee824a89bb2b4c7cb74399bf9d5165bc",
ak:"30bdc45ee00940cda7917d134fdb1523",
url: "http://saasapi.dituhui.com",
// url: "http://114.55.43.0:16907",
// customUrl:"http://120.55.114.153:16900",
customUrl:"http://localhost:16900",
ak:"ee824a89bb2b4c7cb74399bf9d5165bc",
// ak:"30bdc45ee00940cda7917d134fdb1523",
saasHttpRequest: function (method, parameter, successComplate, errorComplate) {
if(parameter){
parameter.ak = saas.ak;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!