(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods/HM-search/HM-search"],{"2b54":function(t,e,o){"use strict";o.r(e);var i=o("917d"),n=o.n(i);for(var r in i)"default"!==r&&function(t){o.d(e,t,(function(){return i[t]}))}(r);e["default"]=n.a},"37c5":function(t,e,o){"use strict";var i;o.d(e,"b",(function(){return n})),o.d(e,"c",(function(){return r})),o.d(e,"a",(function(){return i}));var n=function(){var t=this,e=t.$createElement;t._self._c},r=[]},7126:function(t,e,o){"use strict";(function(t){o("eba6");i(o("66fd"));var e=i(o("c48b"));function i(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,o("543d")["createPage"])},"917d":function(t,e,o){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=o("b528"),n=getApp(),r=function(){o.e("components/mehaotian-search-revision/mehaotian-search-revision").then(function(){return resolve(o("2522"))}.bind(null,o)).catch(o.oe)},a={data:function(){return{defaultKeyword:"",keyword:"",oldKeywordList:[],hotKeywordList:[],keywordList:[],forbid:"",isShowKeywordList:!1,imageUrl:n.globalData.imgUrl,productList:[],pageNum:1,pageSize:10,isNoMoreData:!1,loadingText:""}},onLoad:function(){this.init()},components:{mSearch:r},onReachBottom:function(){this.getCouponList()},methods:{toGoods:function(e){t.navigateTo({url:"../../goods/goods?id="+e})},getCouponList:function(){var e=this;if(t.showLoading({title:"加载中..."}),this.isNoMoreData)return t.hideLoading(),this.loadingText="到底了",!1;var o=this.pageNum,r={regionId:n.globalData.cityId,pageNum:o,couponName:this.keyword,pageSize:this.pageSize};(0,i.getCouponList)(r).then((function(i){"000000"==i.return_code?(t.hideLoading(),e.isNoMoreData=i.return_data.list.length!=e.pageSize,e.pageNum=i.return_data.list.length==e.pageSize?++o:o,e.productList=e.productList.concat(i.return_data.list)):(e.productList=[],t.hideLoading())}))},init:function(){this.loadDefaultKeyword()},blur:function(){t.hideKeyboard()},loadDefaultKeyword:function(){this.defaultKeyword="默认关键字"},loadOldKeyword:function(){var e=this;t.getStorage({key:"OldKeys",success:function(t){var o=JSON.parse(t.data);e.oldKeywordList=o}})},inputChange:function(t){var e=t.detail?t.detail.value:t;if(!e)return this.keywordList=[],void(this.isShowKeywordList=!1);this.isShowKeywordList=!0,this.getCouponList()},drawCorrelativeKeyword:function(t,e){for(var o=t.length,i=[],n=0;n"+e+"");a="
"+a+"
";var s={keyword:r[0],htmlStr:a};i.push(s)}return i},setKeyword:function(t){this.keyword=this.keywordList[t].keyword},oldDelete:function(){var e=this;t.showModal({content:"确定清除历史搜索记录?",success:function(o){o.confirm?(console.log("用户点击确定"),e.oldKeywordList=[],t.removeStorage({key:"OldKeys"})):o.cancel&&console.log("用户点击取消")}})},hotToggle:function(){this.forbid=this.forbid?"":"_forbid"},doSearch:function(t){t=!1===t?this.keyword:t,this.keyword=t,this.pageNum=1,this.getCouponList()},saveKeyword:function(e){var o=this;t.getStorage({key:"OldKeys",success:function(i){var n=JSON.parse(i.data),r=n.indexOf(e);-1==r||n.splice(r,1),n.unshift(e),n.length>10&&n.pop(),t.setStorage({key:"OldKeys",data:JSON.stringify(n)}),o.oldKeywordList=n},fail:function(i){var n=[e];t.setStorage({key:"OldKeys",data:JSON.stringify(n)}),o.oldKeywordList=n}})}}};e.default=a}).call(this,o("543d")["default"])},"976b":function(t,e,o){"use strict";var i=o("c1df"),n=o.n(i);n.a},c1df:function(t,e,o){},c48b:function(t,e,o){"use strict";o.r(e);var i=o("37c5"),n=o("2b54");for(var r in n)"default"!==r&&function(t){o.d(e,t,(function(){return n[t]}))}(r);o("976b");var a,s=o("f0c5"),d=Object(s["a"])(n["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],a);e["default"]=d.exports}},[["7126","common/runtime","common/vendor"]]]);