require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods/goods_search/index"],{"09ed":function(e,t,n){"use strict";(function(e,t){var a=n("47a9");n("7561");a(n("3240"));var o=a(n("cc5a"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(o.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},"1c3c":function(e,t,n){"use strict";var a=n("92a2"),o=n.n(a);o.a},"3b3a":function(e,t,n){},"3e08":function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){}));var a=function(){var e=this,t=e.$createElement,n=(e._self._c,e.history.length),a=n&&!e.isShowMore?e.history.slice(0,7):null,o=n?e.history.length:null,i=e.salesRecommendList.length,c=i?e.salesRecommendList.slice(3):null,s=e.scoreRecommendList.length,r=s?e.scoreRecommendList.slice(3):null,u=e.collectRecommendList.length,l=u?e.collectRecommendList.slice(3):null,h=e.newPartyList.length;e._isMounted||(e.e0=function(t,n){var a=arguments[arguments.length-1].currentTarget.dataset,o=a.eventParams||a["event-params"];n=o.item;return e.setHotSearchValue(n.keyword)},e.e1=function(t){e.isShowMore=!e.isShowMore},e.e2=function(t,n){var a=arguments[arguments.length-1].currentTarget.dataset,o=a.eventParams||a["event-params"];n=o.item;return e.goDetail(n)},e.e3=function(t,n){var a=arguments[arguments.length-1].currentTarget.dataset,o=a.eventParams||a["event-params"];n=o.item;return e.goDetail(n)},e.e4=function(t,n){var a=arguments[arguments.length-1].currentTarget.dataset,o=a.eventParams||a["event-params"];n=o.item;return e.goDetail(n)}),e.$mp.data=Object.assign({},{$root:{g0:n,g1:a,g2:o,g3:i,l0:c,g4:s,l1:r,g5:u,l2:l,g6:h}})},o=[]},"406f":function(e,t,n){"use strict";var a=n("3b3a"),o=n.n(a);o.a},"6f90":function(e,t,n){"use strict";n.r(t);var a=n("c716"),o=n.n(a);for(var i in a)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(i);t["default"]=o.a},"92a2":function(e,t,n){},c716:function(e,t,n){"use strict";(function(e){var a=n("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n("ce7e"),i=n("a230"),c=a(n("cef6")),s=n("4bab"),r=n("bad7"),u=n("b135"),l=e.getSystemInfoSync().statusBarHeight,h={components:{recommend:function(){Promise.all([n.e("common/vendor"),n.e("components/recommend/index")]).then(function(){return resolve(n("6af4"))}.bind(null,n)).catch(n.oe)},home:function(){Promise.all([n.e("common/vendor"),n.e("components/home/index")]).then(function(){return resolve(n("b7a2"))}.bind(null,n)).catch(n.oe)}},mixins:[c.default],data:function(){return{hostProduct:[],searchValue:"",focus:!0,bastList:[],hotSearchList:[],isSpin:!1,first:0,limit:8,page:1,loading:!1,loadend:!1,loadTitle:"加载更多",hotPage:1,isScroll:!0,history:[],imgHost:r.HTTP_REQUEST_URL,salesRecommendList:[],scoreRecommendList:[],collectRecommendList:[],sysHeight:l,newPartyList:[],isShowMore:!1}},computed:{fuzzyHeight:function(){var t=e.getSystemInfoSync().screenHeight;return t-this.sysHeight-56}},onLoad:function(e){var t=this;this.searchValue=e.searchVal||"",this.getSearchHotKeywords(),this.getSearchRecommend(),setTimeout((function(){t.newPartySearch()}),1e3)},onShow:function(t){e.removeStorageSync("form_type_cart"),this.searchList()},methods:{refresh:function(){this.isSpin=!0,this.getSearchHotKeywords()},getSearchHotKeywords:function(){var e=this;(0,o.getHotWordApi)().then((function(t){e.hotSearchList=t.data,setTimeout((function(t){e.isSpin=!1}),1e3)}))},searchList:function(){var e=this;(0,i.searchList)({page:1,limit:10}).then((function(t){e.history=t.data}))},clear:function(){var t=this;(0,i.clearSearch)().then((function(n){e.showToast({title:n.msg,success:function(){t.history=[]}})}))},inputConfirm:function(t){t.detail.value&&(e.hideKeyboard(),this.setHotSearchValue(t.detail.value))},setValue:(0,u.Debounce)((function(e){this.newPartySearch()})),newPartySearch:function(){var e=this;(0,o.getSearchKeyword)({keyword:this.searchValue}).then((function(t){e.newPartyList=t.data.list,e.newPartyList.map((function(n){e.$set(n,"keyword",e.brightKeyword(n.store_name,t.data.keyword))}))}))},brightKeyword:function(e,t){return e.indexOf(t)>-1?(e='

'.concat(e,"

"),e.replace(t,''.concat(t,""))):e},setCommentSearch:function(t){e.navigateTo({url:"/pages/goods/goods_list/index?productId="+t})},setHotSearchValue:function(e){this.$set(this,"searchValue",e),this.focus=!1,this.searchBut()},searchBut:function(){if(this.focus=!1,!(this.searchValue.length>0))return this.$util.Tips({title:"请输入要搜索的商品",icon:"none",duration:1e3,mask:!0});this.newPartyList=[],e.navigateTo({url:"/pages/goods/goods_list/index?searchValue="+this.searchValue})},getSearchRecommend:function(){var e=this;(0,o.getSearchRecommendApi)(1).then((function(t){e.salesRecommendList=t.data})),(0,o.getSearchRecommendApi)(2).then((function(t){e.scoreRecommendList=t.data})),(0,o.getSearchRecommendApi)(3).then((function(t){e.collectRecommendList=t.data}))},goDetail:function(t){(0,s.goShopDetail)(t,this.uid).catch((function(n){e.navigateTo({url:"/pages/goods_details/index?id=".concat(t.id)})}))},goRank:function(t){e.navigateTo({url:"/pages/columnGoods/rank/index?type=".concat(t)})},clearSearchVal:function(){this.searchValue="",this.newPartyList=[]}}};t.default=h}).call(this,n("df3c")["default"])},cc5a:function(e,t,n){"use strict";n.r(t);var a=n("3e08"),o=n("6f90");for(var i in o)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(i);n("1c3c"),n("406f");var c=n("828b"),s=Object(c["a"])(o["default"],a["b"],a["c"],!1,null,"64c4dbd5",null,!1,a["a"],void 0);t["default"]=s.exports}},[["09ed","common/runtime","common/vendor"]]]);