(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/wholesale/goods/goods"],{1432:function(t,e,o){"use strict";var n;o.d(e,"b",(function(){return r})),o.d(e,"c",(function(){return i})),o.d(e,"a",(function(){return n}));var r=function(){var t=this,e=t.$createElement,o=(t._self._c,t.goods.id>0&&1==t.is_open&&1===t.goods.is_negotiable?t.__map(t.good_negotiable,(function(e,o){var n=t.__get_orig(e),r="contact_tel"!==e&&"contact"!==e&&"contact_web"===e?encodeURIComponent(t.mall.setting.web_service_url):null;return{$orig:n,m0:r}})):null);t.$mp.data=Object.assign({},{$root:{l0:o}})},i=[]},"550e":function(t,e,o){"use strict";o.r(e);var n=o("7ea1"),r=o.n(n);for(var i in n)"default"!==i&&function(t){o.d(e,t,(function(){return n[t]}))}(i);e["default"]=r.a},"7ea1":function(t,e,o){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(o("a34a")),r=o("2f62"),i=a(o("e829"));function a(t){return t&&t.__esModule?t:{default:t}}function s(t,e,o,n,r,i,a){try{var s=t[i](a),c=s.value}catch(l){return void o(l)}s.done?e(c):Promise.resolve(c).then(n,r)}function c(t){return function(){var e=this,o=arguments;return new Promise((function(n,r){var i=t.apply(e,o);function a(t){s(i,n,r,a,c,"next",t)}function c(t){s(i,n,r,a,c,"throw",t)}a(void 0)}))}}function l(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,n)}return o}function u(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){o=t[Symbol.iterator]()},n:function(){var t=o.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==o.return||o.return()}finally{if(s)throw i}}}}function f(t,e){if(t){if("string"===typeof t)return g(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?g(t,e):void 0}}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,n=new Array(e);o0&&(o.is_vip=!0,o.discount=o.goods.vip_card_appoint.discount),o.is_vip_card_user=o.goods.vip_card_appoint.is_vip_card_user;var n,r=h(o.goods.attr);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.number="0"}}catch(u){r.e(u)}finally{r.f()}if(1==o.goods.attr_groups.length)o.goods.attr[0].number="0";else{var a,s=h(o.goods.attr_groups);try{for(s.s();!(a=s.n()).done;){var c=a.value;for(var l in c.less_attr_group_name=c.attr_group_name.substring(0,10),c.scrollLeft=0,c.attr_list)c.attr_list[l].active=!(l>0),c.attr_list[l].number=0}}catch(u){s.e(u)}finally{s.f()}}o.flash_sale=o.goods.plugin_extra.flash_sale,o.loading=!0,o.$hideLoading()}))},onShow:function(){var t=this;if(this.showClose=!1,setTimeout((function(){t.showClose=!0})),this.first)return!1;var e=JSON.parse(JSON.stringify(this.goods.attr)),o=JSON.parse(JSON.stringify(this.goods.attr_groups));this.$showLoading(),this.$nextTick((function(){var n=t;n.request({url:n.$api.wholesale.detail,data:{id:n.goods_id}}).then((function(r){n.goods=r.detail,n.goods.attr=e,n.goods.attr_groups=o,t.$hideLoading()}))}))},computed:u(u(u({},(0,r.mapState)({isTip:function(t){return t.mallConfig.mall.setting.is_remind_sell_time},mall:function(t){return t.mallConfig.mall}})),(0,r.mapGetters)("mallConfig",{getTheme:"getTheme"})),{},{good_negotiable:function(){var t=this.mall.setting.good_negotiable;this.contact_tel="",this.contact="",this.contact_web="";for(var e=[],o=0;o0?"u-bottom-height-2":this.full_reduce||this.goods.sell_time>0?"u-bottom-height-1":"u-bottom-height-0"},leftTip:function(){var t="";return t=0==this.isTip&&this.goods.sell_time>0?"box-grow-1":"bd-btn-left bd-btn-half",this.goods&&"goods"===this.goods.type?t:""},disableBtn:function(){return this.goods.is_finish_sell?"btn-finish-sell":"bd-oversell-btn"},showRight:function(){return!(0==this.isTip&&this.goods.sell_time>0)},remindParams:function(){return{sell_time:this.goods.sell_time,goods_id:this.goods.id,template_message_list:this.goods.template_message_list,buy_text:"立即购买"}}}),onShareTimeline:function(){return this.$shareTimeline({title:this.goods.app_share_title?this.goods.app_share_title:this.goods.name,imageUrl:this.goods.pic_url[0].pic_url,query:{id:this.goods.id}})},onShareAppMessage:function(){return this.hShareAppMessage()},methods:{hShareAppMessage:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.$shareAppMessage({path:"/plugins/wholesale/goods/goods",title:this.goods.app_share_title?this.goods.app_share_title:this.goods.name,imageUrl:this.goods.app_share_pic?this.goods.app_share_pic:this.goods.pic_url[0].pic_url,desc:this.goods.subtitle,params:{id:this.goods.id}},t)},getMall:function(t){this.is_open=t.is_open},setCoupon:function(t){this.$set(this.goods.goods_coupon_center[t],"is_receive",1)},clickAttr:function(t){1===t&&this.goods.sell_time>0?this.rightTip():this.show=Math.random()},attr:function(t){this.appAttr=t},favorite:function(){var e=this.$api.user.favorite_add,o=!0;this.goods.favorite&&(e=this.$api.user.favorite_remove,o=!1),this.goods.favorite=o,this.$request({url:e,data:{goods_id:this.goods.id}}).then((function(e){0===e.code||t.showModal({title:"提示",content:e.msg,showCancel:!1})})).catch((function(t){}))},back:function(){t.reLaunch({url:"/pages/index/index"})},request:function(e){var o=this;return c(n.default.mark((function r(){var i,a,s;return n.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i=e.url,a=e.data,n.next=3,o.$request({url:i,data:a});case 3:if(s=n.sent,0!==s.code){n.next=8;break}return n.abrupt("return",s.data);case 8:t.showToast({title:s.msg,icon:"none",duration:1e3}),setTimeout((function(){t.navigateBack()}),1e3);case 10:case"end":return n.stop()}}),r)})))()},attrtap:function(t){var e=this,o=this;if(null!==t.goods){if(o.goods=t.goods,t.goodsAttr&&"undefined"!==t.goodsAttr){var n,r=h(t.goodsAttr);try{for(r.s();!(n=r.n()).done;){var i,a=n.value,s=h(o.goods.attr);try{for(s.s();!(i=s.n()).done;){var c=i.value;a.id==c.id&&(c.number=a.number)}}catch(y){s.e(y)}finally{s.f()}}}catch(y){r.e(y)}finally{r.f()}}o.totalNumber=0;var l,u=0,d=h(o.goods.attr);try{for(d.s();!(l=d.n()).done;){var f=l.value;if(o.totalNumber+=+f.number,f.number>0){var g=1===o.goods.level_show?f.price_member:f.price;u+=f.number*g}}}catch(y){d.e(y)}finally{d.f()}if(o.goods.attr_groups.length>1){var p,b=h(o.goods.attr_groups[0].attr_list);try{for(b.s();!(p=b.n()).done;){var _=p.value;_.number=0;var m,v=h(o.goods.attr);try{for(v.s();!(m=v.n()).done;){var w=m.value;w.number>0&&_.attr_id==w.attr_list[0].attr_id&&_.attr_name==w.attr_list[0].attr_name&&(_.number+=+w.number,_.length=-5-10*+_.number.toString().length)}}catch(y){v.e(y)}finally{v.f()}}}catch(y){b.e(y)}finally{b.f()}}setTimeout((function(){var t,n=0,r=h(o.goods.wholesaleGoods.wholesale_rules);try{for(r.s();!(t=r.n()).done;){var i=t.value;o.totalNumber0&&(0==o.goods.wholesaleGoods.type?u*=e.wholesaleDiscount/10:u-=e.wholesaleDiscount*o.totalNumber),o.totalPrice=u.toFixed(2)}),0)}},makePhoneCall:function(e){t.makePhoneCall({phoneNumber:e})},router:function(e){t.navigateTo({url:e})},changeTime:function(t){this.goods.sell_time=t}},components:{"app-banner":p,"app-attr":b,"app-goods-full-reduce":_,appClose:$,bdInfo:m,bdCoupon:v,bdXbc:w,bdKb:y,bdHc:T,bdDetail:k,bdComments:O,bdService:S,appSellTip:x}};e.default=P}).call(this,o("543d")["default"])},8097:function(t,e,o){},c050:function(t,e,o){"use strict";(function(t){o("2d0a");n(o("66fd"));var e=n(o("d359"));function n(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,o("543d")["createPage"])},d359:function(t,e,o){"use strict";o.r(e);var n=o("1432"),r=o("550e");for(var i in r)"default"!==i&&function(t){o.d(e,t,(function(){return r[t]}))}(i);o("d534");var a,s=o("f0c5"),c=Object(s["a"])(r["default"],n["b"],n["c"],!1,null,"2ab2d96e",null,!1,n["a"],a);e["default"]=c.exports},d534:function(t,e,o){"use strict";var n=o("8097"),r=o.n(n);r.a}},[["c050","common/runtime","common/vendor"]]]);