// common/nyz_area_picker/nyz_area_picker.js
var network = require("../../utils/network.js");
const baseUrl = require('../../api/index.js').config;
const Method = require('../../api/method.js').Method;
const order = require('../../api/order.js');
var app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    show:{    //控制area_select显示隐藏
      type:Boolean,
      value:false
    },
    maskShow:{    //是否显示蒙层
      type: Boolean,
      value: true
    },
    orderProgress:{
      type: Array,
      value:'',

    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },
  // 组件的生命周期
  lifetimes: {
    
    // attached: function () { 
    //   var that = this;
    //   var type = that.properties.orderType;
    //   console.log(that.data.index);
    //   if(type==1)
    //   {
    //     console.log('这是外卖');
    //     var memberId = wx.getStorageSync('memberId');
    //     order.takeCurrentdetail(baseUrl.waimaiUrl + '/client/' + memberId + '/order/waimai/' + that.data.orderid, {}, {}, '加载中',
    //       function (res) {
    //         var result = res.results;
    //         that.setData({
    //           orderlist: result,
    //           foodlist: result.foodItemVoList,
    //           statusToCNMap: map.orderStatus(),
    //           riderlist: result.riderInfoDto,
    //           typeToCNMap: map.orderType(),
    //           ordertype: result.orderType

    //         })
    //         console.log(result);
    //       },
    //       function (err) {
    //         wx.showToast({
    //           title: '失败',
    //         })
    //       }
    //     )
    //   }
    //   else{
    //     console.log('这是自提')
    //     var memberId = wx.getStorageSync('memberId');
    //     order.takeSelfdetail(baseUrl.waimaiUrl + '/client/' + memberId + '/order/ziti/' + that.data.orderid, {}, {}, '加载中',
    //       function (res) {
    //         var result = res.results;
    //         that.setData({
    //           orderlist: result,
    //           foodlist: result.foodItemVoList,
    //           statusToCNMap: map.orderStatus(),
    //           typeToCNMap: map.orderType(),
    //         })
    //         console.log(result);
    //       },
    //       function (err) {
    //         wx.showToast({
    //           title: '失败',
    //         })
    //       }
    //     )
    //   }
    // }
  },
  
  /**
   * 组件的方法列表
   */
  methods: {
    /**
     * 确定按钮的点击事件
     */
    handleNYZAreaSelect:function(e){
      //console.log("e:" + JSON.stringify(e));
      var myEventDetail = e; // detail对象，提供给事件监听函数
      var myEventOption = {}; // 触发事件的选项
      this.triggerEvent('sureSelectArea', myEventDetail, myEventOption)
    },
    /**
     * 取消按钮的点击事件
     */
    handleNYZAreaCancle:function(e){
      var that = this;
      console.log("e:" + JSON.stringify(e))
      that.setData({
        show:false
      })
    },

  }
})
