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 lines
3.8 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods/HM-search/HM-search"],{"277d":function(t,e,o){"use strict";o.r(e);var i=o("93d2"),n=o.n(i);for(var a in i)"default"!==a&&function(t){o.d(e,t,(function(){return i[t]}))}(a);e["default"]=n.a},"2db9":function(t,e,o){},"380e":function(t,e,o){"use strict";o.r(e);var i=o("6fa1"),n=o("277d");for(var a in n)"default"!==a&&function(t){o.d(e,t,(function(){return n[t]}))}(a);o("e8dc");var r,s=o("f0c5"),d=Object(s["a"])(n["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],r);e["default"]=d.exports},"5faf":function(t,e,o){"use strict";(function(t){o("e5b1");i(o("66fd"));var e=i(o("380e"));function i(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,o("543d")["createPage"])},"6fa1":function(t,e,o){"use strict";var i;o.d(e,"b",(function(){return n})),o.d(e,"c",(function(){return a})),o.d(e,"a",(function(){return i}));var n=function(){var t=this,e=t.$createElement;t._self._c},a=[]},"93d2":function(t,e,o){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=o("53e0"),n=getApp(),a=function(){o.e("components/mehaotian-search-revision/mehaotian-search-revision").then(function(){return resolve(o("6385"))}.bind(null,o)).catch(o.oe)},r={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:a},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,a={regionId:n.globalData.cityId,pageNum:o,couponName:this.keyword,pageSize:this.pageSize};(0,i.getCouponList)(a).then((function(i){"000000"==i.return_code?(t.hideLoading(),e.isNoMoreData=i.return_data.list.length!=e.pageSize,e.productList=e.productList.concat(i.return_data.list),i.return_data.total==e.pageNum*e.pageSize&&(e.isNoMoreData=!0),e.pageNum=i.return_data.list.length==e.pageSize?++o:o):(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<o;n++){var a=t[n],r=a[0].replace(e,"<span style='color: #9f9f9f;'>"+e+"</span>");r="<div>"+r+"</div>";var s={keyword:a[0],htmlStr:r};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),a=n.indexOf(e);-1==a||n.splice(a,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=r}).call(this,o("543d")["default"])},e8dc:function(t,e,o){"use strict";var i=o("2db9"),n=o.n(i);n.a}},[["5faf","common/runtime","common/vendor"]]]);