detail.js 8.7 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/advance/detail/detail"],{"0cbb":function(t,e,n){"use strict";(function(t){n("8748");o(n("66fd"));var e=o(n("dfd5"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},"2e1f":function(t,e,n){"use strict";n.r(e);var o=n("3c3e"),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},"38b6":function(t,e,n){"use strict";var o,i=function(){var t=this,e=t.$createElement,n=(t._self._c,{attr_list:t.select_attr_group}),o=Number(110),i=Number(110);t._isMounted||(t.e0=function(e){t.active=!1}),t.$mp.data=Object.assign({},{$root:{a0:n,m0:o,m1:i}})},a=[];n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return o}))},"3c3e":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n("2f62");function i(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 a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var c=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)},s=function(){n.e("plugins/advance/components/detail-ad").then(function(){return resolve(n("cd80"))}.bind(null,n)).catch(n.oe)},l=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(){n.e("components/page-component/goods/app-goods-detail").then(function(){return resolve(n("04ea"))}.bind(null,n)).catch(n.oe)},d=function(){n.e("plugins/advance/components/detail-price-share").then(function(){return resolve(n("b810"))}.bind(null,n)).catch(n.oe)},u=function(){Promise.all([n.e("common/vendor"),n.e("plugins/advance/components/detail-bottom-button")]).then(function(){return resolve(n("8d12"))}.bind(null,n)).catch(n.oe)},h=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)},m=function(){n.e("plugins/advance/components/detail-attr").then(function(){return resolve(n("ce11"))}.bind(null,n)).catch(n.oe)},f=function(){n.e("components/page-component/app-join-member/app-join-member").then(function(){return resolve(n("af6d"))}.bind(null,n)).catch(n.oe)},g=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(){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)},v=function(){n.e("plugins/advance/components/detail-discount").then(function(){return resolve(n("dec5"))}.bind(null,n)).catch(n.oe)},b=function(){n.e("plugins/advance/components/detail-vip").then(function(){return resolve(n("a9c4"))}.bind(null,n)).catch(n.oe)},w=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)},O=function(){n.e("components/page-component/app-goods-detail/app-name").then(function(){return resolve(n("11d7"))}.bind(null,n)).catch(n.oe)},P=function(){Promise.all([n.e("common/vendor"),n.e("components/page-component/app-quick-navigation/app-quick-navigation")]).then(function(){return resolve(n("cf64"))}.bind(null,n)).catch(n.oe)},j=function(){n.e("components/page-component/goods/app-goods-attr").then(function(){return resolve(n("e7a9"))}.bind(null,n)).catch(n.oe)},y=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)},k={name:"detail",data:function(){return{detail:{},active:!0,attr_deposit:"0",attr_swell_deposit:"0",attr_stock:0,attr_price:"0",attr_price_member:0,url:"",level_show:0,loading:!1,select_attr_group:[],zhe:!1,list:[],num:1,shareShow:!1,attr_pic_url:"",goods_id:-1,d:0,h:0,m:0,s:0,end_time:-1}},onLoad:function(t){this.goods_id=t.id},onShow:function(){var e=this;this.$nextTick((function(){e.request_detail({id:e.goods_id}),e.$request({url:e.$api.advance.goods_list,data:{goods_id:e.goods_id}}).then((function(n){0===n.code?e.list=n.data.list:1===n.code&&t.showModal({title:"提示",content:n.msg})}))}))},onHide:function(){clearInterval(this.end_time)},onUnload:function(){clearInterval(this.end_time)},methods:{request_detail:function(e){var n=this;t.showLoading({title:"加载中"}),this.$request({url:this.$api.advance.detail,data:{id:e.id},method:"get"}).then((function(e){0===e.code?(t.hideLoading(),n.detail=e.data.detail,n.detail.num=1,n.loading=!0,n.url="".concat(n.$api.advance.poster,"&goods_id=").concat(n.detail.id),n.getTime(n.detail.advanceGoods.end_prepayment_at),n.set_attr_active()):1===e.code&&t.showModal({title:"提示",content:e.msg})}))},open_share:function(){this.shareShow=!0},change_num:function(t){this.num+=t},change_num_data:function(t){this.num=t},favorite:function(t){this.detail.favorite=t},select_attr:function(t,e){for(var n=this.detail.attr_groups,o=":",i=0,a=0;a<n.length;a++)for(var r=this.detail.attr_groups[a].attr_list,c=0;c<r.length;c++)n[a].attr_group_id===t&&r[c].attr_id===e?this.$set(this.detail.attr_groups[a].attr_list[c],"active",!0):n[a].attr_group_id===t&&r[c].attr_id!==e&&this.$set(this.detail.attr_groups[a].attr_list[c],"active",!1),this.detail.attr_groups[a].attr_list[c].active&&(i=this.detail.attr_groups[a].attr_list[c].attr_id,o+=":".concat(i));var s=o.substr(2);this.get_price_stock(s)},set_attr_active:function(){for(var t=0,e=":",n=0;n<this.detail.attr_groups.length;n++)for(var o=0;o<this.detail.attr_groups[n].attr_list.length;o++)0!==o?this.$set(this.detail.attr_groups[n].attr_list[o],"active",!1):0===o&&(t=this.detail.attr_groups[n].attr_list[o].attr_id,e+=":".concat(t),this.$set(this.detail.attr_groups[n].attr_list[o],"active",!0));this.get_price_stock(e.substr(2))},get_price_stock:function(t){for(var e=this.detail.attr,n=0;n<e.length;n++)if(e[n].sign_id===t){this.select_attr_group=e[n].attr_list;var o=e[n],i=o.deposit,a=o.swell_deposit,r=o.stock,c=o.price,s=o.price_member,l=o.pic_url;this.attr_deposit=i,this.attr_swell_deposit=a,this.attr_stock=r,this.attr_price=c,this.attr_price_member=s,this.attr_pic_url=l}},close_attr:function(t){this.active=t},getTime:function(t){var e=this,n=new Date(t.replace(/-/g,"/")).getTime()-(new Date).getTime();console.log(t),this.d=parseInt(n/1e3/60/60/24),this.h=parseInt(n/1e3/60/60%24),this.m=parseInt(n/1e3/60%60),this.s=parseInt(n/1e3%60),this.end_time=setInterval((function(){var n=(new Date).getTime(),o=new Date(t.replace(/-/g,"/")).getTime(),i=o-n;if(i>0){var a=parseInt(i/1e3/60/60/24),r=parseInt(i/1e3/60/60%24),c=parseInt(i/1e3/60%60),s=parseInt(i/1e3%60);e.d=a,e.h=r,e.m=c,e.s=s}else clearInterval(e.end_time)}),1e3)}},components:{"app-goods-banner":c,"detail-ad":s,"app-iphone-x":l,"app-goods-detail":p,"detail-price-share":d,"detail-bottom-button":u,"app-empty-bottom":h,"detail-attr":m,"app-join-member":f,"app-goods-service":g,"app-related-suggestion-product":_,"detail-discount":v,"detail-vip":b,"app-name":O,"app-vip-card":w,"app-quick-navigation":P,"app-goods-attr":j,"app-goods-marketing":y},computed:a({},(0,o.mapGetters)("mallConfig",{vip:"getVip"}),{},(0,o.mapGetters)("user",{is_vip:"is_vip"}),{},(0,o.mapState)({mall:function(t){return t.mallConfig.mall}})),onShareAppMessage:function(){return this.$shareAppMessage({path:"/plugins/advance/detail/detail",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}})}};e.default=k}).call(this,n("543d")["default"])},"7ef4":function(t,e,n){},8270:function(t,e,n){"use strict";var o=n("7ef4"),i=n.n(o);i.a},dfd5:function(t,e,n){"use strict";n.r(e);var o=n("38b6"),i=n("2e1f");for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);n("8270");var r,c=n("f0c5"),s=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,"2ddcb0b6",null,!1,o["a"],r);e["default"]=s.exports}},[["0cbb","common/runtime","common/vendor"]]]);