(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesM/pages/after_sale_choose"],{2210:function(t,e,n){"use strict";n.r(e);var r=n("478d"),a=n.n(r);for(var i in r)"default"!==i&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e["default"]=a.a},"25cf":function(t,e,n){"use strict";(function(t){n("4518");r(n("66fd"));var e=r(n("9bd9"));function r(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},"324c":function(t,e,n){"use strict";var r;n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return r}));var a=function(){var t=this,e=t.$createElement,n=(t._self._c,t.__map(t.dataList,(function(e,n){var r=t.__get_orig(e),a=t._f("moneyEx")(e.priceAll),i=t._f("moneyEx")(e.price);return{$orig:r,f0:a,f1:i}})));t.$mp.data=Object.assign({},{$root:{l0:n}})},i=[]},"478d":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a(n("a34a"));function a(t){return t&&t.__esModule?t:{default:t}}function i(t){return s(t)||u(t)||c(t)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t,e){if(t){if("string"===typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}}function u(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function s(t){if(Array.isArray(t))return d(t)}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function l(t,e,n,r,a,i,o){try{var c=t[i](o),u=c.value}catch(s){return void n(s)}c.done?e(u):Promise.resolve(u).then(r,a)}function f(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var i=t.apply(e,n);function o(t){l(i,r,a,o,c,"next",t)}function c(t){l(i,r,a,o,c,"throw",t)}o(void 0)}))}}var h=function(){n.e("pagesM/comps/dt_accumulator").then(function(){return resolve(n("c3aa"))}.bind(null,n)).catch(n.oe)},p=function(){n.e("pagesM/comps/foot_toolbar").then(function(){return resolve(n("e5be"))}.bind(null,n)).catch(n.oe)},m={components:{DtAccumulator:h,FootToolbar:p},data:function(){return{dataDetail:{},dataList:[],isFocus:!1,checkedNum:0,checkedAll:!1}},methods:{tapCheckedAll:function(){var t=this;this.checkedAll=!this.checkedAll;var e=this.dataList.slice(0);e.map((function(e){return e.checked=t.checkedAll,e})),this.checkedAll?this.checkedNum=e.length:this.checkedNum=0,this.dataList=e},tapCheck:function(t){var e=this.dataList.slice(0);e[t].checked=!e[t].checked;var n=0;e.forEach((function(t){t.checked&&n++})),this.checkedNum=n,this.checkedAll=n==e.length,this.dataList=e},onAccumulatorChange:function(t,e){var n=this.dataList.slice(0);t>n[e].quantity&&(this.$dialog.toast("售后数量不能大于已购数量"),t=n[e].quantity),t<0&&(t=0),n[e].quantityCalc=t,this.dataList=n},tapSubmit:function(){for(var e,n={},r={},a=this.dataList.slice(0),i=0;e=a[i];i++)if(e.checked){if(!(e.quantityCalc>0)){r=e;break}n[e.id]=e.quantityCalc}if(this.checkedNum>0)if(r.id)this.$dialog.toast("商品 “".concat(r.name,"” 的售后数量不能为0"));else{var o={orderSn:this.dataDetail.sn,orderItems:JSON.stringify(n),orderId:this.loadOptions.orderId,saleType:3};t.navigateTo({url:"/pagesM/pages/after_sale_submit?"+this.$util.serialize(o)})}else this.$dialog.toast("请选择售后商品")},queryDataList:function(){var t=this;return f(r.default.mark((function e(){var n,a,o,c;return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$api.getOrderAfterSaleInfo({_isShowLoading:!0,orderId:t.loadOptions.orderId});case 2:if(n=e.sent,Array.isArray(n))for(a=0;o=n[a];a++)o.store.id==t.$global.server.storeId&&(o.orderItems.map((function(t){return t.quantityCalc=t.quantity,t.priceAll=t.quantity*t.price,t.specificationsDesc=t.specifications.join("+"),t})),(c=t.dataList).push.apply(c,i(o.orderItems)),t.dataDetail=o);case 4:case"end":return e.stop()}}),e)})))()},onLoadPage:function(){wx.hideShareMenu(),this.isLoad&&(this.memberId=this.$auth.getMemberId()),this.queryDataList()}}};e.default=m}).call(this,n("543d")["default"])},"4d65":function(t,e,n){"use strict";var r=n("5ecf"),a=n.n(r);a.a},"5ecf":function(t,e,n){},"9bd9":function(t,e,n){"use strict";n.r(e);var r=n("324c"),a=n("2210");for(var i in a)"default"!==i&&function(t){n.d(e,t,(function(){return a[t]}))}(i);n("4d65");var o,c=n("f0c5"),u=Object(c["a"])(a["default"],r["b"],r["c"],!1,null,"5bb43e56",null,!1,r["a"],o);e["default"]=u.exports}},[["25cf","common/runtime","common/vendor"]]]);