1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/advance/search/search"],{"10dd":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a(n("4795"));function a(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n,r,a,o,s){try{var c=t[o](s),i=c.value}catch(u){return void n(u)}c.done?e(i):Promise.resolve(i).then(r,a)}function s(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var s=t.apply(e,n);function c(t){o(s,r,a,c,i,"next",t)}function i(t){o(s,r,a,c,i,"throw",t)}c(void 0)}))}}function c(t){return h(t)||l(t)||u(t)||i()}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t,e){if(t){if("string"===typeof t)return f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(t,e):void 0}}function l(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function h(t){if(Array.isArray(t))return f(t)}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var d=function(){Promise.all([n.e("common/vendor"),n.e("plugins/advance/components/index-product-list")]).then(function(){return resolve(n("8d6f"))}.bind(null,n)).catch(n.oe)},v="ADVANCE_SEARCH",g={name:"search",data:function(){return{search_text:"",search_list:[],strong:[],search:!1,page:1,over:!1,interval:0}},onLoad:function(){this.$storage.getStorageSync(v)?this.strong=this.$storage.getStorageSync(v):this.$storage.setStorageSync(v,[])},onHide:function(){clearInterval(this.interval)},onUnload:function(){clearInterval(this.interval)},onReachBottom:function(){var t=this;this.over||(this.page+=1,this.$request({url:this.$api.advance.goods,method:"get",data:{keyword:this.search_text,page:this.page}}).then((function(e){0===e.code&&(e.data.list.length>0?t.search_list=[].concat(c(t.search_list),c(e.data.list)):t.over=!0)})))},methods:{empyt_search:function(){this.search_text="",this.search_list=[],this.search=!1,clearInterval(this.interval)},request:function(){var t=this;return s(r.default.mark((function e(){var n,a,o;return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.search=!0,t.page=1,n=t.$storage.getStorageSync(v),!t.search_text.match(/^[ ]*$/)){e.next=5;break}return e.abrupt("return");case 5:return a=[].concat(c(n),[t.search_text]),e.next=8,t.$request({url:t.$api.advance.goods,method:"get",data:{keyword:t.search_text,page:t.page}});case 8:o=e.sent,0===o.code&&(t.search_list=o.data.list,t.set_interval(),t.$storage.setStorageSync(v,a));case 10:case"end":return e.stop()}}),e)})))()},empty_strong:function(){this.$storage.removeStorageSync(v),this.strong=[]},search_strong:function(t){this.search_text=t,this.request()},set_interval:function(){var t=this;clearInterval(this.interval),this.interval=setInterval((function(){var e=(new Date).getTime();0===t.search_list.length&&clearInterval(t.interval);for(var n=0;n<t.search_list.length;n++){var r=new Date(t.search_list[n].advanceGoods.end_prepayment_at.replace(/-/g,"/")).getTime(),a=r-e;if(a>0){var o=parseInt(a/1e3/60/60/24%30),s=parseInt(a/1e3/60/60%24),c=parseInt(a/1e3/60%60),i=parseInt(a/1e3%60);o>0?t.$set(t.search_list[n],"html",o+"天"+s+":"+(c<10?"0"+c:c)+":"+(i<10?"0"+i:i)):t.$set(t.search_list[n],"html",s+":"+(c<10?"0"+c:c)+":"+(i<10?"0"+i:i))}else t.$delete(t.search_list,n),t.search_list.length<10&&t.page_count>1&&t.$request({url:t.$api.advance.goods,method:"get"}).then((function(e){0===e.code&&(t.search_list=e.data.list,t.set_interval())}))}}),1e3)}},components:{"index-product-list":d}};e.default=g},"1d1e":function(t,e,n){"use strict";n.r(e);var r=n("b5ce"),a=n("8e83");for(var o in a)"default"!==o&&function(t){n.d(e,t,(function(){return a[t]}))}(o);n("29c4");var s,c=n("f0c5"),i=Object(c["a"])(a["default"],r["b"],r["c"],!1,null,"181ef736",null,!1,r["a"],s);e["default"]=i.exports},"29c4":function(t,e,n){"use strict";var r=n("84f8"),a=n.n(r);a.a},"84f8":function(t,e,n){},"8e83":function(t,e,n){"use strict";n.r(e);var r=n("10dd"),a=n.n(r);for(var o in r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=a.a},b5ce:function(t,e,n){"use strict";var r,a=function(){var t=this,e=t.$createElement;t._self._c},o=[];n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}))},c24c:function(t,e,n){"use strict";(function(t){n("8748");r(n("66fd"));var e=r(n("1d1e"));function r(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])}},[["c24c","common/runtime","common/vendor"]]]);
|