var app = getApp();
var $ = require('../../../js/util.js');
Page({
  data: {
    is_show: 0,
    is_inp: 0,
    param:{},
    info:[],
    ship_info:[]
  },
  open_input: function () {
    var self = this;
    self.setData({
      is_inp: 1,
    })
  },
  open_show: function () {
    var self = this;
    self.setData({
      is_show: 1,
    })
  },
  onLoad:function(options){
    var self=this;
    var param=self.data.param;
      if(options.id){
        param.id = options.id
      }
    if (options.code) {
      param.code = options.code
    }
    if (options.sn) {
      param.sn = options.sn
    }
    self.setData({
      param:param
    })
    self.gotoSend();
  },
  gotoSend: function () {
    var self = this;
    app.showLoading('加载中...');
    var action = 'c=Member&a=doexpress';
    app.ajaxRequest(action, 'GET', $.ObjectToStr(self.data.param), function (ret) {
      console.log(ret);
      if (ret.status == 1) {
      self.setData({
          info: ret.data.data,
        ship_info: ret.ship_info
        })
      } else {
        app.HCerror('提示', ret.msg); return;
      }
    }, true);
  }
})