require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/discover/components/associatedProduct"],{"2f79":function(e,t,i){},5721:function(e,t,i){"use strict";i.d(t,"b",(function(){return c})),i.d(t,"c",(function(){return o})),i.d(t,"a",(function(){}));var c=function(){var e=this,t=e.$createElement,i=(e._self._c,0==e.isActive?e.bought.length:null),c=0==e.isActive?0===e.bought.length&&!e.loadingb:null,o=1==e.isActive?e.collect.length:null,n=1==e.isActive?0===e.collect.length&&!e.loadingc:null,s=2==e.isActive?e.browse.length:null,l=2==e.isActive?0===e.browse.length&&!e.loadings:null,h=0==e.isActive&&e.bought.length>0||1==e.isActive&&e.collect.length>0||2==e.isActive&&e.browse.length>0,d=e.checkedArr.length;e.$mp.data=Object.assign({},{$root:{g0:i,g1:c,g2:o,g3:n,g4:s,g5:l,g6:h,g7:d}})},o=[]},"5f15":function(e,t,i){"use strict";var c=i("2f79"),o=i.n(c);o.a},"65fc":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var c=i("de22"),o=(i("51a2"),i("8f59"),getApp()),n={props:{checkedObj:{type:Array,default:[]}},data:function(){return{urlDomain:this.$Cache.get("imgHost"),loadTitle:"加载更多",theme:o.globalData.theme,isActive:0,loadedb:!1,loadingb:!1,loadedc:!1,loadingc:!1,loadeds:!1,loadings:!1,whereb:{page:1,limit:10},wherec:{page:1,limit:10},wheres:{page:1,limit:10},searchVal:"",checked:[],list:[],collect:[],bought:[],browse:[],checkedArr:this.checkedObj,disabled:!1}},watch:{checkedObj:{handler:function(e){this.checkedArr=e},deep:!0}},mounted:function(){this.checkedArr=this.checkedObj,this.getBounht(),this.getCollect(),this.getBrowse()},methods:{onScrolltolower:function(){0==this.isActive?this.getBounht():1==this.isActive?this.getCollect():this.getBrowse()},close:function(){this.$emit("close")},tabs:function(e){this.isActive=e,this.searchVal="",this.searchBut()},searchBut:function(){this.loadingb=this.loadingc=this.loadings=this.loadedb=this.loadedc=this.loadeds=!1,this.whereb.page=this.wherec.page=this.wheres.page=1,this.bought=this.collect=this.browse=[],0==this.isActive?this.getBounht():1==this.isActive?this.getCollect():this.getBrowse()},getBounht:function(){var e=this;e.loadingb||e.loadedb||(e.loadingb=!0,(0,c.purchasedApi)(e.whereb).then((function(t){e.loadedb=t.data.list.length<e.whereb.limit,e.bought.push.apply(e.bought,t.data.list),e.whereb.page=e.whereb.page+1,e.loadTitle=e.loadedb?"没有了":"加载更多",e.getInitchecked(e.bought),e.loadingb=!1}),(function(t){e.$util.Tips({title:t})})))},getCollect:function(){var e=this;e.loadingc||e.loadedc||(e.loadingc=!0,(0,c.getCollectUserList)(e.wherec).then((function(t){e.loadedc=t.data.list.length<e.wherec.limit,e.collect.push.apply(e.collect,t.data.list),e.wherec.page=e.wherec.page+1,e.loadTitle=e.loadedc?"没有了":"加载更多",e.getInitchecked(e.collect),e.loadingc=!1}),(function(t){e.$util.Tips({title:t})})))},getBrowse:function(){var e=this;e.loadings||e.loadeds||(e.loadings=!0,(0,c.proBrowseApi)(e.wheres).then((function(t){e.loadeds=t.data.list.length<e.wheres.limit,e.browse.push.apply(e.browse,t.data.list),e.wheres.page=e.wheres.page+1,e.loadTitle=e.loadeds?"没有了":"加载更多",e.getInitchecked(e.browse),e.loadings=!1}),(function(t){e.$util.Tips({title:t})})))},getInitchecked:function(e){var t=this;e.forEach((function(e,i){t.$set(e,"check",!1),t.checkedArr.forEach((function(i,c){e.productId==i.productId&&t.$set(e,"check",!0)}))}))},goodsCheck:function(e,t,i){var c=this;this.checkedArr.length>4&&!e.check||(i.forEach((function(t,i){t.productId==e.productId&&c.$set(t,"check",!t.check)})),e.check?this.checkedArr.push(e):this.checkedArr.splice(this.checkedArr.findIndex((function(t){return t.productId==e.productId})),1),this.disabled=this.checkedArr.length>4)},submit:function(){this.$emit("getProduct",this.checkedArr)}}};t.default=n},"7bb6":function(e,t,i){"use strict";i.r(t);var c=i("5721"),o=i("b910");for(var n in o)["default"].indexOf(n)<0&&function(e){i.d(t,e,(function(){return o[e]}))}(n);i("5f15");var s=i("828b"),l=Object(s["a"])(o["default"],c["b"],c["c"],!1,null,"3c3c384c",null,!1,c["a"],void 0);t["default"]=l.exports},b910:function(e,t,i){"use strict";i.r(t);var c=i("65fc"),o=i.n(c);for(var n in c)["default"].indexOf(n)<0&&function(e){i.d(t,e,(function(){return c[e]}))}(n);t["default"]=o.a}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'pages/discover/components/associatedProduct-create-component',
    {
        'pages/discover/components/associatedProduct-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('df3c')['createComponent'](__webpack_require__("7bb6"))
        })
    },
    [['pages/discover/components/associatedProduct-create-component']]
]);
