(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/warehouse/warehouse-select"],{2803:function(e,n,t){"use strict";var o=t("a41f"),r=t.n(o);r.a},"40be":function(e,n,t){"use strict";(function(e){var o=t("47a9");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(t("7eb4")),a=o(t("34cf")),s=o(t("ee10")),u={data:function(){return{warehouses:[],loading:!0,phoneNumber:""}},onLoad:function(){if(this.phoneNumber=e.getStorageSync("phoneNumber"),!this.phoneNumber)return e.showToast({title:"登录信息无效，请重新登录",icon:"none"}),void e.redirectTo("/pages/login/index");this.fetchWarehouses()},methods:{fetchWarehouses:function(){var n=this;return(0,s.default)(r.default.mark((function t(){var o,s,u,c;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,console.log("开始获取仓库列表，手机号:",n.phoneNumber),n.loading=!0,t.next=5,e.request({url:"https://api.buzhiyushu.cn/shelves/shelves/namelist",method:"GET",data:{phone:n.phoneNumber}});case 5:if(o=t.sent,s=(0,a.default)(o,2),u=s[0],c=s[1],console.log("response",c),n.loading=!1,!u){t.next=15;break}return console.error("请求发生错误:",u),e.showToast({title:"获取仓库列表失败",icon:"none"}),t.abrupt("return");case 15:if(console.log("API响应完整数据:",c),c&&c.data){t.next=20;break}return console.error("响应数据为空"),e.showToast({title:"获取仓库列表失败",icon:"none"}),t.abrupt("return");case 20:if(console.log("响应数据:",c.data),c.data.rows){t.next=25;break}return console.error("rows数据为空"),e.showToast({title:"暂无可用仓库",icon:"none"}),t.abrupt("return");case 25:n.warehouses=c.data.rows||[],console.log("解析后的仓库数据:",n.warehouses),t.next=34;break;case 29:t.prev=29,t.t0=t["catch"](0),console.error("获取仓库列表失败:",t.t0),n.loading=!1,e.showToast({title:"获取仓库列表失败",icon:"none"});case 34:case"end":return t.stop()}}),t,null,[[0,29]])})))()},selectWarehouse:function(n){console.log("选择仓库:",n),e.setStorageSync("selectedWarehouse",n),e.switchTab({url:"/pages/index/index",success:function(){console.log("成功跳转到首页")},fail:function(n){console.error("跳转到首页失败:",n),e.navigateTo({url:"/pages/index/index"})}})}}};n.default=u}).call(this,t("df3c")["default"])},5800:function(e,n,t){"use strict";t.r(n);var o=t("40be"),r=t.n(o);for(var a in o)["default"].indexOf(a)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(a);n["default"]=r.a},"730f":function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"c",(function(){return r})),t.d(n,"a",(function(){}));var o=function(){var e=this.$createElement,n=(this._self._c,this.loading?null:this.warehouses.length);this.$mp.data=Object.assign({},{$root:{g0:n}})},r=[]},a41f:function(e,n,t){},b509:function(e,n,t){"use strict";(function(e,n){var o=t("47a9");t("4058");o(t("3240"));var r=o(t("f220"));e.__webpack_require_UNI_MP_PLUGIN__=t,n(r.default)}).call(this,t("3223")["default"],t("df3c")["createPage"])},f220:function(e,n,t){"use strict";t.r(n);var o=t("730f"),r=t("5800");for(var a in r)["default"].indexOf(a)<0&&function(e){t.d(n,e,(function(){return r[e]}))}(a);t("2803");var s=t("828b"),u=Object(s["a"])(r["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);n["default"]=u.exports}},[["b509","common/runtime","common/vendor"]]]);