1 line
20 KiB
JavaScript
1 line
20 KiB
JavaScript
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-goods_search-index"],{"058a":function(t,e,i){var n=i("e4ce");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=i("4f06").default;a("476115eb",n,!0,{sourceMap:!1,shadowMode:!1})},"0f0a":function(t,e,i){"use strict";i("7a82");var n=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.collectAdd=function(t,e){return a.default.post("front/collect/add",{id:t,category:void 0===e?"product":e})},e.collectAll=function(t,e){return a.default.post("collect/all",{id:t,category:void 0===e?"product":e})},e.collectDel=function(t){return a.default.post("collect/cancel/".concat(t))},e.collectDelete=function(t){return a.default.post("collect/delete",t)},e.getCategoryList=function(){return a.default.get("front/category",{},{noAuth:!0})},e.getCollectUserList=function(t){return a.default.get("collect/user",t)},e.getGroomList=function(t,e){return a.default.get("index/product/"+t,e,{noAuth:!0})},e.getProductCode=function(t){return a.default.get("front/product/code/"+t,{})},e.getProductDetail=function(t,e){return a.default.get("front/product/detail/"+t+"?type="+e,{},{noAuth:!0})},e.getProductGood=function(){return a.default.get("front/product/good")},e.getProductHot=function(t,e){return a.default.get("front/product/hot",{page:void 0===t?1:t,limit:void 0===e?4:e},{noAuth:!0})},e.getProductslist=function(t){return a.default.get("front/products",t,{noAuth:!0})},e.getReplyConfig=function(t){return a.default.get("front/reply/config/"+t,{},{noAuth:!0})},e.getReplyList=function(t,e){return a.default.get("reply/list/"+t,e,{noAuth:!0})},e.getReplyProduct=function(t){return a.default.get("front/reply/product/"+t,{noAuth:!0})},e.getSearchKeyword=function(){return a.default.get("search/keyword",{},{noAuth:!0})},e.postCartAdd=function(t){return a.default.post("front/cart/save",t,{})},e.storeListApi=function(t){return a.default.post("store/list",t,{},1)};var a=n(i("216d"))},"121f":function(t,e,i){"use strict";i.r(e);var n=i("46f4"),a=i.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=a.a},"28d4":function(t,e,i){"use strict";i("7a82");var n=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("99af");var a=i("0f0a"),o=n(i("f7a3")),r=n(i("3b84")),s={components:{goodList:o.default,recommend:r.default},data:function(){return{hostProduct:[],searchValue:"",focus:!0,bastList:[],hotSearchList:[],first:0,limit:8,page:1,loading:!1,loadend:!1,loadTitle:"加载更多",hotPage:1,isScroll:!0,isbastList:!1}},onShow:function(){this.getRoutineHotSearch(),this.getHostProduct()},onReachBottom:function(){this.bastList.length>0?this.getProductList():this.getHostProduct()},methods:{getRoutineHotSearch:function(){var t=this;(0,a.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,a.getProductslist)({keyword:t.searchValue,page:t.page,limit:t.limit}).then((function(e){var i=e.data.list,n=i.length<t.limit;t.bastList=t.$util.SplitArray(i,t.bastList),t.$set(t,"bastList",t.bastList),t.loading=!1,t.loadend=n,t.loadTitle=n?"😕人家是有底线的~~":"加载更多",t.page=t.page+1,t.isbastList=!0})).catch((function(e){t.loading=!1,t.loadTitle="加载更多"})))},getHostProduct:function(){var t=this;this.isScroll&&(0,a.getProductHot)(t.hotPage,t.limit).then((function(e){t.isScroll=e.data.list.length>=t.limit,t.hostProduct=t.hostProduct.concat(e.data.list),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.focus=!1,!(this.searchValue.length>0))return this.$util.Tips({title:"请输入要搜索的商品",icon:"none",duration:1e3,mask:!0});this.page=1,this.loadend=!1,this.$set(this,"bastList",[]),uni.showLoading({title:"正在搜索中"}),this.getProduct
|