1 |
- (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<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?l(Object(o),!0).forEach((function(e){d(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):l(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function d(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function h(t,e){var o;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(o=f(t))||e&&t&&"number"===typeof t.length){o&&(t=o);var n=0,r=function(){};return{s:r,n:function(){return n>=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);o<e;o++)n[o]=t[o];return n}var p=function(){o.e("components/page-component/goods/app-goods-banner").then(function(){return resolve(o("d9fb"))}.bind(null,o)).catch(o.oe)},b=function(){o.e("plugins/wholesale/components/app-attr/app-attr").then(function(){return resolve(o("ac17"))}.bind(null,o)).catch(o.oe)},_=function(){o.e("components/page-component/goods/app-goods-full-reduce").then(function(){return resolve(o("bc5a"))}.bind(null,o)).catch(o.oe)},m=function(){o.e("components/page-component/goods/bd-info").then(function(){return resolve(o("543b"))}.bind(null,o)).catch(o.oe)},v=function(){Promise.all([o.e("common/vendor"),o.e("components/page-component/goods/bd-coupon")]).then(function(){return resolve(o("fb44"))}.bind(null,o)).catch(o.oe)},w=function(){o.e("components/page-component/goods/bd-xbc").then(function(){return resolve(o("48be"))}.bind(null,o)).catch(o.oe)},y=function(){o.e("components/page-component/goods/bd-kb").then(function(){return resolve(o("f02b"))}.bind(null,o)).catch(o.oe)},T=function(){o.e("components/page-component/goods/bd-hc").then(function(){return resolve(o("7eb9"))}.bind(null,o)).catch(o.oe)},k=function(){o.e("components/page-component/goods/bd-detail").then(function(){return resolve(o("7e0d"))}.bind(null,o)).catch(o.oe)},O=function(){o.e("components/page-component/goods/bd-comments").then(function(){return resolve(o("66eb"))}.bind(null,o)).catch(o.oe)},$=function(){o.e("components/basic-component/app-close/app-close").then(function(){return resolve(o("1653"))}.bind(null,o)).catch(o.oe)},S=function(){o.e("components/page-component/goods/bd-service").then(function(){return resolve(o("9413"))}.bind(null,o)).catch(o.oe)},x=function(){o.e("components/page-component/goods/app-sell-tip").then(function(){return resolve(o("f3ad"))}.bind(null,o)).catch(o.oe)},P={name:"goods",mixins:[i.default],data:function(){return{showClose:!1,is_open:0,goods:{id:"",name:"",cover_pic:"",price:"",section:[],wholesaleGoods:{rise_num:0}},selectAttr:{attr_list:[]},webUrl:"",previewUrl:this.$api.wholesale.order_preview,submitUrl:this.$api.wholesale.order_submit,show:0,list:[],appAttr:{},totalNumber:0,totalPrice:"0.00",poster_config:this.$api.wholesale.poster_config,poster_generate:this.$api.wholesale.poster_generate,url:this.$api.wholesale.poster,goods_id:-1,loading:!1,first:!0,is_vip:!1,is_vip_card_user:0,discount:null,full_reduce:null,flash_sale:null,wholesaleDiscount:0}},onLoad:function(t){var e=this;this.$commonLoad.onload(t);var o=this;o.goods_id=t.id,o.webUrl="/plugins/wholesale/goods/goods?id="+t.id,wx.showShareMenu({menus:["shareAppMessage","shareTimeline"]}),o.$showLoading({type:"global",text:"加载中..."}),o.request({url:o.$api.wholesale.detail,data:{id:o.goods_id}}).then((function(t){o.first=!1,o.goods=t.detail,t.detail.goods_activity&&(e.full_reduce=t.detail.goods_activity.full_reduce),o.goods.vip_card_appoint.discount>0&&(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;o<t.length;o++)"contact_tel"===t[o]&&(this.contact_tel="contact_tel"),"contact"===t[o]&&(this.contact="contact"),"contact_web"===t[o]&&(this.contact_web="contact_web");return this.contact_tel&&e.push(this.contact_tel),this.contact&&e.push(this.contact),this.contact_web&&e.push(this.contact_web),e},contactBtnStyle:function(){var t=this.good_negotiable.length,e=this.getTheme.key;return 3!==t||"a"!==e&&"b"!==e&&"f"!==e?3===t&&"a"!==e&&"b"!==e&&"f"!==e?"background:".concat(this.getTheme.background_gradient_btn,";color:").concat(this.getTheme.color,";"):2!==t||"a"!==e&&"b"!==e&&"f"!==e||this.contact_tel?2!==t||"a"!==e&&"b"!==e&&"f"!==e||!this.contact_tel?2!==t||"a"===e||"b"===e||"f"===e||this.contact_tel?2===t&&"a"!==e&&"b"!==e&&"f"!==e&&this.contact_tel?"background:".concat(this.getTheme.background_gradient_btn,";color:").concat(this.getTheme.color):"background:".concat(this.getTheme.background_gradient_btn):"background:".concat(this.getTheme.background_s_gradient_btn,";color:").concat(this.getTheme.color):"background:".concat(this.getTheme.background_gradient_btn):"background:".concat(this.getTheme.background_s_gradient_btn):"background:".concat(this.getTheme.background_gradient_btn)},contactBtn:function(){var t=this.good_negotiable.length,e=this.getTheme.key;return 3!==t||"a"!==e&&"b"!==e&&"f"!==e?3===t&&"a"!==e&&"b"!==e&&"f"!==e?"bd-three-one bd-no-radius ":2!==t||"a"!==e&&"b"!==e&&"f"!==e||this.contact_tel?2!==t||"a"!==e&&"b"!==e&&"f"!==e||!this.contact_tel?2!==t||"a"===e||"b"===e||"f"===e||this.contact_tel?2===t&&"a"!==e&&"b"!==e&&"f"!==e&&this.contact_tel?"bd-btn-half bd-content-radius-1":"text all-width all-radius ":"bd-btn-half bd-content-radius-0":"text bd-btn-half bd-content-radius-1":"text bd-btn-half bd-content-radius-0":"text bd-three-one bd-no-radius "},uBottomHeight:function(){return this.full_reduce&&this.goods.sell_time>0?"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.totalNumber<i.num||(e.wholesaleDiscount=+i.discount,n++)}}catch(y){r.e(y)}finally{r.f()}0==n&&(e.wholesaleDiscount=0==o.goods.wholesaleGoods.type?10:0),e.wholesaleDiscount>0&&(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"]]]);
|