3 lines
14 KiB
JavaScript
3 lines
14 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-386ffced"],{"1da1":function(t,e,o){"use strict";o.d(e,"a",(function(){return n}));o("d3b7");function r(t,e,o,r,n,i,a){try{var s=t[i](a),c=s.value}catch(u){return void o(u)}s.done?e(c):Promise.resolve(c).then(r,n)}function n(t){return function(){var e=this,o=arguments;return new Promise((function(n,i){var a=t.apply(e,o);function s(t){r(a,n,i,s,c,"next",t)}function c(t){r(a,n,i,s,c,"throw",t)}s(void 0)}))}}},"253a":function(t,e,o){t.exports=o.p+"static/app/img/img_default.a608a24a.png"},4866:function(t,e,o){var r=o("24fb");e=r(!1),e.push([t.i,"#search .osll[data-v-0d571755]{min-height:100vh;overflow:scroll}#search .uou[data-v-0d571755]{width:100%;position:fixed;z-index:99;top:0;transition:.2s;-webkit-transition:.2s;background:#fff}#search #sort[data-v-0d571755]{line-height:2.5rem;font-size:14px}#search .mout[data-v-0d571755]{top:-2.25rem}.search[data-v-0d571755]{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-0d571755]{width:2.8125rem}.search .back i[data-v-0d571755]{line-height:2.8125rem;font-size:1.5rem}.search .search-box[data-v-0d571755]{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-0d571755]{-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-0d571755]{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},"67ee":function(t,e,o){"use strict";o("77d4f")},"77d4f":function(t,e,o){var r=o("4866");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);var n=o("499e").default;n("2ef340b8",r,!0,{sourceMap:!1,shadowMode:!1})},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 i}));var r=document.documentElement,n=document.body,i={data:function(){return{}},activated:function(){window.addEventListener("scroll",this.handleScroll)},deactivated:function(){window.removeEventListener("scroll",this.handleScroll)},methods:{getScrollTop:function(){var t=0;return r&&r.scrollTop?t=r.scrollTop:n&&(t=n.scrollTop),t},getClientHeight:function(){var t=0;return t=n.clientHeight&&r.clientHeight?Math.min(n.clientHeight,r.clientHeight):Math.max(n.clientHeight,r.clientHeight),t},getScrollHeight:function(){return Math.max(n.scrollHeight,r.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(){}}}},c7eb:function(t,e,o){"use strict";o.d(e,"a",(function(){return n}));o("a4d3"),o("e01a"),o("d3b7"),o("d28b"),o("3ca3"),o("ddb0"),o("b636"),o("944a"),o("0c47"),o("23dc"),o("d9e2"),o("3410"),o("159b"),o("b0c0"),o("131a"),o("fb6a");var r=o("53ca");function n(){
|
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
n=function(){return t};var t={},e=Object.prototype,o=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,o){return Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(N){u=function(t,e,o){return t[e]=o}}function l(t,e,o,r){var n=e&&e.prototype instanceof f?e:f,i=Object.create(n.prototype),a=new S(r||[]);return i._invoke=function(t,e,o){var r="suspendedStart";return function(n,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===n)throw i;return j()}for(o.method=n,o.arg=i;;){var a=o.delegate;if(a){var s=L(a,o);if(s){if(s===h)continue;return s}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===r)throw r="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r="executing";var c=d(t,e,o);if("normal"===c.type){if(r=o.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:o.done}}"throw"===c.type&&(r="completed",o.method="throw",o.arg=c.arg)}}}(t,o,a),i}function d(t,e,o){try{return{type:"normal",arg:t.call(e,o)}}catch(N){return{type:"throw",arg:N}}}t.wrap=l;var h={};function f(){}function p(){}function g(){}var m={};u(m,a,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(E([])));y&&y!==e&&o.call(y,a)&&(m=y);var w=g.prototype=f.prototype=Object.create(m);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function n(i,a,s,c){var u=d(t[i],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==Object(r["a"])(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,s,c)}),(function(t){n("throw",t,s,c)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,c)}))}c(u.arg)}var i;this._invoke=function(t,o){function r(){return new e((function(e,r){n(t,o,e,r)}))}return i=i?i.then(r,r):r()}}function L(t,e){var o=t.iterator[e.method];if(void 0===o){if(e.delegate=null,"throw"===e.method){if(t.iterator["return"]&&(e.method="return",e.arg=void 0,L(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var r=d(o,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,h;var n=r.arg;return n?n.done?(e[t.resultName]=n.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):n:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=g,u(w,"constructor",g),u(g,"constructor",p),p.displayName=u(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},b(x.prototype),u(x.prototype,s,(function(){return this})),t.AsyncIterator=x,t.async=function(e,o,r,n,i){void 0===i&&(i=Promise);var a=new x(l(e,o,r,n),i);return t.isGeneratorFunction(o)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(w),u(w,c,"Generator"),u(w,a,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var o in t)e.push(o);return e.reverse(),function o(){for(;e.length;){var r=e.pop();if(r in t)return o.value=r,o.done=!1,o}return o.done=!0,o}},t.values=E,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(o,r){return a.type="throw",a.arg=t,e.next=o,r&&(e.method="next",e.arg=void 0),!!r}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.finallyLoc===t)return this.complete(o.completion,o.afterLoc),_(o),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc===t){var r=o.completion;if("throw"===r.type){var n=r.arg;_(o)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,o){return this.delegate={iterator:E(t),resultName:e,nextLoc:o},"next"===this.method&&(this.arg=void 0),h}},t}},d692:function(t,e,o){"use strict";o.r(e);var r=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",{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}})],1)},n=[],i=o("5530"),a=(o("ac1f"),o("841c"),o("99af"),o("a9e3"),o("5880")),s=o("ac0d"),c=o("98e3"),u={mixins:[s["a"]],data:function(){return{inputs:"",amout:!1,allLoaded:!0,goload:!1,goods:[],loading:!1,styleObj:{display:"inline-block",marginRight:"25px",backgroundColor:"white",marginLeft:"5px",position:"static"},jumpSo:!0,storeId:"",pageNum:1,page:1,isLoadMore:!0,total_page:0}},computed:Object(i["a"])({},Object(a["mapState"])(["view"])),methods:Object(i["a"])(Object(i["a"])({},Object(a["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};$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};$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="";2==this.$route.params.fromHome?(e.goods_ids=this.$route.query.gid,o="plugin.store-cashier.frontend.store.goods.get-goods-by-ids"):3==this.$route.params.fromHome?(e.category_id=this.$route.query.cid,o="plugin.store-cashier.frontend.store.goods.get-goods-by-category-id-and-store-id"):this.$router.go(-1),$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(e.data.total<=0)return t.loading=!0,void(t.allLoaded=!0);if(t.goods=t.goods.concat(e.data.data),e.data.current_page==e.data.last_page)return t.loading=!0,void(t.allLoaded=!0)}else t.goods=e.data;else t.loading=!0,t.allLoaded=!0}))}}),activated:function(){this.storeId=this.$route.params.store_id,this.amout=!1,this.loading=!1,1!==this.$route.params.fromHome?(window.location.href.indexOf("#/store/search/")>-1&&setTimeout((function(){window.scrollTo(0,window.storeSearchScrollTop)}),200),this.gotoCouponSearch()):(this.goods=[],this.inputs="",this.pageNum=1)},created:function(){1!==this.$route.params.fromHome&&(this.goods=[],this.inputs="",this.pageNum=1)},mounted:function(){window.storeSearchScrollTop=0},beforeRouteLeave:function(t,e,o){window.storeSearchScrollTop=document.documentElement.scrollTop||document.body.scrollTop,o()},components:{cGoodsList:c["a"]}},l=u,d=(o("67ee"),o("2877")),h=Object(d["a"])(l,r,n,!1,null,"0d571755",null);e["default"]=h.exports}}]); |