You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
6.8 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["user/pages/order/refund"],{"00e4":function(e,t,n){"use strict";var r=n("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n("7eb4")),a=r(n("ee10")),c=r(n("7ca3")),o=n("8f59");function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,c.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var d={components:{},data:function(){return{options:{},detail:{},statusType:{"-1":"已取消",1:"待支付",2:"待服务",3:this.$t("action.attendantName")+"接单",4:this.$t("action.attendantName")+"出发",5:this.$t("action.attendantName")+"到达",6:"服务中",7:"已完成",8:"已评价"},total_refund_num:0,total_refund_price:0,can_refund_num:0,can_refund_price:0,selectAll:!1,selectAdd:!1,form:{text:"",imgs:[]},lockTap:!1}},computed:(0,o.mapState)({primaryColor:function(e){return e.config.configInfo.primaryColor},subColor:function(e){return e.config.configInfo.subColor},configInfo:function(e){return e.config.configInfo}}),onLoad:function(e){this.options=e,this.initIndex()},methods:l(l({},(0,o.mapMutations)(["updateUserItem"])),{},{initIndex:function(){var e=arguments,t=this;return(0,a.default)(i.default.mark((function n(){var r,a,c,o,u,l,d,f,s,p,_;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e.length>0&&void 0!==e[0]&&e[0],r=t.options.id,n.next=4,t.$api.order.orderInfo({id:r});case 4:a=n.sent,t.$util.setNavigationBarColor({bg:t.primaryColor}),c=a.car_price,o=a.can_refund_car_price,u=void 0===o?0:o,l=0,d=0,f=0,a.order_goods.map((function(e){l+=e.can_refund_num,e.apply_num=e.can_refund_num,e.checked=e.can_refund_num<1,e.apply_num>0&&(d+=e.true_price*e.apply_num,f+=e.material_price*e.apply_num)})),s=(1*d).toFixed(2),p=(1*f).toFixed(2),a.can_refund_price=s,a.can_refund_material_price=p,t.detail=a,t.can_refund_num=l,_=u?c:0,t.can_refund_price=(1*s+1*p+1*_).toFixed(2);case 19:case"end":return n.stop()}}),n)})))()},initRefresh:function(){this.initIndex(!0)},imgDel:function(e){var t=e.imagelist,n=e.imgtype;this.form[n]=t},imgUpload:function(e){var t=e.imagelist,n=e.imgtype;this.form[n]=t},handerRadioChange:function(e){var t=this.detail.order_goods[e];if(!(t.can_refund_num<1)){var n=!t.checked;this.detail.order_goods[e].checked=n,this.checkIsSelectAll()}},handerAddRadioChange:function(){var e=this.detail.add_price;1*!e||(this.selectAdd=!this.selectAdd,this.checkIsSelectAll())},changeNum:function(e,t){var n=this;return(0,a.default)(i.default.mark((function r(){var a,c;return i.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(a=n.detail.order_goods[e],c=a.apply_num+t,!(c<1)){r.next=5;break}return n.$util.showToast({title:"此商品最少可退1件"}),r.abrupt("return");case 5:if(!(c>a.can_refund_num)){r.next=8;break}return n.$util.showToast({title:"此商品最多可退".concat(a.can_refund_num,"件")}),r.abrupt("return");case 8:n.detail.order_goods[e].apply_num=c,n.countPrice();case 10:case"end":return r.stop()}}),r)})))()},selectAllItem:function(){var e=this;this.detail.order_goods.map((function(t){t.can_refund_num<1||(t.checked=!e.selectAll)})),this.checkIsSelectAll()},checkIsSelectAll:function(){var e=[];this.detail.order_goods.map((function(t){t.can_refund_num<1||e.push(t)})),this.selectAll=e.every((function(e){return e.checked})),this.countPrice()},countPrice:function(){var e=this.can_refund_num,t=this.detail,n=t.car_price,r=t.can_refund_car_price,i=void 0===r?0:r,a=0,c=0,o=[];this.detail.order_goods.forEach((function(e){e.can_refund_num<1||o.push(e)})),o.forEach((function(e,t){e.checked&&(a+=parseFloat(1*e.true_price+1*e.material_price)*e.apply_num,c+=e.apply_num)}));var u=1*a.toFixed(2);this.total_refund_num=c,this.total_refund_price=i&&e==c?(u+1*n).toFixed(2):u},toSubmit:function(){var e=this;return(0,a.default)(i.default.mark((function t(){var n,r,a,c,o;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.detail,r=n.id,a=n.order_goods,c=[],a.filter((function(e){if(e.checked){if(e.apply_num<1)return;c.push({id:e.id,num:e.apply_num})}})),!(c.length<1)){t.next=6;break}return e.$util.showToast({title:"请选择商品"}),t.abrupt("return");case 6:if(o=e.$util.deepCopy(e.form),o.text){t.next=10;break}return e.$util.showToast({title:"请输入退款原因"}),t.abrupt("return");case 10:if(o.imgs=o.imgs.length>0?o.imgs.map((function(e){return e.path})):[],o=Object.assign({},o,{order_id:r,list:c}),!e.lockTap){t.next=14;break}return t.abrupt("return");case 14:return e.lockTap=!0,e.$util.showLoading(),t.prev=16,t.next=19,e.$api.order.applyOrder(o);case 19:e.$util.hideAll(),e.$util.showToast({title:"提交成功"}),e.lockTap=!1,setTimeout((function(){e.$util.back(),e.$util.goUrl({url:1,openType:"navigateBack"})}),1e3),t.next=28;break;case 25:t.prev=25,t.t0=t["catch"](16),setTimeout((function(){e.lockTap=!1,e.$util.hideAll()}),2e3);case 28:case"end":return t.stop()}}),t,null,[[16,25]])})))()}})};t.default=d},"51cf":function(e,t,n){"use strict";n.r(t);var r=n("6719"),i=n("8cfe");for(var a in i)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(a);n("fe69");var c=n("828b"),o=Object(c["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],void 0);t["default"]=o.exports},6719:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){}));var r=function(){var e=this,t=e.$createElement,n=(e._self._c,e.detail.id?e.__map(e.detail.order_goods,(function(t,n){var r=e.__get_orig(t),i=t.can_refund_num>0?e.$t("action.attendantName"):null;return{$orig:r,m0:i}})):null),r=e.detail.id&&(e.detail.can_refund_material_price||e.detail.can_refund_car_price&&1*e.detail.car_price>0)&&e.detail.can_refund_car_price&&1*e.detail.car_price>0?e.$t("action.attendantName"):null,i=e.detail.id?e.form.text.length:null,a=!e.detail.id||i>300?null:e.form.text.length,c=e.detail.id?e.form.imgs.length:null;e.$mp.data=Object.assign({},{$root:{l0:n,m1:r,g0:i,g1:a,g2:c}})},i=[]},"8cfe":function(e,t,n){"use strict";n.r(t);var r=n("00e4"),i=n.n(r);for(var a in r)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(a);t["default"]=i.a},d342:function(e,t,n){},f9b1:function(e,t,n){"use strict";(function(e,t){var r=n("47a9");n("7043");r(n("3240"));var i=r(n("51cf"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},fe69:function(e,t,n){"use strict";var r=n("d342"),i=n.n(r);i.a}},[["f9b1","common/runtime","common/vendor"]]]);