You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
high-mini/unpackage/dist/build/mp-weixin/pages/goods/HM-search/HM-search.js

1 line
3.4 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods/HM-search/HM-search"],{"16a2":function(t,e,o){"use strict";var n=o("faca"),i=o.n(n);i.a},"50d0":function(t,e,o){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o("524d"),i=getApp(),r=function(){o.e("components/mehaotian-search-revision/mehaotian-search-revision").then(function(){return resolve(o("2c1c"))}.bind(null,o)).catch(o.oe)},a={data:function(){return{defaultKeyword:"",keyword:"",oldKeywordList:[],hotKeywordList:[],keywordList:[],forbid:"",isShowKeywordList:!1,imageUrl:i.globalData.imgUrl,productList:[],pageNum:1,pageSize:10}},onLoad:function(){this.init()},components:{mSearch:r},methods:{getCouponList:function(){var e=this;t.showLoading({});var o={regionId:i.globalData.cityId,pageNum:this.pageNum,couponName:this.keyword,pageSize:this.pageSize};(0,n.getCouponList)(o).then((function(o){"000000"==o.return_code?(t.hideLoading(),e.productList=o.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,n=[],i=0;i<o;i++){var r=t[i],a=r[0].replace(e,"<span style='color: #9f9f9f;'>"+e+"</span>");a="<div>"+a+"</div>";var s={keyword:r[0],htmlStr:a};n.push(s)}return n},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.getCouponList()},saveKeyword:function(e){var o=this;t.getStorage({key:"OldKeys",success:function(n){var i=JSON.parse(n.data),r=i.indexOf(e);-1==r||i.splice(r,1),i.unshift(e),i.length>10&&i.pop(),t.setStorage({key:"OldKeys",data:JSON.stringify(i)}),o.oldKeywordList=i},fail:function(n){var i=[e];t.setStorage({key:"OldKeys",data:JSON.stringify(i)}),o.oldKeywordList=i}})}}};e.default=a}).call(this,o("543d")["default"])},"921b":function(t,e,o){"use strict";o.r(e);var n=o("ab02"),i=o("c92d");for(var r in i)"default"!==r&&function(t){o.d(e,t,(function(){return i[t]}))}(r);o("16a2");var a,s=o("f0c5"),d=Object(s["a"])(i["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],a);e["default"]=d.exports},ab02:function(t,e,o){"use strict";var n;o.d(e,"b",(function(){return i})),o.d(e,"c",(function(){return r})),o.d(e,"a",(function(){return n}));var i=function(){var t=this,e=t.$createElement;t._self._c},r=[]},c92d:function(t,e,o){"use strict";o.r(e);var n=o("50d0"),i=o.n(n);for(var r in n)"default"!==r&&function(t){o.d(e,t,(function(){return n[t]}))}(r);e["default"]=i.a},f6b1:function(t,e,o){"use strict";(function(t){o("185d");n(o("66fd"));var e=n(o("921b"));function n(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,o("543d")["createPage"])},faca:function(t,e,o){}},[["f6b1","common/runtime","common/vendor"]]]);