|
@@ -13,6 +13,10 @@ Page({
|
|
|
//店铺经纬度
|
|
|
latitude: 43.8691319,
|
|
|
longitude: 125.3504459,
|
|
|
+ businessName:null,
|
|
|
+ busEnterpriseId:null,
|
|
|
+ busPatrolstationId:null,
|
|
|
+ orgCode:null,
|
|
|
//标记点
|
|
|
markers: [{
|
|
|
id: 0,
|
|
@@ -30,21 +34,61 @@ Page({
|
|
|
*/
|
|
|
onLoad(options) {
|
|
|
|
|
|
- console.log("@@@",options.id)
|
|
|
this.setData({
|
|
|
- id:options.id
|
|
|
+ id: options.id
|
|
|
})
|
|
|
this.getDetails(options.id)
|
|
|
|
|
|
},
|
|
|
|
|
|
- getDetails(id){
|
|
|
+ getDetails(id) {
|
|
|
+ wx.showLoading()
|
|
|
let obj = new Object();
|
|
|
- obj.id = this.data.id
|
|
|
- http.post("/system/AppEnterpriseController/getEnterpriseDetails", obj, this.getDetailsSuccess)
|
|
|
+ obj.busPatrolstationCode = this.data.id
|
|
|
+ http.post("/system/AppPatrolstationController/getPatrolstationDetail", obj, this.getDetailsSuccess)
|
|
|
},
|
|
|
- getDetailsSuccess(res){
|
|
|
-
|
|
|
+ getDetailsSuccess(res) {
|
|
|
+ console.log("!!!", res)
|
|
|
+ wx.hideLoading()
|
|
|
+ if (res.data.length == 0) {
|
|
|
+
|
|
|
+ wx.showToast({
|
|
|
+ title: '暂无巡更点',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ wx.navigateBack()
|
|
|
+ }, 1000);
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ this.setData({
|
|
|
+ businessName:res.data[0].busEnterpriseName,
|
|
|
+ orgCode:res.data[0].busPatrolstationCode,
|
|
|
+ busEnterpriseId:res.data[0].busEnterpriseId,
|
|
|
+ busPatrolstationId:res.data[0].busPatrolstationId,
|
|
|
+ latitude: res.data[0].latitude,
|
|
|
+ longitude: res.data[0].longitude,
|
|
|
+ markers: [{
|
|
|
+ id: Number(res.data[0].busPatrolstationId),
|
|
|
+ name: res.data[0].busPatrolstationName,
|
|
|
+
|
|
|
+ latitude: res.data[0].latitude,
|
|
|
+ longitude: res.data[0].longitude,
|
|
|
+ width: 35,
|
|
|
+ height: 50
|
|
|
+ }]
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ bindViewEdit(){
|
|
|
+ console.log("@@@",this.data.busEnterpriseId)
|
|
|
+ console.log("@@@",this.data.busPatrolstationId)
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '../new_patrol_point/new_patrol_point?enterpriseId='+this.data.busEnterpriseId +"&busPatrolstationId="+this.data.busPatrolstationId+"&isEdit=y",
|
|
|
+ })
|
|
|
},
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|