2 lines
20 KiB
JavaScript
2 lines
20 KiB
JavaScript
"use strict";/*! For license information please see index.js.LICENSE.txt */
|
|
(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([["pages/applyMoney/index"],{"./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/applyMoney/index.tsx":function(e,n,o){var i=o("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");var _=o("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");var u=o("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js");var a=o("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");var d=o("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");var l=o("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");var t=o("./node_modules/@tarojs/taro/index.js");var c=o.n(t);var s=o("./node_modules/react/cjs/react.production.min.js");var r=o("./node_modules/classnames/index.js");var m=o.n(r);var x=o("./src/pages/applyMoney/index.module.scss");var f=o("./src/api/order.ts");var h=o("./src/components/popup/index.tsx");var p=o("./node_modules/react/cjs/react-jsx-runtime.production.min.js");var g=function GoodsItem(e){var n=e.list,o=n===void 0?[]:n,i=e.obj,_=i===void 0?{}:i,u=e.handTui,a=e.handCancel,d=e.onBlur,t=e.handReduce,c=e.handAdd,s=e.onInputEven;return(0,p.jsx)(p.Fragment,{children:o.map((function(e,n){return(0,p.jsxs)(l.View,{className:x["default"].goodsBox,children:[(0,p.jsxs)(l.View,{className:x["default"].goodsProduct,children:[e.product_code,"# ",e.product_name]}),(0,p.jsx)(l.View,{className:x["default"].goodsLine}),e.av_product_color.map((function(e,n){return(0,p.jsxs)(l.View,{className:x["default"].itemGoods,children:[(0,p.jsx)(l.Image,{className:x["default"].itemPic,mode:"aspectFill",src:"https://test.cdn.zzfzyc.com/mall/no_img.png"}),(0,p.jsxs)(l.View,{className:x["default"].itemRight,children:[(0,p.jsx)(l.View,{className:x["default"].item_right_top,children:(0,p.jsxs)(l.View,{className:x["default"].itemName,children:[e.product_color_code," ",e.product_color_name]})}),(0,p.jsxs)(l.View,{className:x["default"].item_right_Bottom,children:[(0,p.jsxs)(l.View,{className:x["default"].itemMoney,children:["x",(_===null||_===void 0?void 0:_.sale_mode)===0?e.roll:e.length/100,(_===null||_===void 0?void 0:_.sale_mode)===0?"条":"m"]}),!e.isTui&&(0,p.jsx)(l.View,{className:x["default"].btn,onClick:function onClick(){return u===null||u===void 0?void 0:u(e)},children:"退货"}),e.sale_mode!=0&&e.isTui&&(0,p.jsx)(l.View,{className:x["default"].btnOne,onClick:function onClick(){return a===null||a===void 0?void 0:a(e)},children:"已选择退货"}),e.sale_mode==0&&e.isTui&&(0,p.jsxs)(l.View,{className:x["default"].inputBox,children:[(0,p.jsx)(l.View,{className:x["default"].redceBox,onClick:function onClick(){return t===null||t===void 0?void 0:t(e)},children:(0,p.jsx)(l.View,{className:x["default"].reduce})}),(0,p.jsx)(l.View,{className:x["default"].inputBig,children:(0,p.jsx)(l.Input,{type:"number",value:e.nums,onInput:function onInput(n){return s===null||s===void 0?void 0:s(n,e)},maxlength:e.roll,onBlur:function onBlur(n){return d===null||d===void 0?void 0:d(n,e)}})}),(0,p.jsx)(l.View,{className:x["default"].addBox,onClick:function onClick(){return c===null||c===void 0?void 0:c(e)},children:"+"})]})]})]})]},n)}))]},n)}))})};var v=(0,s.memo)(g);var j=function ApplyMoney(){var e=(0,t.useRouter)();var n=(0,f.MpSaleOrder)(),o=n.fetchData;var r=(0,s.useState)([]),g=(0,d["default"])(r,2),j=g[0],b=g[1];var B=(0,s.useState)({}),w=(0,d["default"])(B,2),y=w[0],k=w[1];var N=function(){var n=(0,a["default"])((0,u["default"])().mark((function _callee(){var n;return(0,u["default"])().wrap((function _callee$(i){while(1)switch(i.prev=i.next){case 0:c().showLoading({title:"请稍等...",mask:true});i.next=3;return o({id:e.params.orderId});case 3:n=i.sent;if(n.data){n.data.av_return_product.forEach((function(e){e.av_product_color.forEach((function(e){e.isTui=false;e.nums=1}));return e}));k(n.data);b(n.data.av_return_product);c().hideLoading()}case 5:case"end":return i.stop()}}),_callee)})));return function getDetail(){return n.apply(this,arguments)}}();var V=function handTui(e){var n=j;n.forEach((function(n){var o;(o=n.av_product_color)===null||o===void 0?void 0:o.map((function(n){if(n.sale_order_detail_id==e.sale_order_detail_id){n.isTui=true}return n}))}));b((0,_["default"])(n))};var z=function handCancel(e){j.forEach((function(n){n.av_product_color.map((function(n){if(n.sale_order_detail_id===e.sale_order_detail_id){n.isTui=false}return n}))}));b((0,_["default"])(j))};var C=function handReduce(e){j.forEach((function(n){n.av_product_color.map((function(n){if(n.sale_order_detail_id===e.sale_order_detail_id){if(e.nums===1){n.isTui=false;n.nums=1}else{n.nums--}}return n}))}));b((0,_["default"])(j))};var M=function onInputEven(e,n){j.forEach((function(o){o.av_product_color.map((function(o){if(o.sale_order_detail_id===n.sale_order_detail_id){if(Number(e.detail.value)<1||e.detail.value==""){o.isTui=false;o.nums=1}else{o.nums=Number(e.detail.value)}if(Number(e.detail.value)>o.roll){o.nums=1}}return o}))}));b((0,_["default"])(j))};var T=function onBlur(e,n){j.forEach((function(o){o.av_product_color.map((function(o){if(o.sale_order_detail_id===n.sale_order_detail_id){if(Number(e.detail.value)<1||e.detail.value==""){o.isTui=false;o.nums=1}else{o.nums=Number(e.detail.value)}if(Number(e.detail.value)>o.roll){o.nums=1}}return o}))}));b((0,_["default"])(j))};var E=function handAdd(e){j.forEach((function(n){n.av_product_color.forEach((function(n){if(n.sale_order_detail_id===e.sale_order_detail_id){if(n.nums<n.roll){n.nums++}}}))}));b((0,_["default"])(j))};var I=(0,s.useState)([]),q=(0,d["default"])(I,2),S=q[0],A=q[1];var L=(0,f.MpEnumRefundExplainOne)(),R=L.fetchData;var D=function(){var e=(0,a["default"])((0,u["default"])().mark((function _callee2(){var e;return(0,u["default"])().wrap((function _callee2$(n){while(1)switch(n.prev=n.next){case 0:n.next=2;return R();case 2:e=n.sent;if(e.data){A(e.data.list)}case 4:case"end":return n.stop()}}),_callee2)})));return function getEnum(){return e.apply(this,arguments)}}();var G=(0,s.useRef)({reasonName:"请选择"});var F=(0,s.useState)({reasonId:"",reasonName:"请选择"}),O=(0,d["default"])(F,2),P=O[0],K=O[1];var J=function handReasonOne(e){S.map((function(n){if(n.id===e.id){n.default=true}else{n.default=false}return n}));A((0,_["default"])(S));K((function(n){return(0,i["default"])((0,i["default"])({},n),{},{reasonId:e.id})}));G.current.reasonName=e.name};var X=(0,s.useState)(false),Y=(0,d["default"])(X,2),Z=Y[0],U=Y[1];var W=(0,s.useState)(""),Q=(0,d["default"])(W,2),H=Q[0],$=Q[1];var ee=function getDesc(e){$(e)};var ne=function handCancl(){c().navigateBack({delta:1})};var oe=function handSlect(){K((function(e){return(0,i["default"])((0,i["default"])({},e),{},{reasonName:G.current.reasonName})}));U(false)};var ie=(0,s.useMemo)((function(){var e=[];j.forEach((function(n){n.av_product_color.forEach((function(n){if(n.isTui){e.push(n)}}))}));return e.length}),[j]);var _e=function resetArr(e){e.map((function(e){e.default=false;return e}));return e};var ue=function handReset(){K({reasonId:"",reasonName:"请选择"});G.current.reasonName="请选择";var e=_e(S);A((0,_["default"])(e))};var ae=(0,s.useMemo)((function(){if(P.reasonId!==""){return false}else{return true}}),[P]);var de=(0,s.useMemo)((function(){if(ie>0&&P.reasonId!==""){return false}else{return true}}),[P,ie]);var le=(0,s.useMemo)((function(){if(P.reasonId!==""){return false}else{return true}}),[P]);(0,s.useEffect)((function(){N();D()}),[]);var te=(0,f.MpReturnApplyOrder)(),ce=te.fetchData;var se=function handSure(){if(G.current.reasonName=="其他问题"&&H==""){c().showToast({title:"请填写其他说明",icon:"error",duration:3e3});return false}var n=[];if(y.sale_mode==0&&y.status==9){j.forEach((function(e){e.av_product_color.forEach((function(e){if(e.isTui){n.push({product_color_id:e.sale_mode==0?e.product_color_id:"",product_id:e.sale_mode==0?e.product_id:"",product_roll:e.sale_mode==0?e.nums:0,sale_order_detail_id:e.sale_order_detail_id})}}))}))}if(y.sale_mode==1&&y.status==9||y.sale_mode==2&&y.status==9){j.forEach((function(e){e.av_product_color.forEach((function(e){if(e.isTui){n.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 o={reason_describe:H,fabric_piece_accessory_url:[],goods_status:0,return_reason:1,return_explain:P.reasonId,roll:0,roll_list:n,sale_order_id:Number(e.params.orderId)};console.log(o,888);c().showModal({content:"确认退款吗?",confirmText:"确认",cancelText:"取消",success:function success(e){return(0,a["default"])((0,u["default"])().mark((function _callee3(){var n;return(0,u["default"])().wrap((function _callee3$(i){while(1)switch(i.prev=i.next){case 0:if(!e.confirm){i.next=6;break}c().showLoading({title:"请稍等...",mask:true});i.next=4;return ce(o);case 4:n=i.sent;if((n===null||n===void 0?void 0:n.msg)==="success"){c().showToast({title:"成功"});c().hideLoading();ne()}else{c().hideLoading();c().showToast({title:n===null||n===void 0?void 0:n.msg,icon:"error"})}case 6:case"end":return i.stop()}}),_callee3)})))()}})};var re=(0,s.useMemo)((function(){if(y.sale_mode==0&&y.status==9||y.sale_mode==1&&y.status==9||y.sale_mode==2&&y.status==9){return true}else{return false}}),[y]);return(0,p.jsxs)(l.View,{className:x["default"].main,children:[re&&(0,p.jsxs)(l.View,{className:x["default"].bgBox,children:[(0,p.jsx)(v,{list:j,obj:y,handTui:function handTui(e){return V(e)},handCancel:function handCancel(e){return z(e)},onBlur:function onBlur(e,n){return T(e,n)},handReduce:function handReduce(e){return C(e)},handAdd:function handAdd(e){return E(e)},onInputEven:function onInputEven(e,n){return M(e,n)}}),(0,p.jsxs)(l.View,{className:x["default"].hasSelect,children:["汇总:已选",ie,"种商品"]})]}),(0,p.jsx)(l.View,{className:x["default"].resonBig,children:(0,p.jsxs)(l.View,{className:x["default"].reasonItem,onClick:function onClick(){U(true)},children:[(0,p.jsxs)(l.View,{className:x["default"].reasonLeft,children:[(0,p.jsx)(l.View,{className:x["default"].reasonFont,children:"退款原因"}),(0,p.jsx)(l.Text,{className:x["default"].xing,children:"*"}),P.reasonName==="请选择"&&(0,p.jsx)(l.View,{className:x["default"].selectFont,children:"请选择"}),P.reasonName!=="请选择"&&(0,p.jsx)(l.View,{className:x["default"].selectFont,children:P.reasonName})]}),(0,p.jsx)(l.View,{className:m()("iconfont","icon-chakanquanbukehu",x["default"].chakanquanbukehu)})]})}),(0,p.jsxs)(l.View,{className:x["default"].descBox,children:[(0,p.jsx)(l.View,{className:x["default"].title,children:"其他说明"}),(0,p.jsx)(l.View,{className:x["default"].textBox,children:(0,p.jsx)(l.Textarea,{onInput:function onInput(e){return ee(e.detail.value)},value:H,placeholderStyle:"font-size: 28rpx;font-weight: 400;",placeholder:"选填/退款说明中选择(其他问题)必填"})})]}),(0,p.jsx)(l.View,{className:x["default"].safeBox,children:(0,p.jsxs)(l.View,{className:x["default"].bottomBox,children:[(0,p.jsx)(l.Button,{className:x["default"].resetBox,onClick:function onClick(){ne()},children:" 取消"}),re&&(0,p.jsx)(l.Button,{className:m()(de?x["default"].button:x["default"].activeButton),disabled:de,onClick:function onClick(){return se()},children:" 确认退款"}),!re&&(0,p.jsx)(l.Button,{className:m()(le?x["default"].button:x["default"].activeButton),disabled:le,onClick:function onClick(){return se()},children:" 确认退款"})]})}),(0,p.jsx)(h["default"],{title:"筛选情况",show:Z,onClose:function onClose(){U===null||U===void 0?void 0:U(false)},children:(0,p.jsx)(l.ScrollView,{scrollY:true,children:(0,p.jsxs)(l.View,{className:x["default"].popupBox,children:[(0,p.jsxs)(l.View,{className:x["default"].thirdBox,children:[(0,p.jsx)(l.View,{className:x["default"].thirdTopfont,children:"退款原因"}),(0,p.jsx)(l.View,{className:x["default"].flexModebox,children:S.map((function(e,n){return(0,p.jsx)(l.View,{onClick:function onClick(){J(e)},className:m()(e.default?x["default"].activemodeBox:x["default"].modeBox),children:e.name},n)}))})]}),(0,p.jsx)(l.View,{className:x["default"].safeBoxs}),(0,p.jsxs)(l.View,{className:x["default"].bottomBox1,children:[(0,p.jsx)(l.Button,{className:x["default"].resetBox1,onClick:function onClick(){ue()},children:" 重置"}),(0,p.jsx)(l.Button,{className:m()(ae?x["default"].button1:x["default"].activeButton1),disabled:ae,onClick:function onClick(){return oe()},children:" 确认"})]})]})})})]})};n["default"]=j},"./src/pages/applyMoney/index.tsx":function(e,n,o){var i=o("./node_modules/@tarojs/runtime/dist/runtime.esm.js");var _=o("./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/applyMoney/index.tsx");var u={navigationBarTitleText:"申请退款",enableShareAppMessage:true};_["default"].enableShareAppMessage=true;var a=Page((0,i.createPageConfig)(_["default"],"pages/applyMoney/index",{root:{cn:[]}},u||{}));var d=_["default"]},"./src/pages/applyMoney/index.module.scss":function(e,n){n["default"]={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",iconfont:"index-module__iconfont___WazZU","icon-shouhou1":"index-module__icon-shouhou1___MufSu","icon-cangku1":"index-module__icon-cangku1___XEXEH","icon-saoma":"index-module__icon-saoma___vBMAG","icon-dizhi1":"index-module__icon-dizhi1___W8uau","icon-huodaofukuan":"index-module__icon-huodaofukuan___hCKVy","icon-yufukuan1":"index-module__icon-yufukuan1___wxcm4","icon-yue":"index-module__icon-yue___eWb_J","icon-zidingyi":"index-module__icon-zidingyi___aDsls","icon-jinetiaozheng":"index-module__icon-jinetiaozheng___QkVBv","icon-tuikuan1":"index-module__icon-tuikuan1___RCz3O","icon-zhankai":"index-module__icon-zhankai___Vj1Ak","icon-shouqi":"index-module__icon-shouqi____9ueX","icon-lujing":"index-module__icon-lujing___JtV3o","icon-jizhumima":"index-module__icon-jizhumima____wpPD","icon-a-jizhumima":"index-module__icon-a-jizhumima___VGD1n","icon-weixindenglu":"index-module__icon-weixindenglu___VDKvp","icon-kehuxinxi":"index-module__icon-kehuxinxi___J8INh","icon-yewuyuanqizi":"index-module__icon-yewuyuanqizi___eCPb1","icon-chakanquanbukehu":"index-module__icon-chakanquanbukehu___cA60j","icon-biyan":"index-module__icon-biyan___V9B2n","icon-bianji":"index-module__icon-bianji___pJyFd","icon-daikuan":"index-module__icon-daikuan___xY_XT","icon-cangku":"index-module__icon-cangku___lCeFo","icon-guanlidingdan":"index-module__icon-guanlidingdan____YJ3G","icon-mima":"index-module__icon-mima___EKhZs","icon-guanbi":"index-module__icon-guanbi___mGjZd","icon-jianshao":"index-module__icon-jianshao___gbDdc","icon-dingwei":"index-module__icon-dingwei___Kuiyq","icon-saomiao":"index-module__icon-saomiao___AE04p","icon-peihuo":"index-module__icon-peihuo___czQQ9","icon-shaixuan":"index-module__icon-shaixuan___Eg410","icon-paiming":"index-module__icon-paiming___VVigr","icon-shanchusousuoxinxi":"index-module__icon-shanchusousuoxinxi___mzqnm","icon-shijian":"index-module__icon-shijian___OlyK2","icon-sousuo":"index-module__icon-sousuo___zZ3tL","icon-shouhou":"index-module__icon-shouhou___dNBPc","icon-sousuofanhui":"index-module__icon-sousuofanhui___rKzWm","icon-sousuoshanchu":"index-module__icon-sousuoshanchu_____k2o","icon-tuikuan":"index-module__icon-tuikuan___YC1gF","icon-tishi":"index-module__icon-tishi___vNz1p","icon-xianxiahuizong":"index-module__icon-xianxiahuizong___A1RAi","icon-xinzeng":"index-module__icon-xinzeng___TyFfV","icon-yonghuming":"index-module__icon-yonghuming___FBKYn","icon-yanjing":"index-module__icon-yanjing___ga8OX","icon-yufukuan":"index-module__icon-yufukuan___NL3Mi","icon-wodekefu":"index-module__icon-wodekefu___GD8rS","icon-dizhi":"index-module__icon-dizhi____5ylu","icon-shouhouzhongxin":"index-module__icon-shouhouzhongxin___k16CE","icon-wodeshoucang":"index-module__icon-wodeshoucang___riKie","icon-shoukuanliebiao":"index-module__icon-shoukuanliebiao___NKqnL","icon-madanguanli":"index-module__icon-madanguanli___DGUpU","icon-qusechazhao":"index-module__icon-qusechazhao___QvBpR","icon-pandiansaoma":"index-module__icon-pandiansaoma___l6dWK","icon-yaoqingma":"index-module__icon-yaoqingma___OliMo","icon-duizhang":"index-module__icon-duizhang___yDo5m","icon-tihuoliebiao":"index-module__icon-tihuoliebiao___M7txT","icon-yangpinduibi":"index-module__icon-yangpinduibi___LwOSR","icon-yansequyang":"index-module__icon-yansequyang___gSTD2","icon-fahuoliebiao":"index-module__icon-fahuoliebiao___WsTud","icon-yuncangkucun":"index-module__icon-yuncangkucun___Fhp2o","icon-xiaoshou":"index-module__icon-xiaoshou___CjfxY","icon-qianzhicangkucun":"index-module__icon-qianzhicangkucun___zTd6f","icon-lingquseka":"index-module__icon-lingquseka___vGMfD","icon-gouwu1":"index-module__icon-gouwu1___s3lOG","icon-dingdan1":"index-module__icon-dingdan1___EnYqm","icon-gerenzhongxin1":"index-module__icon-gerenzhongxin1___iHaUo","icon-shouye1":"index-module__icon-shouye1___HH_y5","icon-gerenzhongxin":"index-module__icon-gerenzhongxin___J7VuA","icon-dingdan":"index-module__icon-dingdan___JXVhf","icon-shouye":"index-module__icon-shouye___z1ZzW","icon-gouwu":"index-module__icon-gouwu___VMKk7",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"}}},function(e){var __webpack_exec__=function(n){return e(e.s=n)};e.O(0,["taro","vendors","common"],(function(){return __webpack_exec__("./src/pages/applyMoney/index.tsx")}));var n=e.O()}]); |