(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["promotionpages/combo/detail/detail"],{"0180":function(n,e,t){"use strict";(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=r(t("4795")),i=r(t("4c22"));function r(n){return n&&n.__esModule?n:{default:n}}function u(n,e,t,o,i,r,u){try{var a=n[r](u),c=a.value}catch(s){return void t(s)}a.done?e(c):Promise.resolve(c).then(o,i)}function a(n){return function(){var e=this,t=arguments;return new Promise((function(o,i){var r=n.apply(e,t);function a(n){u(r,o,i,a,c,"next",n)}function c(n){u(r,o,i,a,c,"throw",n)}a(void 0)}))}}var c=function(){t.e("components/uni-number-box/uni-number-box").then(function(){return resolve(t("77e6"))}.bind(null,t)).catch(t.oe)},s=function(){Promise.all([t.e("common/vendor"),t.e("components/ns-show-toast/ns-show-toast")]).then(function(){return resolve(t("f505"))}.bind(null,t)).catch(t.oe)},l={components:{uniNumberBox:c,nsShowToast:s},data:function(){return{num:1,blId:0,combo:[],packagePrice:[],saveThePrice:0,isDisabled:!1,isIphoneX:!1}},mixins:[i.default],onLoad:function(n){this.blId=n.bl_id||0,this.isIphoneX=this.$util.uniappIsIPhoneX()},onShow:function(){this.$langConfig.refresh(),this.getDetail()},onHide:function(){this.btnSwitch=!0},methods:{getDetail:function(){var n=this;this.$api.sendRequest({url:"/bundling/api/bundling/detail",data:{bl_id:this.blId},success:function(e){e.data?(n.combo=e.data,n.numberChange()):n.$util.showToast({title:e.message}),n.$refs.loadingCover&&n.$refs.loadingCover.hide()},fail:function(e){n.$refs.loadingCover&&n.$refs.loadingCover.hide()}})},toGoodsDetail:function(n){this.$util.redirectTo("/pages/goods/detail/detail",{sku_id:n})},numberChange:function(n,e){var t=this;setTimeout((function(){var o=0;n&&0==t.num.length&&(t.num=1,o++),n&&(t.num<=0||isNaN(t.num))&&(t.number=1,o++),n&&(t.num=parseInt(t.num));for(var i=0,r=0;r<t.combo.bundling_goods.length;r++)i+=parseFloat(t.combo.bundling_goods[r].price),t.combo.bundling_goods[r].stock<t.num&&o++;t.isDisabled=o>0,t.saveThePrice=((i-t.combo.bl_price)*t.num).toFixed(2),t.packagePrice=(t.combo.bl_price*t.num).toFixed(2),t.packagePrice=t.packagePrice.toString().split("."),e&&e()}),0)},comboBuy:function(){var e=this;return a(o.default.mark((function t(){return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.isDisabled){t.next=2;break}return t.abrupt("return");case 2:e.numberChange(!0,(function(){if(n.getStorageSync("token")){if(0!=e.btnSwitch){e.btnSwitch=!1;var t={bl_id:e.blId,num:e.num};n.setStorage({key:"comboOrderCreateData",data:t,success:function(){e.$util.redirectTo("/promotionpages/combo/payment/payment"),e.btnSwitch=!1}})}}else e.$refs.login.open("/promotionpages/combo/detail/detail?bl_id="+e.blId)}));case 3:case"end":return t.stop()}}),t)})))()},imageError:function(n){this.combo.bundling_goods[n].sku_image=this.$util.getDefaultImage().default_goods_img,this.$forceUpdate()}},onShareAppMessage:function(n){var e="购买套餐，优惠多多哦",t="/promotionpages/combo/detail/detail?bl_id="+this.blId;return{title:e,path:t,success:function(n){},fail:function(n){}}}};e.default=l}).call(this,t("543d")["default"])},"113d":function(n,e,t){"use strict";(function(n){t("6b76");o(t("66fd"));var e=o(t("8b68"));function o(n){return n&&n.__esModule?n:{default:n}}n(e.default)}).call(this,t("543d")["createPage"])},1719:function(n,e,t){"use strict";var o={loadingCover:function(){return t.e("components/loading-cover/loading-cover").then(t.bind(null,"cd2f"))},nsLogin:function(){return Promise.all([t.e("common/vendor"),t.e("components/ns-login/ns-login")]).then(t.bind(null,"37fd"))},nsShowToast:function(){return Promise.all([t.e("common/vendor"),t.e("components/ns-show-toast/ns-show-toast")]).then(t.bind(null,"f505"))}},i=function(){var n=this,e=n.$createElement,t=(n._self._c,n.$lang("common.currencySymbol")),o=n.__map(n.combo.bundling_goods,(function(e,t){var o=n.$util.img(e.sku_image,{size:"mid"});return{$orig:n.__get_orig(e),g0:o}})),i=n.$lang("common.currencySymbol"),r=n.$lang("common.currencySymbol");n.$mp.data=Object.assign({},{$root:{m0:t,l0:o,m1:i,m2:r}})},r=[];t.d(e,"b",(function(){return i})),t.d(e,"c",(function(){return r})),t.d(e,"a",(function(){return o}))},2476:function(n,e,t){"use strict";t.r(e);var o=t("0180"),i=t.n(o);for(var r in o)"default"!==r&&function(n){t.d(e,n,(function(){return o[n]}))}(r);e["default"]=i.a},"3c6e":function(n,e,t){},"8b68":function(n,e,t){"use strict";t.r(e);var o=t("1719"),i=t("2476");for(var r in i)"default"!==r&&function(n){t.d(e,n,(function(){return i[n]}))}(r);t("9d92");var u,a=t("f0c5"),c=Object(a["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],u);e["default"]=c.exports},"9d92":function(n,e,t){"use strict";var o=t("3c6e"),i=t.n(o);i.a}},[["113d","common/runtime","common/vendor"]]]);