(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/topic/list"],{"0bb5":function(t,e,i){"use strict";var n=i("45f4"),r=i.n(n);r.a},1970:function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=i("2f62");function r(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function o(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?r(Object(i),!0).forEach((function(e){a(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function a(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var c=function(){i.e("components/page-component/app-special-topic/app-special-topic-list").then(function(){return resolve(i("1e2c"))}.bind(null,i)).catch(i.oe)},s=1,u={},l=!1,f=!1,d={name:"list",components:{appSpecialTopicList:c},data:function(){return{list:[],typeList:[],tabCurrentIndex:0,KEY:"_TOPIC_SEARCH_DATA",historyList:[],keyword:"",isSearch:!1}},computed:o(o({},(0,n.mapState)({bar_title:function(t){return t.mallConfig.bar_title}})),(0,n.mapGetters)("mallConfig",{getTheme:"getTheme"})),watch:{keyword:{handler:function(t,e){t!==e&&(this.isSearch=!0)},immediate:!0}},onLoad:function(t){this.$commonLoad.onload(t),s=1,l=!1,f=!1,"undefined"!=typeof t.type&&(u.type=t.type),this.loadData(),this.loadType()},onReachBottom:function(){l||this.isSearch||this.loadData()},onShareAppMessage:function(){var t=this.$platDiff.route(),e="专题列表";for(var i in this.bar_title)if(this.bar_title[i].value==t){e=this.bar_title[i].new_name;break}return this.$shareAppMessage({title:e,path:"/pages/topic/list"})},methods:{historyClick:function(t){this.keyword=t.trim(),this.searchList()},setHistory:function(){var t=this.getHistory(),e=this.keyword.trim();e&&(t.forEach((function(i,n){i.keyword===e&&t.splice(n,1)})),t.unshift({keyword:e}),t.length>20&&t.pop(),this.historyList=t,this.$storage.setStorageSync(this.KEY,t))},getHistory:function(){var t=this.$storage.getStorageSync(this.KEY);return t||(t=[]),t},deleteHistory:function(){var e=this;t.showModal({content:"确认删除全部历史记录？",success:function(t){t.confirm&&(e.$storage.removeStorageSync(e.KEY),e.historyList=[])}})},clear:function(){t.hideKeyboard(),this.keyword=""},searchList:function(){s=1,this.keyword=this.keyword.trim(),this.loadData()},loadData:function(){var t=this;f||(this.$showLoading(),f=!0,u.page=s,this.setHistory(),this.$request({url:this.$api.topic.list,data:Object.assign({},{keyword:this.keyword},u)}).then((function(e){f=!1,t.isSearch=!1,t.historyList=t.getHistory(),t.$hideLoading(),0===e.code&&(1===s&&(t.list=[]),e.data.list.length>0?(t.list=t.list.concat(e.data.list),s++):l=!0)})).catch((function(e){t.$hideLoading(),f=!1})))},loadType:function(){var t=this;this.$request({url:this.$api.topic.type}).then((function(e){if(0===e.code&&e.data.list.length>0){var i=[{id:0,name:"全部"},{id:-1,name:"精选"}];for(var n in t.typeList=i.concat(e.data.list),t.typeList)if(t.typeList[n].id==u.type){t.tabCurrentIndex=n;break}}})).catch((function(t){f=!1}))},tabClick:function(t){s=1,l=!1;var e=this.typeList[t].id;this.tabCurrentIndex=t,u={page:s,type:e},this.loadData()}}};e.default=d}).call(this,i("543d")["default"])},"45f4":function(t,e,i){},"6c8e":function(t,e,i){"use strict";i.r(e);var n=i("95cc"),r=i("c6e7");for(var o in r)"default"!==o&&function(t){i.d(e,t,(function(){return r[t]}))}(o);i("0bb5");var a,c=i("f0c5"),s=Object(c["a"])(r["default"],n["b"],n["c"],!1,null,"4ec36286",null,!1,n["a"],a);e["default"]=s.exports},"95cc":function(t,e,i){"use strict";var n;i.d(e,"b",(function(){return r})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){return n}));var r=function(){var t=this,e=t.$createElement;t._self._c},o=[]},c6e7:function(t,e,i){"use strict";i.r(e);var n=i("1970"),r=i.n(n);for(var o in n)"default"!==o&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=r.a},ecd4:function(t,e,i){"use strict";(function(t){i("2d0a");n(i("66fd"));var e=n(i("6c8e"));function n(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,i("543d")["createPage"])}},[["ecd4","common/runtime","common/vendor"]]]);