1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[1360],{6023:function(e,o,n){var t=n(2180),_=n(1413),i=n(3433),a=n(4165),r=n(5861),d=n(9439),l=n(1515),s=n(2954),u=n.n(s),c=n(7294),m=n(4184),x=n.n(m),f={common_safe_area_y:"index-module__common_safe_area_y___QuJSu","flex-col":"index-module__flex-col___LIJrl","flex-row":"index-module__flex-row___gfogN","justify-between":"index-module__justify-between___xNDdG","justify-center":"index-module__justify-center___TClQQ","items-center":"index-module__items-center___JjouU","flex-item":"index-module__flex-item___E2hCC","full-100":"index-module__full-100___VFhLz","color-blue":"index-module__color-blue___uaPDR","color-yellow":"index-module__color-yellow___RDz90","color-green":"index-module__color-green___JUwxq","color-grey":"index-module__color-grey___bENOi","color-white":"index-module__color-white___Il714","s-w":"index-module__s-w___CAPfU","s-e":"index-module__s-e___iUXIP",filter:"index-module__filter___sNcvx",bgBox:"index-module__bgBox___S022k",goodsBox:"index-module__goodsBox___Leh5y",goodsProduct:"index-module__goodsProduct___sambY",goodsLine:"index-module__goodsLine___ombXo",itemGoods:"index-module__itemGoods___TaK_j",itemPic:"index-module__itemPic___M2G87",itemRight:"index-module__itemRight___moEMd",item_right_top:"index-module__item_right_top___hhm4t",itemName:"index-module__itemName___BACzM",itemNums:"index-module__itemNums___MoM5e",item_right_Bottom:"index-module__item_right_Bottom___JRPaM",itemMoney:"index-module__itemMoney___GBWee",itemMoneyOne:"index-module__itemMoneyOne____ayDB",btn:"index-module__btn___XtxnP",btnOne:"index-module__btnOne____TTyA",inputBox:"index-module__inputBox___ujCqu",redceBox:"index-module__redceBox___yvH4S",reduce:"index-module__reduce___LdrpL",inputBig:"index-module__inputBig___nfWrZ",addBox:"index-module__addBox___ZCEqf",hasSelect:"index-module__hasSelect___bkdIA",resonBig:"index-module__resonBig___BURyX",reasonItem:"index-module__reasonItem___sG95X",reasonLeft:"index-module__reasonLeft___wr5QI",reasonFont:"index-module__reasonFont___Ji40m",xing:"index-module__xing___d8Px0",selectFont:"index-module__selectFont___Gu1Fc",chakanquanbukehu:"index-module__chakanquanbukehu___ZJuzt",descBox:"index-module__descBox___Z3LIW",title:"index-module__title___YEMjQ",textBox:"index-module__textBox___ZbBbl",bottomBox:"index-module__bottomBox___EBFjO",resetBox:"index-module__resetBox___YKkK9",button:"index-module__button___juboI",activeButton:"index-module__activeButton___Vtygw",safeBox:"index-module__safeBox___VZDGK",popupBox:"index-module__popupBox___lw7pI",thirdBox:"index-module__thirdBox___KMu2E",thirdTopfont:"index-module__thirdTopfont___Ayu8G",timeBox2:"index-module__timeBox2___YNinn",more:"index-module__more___hFf7L",flexModebox:"index-module__flexModebox___o2vw9",activemodeBox:"index-module__activemodeBox___lDPLz",modeBox:"index-module__modeBox___zxUK4",bottomBox1:"index-module__bottomBox1___mS32m",resetBox1:"index-module__resetBox1___eEs19",button1:"index-module__button1___h5uEn",activeButton1:"index-module__activeButton1___y758H",safeBoxs:"index-module__safeBoxs___kobu1"},h=n(1251),p=n(5989),B=n(5893),v=function GoodsItem(e){var o=e.list,n=void 0===o?[]:o,t=e.obj,_=void 0===t?{}:t,i=e.handTui,a=e.handCancel,r=e.onBlur,d=e.handReduce,s=e.handAdd,u=e.onInputEven;return(0,B.jsx)(B.Fragment,{children:n.map((function(e,o){return(0,B.jsxs)(l.G7,{className:f.goodsBox,children:[(0,B.jsxs)(l.G7,{className:f.goodsProduct,children:[e.product_code,"# ",e.product_name]}),(0,B.jsx)(l.G7,{className:f.goodsLine}),e.av_product_color.map((function(e,o){return(0,B.jsxs)(l.G7,{className:f.itemGoods,children:[(0,B.jsx)(l.Ee,{className:f.itemPic,mode:"aspectFill",src:"https://test.cdn.zzfzyc.com/mall/no_img.png"}),(0,B.jsxs)(l.G7,{className:f.itemRight,children:[(0,B.jsx)(l.G7,{className:f.item_right_top,children:(0,B.jsxs)(l.G7,{className:f.itemName,children:[e.product_color_code," ",e.product_color_name]})}),(0,B.jsxs)(l.G7,{className:f.item_right_Bottom,children:[(0,B.jsxs)(l.G7,{className:f.itemMoney,children:["x",0===(null==_?void 0:_.sale_mode)?e.roll:e.length/100,0===(null==_?void 0:_.sale_mode)?"条":"m"]}),!e.isTui&&(0,B.jsx)(l.G7,{className:f.btn,onClick:function onClick(){return null==i?void 0:i(e)},children:"退货"}),0!=e.sale_mode&&e.isTui&&(0,B.jsx)(l.G7,{className:f.btnOne,onClick:function onClick(){return null==a?void 0:a(e)},children:"已选择退货"}),0==e.sale_mode&&e.isTui&&(0,B.jsxs)(l.G7,{className:f.inputBox,children:[(0,B.jsx)(l.G7,{className:f.redceBox,onClick:function onClick(){return null==d?void 0:d(e)},children:(0,B.jsx)(l.G7,{className:f.reduce})}),(0,B.jsx)(l.G7,{className:f.inputBig,children:(0,B.jsx)(l.II,{type:"number",value:e.nums,onInput:function onInput(o){return null==u?void 0:u(o,e)},maxlength:e.roll,onBlur:function onBlur(o){return null==r?void 0:r(o,e)}})}),(0,B.jsx)(l.G7,{className:f.addBox,onClick:function onClick(){return null==s?void 0:s(e)},children:"+"})]})]})]})]},o)}))]},o)}))})},N=(0,c.memo)(v),g=function ApplyMoney(){var e=(0,s.useRouter)(),o=(0,h.e1)().fetchData,n=(0,c.useState)([]),t=(0,d.Z)(n,2),m=t[0],v=t[1],g=(0,c.useState)({}),j=(0,d.Z)(g,2),b=j[0],G=j[1],k=function(){var n=(0,r.Z)((0,a.Z)().mark((function _callee(){var n;return(0,a.Z)().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return u().showLoading({title:"请稍等...",mask:!0}),t.next=3,o({id:e.params.orderId});case 3:(n=t.sent).data&&(n.data.av_return_product.forEach((function(e){return e.av_product_color.forEach((function(e){e.isTui=!1,e.nums=1})),e})),G(n.data),v(n.data.av_return_product),u().hideLoading());case 5:case"end":return t.stop()}}),_callee)})));return function getDetail(){return n.apply(this,arguments)}}(),C=(0,c.useState)([]),w=(0,d.Z)(C,2),Z=w[0],y=w[1],E=(0,h.Ol)().fetchData,I=function(){var e=(0,r.Z)((0,a.Z)().mark((function _callee2(){var e;return(0,a.Z)().wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,E();case 2:(e=o.sent).data&&y(e.data.list);case 4:case"end":return o.stop()}}),_callee2)})));return function getEnum(){return e.apply(this,arguments)}}(),T=(0,c.useRef)({reasonName:"请选择"}),M=(0,c.useState)({reasonId:"",reasonName:"请选择"}),L=(0,d.Z)(M,2),S=L[0],z=L[1],P=(0,c.useState)(!1),R=(0,d.Z)(P,2),A=R[0],F=R[1],D=(0,c.useState)(""),O=(0,d.Z)(D,2),J=O[0],q=O[1],K=function handCancl(){u().navigateBack({delta:1})},U=(0,c.useMemo)((function(){var e=[];return m.forEach((function(o){o.av_product_color.forEach((function(o){o.isTui&&e.push(o)}))})),e.length}),[m]),Q=(0,c.useMemo)((function(){return""===S.reasonId}),[S]),X=(0,c.useMemo)((function(){return!(U>0&&""!==S.reasonId)}),[S,U]),Y=(0,c.useMemo)((function(){return""===S.reasonId}),[S]);(0,c.useEffect)((function(){k(),I()}),[]);var V=(0,h.Gw)().fetchData,W=function handSure(){if("其他问题"==T.current.reasonName&&""==J)return u().showToast({title:"请填写其他说明",icon:"error",duration:3e3}),!1;var o=[];0==b.sale_mode&&9==b.status&&m.forEach((function(e){e.av_product_color.forEach((function(e){e.isTui&&o.push({product_color_id:0==e.sale_mode?e.product_color_id:"",product_id:0==e.sale_mode?e.product_id:"",product_roll:0==e.sale_mode?e.nums:0,sale_order_detail_id:e.sale_order_detail_id})}))})),(1==b.sale_mode&&9==b.status||2==b.sale_mode&&9==b.status)&&m.forEach((function(e){e.av_product_color.forEach((function(e){e.isTui&&o.push({product_color_id:e.product_color_id,product_id:e.product_id,product_roll:0,sale_order_detail_id:e.sale_order_detail_id})}))}));var n={reason_describe:J,fabric_piece_accessory_url:[],goods_status:0,return_reason:1,return_explain:S.reasonId,roll:0,roll_list:o,sale_order_id:Number(e.params.orderId)};console.log(n,888),u().showModal({content:"确认退款吗?",confirmText:"确认",cancelText:"取消",success:function success(e){return(0,r.Z)((0,a.Z)().mark((function _callee3(){var o;return(0,a.Z)().wrap((function _callee3$(t){for(;;)switch(t.prev=t.next){case 0:if(!e.confirm){t.next=6;break}return u().showLoading({title:"请稍等...",mask:!0}),t.next=4,V(n);case 4:"success"===(null==(o=t.sent)?void 0:o.msg)?(u().showToast({title:"成功"}),u().hideLoading(),K()):(u().hideLoading(),u().showToast({title:null==o?void 0:o.msg,icon:"error"}));case 6:case"end":return t.stop()}}),_callee3)})))()}})},$=(0,c.useMemo)((function(){return 0==b.sale_mode&&9==b.status||1==b.sale_mode&&9==b.status||2==b.sale_mode&&9==b.status}),[b]);return(0,B.jsxs)(l.G7,{className:f.main,children:[$&&(0,B.jsxs)(l.G7,{className:f.bgBox,children:[(0,B.jsx)(N,{list:m,obj:b,handTui:function handTui(e){return function handTui(e){var o=m;o.forEach((function(o){var n;null===(n=o.av_product_color)||void 0===n||n.map((function(o){return o.sale_order_detail_id==e.sale_order_detail_id&&(o.isTui=!0),o}))})),v((0,i.Z)(o))}(e)},handCancel:function handCancel(e){return function handCancel(e){m.forEach((function(o){o.av_product_color.map((function(o){return o.sale_order_detail_id===e.sale_order_detail_id&&(o.isTui=!1),o}))})),v((0,i.Z)(m))}(e)},onBlur:function onBlur(e,o){return function onBlur(e,o){m.forEach((function(n){n.av_product_color.map((function(n){return n.sale_order_detail_id===o.sale_order_detail_id&&(Number(e.detail.value)<1||""==e.detail.value?(n.isTui=!1,n.nums=1):n.nums=Number(e.detail.value),Number(e.detail.value)>n.roll&&(n.nums=1)),n}))})),v((0,i.Z)(m))}(e,o)},handReduce:function handReduce(e){return function handReduce(e){m.forEach((function(o){o.av_product_color.map((function(o){return o.sale_order_detail_id===e.sale_order_detail_id&&(1===e.nums?(o.isTui=!1,o.nums=1):o.nums--),o}))})),v((0,i.Z)(m))}(e)},handAdd:function handAdd(e){return function handAdd(e){m.forEach((function(o){o.av_product_color.forEach((function(o){o.sale_order_detail_id===e.sale_order_detail_id&&o.nums<o.roll&&o.nums++}))})),v((0,i.Z)(m))}(e)},onInputEven:function onInputEven(e,o){return function onInputEven(e,o){m.forEach((function(n){n.av_product_color.map((function(n){return n.sale_order_detail_id===o.sale_order_detail_id&&(Number(e.detail.value)<1||""==e.detail.value?(n.isTui=!1,n.nums=1):n.nums=Number(e.detail.value),Number(e.detail.value)>n.roll&&(n.nums=1)),n}))})),v((0,i.Z)(m))}(e,o)}}),(0,B.jsxs)(l.G7,{className:f.hasSelect,children:["汇总:已选",U,"种商品"]})]}),(0,B.jsx)(l.G7,{className:f.resonBig,children:(0,B.jsxs)(l.G7,{className:f.reasonItem,onClick:function onClick(){F(!0)},children:[(0,B.jsxs)(l.G7,{className:f.reasonLeft,children:[(0,B.jsx)(l.G7,{className:f.reasonFont,children:"退款原因"}),(0,B.jsx)(l.xv,{className:f.xing,children:"*"}),"请选择"===S.reasonName&&(0,B.jsx)(l.G7,{className:f.selectFont,children:"请选择"}),"请选择"!==S.reasonName&&(0,B.jsx)(l.G7,{className:f.selectFont,children:S.reasonName})]}),(0,B.jsx)(l.G7,{className:x()("iconfont","icon-chakanquanbukehu",f.chakanquanbukehu)})]})}),(0,B.jsxs)(l.G7,{className:f.descBox,children:[(0,B.jsx)(l.G7,{className:f.title,children:"其他说明"}),(0,B.jsx)(l.G7,{className:f.textBox,children:(0,B.jsx)(l.gx,{onInput:function onInput(e){return function getDesc(e){q(e)}(e.detail.value)},value:J,placeholderStyle:"font-size: 28rpx;font-weight: 400;",placeholder:"选填/退款说明中选择(其他问题)必填"})})]}),(0,B.jsx)(l.G7,{className:f.safeBox,children:(0,B.jsxs)(l.G7,{className:f.bottomBox,children:[(0,B.jsx)(l.zx,{className:f.resetBox,onClick:function onClick(){K()},children:" 取消"}),$&&(0,B.jsx)(l.zx,{className:x()(X?f.button:f.activeButton),disabled:X,onClick:function onClick(){return W()},children:" 确认退款"}),!$&&(0,B.jsx)(l.zx,{className:x()(Y?f.button:f.activeButton),disabled:Y,onClick:function onClick(){return W()},children:" 确认退款"})]})}),(0,B.jsx)(p.Z,{title:"筛选情况",show:A,onClose:function onClose(){null==F||F(!1)},children:(0,B.jsx)(l.pf,{scrollY:!0,children:(0,B.jsxs)(l.G7,{className:f.popupBox,children:[(0,B.jsxs)(l.G7,{className:f.thirdBox,children:[(0,B.jsx)(l.G7,{className:f.thirdTopfont,children:"退款原因"}),(0,B.jsx)(l.G7,{className:f.flexModebox,children:Z.map((function(e,o){return(0,B.jsx)(l.G7,{onClick:function onClick(){!function handReasonOne(e){Z.map((function(o){return o.id===e.id?o.default=!0:o.default=!1,o})),y((0,i.Z)(Z)),z((function(o){return(0,_.Z)((0,_.Z)({},o),{},{reasonId:e.id})})),T.current.reasonName=e.name}(e)},className:x()(e.default?f.activemodeBox:f.modeBox),children:e.name},o)}))})]}),(0,B.jsx)(l.G7,{className:f.safeBoxs}),(0,B.jsxs)(l.G7,{className:f.bottomBox1,children:[(0,B.jsx)(l.zx,{className:f.resetBox1,onClick:function onClick(){!function handReset(){z({reasonId:"",reasonName:"请选择"}),T.current.reasonName="请选择";var e=function resetArr(e){return e.map((function(e){return e.default=!1,e})),e}(Z);y((0,i.Z)(e))}()},children:" 重置"}),(0,B.jsx)(l.zx,{className:x()(Q?f.button1:f.activeButton1),disabled:Q,onClick:function onClick(){return function handSlect(){z((function(e){return(0,_.Z)((0,_.Z)({},e),{},{reasonName:T.current.reasonName})})),F(!1)}()},children:" 确认"})]})]})})})]})};g.enableShareAppMessage=!0;Page((0,t.createPageConfig)(g,"pages/applyMoney/index",{root:{cn:[]}},{navigationBarTitleText:"申请退款",enableShareAppMessage:!0}||{}))}},function(e){e.O(0,[2107,1216,8592],(function(){return o=6023,e(e.s=o);var o}));e.O()}]); |