(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/discover/discoverCreate/topic"],{"12f4":function(t,e,i){},6771:function(t,e,i){"use strict";var c=i("12f4"),n=i.n(c);n.a},"6d3c":function(t,e,i){"use strict";i.r(e);var c=i("c187"),n=i("d64e");for(var o in n)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(o);i("6771"),i("fa9b");var a=i("828b"),r=Object(a["a"])(n["default"],c["b"],c["c"],!1,null,null,null,!1,c["a"],void 0);e["default"]=r.exports},7402:function(t,e,i){"use strict";(function(t,e){var c=i("47a9");i("f076");c(i("3240"));var n=c(i("6d3c"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(n.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},ba6d:function(t,e,i){"use strict";(function(t){var c=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=c(i("af34")),o=i("eb8a"),a=c(i("89cc")),r=i("2c18"),s=t.getWindowInfo().statusBarHeight,u={name:"createTopic",data:function(){return{sysHeight:s,id:0,topicSelectedList:[],topicKeyword:"",showFilter:!1,filterTopicList:[],focus:!0,recommendParams:{page:1,limit:10,is_recommend:1},showMore:!1,recommendTopic:[],boxHeight:0}},mixins:[a.default],computed:{filterStyle:function(){var e=t.getWindowInfo().windowHeight;return{height:e-this.boxHeight+"px",top:this.boxHeight+"px"}}},onLoad:function(t){t.data&&(this.topicSelectedList=JSON.parse(t.data)),this.getTopic()},methods:{getHeight:function(){var e=this;t.createSelectorQuery().select(".topic-box").boundingClientRect((function(t){e.boxHeight=t.height})).exec()},handleInput:(0,r.Debounce)((function(t){var e=this,i=t.detail.value;i.length>10&&(this.topicKeyword=i.slice(0,10)),this.topicKeyword?(0,o.getTopicApi)({is_community:1,name:this.topicKeyword}).then((function(t){e.getHeight(),e.filterTopicList=t.data,e.filterTopicList.unshift({name:e.topicKeyword}),e.showFilter=!0})):this.showFilter=!1})),getTopic:function(){var t=this;(0,o.getTopicApi)(this.recommendParams).then((function(e){t.showMore=e.data.length>=t.recommendParams.limit,t.recommendTopic=t.recommendTopic.concat(e.data),t.recommendParams.page++;var i=[];t.recommendTopic.forEach((function(e,c){t.topicSelectedList.forEach((function(t){t.name.includes(e.name)&&i.push(c)}))})),i=(0,n.default)(new Set(i)).sort((function(t,e){return e-t})),i.forEach((function(e){t.recommendTopic.splice(e,1)}))}))},changeTopic:function(t){var e=this;if(this.showFilter=!1,this.topicKeyword="",this.topicSelectedList.length>4)return this.$util.Tips({title:"最多可选择5个话题"});this.focus=!1;var i=this.topicSelectedList.map((function(t){return t.name}));i.includes(t.name)||this.topicSelectedList.push(t),this.recommendTopic.splice(this.recommendTopic.findIndex((function(e){return e.id==t.id})),1),this.$nextTick((function(){e.focus=!0}))},confirmCreate:function(){this.topicKeyword&&this.changeTopic({name:this.topicKeyword})},saveTopic:function(){t.$emit("topicSave",this.topicSelectedList),t.navigateBack()},delTopic:function(t){this.topicSelectedList.splice(t,1)}}};e.default=u}).call(this,i("df3c")["default"])},c187:function(t,e,i){"use strict";i.d(e,"b",(function(){return c})),i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){}));var c=function(){var t=this.$createElement,e=(this._self._c,this.__get_style([this.filterStyle]));this.$mp.data=Object.assign({},{$root:{s0:e}})},n=[]},c6ea:function(t,e,i){},d64e:function(t,e,i){"use strict";i.r(e);var c=i("ba6d"),n=i.n(c);for(var o in c)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return c[t]}))}(o);e["default"]=n.a},fa9b:function(t,e,i){"use strict";var c=i("c6ea"),n=i.n(c);n.a}},[["7402","common/runtime","common/vendor"]]]);