webpackJsonp([59],{CP7u:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r("woOf"),n=r.n(i),s=r("Dd8w"),a=r.n(s),c=r("UgCr"),o=r("c+FZ"),u=r("G/zf"),m=r("NYxO"),d={data:function(){return{recommendList:[],listParams:{page:0,per_page:10},loading:!1,isMore:!0,quantity:0}},components:{"v-recommend-list":u.a},created:function(){var t=this;this.$on("get-cart-quantity",function(){t.getCarNumber()})},computed:Object(m.e)({user:function(t){return t.auth.user},cartNumber:function(t){return t.tabBar.cartNumber}}),mounted:function(){},methods:a()({},Object(m.d)({setCartNumber:"setCartNumber"}),{getCarNumber:function(){var t=this;Object(o.f)().then(function(e){e&&t.setCartNumber(e.quantity)})},goBack:function(){this.$router.go(-1)},recommendProductList:function(){var t=this,e=n()({},this.listParams,this.$route.query);Object(c.d)(e.product,e.page,e.per_page).then(function(e){e&&(t.recommendList=t.recommendList.concat(e.products),t.isMore=e.paged.more)})},getMore:function(){this.loading=!0,this.listParams.page=++this.listParams.page,this.isMore&&(this.loading=!1,this.recommendProductList(!0))},goCart:function(){this.user?this.$router.push({name:"cart",params:{type:0}}):this.$router.push({name:"signin"})}})},l={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"recommend-wrapper"},[i("div",{staticClass:"ui-commmon-header"},[i("img",{staticClass:"ui-go-back",attrs:{src:r("Vbkh")},on:{click:function(e){t.goBack()}}}),t._v(" "),i("h3",[t._v("相关搭配")]),t._v(" "),i("img",{staticClass:"ui-cart",attrs:{src:r("6B49")},on:{click:function(e){t.goCart()}}}),t._v(" "),t.cartNumber<=100&&t.cartNumber>0?i("span",{staticClass:"cart-number"},[t._v(t._s(t.cartNumber))]):t._e(),t._v(" "),t.cartNumber>=100&&t.cartNumber>0?i("span",{staticClass:"cart-number"},[t._v("99+")]):t._e()]),t._v(" "),i("div",{directives:[{name:"infinite-scroll",rawName:"v-infinite-scroll",value:t.getMore,expression:"getMore"}],staticClass:"ui-recommend-body",attrs:{"infinite-scroll-disabled":"loading","infinite-scroll-distance":"10"}},[t._l(t.recommendList,function(t,e){return i("v-recommend-list",{key:e,attrs:{item:t,productId:t.id}})}),t._v(" "),t.isMore?t._e():i("p",{staticClass:"recommend-no-more"},[t._v("没有更多了")])],2)])},staticRenderFns:[]};var f=r("VU/8")(d,l,!1,function(t){r("z6s1")},"data-v-328f8b52",null);e.default=f.exports},z6s1:function(t,e){}});
//# sourceMappingURL=59.e8e7c915d434a33994f5.js.map