(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods_details/discountsGoodsList"],{"0bde":function(t,e,s){"use strict";var i=s("ec20"),c=s.n(i);c.a},"1d02":function(t,e,s){"use strict";s.r(e);var i=s("89891"),c=s.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){s.d(e,t,(function(){return i[t]}))}(r);e["default"]=c.a},"7fa3":function(t,e,s){"use strict";(function(t,e){var i=s("4ea4");s("59a4");i(s("66fd"));var c=i(s("adb8"));t.__webpack_require_UNI_MP_PLUGIN__=s,e(c.default)}).call(this,s("bc2e")["default"],s("543d")["createPage"])},8365:function(t,e,s){"use strict";s.d(e,"b",(function(){return i})),s.d(e,"c",(function(){return c})),s.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,s=(t._self._c,t.__map(t.discountsData,(function(e,s){var i=t.__get_orig(e),c=t.proNum==s?t.__map(e.products,(function(s,i){var c=t.__get_orig(s),r=1==e.type?t.selectValue.includes(s.id+"")||1==e.type&&0==i:null;return{$orig:c,g0:r}})):null;return{$orig:i,l0:c}})));t.$mp.data=Object.assign({},{$root:{l1:s}})},c=[]},89891:function(t,e,s){"use strict";(function(t){var i=s("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var c=s("f8b7"),r=i(s("5c3b")),a={components:{productWindow:function(){Promise.all([s.e("common/vendor"),s.e("components/productWindow/index")]).then(function(){return resolve(s("c8cb"))}.bind(null,s)).catch(s.oe)}},mixins:[r.default],data:function(){return{productId:"",discountsData:[],attr:{cartAttr:!1,productAttr:[],productSelect:{}},productValue:[],isOpen:!1,attrValue:[],attrTxt:"",cartList:{valid:[],invalid:[]},selectAttr:[],selectValue:[],proNum:0,images:[],selectCountPrice:[],selectTitle:"",saveMoney:0}},onLoad:function(t){this.productId=t.id,this.getData(0)},onShow:function(){t.removeStorageSync("form_type_cart")},methods:{getData:function(e){var s=this;(0,c.storeDiscountsList)(this.productId).then((function(i){if(s.discountsData=i.data,!s.discountsData.length)return t.navigateBack({delta:1});if(i.data[e].products.map((function(t,c){s.seleNum=c,s.attr.productAttr=i.data[e].products[c].productAttr,s.productValue=i.data[e].products[c].productValue,s.$set(s.selectAttr,[c],i.data[e].products[c].productValue),s.selectValue.push(i.data[e].products[c].id+""),s.DefaultSelect()})),!s.images.length)for(var c=0;c0?(this.$set(this.attr.productSelect,"image",e.image),this.$set(this.attr.productSelect,"price",e.price),this.$set(this.attr.productSelect,"stock",e.stock),this.$set(this.attr.productSelect,"product_stock",e.product_stock),this.$set(this.attr.productSelect,"unique",e.unique),this.$set(this.attr.productSelect,"cart_num",1),this.$set(this.attr.productSelect,"vip_price",e.vip_price),this.$set(this,"attrTxt","已选择"),this.attrValue[this.seleNum]=t||""):(this.$set(this.attr.productSelect,"image",e.image),this.$set(this.attr.productSelect,"price",e.price),this.$set(this.attr.productSelect,"product_stock",e.product_stock),this.$set(this.attr.productSelect,"stock",0),this.$set(this.attr.productSelect,"unique",""),this.$set(this.attr.productSelect,"cart_num",0),this.$set(this.attr.productSelect,"vip_price",e.vip_price),this.attrValue[this.seleNum]=t||"",this.$set(this,"attrTxt","请选择")),this.$set(this.selectAttr,[this.seleNum],e),this.switchSelect()},DefaultSelect:function(){var t=this.attr.productAttr,e=[],s=[];for(var i in this.productValue)s.push(this.productValue[i].price);var c=Math.min.apply(null,s);for(var i in this.productValue)if(this.productValue[i].product_stock>0&&this.productValue[i].price==c){e=this.attr.productAttr.length?i.split(","):[];break}for(var r=0;r0){var c=i.map((function(i){return t?(e.footerswitch?i.attrStatus?(i.checked=!0,s.push(i.id)):i.checked=!1:(i.checked=!0,s.push(i.id)),e.isAllSelect=!0):(i.checked=!1,e.isAllSelect=!1),i}));e.$set(e.cartList,"valid",c),e.selectValue=s,e.switchSelect()}},checkboxChange:function(t){var e=this,s=t.detail.value,i=e.cartList.valid,c=[],r=[],a=[],u=i.map((function(t){return e.inArray(t.id,s)?e.footerswitch?t.attrStatus?(t.checked=!0,c.push(t)):t.checked=!1:(t.checked=!0,c.push(t)):(t.checked=!1,r.push(t)),t}));e.footerswitch&&(a=r.filter((function(t){return!t.attrStatus}))),e.$set(e.cartList,"valid",u),e.isAllSelect=u.length===c.length+a.length,e.selectValue=s,e.switchSelect()},switchSelect:function(){var t=0,e=0;for(var s in this.selectAttr)this.selectValue.includes(this.selectAttr[s].product_id+"")&&(t+=Number(this.selectAttr[s].price),e+=Number(this.selectAttr[s].product_price));this.selectCountPrice[this.proNum].total_pic=t,this.saveMoney=Number(e-t).toFixed(2)||0},changeShow:function(t){this.selectValue=[],t===this.proNum?(this.proNum=-1,this.selectCountPrice[t].total_pic=0):(this.proNum=t,this.getList(t))},subData:function(e){var s=this,i=[],r={new:1,discountId:this.discountsData[e].id,discountInfos:[]};if(0==this.discountsData[e].type)this.selectValue=[],this.discountsData[e].products.map((function(t){s.selectValue.push(t.id+"")}));else if(this.selectValue.length<2)return this.selectValue=[],this.$util.Tips({title:"请先选择套餐商品"});for(var a=0;a