(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-268d1fd4"],{"1f07":function(s,t,e){"use strict";e("2943")},2943:function(s,t,e){},4830:function(s,t,e){"use strict";e.r(t),e("14d9");var a=e("2f62"),i=e("e032"),r=(a={name:"EgameSearch",props:{cid:[String,Number]},data:()=>({keywords:"",hotKeywords:[],historyKeywords:[],searchStatus:0,SEARCH_STATUS_INIT:0,SEARCH_STATUS_PROCEEDING:1,SEARCH_STATUS_COMPLETED:2,gameList:[],curPage:1,totalPage:3}),computed:{...Object(a.b)("lottery",["thirdGames"]),...Object(a.b)("user",[,"loginStatus","userInfo"])},mounted(){this.getSearchHistoryList()},methods:{back(){this.$emit("hide")},search(){this.keywords&&(this.searchStatus=this.SEARCH_STATUS_PROCEEDING,this.resetSearch(),this.searchGames())},selectKeywords(s){this.keywords=s,this.search()},clearHistoryKeywords(){0!==this.historyKeywords.length&&this.$store.dispatch("thirdGames/cleanSearchHistory").then(s=>{1==s.code?this.historyKeywords=[]:this.$message({message:s.msg,type:"warning"})}).catch(s=>{this.$message({message:s,type:"warning"})})},clearInput(){this.keywords="",this.searchStatus=this.SEARCH_STATUS_INIT},resetSearch(){this.gameList=[],this.totalPage=0,this.curPage=1},getSearchHistoryList(){this.$store.dispatch("thirdGames/getSearchHistoryList",{category_id:this.cid}).then(s=>{var t;1==s.code?(this.hotKeywords=null==(t=s.data)?void 0:t.hotData,this.historyKeywords=null==(t=s.data)||null==(t=t.historyData)?void 0:t.reverse()):this.$message({message:s.msg,type:"warning"})}).catch(s=>{this.$message({message:s,type:"warning"})})},searchGames(){this.$store.dispatch("thirdGames/searchGames",{category_id:this.cid,game_name:this.keywords,limit:20,page:this.curPage}).then(s=>{var t;1==s.code?(t=s.data,this.totalPage=t.last_page,this.gameList.push(...t.list),this.searchStatus=this.SEARCH_STATUS_COMPLETED):this.$message({message:s.msg,type:"warning"}),1===this.curPage&&this.getSearchHistoryList()}).catch(s=>{this.$message({message:s,type:"warning"})})},load(){this.curPage<this.totalPage&&(this.curPage++,this.searchGames())},toGame(){var s=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};s.show_list=1,Object(i.a)(s)}}},e("1f07"),e("a26d"),e("2877"));r=Object(r.a)(a,(function(){var s=this,t=s._self._c;return t("div",{staticClass:"egame-search-comp"},[t("div",{staticClass:"mask"}),t("div",{staticClass:"main"},[t("div",{staticClass:"btn-close iconfont icon-icon_floatbar_close",on:{click:s.back}}),t("header",{staticClass:"search-header"},[t("div",{staticClass:"ipt-search-wp"},[t("span",{staticClass:"iconfont icon-icon_search"}),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.keywords,expression:"keywords",modifiers:{trim:!0}}],attrs:{placeholder:s.$t("homeAndLoginRegistration.pleaseInputGameName"),maxlength:"50"},domProps:{value:s.keywords},on:{keyup:function(t){return!t.type.indexOf("key")&&s._k(t.keyCode,"enter",13,t.key,"Enter")?null:s.search.apply(null,arguments)},input:function(t){t.target.composing||(s.keywords=t.target.value.trim())},blur:function(t){return s.$forceUpdate()}}}),t("span",{staticClass:"icon-clear-ipt-wp"},[t("span",{directives:[{name:"show",rawName:"v-show",value:0<s.keywords.length,expression:"keywords.length > 0"}],staticClass:"icon-clear-ipt iconfont icon-icon_close_46",on:{click:s.clearInput}})]),t("span",{class:["btn-search",0===s.keywords.length?"disable":""],on:{click:s.search}},[s._v(s._s(s.$t("homeAndLoginRegistration.search")))])])]),t("section",{staticClass:"content"},[s.searchStatus===s.SEARCH_STATUS_INIT?t("div",{staticClass:"search-keywords-wp"},[t("ul",{staticClass:"hot-keywords keywords-ls"},s._l(s.hotKeywords,(function(e,a){return t("li",{key:a,staticClass:"keyword-item",on:{click:function(t){return s.selectKeywords(e.game_name)}}},[s._v(s._s(e.game_name))])})),0),t("section",{staticClass:"history-keywords-wp"},[t("header",[t("span",[s._v(s._s(s.$t("homeAndLoginRegistration.searchHistory")))]),t("span",{staticClass:"iconfont icon-icon_delete",on:{click:s.clearHistoryKeywords}})]),t("ul",{staticClass:"keywords-ls"},s._l(s.historyKeywords,(function(e,a){return t("li",{key:a,staticClass:"keyword-item",on:{click:function(t){return s.selectKeywords(e.keyword)}}},[s._v(s._s(e.keyword))])})),0)])]):t("div",{staticClass:"search-result-wp"},[s.searchStatus===s.SEARCH_STATUS_PROCEEDING?t("div",{directives:[{name:"loading",rawName:"v-loading",value:!0,expression:"true"}],staticClass:"loading"}):s.searchStatus===s.SEARCH_STATUS_COMPLETED?[0<s.gameList.length?t("div",{staticClass:"game-list-wp"},[t("ul",{directives:[{name:"infinite-scroll",rawName:"v-infinite-scroll",value:s.load,expression:"load"}],staticClass:"game-list"},s._l(s.gameList,(function(a,i){return t("li",{key:i,staticClass:"game-item"},[t("div",{staticClass:"img"},[t("el-image",{attrs:{src:a.icon,lazy:""}},[t("div",{staticClass:"image-slot",attrs:{slot:"error"},slot:"error"},[t("img",{attrs:{src:e("e8b7")}})])])],1),t("div",{staticClass:"name"},[s._v(" "+s._s(a.game_name)+" ")]),t("div",{staticClass:"cover",on:{click:function(t){return s.toGame(a)}}},[t("span",[s._v(s._s(s.$t("homeAndLoginRegistration.startTheGame")))])])])})),0)]):t("div",{staticClass:"no-data-wp"},[t("img",{attrs:{src:e("db12")}}),t("span",[s._v(s._s(s.$t("homeAndLoginRegistration.notFoundSimilarGames")))])])]:s._e()],2)])])])}),[],!1,null,"46db40d6",null);t.default=r.exports},a26d:function(s,t,e){"use strict";e("d89a")},d89a:function(s,t,e){},db12:function(s,t,e){s.exports=e.p+"static/img/no_data.9337ec23.png"}}]);