1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/advance/index/index"],{"12cd":function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=a(e("4795"));function a(t){return t&&t.__esModule?t:{default:t}}function i(t){return s(t)||u(t)||c(t)||o()}function o(){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 c(t,n){if(t){if("string"===typeof t)return l(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?l(t,n):void 0}}function u(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function s(t){if(Array.isArray(t))return l(t)}function l(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}function f(t,n,e,r,a,i,o){try{var c=t[i](o),u=c.value}catch(s){return void e(s)}c.done?n(u):Promise.resolve(u).then(r,a)}function d(t){return function(){var n=this,e=arguments;return new Promise((function(r,a){var i=t.apply(n,e);function o(t){f(i,r,a,o,c,"next",t)}function c(t){f(i,r,a,o,c,"throw",t)}o(void 0)}))}}var p=function(){e.e("plugins/advance/components/search-input").then(function(){return resolve(e("4333"))}.bind(null,e)).catch(e.oe)},v=function(){e.e("plugins/advance/components/index-swipe").then(function(){return resolve(e("870f"))}.bind(null,e)).catch(e.oe)},h=function(){Promise.all([e.e("common/vendor"),e.e("plugins/advance/components/index-product-list")]).then(function(){return resolve(e("8d6f"))}.bind(null,e)).catch(e.oe)},m={name:"index",data:function(){return{product_list:[],picture_list:[],page_count:1,interval:null,page:1}},onHide:function(){clearInterval(this.interval)},onUnload:function(){clearInterval(this.interval)},onLoad:function(){var t=this;this.requestBanner().then((function(){t.requestList()}))},methods:{cutoffTime:function(t){var n=this,e=(new Date).getTime();t.map((function(r,a){var i=new Date(r.advanceGoods.end_prepayment_at.replace(/-/g,"/")).getTime(),o=i-e;if(o>0){var c=parseInt(o/1e3/60/60/24),u=parseInt(o/1e3/60/60%24),s=parseInt(o/1e3/60%60),l=parseInt(o/1e3%60);c>0?n.$set(t[a],"html","".concat(c,"天").concat(u,":").concat(s<10?"0"+s:s,":").concat(l<10?"0"+l:l)):n.$set(t[a],"html","".concat(u,":").concat(s<10?"0"+s:s,":").concat(l<10?"0"+l:l))}else n.$delete(t,a),n.product_list.length<10&&n.page_count>1&&(n.product_list=[],n.requestList())}))},set_interval:function(){var t=this;clearInterval(this.interval),this.cutoffTime(this.product_list),this.interval=setInterval((function(){t.cutoffTime(t.product_list)}),1e3)},requestList:function(){var t=this;return d(r.default.mark((function n(){var e,a;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.$request({url:t.$api.advance.goods,method:"get",data:{page:t.page}});case 2:e=n.sent,0===e.code&&((a=t.product_list).push.apply(a,i(e.data.list)),t.page_count=e.data.pagination.page_count,t.set_interval());case 4:case"end":return n.stop()}}),n)})))()},requestBanner:function(){var t=this;return d(r.default.mark((function n(){return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:t.$request({url:t.$api.advance.banner,method:"get"}).then((function(n){0===n.code&&(t.picture_list=n.data.list)}));case 1:case"end":return n.stop()}}),n)})))()}},components:{"search-input":p,"index-swipe":v,"product-list":h},onShareAppMessage:function(){return this.$shareAppMessage({path:"/plugins/advance/index/index",title:this.$children[0].navigationBarTitle})},onReachBottom:function(){this.page<this.page_count&&(this.page++,this.requestList())}};n.default=m},"45f8":function(t,n,e){"use strict";e.r(n);var r=e("12cd"),a=e.n(r);for(var i in r)"default"!==i&&function(t){e.d(n,t,(function(){return r[t]}))}(i);n["default"]=a.a},"868c":function(t,n,e){"use strict";(function(t){e("8748");r(e("66fd"));var n=r(e("934c"));function r(t){return t&&t.__esModule?t:{default:t}}t(n.default)}).call(this,e("543d")["createPage"])},"934c":function(t,n,e){"use strict";e.r(n);var r=e("f317"),a=e("45f8");for(var i in a)"default"!==i&&function(t){e.d(n,t,(function(){return a[t]}))}(i);e("9568");var o,c=e("f0c5"),u=Object(c["a"])(a["default"],r["b"],r["c"],!1,null,"47662716",null,!1,r["a"],o);n["default"]=u.exports},9568:function(t,n,e){"use strict";var r=e("f004"),a=e.n(r);a.a},f004:function(t,n,e){},f317:function(t,n,e){"use strict";var r,a=function(){var t=this,n=t.$createElement;t._self._c},i=[];e.d(n,"b",(function(){return a})),e.d(n,"c",(function(){return i})),e.d(n,"a",(function(){return r}))}},[["868c","common/runtime","common/vendor"]]]);
|