(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/claim"],{"68ed":function(t,e,n){"use strict";(function(t){var a=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=a(n("2eee")),r=a(n("9523")),o=a(n("278c")),c=a(n("c973")),s=n("26cb");function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function l(t){for(var e=1;e=this.list.last_page||this.loading||(this.param.page=this.param.page+1,this.loading=!0,this.getList())},onShareAppMessage:function(t){var e=this.userInfo.id,n="/pages/claim?pid=".concat(e);return this.$util.log(n),{title:"",imageUrl:"",path:n}},methods:l(l(l({},(0,s.mapActions)(["getConfigInfo"])),(0,s.mapMutations)(["updateUserItem"])),{},{initIndex:function(){var t=arguments,e=this;return(0,c.default)(i.default.mark((function n(){var a,r,c,s,u;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(a=t.length>0&&void 0!==t[0]&&t[0],e.configInfo.id&&!a){n.next=5;break}return n.next=4,e.getConfigInfo();case 4:"apple"==e.loginType&&e.updateUserItem({key:"isShowLogin",val:!1});case 5:return n.next=7,e.getLocation();case 7:return n.next=9,Promise.all([e.$api.claim.claimBanner({type:3}),e.$api.claim.claimCateList({type:2})]);case 9:r=n.sent,c=(0,o.default)(r,2),s=c[0],u=c[1],u.unshift({id:0,title:"全部"}),e.banner=s,e.tabList=u,e.isLoad=!0,e.refresh=!1,e.param.page=1,e.getList();case 20:case"end":return n.stop()}}),n)})))()},initRefresh:function(){this.refresh=!0,this.$refs.rank_item.close(),this.initIndex(!0)},getLocation:function(){var t=this;return(0,c.default)(i.default.mark((function e(){var n;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.location,n.lat){e.next=6;break}return e.next=4,t.$util.getBmapLocation();case 4:n=e.sent,t.updateUserItem({key:"location",val:n});case 6:case"end":return e.stop()}}),e)})))()},handerTabChange:function(t,e){this[e]=t,this.$refs.rank_item.close(),"activeIndex"==e&&(this.cate_id=this.tabList[t].id),this.$util.showLoading(),this.param.page=1,this.list.data=[],this.getList()},toShowRank:function(){var t=this,e=this.show_rank_item;this.lockTap||(this.lockTap=!0,setTimeout((function(){var n=e?"close":"open";t.$refs.rank_item[n]()}),500))},popupChange:function(t){var e=this,n=t.show;this.show_rank_item=n,setTimeout((function(){e.lockTap=!1}),200)},getList:function(){var t=this;return(0,c.default)(i.default.mark((function e(){var n,a,r,o,c,s,u,l,f,d,p,h,g,m,v;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.list,a=t.param,r=t.tabList,t.activeIndex,c=t.rankList,s=t.rankInd,u=t.cate_id,l=r.findIndex((function(t){return t.id==u})),u=-1==l?0:u,o=-1==l?0:l,t.cate_id=u,t.activeIndex=o,f=c[s].id,3!=f||t.location.lat){e.next=12;break}return t.$util.hideAll(),e.next=11,t.getLocation();case 11:return e.abrupt("return");case 12:return d=t.location,p=d.lng,h=void 0===p?0:p,g=d.lat,m=void 0===g?0:g,a=Object.assign({},a,{cate_id:u,sort:f}),3===f&&(a.lat=m,a.lng=h),e.next=17,t.$api.claim.claimList(a);case 17:v=e.sent,v.data.map((function(t){var e=t.stock,n=t.sale_num;t.precent=(n/(e+n)*100).toFixed(2)+"%"})),1==t.param.page||(v.data=n.data.concat(v.data)),t.list=v,t.loading=!1,t.$util.hideAll();case 22:case"end":return e.stop()}}),e)})))()},goDetail:function(t){var e=this;return(0,c.default)(i.default.mark((function n(){var a,r;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:a=e.list.data[t].id,r="/claim/pages/detail?id=".concat(a),e.$util.toCheckLogin({url:r});case 3:case"end":return n.stop()}}),n)})))()}})};e.default=f}).call(this,n("543d")["default"])},"7a49":function(t,e,n){"use strict";(function(t,e){var a=n("4ea4");n("b03e");a(n("66fd"));var i=a(n("8c20"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(i.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},"7a58":function(t,e,n){"use strict";var a=n("8cdd"),i=n.n(a);i.a},"8c20":function(t,e,n){"use strict";n.r(e);var a=n("e9d2"),i=n("8d8e");for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);n("7a58");var o=n("f0c5"),c=Object(o["a"])(i["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],void 0);e["default"]=c.exports},"8cdd":function(t,e,n){},"8d8e":function(t,e,n){"use strict";n.r(e);var a=n("68ed"),i=n.n(a);for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);e["default"]=i.a},e9d2:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,n=(t._self._c,t.isLoad?t.banner.length:null),a=t.isLoad?t.banner.length:null,i=t.isLoad&&t.loading?t.list.current_page>=t.list.last_page&&t.list.data.length>0:null,r=t.isLoad?!t.loading&&t.list.data.length<=0&&1==t.list.current_page:null;t.$mp.data=Object.assign({},{$root:{g0:n,g1:a,g2:i,g3:r}})},i=[]}},[["7a49","common/runtime","common/vendor"]]]);