1 line
7.1 KiB
JavaScript
1 line
7.1 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-624d3d13","chunk-2d0d83d6"],{"0c31":function(t,e,o){var i=o("24fb");e=i(!1),e.push([t.i,"#search .uou[data-v-36664f37]{width:100%;position:fixed;z-index:99;top:0;transition:.2s;-webkit-transition:.2s;background:#fff}#search #sort[data-v-36664f37]{line-height:2.5rem;font-size:14px}#search .mout[data-v-36664f37]{top:-2.25rem}.search[data-v-36664f37]{height:2.8125rem;line-height:2.8125rem;position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;overflow:hidden;background:#fff;border-bottom:.0625rem solid #f5f5f5}.search .back[data-v-36664f37]{width:2.8125rem}.search .back i[data-v-36664f37]{line-height:2.8125rem;font-size:1.5rem}.search .search-box[data-v-36664f37]{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;width:75%;margin-top:.5rem;padding:0 .625rem;background-color:#f2f2f2;height:1.75rem;line-height:1.75rem;border-radius:.875rem}.search .search-box input[data-v-36664f37]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;line-height:1.75rem;border:none;color:#333}.search .search-box i[data-v-36664f37]{position:absolute;right:1rem;-webkit-box-flex:0;-webkit-flex:0 0 1.5rem;-ms-flex:0 0 1.5rem;flex:0 0 1.5rem}",""]),t.exports=e},1441:function(t,e,o){var i=o("0c31");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=o("499e").default;a("7e42b27b",i,!0,{sourceMap:!1,shadowMode:!1})},"253a":function(t,e,o){t.exports=o.p+"static/app/img/img_default.a608a24a.png"},"79db":function(t,e,o){t.exports=o.p+"static/app/img/empty-image-search.ef236a93.png"},8798:function(t,e,o){t.exports=o.p+"static/app/img/no-more-product.f4632785.png"},ac0d:function(t,e,o){"use strict";o.d(e,"a",(function(){return s}));var i=document.documentElement,a=document.body,s={data:function(){return{}},activated:function(){window.addEventListener("scroll",this.handleScroll)},deactivated:function(){window.removeEventListener("scroll",this.handleScroll)},methods:{getScrollTop:function(){var t=0;return i&&i.scrollTop?t=i.scrollTop:a&&(t=a.scrollTop),t},getClientHeight:function(){var t=0;return t=a.clientHeight&&i.clientHeight?Math.min(a.clientHeight,i.clientHeight):Math.max(a.clientHeight,i.clientHeight),t},getScrollHeight:function(){return Math.max(a.scrollHeight,i.scrollHeight)},handleScroll:function(){this.otherScroll();var t=document.documentElement.scrollTop||document.body.scrollTop;this.btnFlag=t>60,this.getScrollTop()+this.getClientHeight()+105>this.getScrollHeight()?(this.isLoadMore&&this.getMoreData(),this.isBottom=!0):this.isBottom=!1},otherScroll:function(){}}}},d692:function(t,e,o){"use strict";o.r(e);var i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{attrs:{id:"search",transition:"fadeInLeft"}},[o("div",{staticClass:"uou",class:{mout:t.amout},style:{width:3==this.fun.getPhoneEnv()?"375px":"100%"},attrs:{id:"soso"}},[o("div",{staticClass:"search"},[o("div",{staticClass:"back",on:{click:t.goback}},[o("i",{staticClass:"fa fa-angle-left"})]),o("div",{staticClass:"search-box"},[o("form",{staticStyle:{flex:"0 0 86%",display:"flex"},attrs:{action:"#"},on:{submit:function(t){t.preventDefault()}}},[o("input",{directives:[{name:"model",rawName:"v-model",value:t.inputs,expression:"inputs"}],attrs:{type:"search",placeholder:"请输入内容"},domProps:{value:t.inputs},on:{keypress:t.enterSearch,input:function(e){e.target.composing||(t.inputs=e.target.value)}},nativeOn:{click:function(e){return t.hidebox.apply(null,arguments)}}})]),o("i",{staticClass:"iconfont icon-sousuo1",staticStyle:{color:"#ccc"},on:{click:t.search}})]),o("div",{staticStyle:{position:"absolute",right:"1rem"}},[o("i",{directives:[{name:"show",rawName:"v-show",value:t.view,expression:"view"}],staticClass:"fa fa-th-large",on:{click:function(e){return t.$store.commit("views")}}}),o("i",{directives:[{name:"show",rawName:"v-show",value:!t.view,expression:"!view"}],staticClass:"fa fa-th-list",on:{click:function(e){return t.$store.commit("views")}}})])])]),o("div",{staticStyle:{height:"3.4375rem",display:"block"}}),o("c-goodsList",{staticClass:"osll",attrs:{goods:t.goods,text:"搜索结果",styleCon:t.styleObj,loading:t.loading,jumpSo:t.jumpSo,storeId:t.storeId}}),o("yz-blank",{attrs:{datas:t.goods,text:"暂无商品信息"}})],1)},a=[],s=o("5530"),r=(o("ac1f"),o("841c"),o("99af"),o("a9e3"),o("5880")),n=o("ac0d"),c=o("98e3"),d=o("eb17"),l={mixins:[n["a"]],data:function(){return{inputs:"",amout:!1,allLoaded:!0,goload:!1,goods:[],loading:!1,styleObj:{"align-items":"baseline",marginRight:"25px",backgroundColor:"white",marginLeft:"5px",position:"static"},jumpSo:!0,storeId:"",pageNum:1,page:1,isLoadMore:!0,total_page:0}},computed:Object(s["a"])({},Object(r["mapState"])(["view"])),methods:Object(s["a"])(Object(s["a"])({},Object(r["mapMutations"])(["views"])),{},{enterSearch:function(t){13===t.keyCode&&(t.preventDefault(),this.search())},showbox:function(){this.show=!this.show},hidebox:function(){this.show=!1},search:function(){this.pageNum=1,this.goods=[],this.goload=!0,this.isLoadMore=!0,this.gotoSearch()},getMoreData:function(){var t=this;this.isLoadMore=!1;var e=this;if(e.pageNum>=e.total_page)this.isNOMore=!0;else{e.pageNum+=1;var o={store_id:this.$route.params.store_id,kwd:this.inputs,page:this.pageNum};this.$route.query.cid&&(o.category=this.$route.query.cid),$http.get("plugin.store-cashier.frontend.store.goods.get-goods-by-kwd",o,"加载中...").then((function(o){if(e.isLoadMore=!0,1!=o.result)return e.pageNum=e.pageNum-1,void(e.isLoadMore=!1);t.goods=t.goods.concat(o.data.data)})).catch((function(t){}))}},goback:function(){this.$router.go(-1)},gotoSearch:function(){var t=this,e={store_id:this.$route.params.store_id,kwd:this.inputs,page:this.pageNum};this.$route.query.cid&&(e.category=this.$route.query.cid),$http.get("plugin.store-cashier.frontend.store.goods.get-goods-by-kwd",e,".").then((function(e){1==e.result?(t.goods=t.goods.concat(e.data.data),t.isLoadMore=!0,t.total_page=e.data.last_page,t.total_page||(t.total_page=0)):(t.loading=!0,t.allLoaded=!0)}))},gotoCouponSearch:function(){var t=this;this.goload=!0;var e={store_id:this.$route.params.store_id,page:this.pageNum},o="";if(2==this.$route.params.fromHome)e.goods_ids=this.$route.query.gid,o="plugin.store-cashier.frontend.store.goods.get-goods-by-ids";else{if(3!=this.$route.params.fromHome)return this.gotoSearch();e.category_id=this.$route.query.cid,o="plugin.store-cashier.frontend.store.goods.get-goods-by-category-id-and-store-id"}$http.get(o,e,".").then((function(e){if(1==e.result)if(t.pageNum=Number(t.pageNum)+1,t.loading=!1,t.allLoaded=!1,2==t.$route.params.fromHome){if(t.goods=t.goods.concat(e.data.data),e.data.current_page==e.data.last_page||e.data.total<=0)return t.loading=!0,void(t.allLoaded=!0)}else t.goods=e.data;else t.loading=!0,t.allLoaded=!0}))}}),mounted:function(){this.storeId=this.$route.params.store_id,this.gotoCouponSearch()},created:function(){},components:{cGoodsList:c["a"],yzBlank:d["default"]}},u=l,h=(o("eb88"),o("2877")),g=Object(h["a"])(u,i,a,!1,null,"36664f37",null);e["default"]=g.exports},eb88:function(t,e,o){"use strict";o("1441")}}]); |