(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/sales-return/sales-return"],{"036e":function(n,e,t){"use strict";var o=t("329e"),u=t.n(o);u.a},1814:function(n,e,t){"use strict";(function(n){t("fdf4");o(t("66fd"));var e=o(t("d89b"));function o(n){return n&&n.__esModule?n:{default:n}}wx.__webpack_require_UNI_MP_PLUGIN__=t,n(e.default)}).call(this,t("543d")["createPage"])},2112:function(n,e,t){"use strict";t.r(e);var o=t("d956"),u=t.n(o);for(var i in o)"default"!==i&&function(n){t.d(e,n,(function(){return o[n]}))}(i);e["default"]=u.a},"283b":function(n,e,t){},"329e":function(n,e,t){},"6ce3":function(n,e,t){"use strict";var o=t("283b"),u=t.n(o);u.a},d89b:function(n,e,t){"use strict";t.r(e);var o=t("f80f"),u=t("2112");for(var i in u)"default"!==i&&function(n){t.d(e,n,(function(){return u[n]}))}(i);t("036e"),t("6ce3");var r,a=t("f0c5"),s=Object(a["a"])(u["default"],o["b"],o["c"],!1,null,"8f59a2be",null,!1,o["a"],r);e["default"]=s.exports},d956:function(n,e,t){"use strict";(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=t("057a"),u={data:function(){return{goods:"",action:"".concat(this.$config.redirect_uri,"/api/store/upload_refund_order_img"),header:{Authorization:"Bearer "+n.getStorageSync("token")},num:0,reasonList:[{id:1,text:"质量问题",isChecked:!1},{id:2,text:"不愿意穿了",isChecked:!1},{id:3,text:"价格太贵",isChecked:!1},{id:4,text:"穿的没有讲的好",isChecked:!1}],isPaid:!1,reason:"",reason_all:"",imgs:[],origin_order_no:""}},computed:{refundNum:function(){var n=0,e=this.goods;return e&&e.map((function(e){e.newSku.map((function(e){n+=e.quitNum}))})),n},refundPrice:function(){var n=0,e=this.goods;return e&&e.map((function(e){e.newSku.map((function(e){n+=e.quitNum*e.price}))})),n}},onLoad:function(e){this.origin_order_no=e.order_no;for(var t=n.getStorageSync("goodsInfo"),o=[],u=0;u<t.length;u++)t[u].newSku=t[u].newSku.filter((function(n){return n.quitNum>0})),t[u].newSku.length>0&&o.push(t[u]);this.goods=o},methods:{refundSub:function(n){var e=0;return n&&n.newSku.map((function(n){e+=n.quitNum})),e},refSubtotal:function(n){var e=0;return n&&n.newSku.map((function(n){e+=n.quitNum*n.price})),e},onSuccess:function(n,e,t){this.imgs.push(n.data)},onRemove:function(n,e){this.imgs.splice(n,1)},uploadError:function(e){n.showModal({content:"上传图片失败，请重试",showCancel:!1})},Checked:function(n,e){var t=this,o=this.reasonList;o.map((function(n,o){o==e?(t.reason=n.text,n.isChecked=!0):n.isChecked=!1})),this.isPaid=!1},reasonInput:function(e){this.num=e.detail.value.length,200==this.num&&n.showToast({title:"已超过200字",icon:"none"})},submit:function(){if(!this.reason)return n.showModal({content:"请选择退货原因",showCancel:!1}),!1;var e=this.goods,t=[],u=0;for(var i in e)for(var r in e[i].sku)t[u]=[e[i].sku[r].id,e[i].sku[r].quitNum],u++;n.showLoading({title:"提交中..."}),(0,o.submitRefund)({reason_all:this.reason_all,reason:this.reason,img:this.imgs,sku:t,origin_order_no:this.origin_order_no}).then((function(e){200==e.code?(n.removeStorageSync("goodsInfo"),n.showModal({content:"退货申请已提交！",showCancel:!1,success:function(e){e.confirm&&n.reLaunch({url:"../order-manage/order-manage"})}})):n.showModal({content:e.data||"申请退货失败！",showCancel:!1}),n.hideLoading()})).catch((function(e){n.hideLoading()}))}}};e.default=u}).call(this,t("543d")["default"])},f80f:function(n,e,t){"use strict";t.d(e,"b",(function(){return u})),t.d(e,"c",(function(){return i})),t.d(e,"a",(function(){return o}));var o={uUpload:function(){return t.e("node-modules/uview-ui/components/u-upload/u-upload").then(t.bind(null,"6224"))},uPopup:function(){return t.e("node-modules/uview-ui/components/u-popup/u-popup").then(t.bind(null,"1c1d"))}},u=function(){var n=this,e=n.$createElement,t=(n._self._c,n.__map(n.goods,(function(e,t){var o=n.__get_orig(e),u=n.refundSub(e),i=n.refSubtotal(e);return{$orig:o,m0:u,m1:i}})));n._isMounted||(n.e0=function(e){n.isPaid=!0},n.e1=function(e){n.isPaid=!1}),n.$mp.data=Object.assign({},{$root:{l0:t}})},i=[]}},[["1814","common/runtime","common/vendor"]]]);