/**
 * zzx
 * 2020.10.22
 * 提货任务指派
 */
import { UPCLOUD_RDC_TMS_MAINDATA_SERVICE,UPCLOUD_RDC_TMS_BUSINESS_SERVICE,UPCLOUD_RDC_TMS_INTERFACE_SERVICE} from '@/config/serviceSettings.js';
import { getSelectGJ, querySysPicture } from '@/utils/prolog.ajax.js';


export default () => {
  var master_grid, edit_grid_opts, edit_grid, map, myGeo;
  var selectedData;
  // var userinfo = JSON.parse(window.localStorage.getItem("userinfo"));

  // 跳转页面
  var carousel = layui.carousel;
  carousel.render({
    elem: "#pickupTaskAssignment",
    autoplay: false,
    index: 0,
    arrow: "none",
    indicator: "none",
    anim: "fade",
    width: "100%", // 设置容器宽度
    height: "100%"
  });
  // 切换页面
  function changePanel(name) {
    var slideList = ["#pickupTaskAssignment_main", "#pickupTaskAssignment_edit"];
    for (var i = 0; i < slideList.length; i++) {
      if (slideList[i] == name) {
        $(name).css("display", "block");
      }
      else {
        $(slideList[i]).css("display", "none");
      }
    }
  }
  // 返回
  $(document).on("click", "#pickupTaskAssignment_edit_return", function () {
    changePanel("#pickupTaskAssignment_main");
  });

  // 获取默认时间
  var startTime = Prolog.formatDate(new Date(), "%YY-%MM") + "-01 00:00:00";
  var endTime = Prolog.formatDate(new Date()) + " 23:59:59";
  // 获取下拉框
  var dataSelect = {
    TMS_REF_BILLTYPE: [],
    BILL_TYPE: [],
    GET_CUS_TYPE: [],
    URG_FLG: []
  };
  getSelectGJ([
    { "objectcode": "TMS_REF_BILLTYPE" },
    { "objectcode": "BILL_TYPE" },
    { "objectcode": "GET_CUS_TYPE" },
    { "objectcode": "URG_FLG" }
  ], function (data) {
    dataSelect = data.data;
    dataSelect.TMS_REF_BILLTYPE.unshift({ "value": "", "text": "" });
    dataSelect.BILL_TYPE.unshift({ "value": "", "text": "" });
  });

  // 配送中心table
  var branchTable = {
    // terrace显示全部，card分页显示
    skin: "card",
    // renderer:"grid",
    columns: [
      { id: "companyid", name: "id", type: "ro", width: "130", hidden: true },
      { id: "companycode", name: "配送中心编号", type: "ro" },
      { id: "companyname", name: "配送中心名称", type: "ro" }
    ],
    multiselect: false,
    toolbar: [
      { type: "settings", position: "label-left", width: 200, labelWidth: 100 },
      {
        type: "block", id: "bk", blockOffset: 0, list: [
          { type: "input", name: "companycode", label: "配送中心编号:", width: 120 },
          { type: "newcolumn" },
          { type: "button", name: "querycarr", value: "查询" },
          { type: "newcolumn" },
          { type: "button", name: "car_Reset", value: "重置" }
        ]
      }
    ],
    url: UPCLOUD_RDC_TMS_MAINDATA_SERVICE+"/pubCompany/queryCompanyBranch",
    pagebar: { type: "simple" },
    type: "post", // 数据提交方式，默认为get
    params: JSON.stringify({ companytype: "S" }), // 查询提交参数，分页参数默认为pageNum,pageSize
    contentType: "application/json",
    page: true, // 是否启用分页
    totalCount: "totalCount" // 总记录数字段，默认totalCount
  };
  // 客户table
  var customerTable = {
    // terrace显示全部，card分页显示
    skin: "card",
    // renderer:"grid",
    columns: [
      { id: "companyid", name: "id", type: "ro", width: "130", hidden: true },
      { id: "companycode", name: "客户编号", type: "ro" },
      { id: "companyname", name: "客户名称", type: "ro" }
    ],
    multiselect: false,
    toolbar: [
      { type: "settings", position: "label-left", width: 200, labelWidth: 70 },
      {
        type: "block", id: "bk", blockOffset: 0, list: [
          { type: "input", name: "companycode", label: "客户编码:", width: 120 },
          { type: "newcolumn" },
          { type: "button", name: "querycarr", value: "查询" },
          { type: "newcolumn" },
          { type: "button", name: "car_Reset", value: "重置" }
        ]
      }
    ],
    url: UPCLOUD_RDC_TMS_MAINDATA_SERVICE+"/pubCompany/queryCompanyCustomer",
    pagebar: { type: "simple" },
    type: "post", // 数据提交方式，默认为get
    params: JSON.stringify({ companytype: "C" }), // 查询提交参数，分页参数默认为pageNum,pageSize
    contentType: "application/json",
    page: true, // 是否启用分页
    totalCount: "totalCount" // 总记录数字段，默认totalCount
  };

  // 主页grid
  var master_grid_opts = {
    skin: "card",
    columns: [
      { id: "shipbillid", name: "运单id", type: "ro", width: "130", hidden: true },
      { id: "branchname", name: "配送中心", type: "ro", width: 120 },
      { id: "shipbillno", name: "运单编号", type: "ro", width: 120 },
      { id: "consignorname", name: "货主名称", type: "ro", width: 120 },
      { id: "billtype", name: "单据类型", type: "ro", width: 120 },
      { id: "linenane", name: "线路名称", type: "ro", width: 120 },
      { id: "billdate", name: "单据时间", type: "ro", width: 120 },
      { id: "refbillno", name: "业务单据号", type: "ro", width: 120 },
      { id: "refbilltype", name: "业务单据类型", type: "ro", width: 120 },
      { id: "shiptoCustomerName", name: "客户名称", type: "ro", width: 120 },
      { id: "shiptoAddress", name: "客户地址", type: "ro", width: 120 },
      { id: "rsumcases", name: "件数", type: "ro", width: 120 },
      { id: "rsumgoodsweight", name: "重量", type: "ro", width: 120 },
      { id: "rsumgoodsvol", name: "体积", type: "ro", width: 120 },
      { id: "memo", name: "备注", type: "ro", width: 120 }

      // { id: "shipbillno", name: "运单编号", type: "ro", width: 120 },
      // { id: "rrfshipbillid", name: "原运单id", type: "ro", width: 120 },
      // { id: "rrfshipbillno", name: "原运单编号", type: "ro", width: 120 },
      // { id: "fathershipbillno", name: "父运单编号", type: "ro", width: 120 },
      // { id: "branchid", name: "当前仓编号", type: "ro", width: 120 },
      // { id: "branchname", name: "当前仓名称", type: "ro", width: 120 },
      // { id: "consignor", name: "货主编号", type: "ro", width: 120 },
      // { id: "consignorname", name: "货主名称", type: "ro", width: 120 },
      // { id: "billtype", name: "单据类型", type: "ro", width: 120 },
      // { id: "billsource", name: "单据来源", type: "ro", width: 120 },
      // { id: "billdate", name: "单据时间", type: "ro", width: 120 },
      // { id: "lineno", name: "线路编号", type: "ro", width: 120 },
      // { id: "linenane", name: "线路名称", type: "ro", width: 120 },
      // { id: "loadbillno", name: "装车单号", type: "ro", width: 120 },
      // { id: "carrierid", name: "承运商id", type: "ro", width: 120 },
      // { id: "carriername", name: "承运商", type: "ro", width: 120 },
      // { id: "shiptoCustomerType", name: "目的客户类型", type: "ro", width: 120 },
      // { id: "shiptoCustomerId", name: "目的客户/个人id", type: "ro", width: 120 },
      // { id: "shiptoCustomerName", name: "目的客户/个人名称", type: "ro", width: 120 },
      // { id: "shiptoAddress", name: "目的详细地址", type: "ro", width: 120 },
      // { id: "reqshipmentdate", name: "预计发货日期", type: "ro", width: 120 },
      // { id: "reqarrivvaldate", name: "要求到货日期", type: "ro", width: 120 },
      // { id: "urgentIdentify", name: "紧急标识", type: "ro", width: 120 },
      // { id: "refbillid", name: "业务单据id", type: "ro", width: 120 },
      // { id: "refbillno", name: "业务单据号", type: "ro", width: 120 },
      // { id: "refbilltype", name: "业务单据类型", type: "ro", width: 120 },
      // { id: "rsumcases", name: "实际总件数", type: "ro", width: 120 },
      // { id: "rsumpcs", name: "实际整件数", type: "ro", width: 120 },
      // { id: "rsumboxnum", name: "实际拼箱数", type: "ro", width: 120 },
      // { id: "rsumgoodsqty", name: "实际货物总数量", type: "ro", width: 120 },
      // { id: "rsumgoodsweight", name: "实际货物总重量", type: "ro", width: 120 },
      // { id: "rsumgoodsvol", name: "实际货物总体积", type: "ro", width: 120 },
      // { id: "status", name: "状态", type: "ro", width: 120 },
      // { id: "memo", name: "备注", type: "ro", width: 120 }
      // {
      //   id: "status", name: "状态", type: "ro", width: 120, render: function (v) {
      //     return getSelectValue(dataSelect.AUDIT_STATUS, v);
      //   }
      // },
    ],
    toolbar: [
      { type: "settings", labelWidth: 70, labelAlign: "right" },
      {
        type: "row",
        list: [
          { type: "calendar", className: "layui-col-md3", name: "startTime", label: "开始时间:", value: startTime },
          { type: "calendar", className: "layui-col-md3", name: "endTime", label: "结束时间:", value: endTime },
          {
            type: "selectTable",
            className: "layui-col-md3",
            placeholder: "请选择配送中心",
            readonly: false,
            table: branchTable,
            tableWidth: 600,
            tableHeight: 500,
            fieldText: "companyname",
            fieldValue: "companyid",
            name: "branchidList",
            label: "配送中心:",
            listener: function (Grid) {
              setMethod(Grid, branchTable, function () { });
            }
          },

          { type: "input", className: "layui-col-md3", name: "shipbillno", label: "运单号:" },
          { type: "input", className: "layui-col-md3", name: "refbillno", label: "业务单号:" },
          {
            type: "selectTable",
            className: "layui-col-md3",
            placeholder: "请选择客户",
            readonly: false,
            table: customerTable,
            tableWidth: 600,
            tableHeight: 500,
            fieldText: "companyname",
            fieldValue: "companyid",
            name: "shiptoCustomerIdList",
            label: "客户:",
            listener: function (Grid) {
              setMethod(Grid, customerTable, function () { });
            }
          },
          {
            type: "block", className: "layui-col-md3 form_btn_left",
            list: [
              { type: "button", className: "btn-normal", name: "master_search", value: "查 询" },
              { type: "newcolumn" },
              { type: "button", name: "master_reset", value: "重 置" }
            ]
          },
          {
            type: "block", className: "layui-col-md3 right",
            list: [
              { type: "button", className: "btn-normal", name: "master_pickupTaskAssignment", value: "任务指派" }
            ]
          }
        ]
      }
    ],
    fixedLast: false, // 开启固定列，固定最后一行，倒数第二列不能隐藏
    multiselect: true, // 是否支持多选
    url: UPCLOUD_RDC_TMS_BUSINESS_SERVICE+"/dispatch/pickUpTaskAssignQuery", // 数据接口
    type: "post", // 数据提交方式，默认为get
    params: JSON.stringify({ startTime: startTime, endTime: endTime }), // 查询提交参数，分页参数默认为pageNum,pageSize
    page: true, // 是否启用分页
    contentType: "application/json",
    totalCount: "totalCount" // 总记录数字段，默认totalCount
  };
  master_grid = new PlgGrid(master_grid_opts);
  master_grid.renderTo("pickupTaskAssignment_master");
  master_grid.loadData();
  master_grid.attachToolBarEvent("onButtonClick", function (name) {
    switch (name) {
      case "master_search":
        var request = master_grid.getToolBarForm().getFormData();
        request.startTime = request.startTime ? Prolog.formatDate(request.startTime) + " 00:00:00" : "";
        request.endTime = request.endTime ? Prolog.formatDate(request.endTime) + " 23:59:59" : "";
        if (request.startTime > request.endTime) {
          layer.msg("开始时间不能大于结束时间");
          return false;
        }
        request.branchid = request.branchidList ? JSON.parse(request.branchidList)[0] : "";
        request.shiptoCustomerId = request.shiptoCustomerIdList ? JSON.parse(request.shiptoCustomerIdList)[0] : "";
        dealNullQueryCondition(request);
        delete request.branchidList;
        delete request.shiptoCustomerIdList;
        master_grid.setParams(JSON.stringify(request));
        master_grid.reload();
        break;
      case "master_reset":
        master_grid.getToolBarForm().clear();
        master_grid.getToolBarForm().setText("branchidList", "");
        master_grid.getToolBarForm().setText("shiptoCustomerIdList", "");
        master_grid.getToolBarForm().setFormData({ startTime: startTime, endTime: endTime });
        break;
      case "master_pickupTaskAssignment":
        var ids = master_grid.getCheckedIds();
        if (!ids) {
          layer.msg("请选择数据");
          return false;
        }
        var shiptoCustomerIdSet = new Set();
        ids.split(",").forEach(item => shiptoCustomerIdSet.add(master_grid.getRowData(item).shiptoCustomerId));
        if (shiptoCustomerIdSet.size > 1) {
          layer.msg("请选择相同客户的数据");
          return false;
        }
        pickupTaskAssignment(ids);
        break;
    }
  });
  // 提货任务指派
  function pickupTaskAssignment(ids) {
    selectedData = ids.split(",").map(item => {
      const element = master_grid.getRowData(item);
      return {
        shipbillid: element.shipbillid
      };
    });
    changePanel("#pickupTaskAssignment_edit");
    editGridInit();
    mapCreated(); // 初始化地图
  }

  // 编辑页grid
  edit_grid_opts = {
    skin: "card",
    columns: [
      { id: "INDEX", name: "运单id", type: "ro", width: "130", hidden: true },
      { id: "voucherno", name: "车牌号", type: "ro", width: 120 },
      { id: "departuretime", name: "发车时间", type: "ro", width: 120 },
      { id: "sendCustomer", name: "送货客户", type: "ro", width: 120 },
      { id: "sendPcs", name: "送货件数", type: "ro", width: 120 },
      { id: "sendCustomerc", name: "已送客户", type: "ro", width: 120 },
      { id: "sendPcsc", name: "已送件数", type: "ro", width: 120 }
    ],
    toolbar: [
      { type: "settings", labelWidth: 70, labelAlign: "right" },
      {
        type: "row",
        list: [
          { type: "input", className: "layui-col-md12", name: "loadbillno", label: "装车单号:" },
          { type: "input", className: "layui-col-md12", name: "voucherno", label: "车牌号:" },
          {
            type: "block", className: "layui-col-md12 form_btn_left",
            list: [
              { type: "button", className: "btn-normal", name: "edit_search", value: "查 询" },
              { type: "newcolumn" },
              { type: "button", className: "btn-normal", name: "edit_assignment", value: "任务指派" }
            ]
          }
        ]
      }
    ],
    beforeLoadData: function (res) {
      res.data.forEach((item, index) => {
        item.INDEX = index + "";
      });
      return res;
    },
    fixedLast: false, // 开启固定列，固定最后一行，倒数第二列不能隐藏
    multiselect: false, // 是否支持多选
    url: UPCLOUD_RDC_TMS_BUSINESS_SERVICE+"/dispatch/pickUpTaskVehicleQuery", // 数据接口
    type: "post", // 数据提交方式，默认为get
    params: "{}", // 查询提交参数，分页参数默认为pageNum,pageSize
    page: false, // 是否启用分页
    contentType: "application/json",
    totalCount: "totalCount" // 总记录数字段，默认totalCount
  };
  // 注册编辑页grid
  function editGridInit() {
    edit_grid = new PlgGrid(edit_grid_opts);
    edit_grid.loadData();
    edit_grid.renderTo("pickupTaskAssignment_edit_grid");
    edit_grid.attachToolBarEvent("onButtonClick", function (name) {
      switch (name) {
        case "edit_search":
          var request = edit_grid.getToolBarForm().getFormData();
          dealNullQueryCondition(request);
          edit_grid.setParams(JSON.stringify(request));
          edit_grid.reload();
          break;
        case "edit_assignment":
          var id = edit_grid.getSelectedRowId();
          if (!id) {
            layer.msg("请选择车辆");
            return false;
          }
          pickUpTaskAssignConfirm(id);
          break;
      }
    });
  }
  // 指派确认
  function pickUpTaskAssignConfirm(id) {
    const list = selectedData.map(item => {
      const element = edit_grid.getRowData(id);
      return Object.assign({}, item, { loadbillid: element.loadbillid, voucherno: element.voucherno });
    });

    let pload = PlgDialog.load(2, { shade: [0.6, "#fff"] });
    Prolog.ajax({
      url: UPCLOUD_RDC_TMS_BUSINESS_SERVICE+"/dispatch/pickUpTaskAssignConfirm", type: "post", contentType: "application/json", data: JSON.stringify(list),
      success: function (res) {
        PlgDialog.close(pload);
        if (res.success) {
          PlgDialog.msg(res.message);
          changePanel("#pickupTaskAssignment_main");
          master_grid.reload();
          return true;
        }
                return false;

      }, error: function () { PlgDialog.close(pload); return false; }
    });
  }

  // 编辑页地图
  //初始化方法
  function loadData() {

  }

  //#region 百度地图相关代码
  function loadDefulatMap(callback) {
    var point = new BMap.Point(116.404, 39.915); // 创建点坐标
    map.centerAndZoom(point, 15); // 初始化地图，设置中心点坐标和地图级别
    map.addControl(new BMap.NavigationControl());
    map.addControl(new BMap.ScaleControl());
    map.addControl(new BMap.OverviewMapControl());
    //map.addControl(new BMap.MapTypeControl()); //不同类型的百度地图
    map.setCurrentCity("北京"); // 仅当设置城市信息时，MapTypeControl的切换功能才能可用
    //地图加载完成后加载数据
    callback();
  }
  //地图选点点击事件
  function clickCoordinate(e) {
    var point = e.point;
    //请先选择省市区
    //var area = $(".store_Area").val();
    //if (area == null || area == "") {
    //    alert(baiduParam.SelectRegion_Error);
    //    return;
    //}
    createMarker(point);
  }
  function setPlace(value) {
    var local = new BMap.LocalSearch(map, { //智能搜索
      onSearchComplete: myFun
    });
    function myFun() {
      if (local.getResults().getPoi(0)) {
        var point = local.getResults().getPoi(0).point; //获取第一个智能搜索的结果
        createMarker(point);
      }
      else {
        alert("未搜索到结果，请重新输入");
      }
    }
    local.search(value);
  }

  var baiduParam = {
    oldPoint: null,//记录旧值,用于地图拖拽失败后回到原来位置
    Exceed_Error: "定位地址失败，您搜索或定位超出县级范围，请重新选择定位",
    SelectRegion_Error: "定位地址失败，您搜索或定位超出县级范围，请先选择省市区",
    Location_Div: "<div id='descConten'>已将坐标定位为<hr/>{address}<br/><small style='color: #858585;line-height: 24px;'>地址：{title}</small><br/><br/><input type='button' value='确定' id='saveLngLat' style=' background: rgb(135,205,208);border: none;color: white;height: 30px;width: 60px;border-radius: 4px;' ></div> ",
    Location_Sure_Div: "<img style='width:20px;top: 5px;position: relative;'  src='img/success.png' />已将坐标定位为<hr/>{address}<br/><small style='color: #858585;line-height: 24px;'>地址：{title}</small><br/><br/>"
  };

  function createMarker(point, isLoad) {
    //反向解析地址
    myGeo.getLocation(point, function (rs) {
      map.clearOverlays();//清除之前所有的标志

      //红点开始
      var marker = new BMap.Marker(point);// 创建标注
      map.addOverlay(marker); // 将标注添加到地图中
      marker.enableDragging();//可拖拽 自定义拖拽
      //拖拽前事件
      marker.addEventListener("dragstart", function (e) {
        baiduParam.oldPoint = e.point;
      });
      //拖拽完成事件
      marker.addEventListener("dragend", function (e) {
        createMarker(e.point);
      });
      //红点完成

      baiduParam.oldPoint = null;
      /******** 图层初始化 ********/
      /**图层样式文字处理开始**/
      var html = baiduParam.Location_Div;
      if (isLoad == true) {
        map.centerAndZoom(point, map.getZoom()); //重置地图位置
        html = baiduParam.Location_Sure_Div;
      }
      //解析地址
      var rsaddress = rs.address;
      var rstitle = rs.surroundingPois[0] != null ? rs.surroundingPois[0].title : "";
      html = html.replace("{address}", rsaddress).replace("{title}", rstitle);
      /**图层样式文字处理结束**/
      // let dataItem = {
      //   newLongitude: point.lng,
      //   newLatitude: point.lat,
      //   newAddress: rsaddress,
      //   city: rs.addressComponents.city,
      //   district: rs.addressComponents.district,
      //   province: rs.addressComponents.province,
      //   town: rs.addressComponents.street
      // };
      // PoSingle_from1.setFormData(dataItem);
      var infoWindow = new BMap.InfoWindow(html, { offset: { width: 0, height: -25 } });
      // 创建信息窗口对象
      map.openInfoWindow(infoWindow, point); //开启信息窗口
      //确定事件绑定
      infoWindow.addEventListener("open", function () {
        $("#saveLngLat").unbind("click");
        $("#saveLngLat").click(function () {
          infoWindow.setContent("<img style='width:20px;top: -2px;position: relative;' src='img/success.png' />已将坐标定位为<hr/>" + rs.address + "<br/><small style='color: #858585;line-height: 24px;'>地址：" + (rs.surroundingPois[0] != null ? rs.surroundingPois[0].title : "") + "</small><br/><br/>");
          $(".store_Lng").val(rs.point.lng);
          $(".store_Lat").val(rs.point.lat);
        });
      });
      infoWindow.redraw(function () {
        $("#saveLngLat").unbind("click");
        $("#saveLngLat").click(function () {
          infoWindow.setContent("<img style='width:20px;top: -2px;position: relative;'  src='img/success.png' />已将坐标定位为<hr/>" + rs.address + "<br/><small style='color: #858585;line-height: 24px;'>地址：" + (rs.surroundingPois[0] != null ? rs.surroundingPois[0].title : "") + "</small><br/><br/>");
          $(".store_Lng").val(rs.point.lng);
          $(".store_Lat").val(rs.point.lat);
        });
      });
      /******** 图层初始化 ********/
    });
  }
  //#region /****查询控件类****/
  function BigZoomControl() {
    // 设置默认停靠位置和偏移量
    this.defaultAnchor = BMAP_ANCHOR_TOP_RIGHT;
    this.defaultOffset = new BMap.Size(150, 20);
  }
  setTimeout(() => {

  }, 1000);

  // 初始化地图
  function mapCreated() {
    // 通过JavaScript的prototype属性继承于BMap.Control
    BigZoomControl.prototype = new BMap.Control();
    // 自定义控件必须实现自己的initialize方法,并且将控件的DOM元素返回
    // 在本方法中创建个div元素作为控件的容器,并将其添加到地图容器中
    BigZoomControl.prototype.initialize = function (map) {
      // 创建一个DOM元素
      var div = document.createElement("div");
      // 设置样式
      div.style.cursor = "pointer";
      div.style.margin = "0 auto";
      div.style.backgroundColor = "white";
      div.innerHTML = "<div><input type='text' id = 'baiduAddress' name = 'baiduAddress' style='width: 350px;height: 33px;text-indent:1em;float:left;border: 1px solid #D2D2D2!important;border-right:none;' placeholder='输入门店详细地址, 越详细定位越精准' /><div  class='searchMap' style='border:1px solid #f50;background-color:#f50;width:60px;height:33px;float:left;'></div><img  class='searchMap' src='img/search.png' style='height: 22px;position: absolute;right: 18px;top: 7px;'/><div style='clear:both'></div></div>";
      // 添加DOM元素到地图中
      map.getContainer().appendChild(div);
      // 将DOM元素返回
      return div;
    };
    //#endregion
    //#endregion

    //#region 百度地图初始化
    /****************百度地图初始化开始****************/
    map = new BMap.Map("pickupTaskAssignment_edit_map");
    map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放
    // 创建地址解析器实例
    myGeo = new BMap.Geocoder();
    loadDefulatMap(loadData);//初始化地图以及加载初始化数据
    // 创建控件
    var myZoomCtrl = new BigZoomControl();
    //// 查询控件类到地图当中
    map.addControl(myZoomCtrl);
    //查询控件的点击事件
    $(".searchMap").click(function () {
      setPlace($("#baiduAddress").val());
    });
    // bindEvent();
    // function bindEvent() {
    //   //查询百度地图
    //   map.addEventListener("click", clickCoordinate); //地图点击事件
    // }
    /****************百度地图初始化完成****************/
  }
};