1 |
- require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods/goods_search/index"],{"0e2c":function(t,e,o){"use strict";o.r(e);var i=o("efe7"),n=o.n(i);for(var s in i)["default"].indexOf(s)<0&&function(t){o.d(e,t,(function(){return i[t]}))}(s);e["default"]=n.a},"0e7d":function(t,e,o){"use strict";o.r(e);var i=o("aeed"),n=o("0e2c");for(var s in n)["default"].indexOf(s)<0&&function(t){o.d(e,t,(function(){return n[t]}))}(s);o("8320");var a=o("f0c5"),c=Object(a["a"])(n["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);e["default"]=c.exports},8320:function(t,e,o){"use strict";var i=o("a5a7"),n=o.n(i);n.a},a5a7:function(t,e,o){},aeed:function(t,e,o){"use strict";o.d(e,"b",(function(){return i})),o.d(e,"c",(function(){return n})),o.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,o=(t._self._c,t.$t("搜索商品名称")),i=t.$t("搜索"),n=t.history.length,s=n?t.$t("搜索历史"):null,a=t.$t("热门搜索"),c=t.bastList.length,l=t.bastList.length,r=t.bastList.length,u=t.bastList.length,h=0==t.bastList.length&&t.page>1;t.$mp.data=Object.assign({},{$root:{m0:o,m1:i,g0:n,m2:s,m3:a,g1:c,g2:l,g3:r,g4:u,g5:h}})},n=[]},e313:function(t,e,o){"use strict";(function(t,e){var i=o("4ea4");o("4789");i(o("66fd"));var n=i(o("0e7d"));t.__webpack_require_UNI_MP_PLUGIN__=o,e(n.default)}).call(this,o("bc2e")["default"],o("543d")["createPage"])},efe7:function(t,e,o){"use strict";(function(t){var i=o("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o("2a39"),s=o("5743"),a=i(o("19b6")),c=o("00a0"),l={components:{goodList:function(){Promise.all([o.e("common/vendor"),o.e("components/goodList/index")]).then(function(){return resolve(o("d47f"))}.bind(null,o)).catch(o.oe)},recommend:function(){Promise.all([o.e("common/vendor"),o.e("components/recommend/index")]).then(function(){return resolve(o("7992"))}.bind(null,o)).catch(o.oe)},home:function(){Promise.all([o.e("common/vendor"),o.e("components/home/index")]).then(function(){return resolve(o("3b71"))}.bind(null,o)).catch(o.oe)}},mixins:[a.default],data:function(){return{imgHost:c.HTTP_REQUEST_URL,hostProduct:[],searchValue:"",focus:!0,bastList:[],hotSearchList:[],first:0,limit:8,page:1,loading:!1,loadend:!1,loadTitle:this.$t("加载更多"),hotPage:1,isScroll:!0,history:[],scrollTop:0,old:{scrollTop:0},scrollTopShow:!1}},onShow:function(){this.getHostProduct(),this.searchList();try{this.hotSearchList=t.getStorageSync("hotList")}catch(e){}},onPageScroll:function(e){t.$emit("scroll")},methods:{scrollLower:function(){this.bastList.length>0?this.getProductList():this.getHostProduct()},scroll:function(t){this.scrollTopShow=t.detail.scrollTop>150,this.old.scrollTop=t.detail.scrollTop},goTop:function(t){var e=this;this.scrollTop=this.old.scrollTop,this.$nextTick((function(){e.scrollTop=0}))},searchList:function(){var t=this;(0,s.searchList)({page:1,limit:10}).then((function(e){t.history=e.data}))},clear:function(){var e=this;(0,s.clearSearch)().then((function(o){t.showToast({title:o.msg,success:function(){e.history=[]}})}))},inputConfirm:function(e){e.detail.value&&(t.hideKeyboard(),this.setHotSearchValue(e.detail.value))},getRoutineHotSearch:function(){var t=this;(0,n.getSearchKeyword)().then((function(e){t.$set(t,"hotSearchList",e.data)}))},getProductList:function(){var t=this;t.loadend||t.loading||(t.loading=!0,t.loadTitle="",(0,n.getProductslist)({keyword:t.searchValue.trim(),page:t.page,limit:t.limit}).then((function(e){var o=e.data,i=o.length<t.limit;t.bastList=t.$util.SplitArray(o,t.bastList),t.$set(t,"bastList",t.bastList),t.loading=!1,t.loadend=i,t.loadTitle=i?t.$t("没有更多内容啦~"):t.$t("加载更多"),t.page=t.page+1})).catch((function(e){t.loading=!1,t.loadTitle=t.$t("加载更多")})))},getHostProduct:function(){var t=this;this.isScroll&&(0,n.getProductHot)(t.hotPage,t.limit).then((function(e){t.isScroll=e.data.length>=t.limit,t.hostProduct=t.hostProduct.concat(e.data),t.hotPage+=1}))},setHotSearchValue:function(t){this.$set(this,"searchValue",t),this.page=1,this.loadend=!1,this.$set(this,"bastList",[]),this.getProductList()},setValue:function(t){this.$set(this,"searchValue",t.detail.value)},searchBut:function(){if(!this.searchValue.trim())return this.$util.Tips({title:this.$t("请输入要搜索的商品")});this.focus=!1,this.page=1,this.loadend=!1,this.$set(this,"bastList",[]),t.showLoading({title:this.$t("正在搜索中")}),this.getProductList(),t.hideLoading()}}};e.default=l}).call(this,o("543d")["default"])}},[["e313","common/runtime","common/vendor"]]]);
|