(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/stock/update/update"],{"04ab":function(t,e,n){"use strict";var o=n("62a0"),i=n.n(o);i.a},"1b0f":function(t,e,n){"use strict";var o;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return o}));var i=function(){var t=this,e=t.$createElement;t._self._c},a=[]},"2afb":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n("2f62");function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var c={data:function(){return{iphone_x:!1,user:{},up_type:"",loading:!1,canUp:!1,up:{},success:!1,page:2,width:-25,setting:{},page_count:1,list:[]}},computed:a({},(0,o.mapState)({stock:function(t){return t.mallConfig.__wxapp_img.stock},mall:function(t){return t.mallConfig.mall},userInfo:function(t){return t.user.info}})),methods:{getList:function(){var e=this;e.$request({url:e.$api.stock.level}).then((function(n){0==n.code?function(){e.user=n.data.user,e.up_type=n.data.up_type;var t=n.data.list;e.page_count=n.data.pagination.page_count;var o=e.user.condition.toString();e.width=-20-5*o.length;var i=0;if(e.success=!1,0==t.length)e.$hideLoading();else for(var a in t)t[a].up=!0,i++,+t[a].condition>+e.user.condition&&(t[a].up=!1,i--),a==t.length-1&&setTimeout((function(){e.list=t,e.$hideLoading()}),200);i>0&&(e.canUp=!0)}():(e.$hideLoading(),t.showToast({title:n.msg,icon:"none",duration:1e3}))})).catch((function(t){e.$hideLoading()}))},toUpdate:function(){var e=this,n=this;t.showLoading({mask:!0,title:"加载中..."}),n.$request({url:n.$api.stock.up}).then((function(o){t.hideLoading(),0==o.code?(n.up=o.data,e.success=!0,e.canUp=!1):t.showToast({title:o.msg,icon:"none",duration:1e3})}))},getMore:function(){var e=this;if(this.loading)return!1;if(this.page>this.page_count)return!1;var n=this;t.showLoading({mask:!0,title:"加载中..."}),n.loading=!0,n.$request({url:n.$api.stock.level,data:{page:this.page}}).then((function(o){e.loading=!1,0==o.code?function(){var e=o.data.list,i=0;if(0==e.length)t.hideLoading();else for(var a in n.page++,e)e[a].up=!0,i++,+e[a].condition>+n.user.condition&&(e[a].up=!1,i--),a==e.length-1&&setTimeout((function(){n.list=n.list.concat(e),n.$forceUpdate(),t.hideLoading()}),200);i>0&&(n.canUp=!0)}():(t.hideLoading(),t.showToast({title:o.msg,icon:"none",duration:1e3}))})).catch((function(n){e.loading=!1,t.hideLoading()}))},getSetting:function(){var e=this;e.$showLoading({type:"global",text:"加载中..."}),e.$request({url:e.$api.stock.setting}).then((function(n){e.getList(),0==n.code?e.setting=n.data:t.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(n){e.$hideLoading(),t.hideLoading()}))}},onReachBottom:function(){this.getMore()},onLoad:function(e){this.$commonLoad.onload(e);var n=this;t.getSystemInfo({success:function(t){(t.model.indexOf("iPhone X")>-1||t.model.indexOf("iPhone 11")>-1||t.model.indexOf("iPhone11")>-1||t.model.indexOf("iPhone12")>-1||t.model.indexOf("Unknown Device")>-1)&&(n.iphone_x=!0)}}),n.getSetting()}};e.default=c}).call(this,n("543d")["default"])},"62a0":function(t,e,n){},c567:function(t,e,n){"use strict";(function(t){n("2d0a");o(n("66fd"));var e=o(n("f7e7"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},f093:function(t,e,n){"use strict";n.r(e);var o=n("2afb"),i=n.n(o);for(var a in o)"default"!==a&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=i.a},f7e7:function(t,e,n){"use strict";n.r(e);var o=n("1b0f"),i=n("f093");for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);n("04ab");var r,c=n("f0c5"),u=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,"3bd1b3fe",null,!1,o["a"],r);e["default"]=u.exports}},[["c567","common/runtime","common/vendor"]]]);