1 line
5.6 KiB
JavaScript
1 line
5.6 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/shop"],{"026c":function(t,e,n){"use strict";(function(t){var i=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("2eee")),o=i(n("9523")),r=i(n("c973")),s=n("26cb");function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){(0,o.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var f={components:{},data:function(){return{isLoad:!1,options:{},storeInfo:{},tabList:[],activeIndex:0,cate_id:0,shopHeight:0,param:{page:1,cate_id:0},list:{data:[]},loading:!0,lockTap:!1,show_rank_item:!1}},computed:(0,s.mapState)({primaryColor:function(t){return t.config.configInfo.primaryColor},subColor:function(t){return t.config.configInfo.subColor},configInfo:function(t){return t.config.configInfo},userInfo:function(t){return t.user.userInfo},shopCarList:function(t){return t.order.shopCarList},loginType:function(t){return t.user.loginType}}),onLoad:function(){var t=this;return(0,r.default)(a.default.mark((function e(){return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.$util.showLoading(),e.next=3,t.initIndex();case 3:case"end":return e.stop()}}),e)})))()},onPullDownRefresh:function(){t.showNavigationBarLoading(),this.initRefresh(),t.stopPullDownRefresh(),this.show_rank_item&&this.$refs.rank_item.close()},onReachBottom:function(){this.list.current_page>=this.list.last_page||this.loading||(this.param.page=this.param.page+1,this.loading=!0,this.getList())},methods:u(u(u({},(0,s.mapActions)(["getConfigInfo","updateCommonOptions","getShopCarList"])),(0,s.mapMutations)(["updateUserItem"])),{},{initIndex:function(){var t=arguments,e=this;return(0,r.default)(a.default.mark((function n(){var i,o,r;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(i=t.length>0&&void 0!==t[0]&&t[0],e.configInfo.id&&!i){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.$api.shop.goodsIndex();case 7:return o=n.sent,r=o.cate_id,r.unshift({id:0,title:"全部"}),e.isLoad=!0,e.tabList=r,e.param.page=1,n.next=15,Promise.all([e.getShopCarList(),e.getList()]);case 15:e.toSetResHeight();case 16:case"end":return n.stop()}}),n)})))()},initRefresh:function(){this.param.page=1,this.initIndex(!0)},getList:function(){var t=this;return(0,r.default)(a.default.mark((function e(){var n,i,o,r,s,c,u;return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=t.list,i=t.tabList,t.activeIndex,r=t.cate_id,s=i.findIndex((function(t){return t.id==r})),r=-1==s?0:r,o=-1==s?0:s,t.cate_id=r,t.activeIndex=o,c=Object.assign({},t.param,{cate_id:r}),e.next=9,t.$api.shop.goodsList(c);case 9:u=e.sent,1==t.param.page||(u.data=n.data.concat(u.data)),t.list=u,t.loading=!1,t.$util.hideAll();case 13:case"end":return e.stop()}}),e)})))()},toSearch:function(t){this.loading=!0,this.param.page=1,this.param.goods_name=t,this.getList()},toSetResHeight:function(){var e=this;return(0,r.default)(a.default.mark((function n(){var i;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:i=t.createSelectorQuery(),i.select(".shop-search-info").boundingClientRect((function(t){e.shopHeight=t.height-40})).exec();case 2:case"end":return n.stop()}}),n)})))()},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)},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()},goDetail:function(t){var e=this.list.data[t].id,n="/shop/pages/detail?id=".concat(e);this.$util.toCheckLogin({url:n})}})};e.default=f}).call(this,n("543d")["default"])},"1f69":function(t,e,n){"use strict";n.r(e);var i=n("7eb1"),a=n("68fc");for(var o in a)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(o);n("f437");var r=n("f0c5"),s=Object(r["a"])(a["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);e["default"]=s.exports},"68fc":function(t,e,n){"use strict";n.r(e);var i=n("026c"),a=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=a.a},"7eb1":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.tabList.length),i=t.loading?t.list.current_page>=t.list.last_page&&t.list.data.length>0:null,a=!t.loading&&t.list.data.length<=0&&1==t.list.current_page;t._isMounted||(t.e0=function(e){return e.stopPropagation(),t.$util.toCheckLogin({url:"/shop/pages/car"})}),t.$mp.data=Object.assign({},{$root:{g0:n,g1:i,g2:a}})},a=[]},"87e9":function(t,e,n){"use strict";(function(t,e){var i=n("4ea4");n("b03e");i(n("66fd"));var a=i(n("1f69"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(a.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},c3f4:function(t,e,n){},f437:function(t,e,n){"use strict";var i=n("c3f4"),a=n.n(i);a.a}},[["87e9","common/runtime","common/vendor"]]]); |