Commit 71fbd94b by 白杨

网点界面

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