(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/sales-return/sales-return"],{208:function(n,e,t){"use strict";(function(n,e){var o=t(4);t(26);o(t(25));var r=o(t(209));n.__webpack_require_UNI_MP_PLUGIN__=t,e(r.default)}).call(this,t(1)["default"],t(2)["createPage"])},209:function(n,e,t){"use strict";t.r(e);var o=t(210),r=t(212);for(var i in r)["default"].indexOf(i)<0&&function(n){t.d(e,n,(function(){return r[n]}))}(i);t(214),t(216);var u,a=t(32),s=Object(a["default"])(r["default"],o["render"],o["staticRenderFns"],!1,null,"af4628b4",null,!1,o["components"],u);s.options.__file="pages/sales-return/sales-return.vue",e["default"]=s.exports},210:function(n,e,t){"use strict";t.r(e);var o=t(211);t.d(e,"render",(function(){return o["render"]})),t.d(e,"staticRenderFns",(function(){return o["staticRenderFns"]})),t.d(e,"recyclableRender",(function(){return o["recyclableRender"]})),t.d(e,"components",(function(){return o["components"]}))},211:function(n,e,t){"use strict";var o;t.r(e),t.d(e,"render",(function(){return r})),t.d(e,"staticRenderFns",(function(){return u})),t.d(e,"recyclableRender",(function(){return i})),t.d(e,"components",(function(){return o}));try{o={uUpload:function(){return t.e("node-modules/uview-ui/components/u-upload/u-upload").then(t.bind(null,474))},uPopup:function(){return t.e("node-modules/uview-ui/components/u-popup/u-popup").then(t.bind(null,481))}}}catch(a){if(-1===a.message.indexOf("Cannot find module")||-1===a.message.indexOf(".vue"))throw a;console.error(a.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范，文档：https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范，需手动引入，并在 components 中注册该组件")}var r=function(){var n=this,e=n.$createElement,t=(n._self._c,n.__map(n.goods,(function(e,t){var o=n.__get_orig(e),r=n.refundSub(e),i=n.refSubtotal(e);return{$orig:o,m0:r,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=!1,u=[];r._withStripped=!0},212:function(n,e,t){"use strict";t.r(e);var o=t(213),r=t.n(o);for(var i in o)["default"].indexOf(i)<0&&function(n){t.d(e,n,(function(){return o[n]}))}(i);e["default"]=r.a},213:function(n,e,t){"use strict";(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=t(71),r={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=[],r=0;r<t.length;r++)t[r].newSku=t[r].newSku.filter((function(n){return n.quitNum>0})),t[r].newSku.length>0&&o.push(t[r]);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=[],r=0;for(var i in e)for(var u in e[i].sku)t[r]=[e[i].sku[u].id,e[i].sku[u].quitNum],r++;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=r}).call(this,t(2)["default"])},214:function(n,e,t){"use strict";t.r(e);var o=t(215),r=t.n(o);for(var i in o)["default"].indexOf(i)<0&&function(n){t.d(e,n,(function(){return o[n]}))}(i);e["default"]=r.a},215:function(n,e,t){},216:function(n,e,t){"use strict";t.r(e);var o=t(217),r=t.n(o);for(var i in o)["default"].indexOf(i)<0&&function(n){t.d(e,n,(function(){return o[n]}))}(i);e["default"]=r.a},217:function(n,e,t){}},[[208,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/sales-return/sales-return.js.map