const Parser = require("../xml/xmldom/dom-parser");
var app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    latitude : 37.868654,
    longitude : 112.573299,
    name:'优千家物业',
    scale:16 ,
    markers: [{
      id: 1,
      latitude: 37.868654,
      longitude: 112.573299,
      //iconPath: '/image/location.png',
      callout:{
        content:"铜锣湾国际公寓A座\r\n电话:0351-8201348",
        bgColor:"#fff",
        padding:"5px",
        borderRadius:"2px",
        borderWidth:"1px",
        borderColor:"#07c160",
      }
    }]
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    this.mapCtx = wx.createMapContext('map');
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    var method = "Insertfdc_pm_meter";
    var wsdlurl = app.webUrl;
    var targetNamespace = "http://tempuri.org/";
    var datacory =
      '<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header><MySoapHeader xmlns="http://tempuri.org/"><UserName>admin</UserName><PassWord>admin123</PassWord></MySoapHeader></soap:Header><soap:Body><Insertfdc_pm_meter xmlns="http://tempuri.org/"><Userid>1110</Userid><hcode>1000103#-B3SHJ</hcode><pk_meterid>1000103#-18016668</pk_meterid><ncur>4000.00</ncur><bdate>2020/05/29</bdate><edate>2020/2/18 0:00:00</edate></Insertfdc_pm_meter></soap:Body></soap:Envelope>';
    // wx.request({
    //   url: wsdlurl,
    //   data: datacory,
    //   method: 'POST',
    //   header: {
    //     'Content-Type':'text/xml; charset=utf-8',
    //     'SOAPAction':targetNamespace+method,
    //   },
    //   success:function(res){
    //  console.log(res.data);
    //   }
    // })
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {},

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {},
  mapclick: function() {
    var that = this;
    console.log("地图点击");
    
  },
});
