require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/discover/components/discover_topic"],{1894:function(t,e,i){"use strict";i.r(e);var o=i("7fdc"),c=i("c5c0");for(var s in c)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return c[t]}))}(s);i("4636");var n=i("828b"),a=Object(n["a"])(c["default"],o["b"],o["c"],!1,null,"d1840724",null,!1,o["a"],void 0);e["default"]=a.exports},"1f03":function(t,e,i){"use strict";var o=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var c=o(i("af34")),s=i("8f59"),n=i("785a"),a=getApp(),d={computed:(0,s.mapGetters)(["discoverTopic"]),components:{popupHeader:function(){i.e("components/popupHeader").then(function(){return resolve(i("a717"))}.bind(null,i)).catch(i.oe)}},data:function(){return{focus:!1,searchValue:"",theme:a.globalData.theme,where:{page:1,limit:30,keywords:""},loaded:!1,loading:!1,topicList:[],topicRecommendList:[],topicSelectedList:[]}},mounted:function(){this.topicSelectedList=(0,c.default)(this.discoverTopic),this.getTopicList(),this.getTopicRecommendList()},onReachBottom:function(){this.getTopicList()},methods:{close:function(){this.$emit("onClose")},getInitchecked:function(t){var e=this;t.forEach((function(t,i){e.$set(t,"check",!1),e.topicSelectedList.forEach((function(i,o){t.id==i.id&&e.$set(t,"isChoose",!0)}))}))},searchBut:function(){this.focus=!1,this.where.page=1,this.loaded=!1,this.loading=!1,this.topicList=[],this.getTopicList()},onBlur:function(){},setValue:function(t){this.$set(this,"searchValue",t.detail.value)},submit:function(){this.$store.commit("DiscoverTopic",this.topicSelectedList),this.$emit("onClose",this.topicSelectedList)},onCheck:function(t){var e=this;if(!(this.topicSelectedList.length>4)||t.isChoose){var i=[].concat((0,c.default)(this.topicRecommendList),(0,c.default)(this.topicList));i.forEach((function(i,o){i.id==t.id&&e.$set(i,"isChoose",!i.isChoose)})),t.isChoose?this.topicSelectedList.push(t):this.topicSelectedList.splice(this.topicSelectedList.findIndex((function(e){return e.id==t.id})),1)}},getTopicList:function(){var t=this;this.loading||this.loaded||(this.loading=!0,this.where.keywords=encodeURIComponent(this.searchValue),(0,n.topicListApi)(this.where).then((function(e){t.loadingb=!1,t.loaded=e.data.list.length<t.where.limit,t.topicList.push.apply(t.topicList,e.data.list),t.where.page=t.where.page+1,t.topicList.forEach((function(e,i){t.$set(e,"isChoose",!1)})),t.getInitchecked(t.topicList)}),(function(e){t.$util.Tips({title:e.message})})))},getTopicRecommendList:function(){var t=this;(0,n.topicRecommendListApi)().then((function(e){t.topicRecommendList=e.data,t.topicRecommendList.forEach((function(e,i){t.$set(e,"isChoose",!1)})),t.getInitchecked(t.topicRecommendList)}),(function(e){t.$util.Tips({title:e.message})}))}}};e.default=d},2082:function(t,e,i){},4636:function(t,e,i){"use strict";var o=i("2082"),c=i.n(o);c.a},"7fdc":function(t,e,i){"use strict";i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return c})),i.d(e,"a",(function(){}));var o=function(){var t=this.$createElement,e=(this._self._c,this.topicSelectedList.length);this.$mp.data=Object.assign({},{$root:{g0:e}})},c=[]},c5c0:function(t,e,i){"use strict";i.r(e);var o=i("1f03"),c=i.n(o);for(var s in o)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return o[t]}))}(s);e["default"]=c.a}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'pages/discover/components/discover_topic-create-component',
    {
        'pages/discover/components/discover_topic-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('df3c')['createComponent'](__webpack_require__("1894"))
        })
    },
    [['pages/discover/components/discover_topic-create-component']]
]);
