|
@@ -10,7 +10,10 @@ Page({
|
|
|
mapworkelist:[],
|
|
|
inputValue:"",
|
|
|
workelist:[],
|
|
|
- hasMarkers:true
|
|
|
+ hasMarkers:true,
|
|
|
+ workedesc:"",
|
|
|
+ status:"",
|
|
|
+ show:false
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -25,6 +28,10 @@ Page({
|
|
|
}
|
|
|
})
|
|
|
that.workDesc();
|
|
|
+ that.setData({
|
|
|
+ status:app.globalData.status
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
|
|
|
onHide(){
|
|
@@ -64,25 +71,68 @@ Page({
|
|
|
})
|
|
|
} else {
|
|
|
var data=res.message.data.data
|
|
|
+
|
|
|
that.setData({
|
|
|
workelist:res.message.data.data
|
|
|
})
|
|
|
var maplist=[];
|
|
|
+ var workelist=[];
|
|
|
for (var i = 0; i < data.length; ++i) {
|
|
|
maplist[i]={
|
|
|
-
|
|
|
'id':data[i]['id'],
|
|
|
'latitude':data[i]['lat'],
|
|
|
'longitude':data[i]['lng'],
|
|
|
'iconPath': '/image/address/location.png',
|
|
|
- 'width':100,
|
|
|
- 'height':100
|
|
|
+ 'width':60,
|
|
|
+ 'height':60,
|
|
|
+ }
|
|
|
+ workelist[data[i]['id']]={
|
|
|
+ 'id':data[i]['id'],
|
|
|
+ 'latitude':data[i]['lat'],
|
|
|
+ 'longitude':data[i]['lng'],
|
|
|
+ 'title':data[i]['title'],
|
|
|
+ 'address':data[i]['address'],
|
|
|
+ 'name':data[i]['name'],
|
|
|
+ 'signing_status':data[i]['signing_status'],
|
|
|
+ 'distance':data[i]['distance']
|
|
|
}
|
|
|
|
|
|
+ if((keyword!='' || keyword!=null)&& i==0){
|
|
|
+
|
|
|
+ that.setData({
|
|
|
+ workedesc: workelist[data[i]['id']],
|
|
|
+ show:true
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ console.log(data);
|
|
|
+ if(data=="" || data ==null || data==[]){
|
|
|
+ console.log(33333);
|
|
|
+ var workedesc={
|
|
|
+ 'id':0,
|
|
|
+ 'latitude':0,
|
|
|
+ 'longitude':0,
|
|
|
+ 'title':'暂无数据',
|
|
|
+ 'address':'暂无数据',
|
|
|
+ 'name':'暂无数据',
|
|
|
+ 'signing_status':0,
|
|
|
+ 'distance':0
|
|
|
+ }
|
|
|
+ that.setData({
|
|
|
+ workedesc: workedesc,
|
|
|
+ show:true
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
that.setData({
|
|
|
mapworkelist:maplist,
|
|
|
- hasMarkers:true
|
|
|
+ hasMarkers:true,
|
|
|
+ workelist:workelist
|
|
|
})
|
|
|
|
|
|
|
|
@@ -92,13 +142,51 @@ Page({
|
|
|
wx.hideLoading();
|
|
|
|
|
|
}).catch(function (err) {
|
|
|
- console.log(222);
|
|
|
- })
|
|
|
-
|
|
|
+ var workedesc={
|
|
|
+ 'id':0,
|
|
|
+ 'latitude':0,
|
|
|
+ 'longitude':0,
|
|
|
+ 'title':'暂无数据!',
|
|
|
+ 'address':'暂无数据!',
|
|
|
+ 'name':'暂无数据!',
|
|
|
+ 'signing_status':12,
|
|
|
+ 'distance':0
|
|
|
+ }
|
|
|
+ that.setData({
|
|
|
+ workedesc: workedesc,
|
|
|
+ show:true
|
|
|
+ })})
|
|
|
},
|
|
|
bindKeyInput: function (e) {
|
|
|
this.setData({
|
|
|
inputValue: e.detail.value
|
|
|
})
|
|
|
},
|
|
|
+markertap(e) {
|
|
|
+ console.log('@@@ markertap', e)
|
|
|
+var workelist=this.data.workelist;
|
|
|
+var markerId=e.detail.markerId;
|
|
|
+var workedesc=workelist[markerId];
|
|
|
+this.setData({
|
|
|
+ workedesc: workedesc,
|
|
|
+ show:true
|
|
|
+})
|
|
|
+
|
|
|
+},
|
|
|
+//设置网点
|
|
|
+setworke(e){
|
|
|
+ app.api.useApi(app.globalData.baseAppUrl+"api/user",{
|
|
|
+ network_id:e.target.dataset.id,
|
|
|
+
|
|
|
+ },"get").then(function(res){
|
|
|
+ if (res.code == 200) {
|
|
|
+ wx.showLoading({
|
|
|
+ title: '网点设置成功',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(function(err){
|
|
|
+ console.log(222);
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
})
|