1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/miaosha/goods/goods"],{"1a89":function(t,e,n){"use strict";var o,i=function(){var t=this,e=t.$createElement,n=(t._self._c,Number(110));t.$mp.data=Object.assign({},{$root:{m0:n}})},a=[];n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return o}))},"420b":function(t,e,n){"use strict";n.r(e);var o=n("1a89"),i=n("f750");for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);n("c300");var r,s=n("f0c5"),c=Object(s["a"])(i["default"],o["b"],o["c"],!1,null,"510536b6",null,!1,o["a"],r);e["default"]=c.exports},"46ef":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=a(n("4795")),i=n("2f62");function a(t){return t&&t.__esModule?t:{default:t}}function r(t,e,n,o,i,a,r){try{var s=t[a](r),c=s.value}catch(p){return void n(p)}s.done?e(c):Promise.resolve(c).then(o,i)}function s(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function s(t){r(a,o,i,s,c,"next",t)}function c(t){r(a,o,i,s,c,"throw",t)}s(void 0)}))}}function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var d=function(){Promise.all([n.e("common/vendor"),n.e("components/page-component/goods/app-goods-banner")]).then(function(){return resolve(n("de38"))}.bind(null,n)).catch(n.oe)},l=function(){n.e("plugins/miaosha/components/app-goods-time").then(function(){return resolve(n("e57e"))}.bind(null,n)).catch(n.oe)},h=function(){n.e("plugins/miaosha/components/app-merchant-guarantee").then(function(){return resolve(n("f9f1"))}.bind(null,n)).catch(n.oe)},m=function(){n.e("plugins/miaosha/components/app-price-title-share").then(function(){return resolve(n("e3fe"))}.bind(null,n)).catch(n.oe)},f=function(){Promise.all([n.e("common/vendor"),n.e("components/page-component/app-attr/app-attr")]).then(function(){return resolve(n("4761"))}.bind(null,n)).catch(n.oe)},g=function(){n.e("components/page-component/goods/app-goods-attr").then(function(){return resolve(n("e7a9"))}.bind(null,n)).catch(n.oe)},v=function(){n.e("components/page-component/app-related-suggestion-product/app-related-suggestion-product").then(function(){return resolve(n("f0d4"))}.bind(null,n)).catch(n.oe)},b=function(){Promise.all([n.e("common/vendor"),n.e("components/page-component/goods/app-goods-service")]).then(function(){return resolve(n("be7d"))}.bind(null,n)).catch(n.oe)},_=function(){Promise.all([n.e("common/vendor"),n.e("components/page-component/goods/app-goods-marketing")]).then(function(){return resolve(n("b3c0"))}.bind(null,n)).catch(n.oe)},y=function(){n.e("components/page-component/app-join-member/app-join-member").then(function(){return resolve(n("af6d"))}.bind(null,n)).catch(n.oe)},w=function(){n.e("components/page-component/goods/app-goods-detail").then(function(){return resolve(n("04ea"))}.bind(null,n)).catch(n.oe)},O=function(){n.e("components/page-component/app-iphonex-bottom/app-iphonex-bottom").then(function(){return resolve(n("152d"))}.bind(null,n)).catch(n.oe)},j=function(){Promise.all([n.e("common/vendor"),n.e("components/basic-component/app-iphone-x/app-iphone-x")]).then(function(){return resolve(n("bd7b"))}.bind(null,n)).catch(n.oe)},P=function(){Promise.all([n.e("common/vendor"),n.e("components/basic-component/app-empty-bottom/app-empty-bottom")]).then(function(){return resolve(n("51dc"))}.bind(null,n)).catch(n.oe)},A=function(){Promise.all([n.e("common/vendor"),n.e("components/page-component/app-vip-card/app-vip-card")]).then(function(){return resolve(n("744f"))}.bind(null,n)).catch(n.oe)},$={name:"goods",data:function(){return{detail:{},cartShow:!1,miaosha_status:-1,miaosha_time:0,selectAttr:{},previewUrl:this.$api.miaosha.order_preview,submitUrl:this.$api.miaosha.order_submit,url:"",show:!1,list:[],miaosha_buy_count:0,appAttr:{},goods_id:-1,hour:0,minute:0,second:0,day:0,time:-1,is_vip_card_user:0,discount:null,is_vip:!1,loading:!1}},onLoad:function(t){this.goods_id=t.id},onShow:function(){var t=this;this.$nextTick((function(){var e=t;t.request({url:t.$api.miaosha.goods_detail,data:{id:t.goods_id}}).then((function(n){var o=n.detail,i=n.miaosha_status,a=n.miaosha_time,r=n.miaosha_buy_count;t.detail=o,t.miaosha_status=i,t.miaosha_buy_count=r,t.loading=!0,t.url="".concat(t.$api.miaosha.poster,"&goods_id=").concat(t.detail.id),t.getTime(a),t.request({url:t.$api.goods.new_recommend,data:{goods_id:t.detail.id}}).then((function(n){t.list=n.list,e.detail.vip_card_appoint.discount>0&&(e.is_vip=!0,e.discount=e.detail.vip_card_appoint.discount),e.is_vip_card_user=e.detail.vip_card_appoint.is_vip_card_user}))}))}))},onHide:function(){clearInterval(this.time)},onUnload:function(){clearInterval(this.time)},computed:p({},(0,i.mapState)("gConfig",{iphone:function(t){return t.iphone},iphoneHeight:function(t){return t.iphoneHeight}}),{},(0,i.mapState)({mall:function(t){return t.mallConfig.mall}})),onShareAppMessage:function(){return this.$shareAppMessage({path:"/plugins/miaosha/goods/goods",title:this.detail.app_share_title?this.detail.app_share_title:this.detail.name,imageUrl:this.detail.app_share_pic?this.detail.app_share_pic:"",params:{id:this.detail.id}})},methods:{attr:function(t){this.appAttr=t},request:function(t){var e=this;return s(o.default.mark((function n(){var i,a,r;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i=t.url,a=t.data,n.next=3,e.$request({url:i,data:a});case 3:if(r=n.sent,0!==r.code){n.next=6;break}return n.abrupt("return",r.data);case 6:case"end":return n.stop()}}),n)})))()},attrtap:function(t){this.selectAttr=null!==t?t:{}},joinCart:function(){var t=this;"none"===this.appAttr.display?this.show=Math.random():this.$request({url:this.$api.miaosha.add_cart,method:"post",data:{miaosha_goods_id:this.selectAttr.goods_id,attr_id:this.selectAttr.id,num:this.appAttr.number}}).then((function(e){0===e.code&&(t.appAttr.display="none")}))},buy:function(){if("none"===this.appAttr.display)this.show=Math.random();else{for(var t=this.detail.mch_id,e=[],n={id:this.detail.id,attr:[],num:this.appAttr.number,goods_attr_id:this.selectAttr.id,cart_id:0},o=0;o<this.selectAttr.attr_list.length;o++){var i={attr_id:this.selectAttr.attr_list[o].attr_id,attr_group_id:this.selectAttr.attr_list[o].attr_group_id};n.attr.push(i)}e.push({mch_id:t,goods_list:[n]}),this.$jump({open_type:"navigate",url:"/pages/order-submit/order-submit?mch_list=".concat(JSON.stringify(e),"&preview_url=").concat(encodeURIComponent(this.$api.miaosha.order_preview),"&submit_url=").concat(encodeURIComponent(this.$api.miaosha.order_submit))})}},getTime:function(t){var e=this;t-=1,this.day=parseInt(t/3600/24),this.hour=parseInt(t/3600%24),this.minute=parseInt(t/60%60),this.second=parseInt(t%60),clearInterval(this.time),this.time=setInterval((function(){t-=1,t<0&&clearInterval(e.time),e.day=parseInt(t/3600/24),e.hour=parseInt(t/3600%24),e.minute=parseInt(t/60%60),e.second=parseInt(t%60)}),1e3)}},components:{"app-banner":d,"app-goods-time":l,"app-merchant-guarantee":h,"app-price-title-share":m,"app-attr":f,"app-goods-attr":g,"app-related-suggestion-product":v,"app-goods-service":b,"app-goods-marketing":_,"app-join-member":y,"app-goods-detail":w,"app-iphone-bottom":O,"app-iphone-x":j,"app-empty-bottom":P,"app-vip-card":A}};e.default=$},5604:function(t,e,n){"use strict";(function(t){n("8748");o(n("66fd"));var e=o(n("420b"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},c300:function(t,e,n){"use strict";var o=n("d25ab"),i=n.n(o);i.a},d25ab:function(t,e,n){},f750:function(t,e,n){"use strict";n.r(e);var o=n("46ef"),i=n.n(o);for(var a in o)"default"!==a&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=i.a}},[["5604","common/runtime","common/vendor"]]]);
|