2 lines
7.3 KiB
JavaScript
2 lines
7.3 KiB
JavaScript
/*! For license information please see e7420cee2888c6c5b6850b0ffea5d36a.js.LICENSE.txt */
|
|
"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([["sub-common/e7420cee2888c6c5b6850b0ffea5d36a"],{"./src/components/RefundCodelist/index.tsx":function(e,o,t){var r=t("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js");var i=t("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");var a=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");var n=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");var l=t("./node_modules/@tarojs/taro/index.js");var d=t.n(l);var u=t("./node_modules/react/cjs/react.production.min.js");var s=t("./src/components/RefundCodelist/index.module.scss");var c=t("./src/components/popup/index.tsx");var v=t("./src/use/useCheckAuthorize.tsx");var _=t("./src/common/common.ts");var m=t("./src/api/order.ts");var p=t("./src/common/format.js");var f=t("./node_modules/react/cjs/react-jsx-runtime.production.min.js");var b=function RefundCodelist(e){var o=(0,m.GetReturnPayCode)(),t=o.fetchData;var l=(0,u.useState)(""),b=(0,a["default"])(l,2),h=b[0],j=b[1];var g=(0,u.useMemo)((function(){if((e===null||e===void 0?void 0:e.obj.type)==1||(e===null||e===void 0?void 0:e.obj.type)==3){return e===null||e===void 0?void 0:e.obj.quality_check_pass_number}else{return e===null||e===void 0?void 0:e.obj.total_number}}),[e===null||e===void 0?void 0:e.obj]);var w=function(){var o=(0,i["default"])((0,r["default"])().mark((function _callee(){var o,i,a,n,l,u,s,c,v,_,m,f,b,h,w,x,y,S,k,P;var C,A,D,R;return(0,r["default"])().wrap((function _callee$(r){while(1)switch(r.prev=r.next){case 0:d().showLoading({title:"请稍等...",mask:true});C=[];A=[];if(e.obj.type==1||(e===null||e===void 0?void 0:e.obj.type)==3){A=e.obj.quality_check_pass_product}else{A=e.obj.product_list}A.forEach((function(e){e.product_colors.forEach((function(o){C.push({product_code:e.code,product_name:e.name,product_color_code:o.code,product_color_name:o.name,num:o.roll.toString(),weight:(0,p.formatWeightDiv)(o.label_weight).toString(),deduction_weight:(0,p.formatWeightDiv)(o.deductions_weight).toString(),settle_weight:(0,p.formatWeightDiv)(o.settle_weight).toString(),deduction_amount:(o.deductions_amount/100).toString(),sale_price:(o.sale_price/100).toString(),total_price:(o.estimate_amount/100).toString(),length:(o.length/100).toString(),weight_error:(0,p.formatWeightDiv)(o.settle_weight_error).toString()})}))}));D={list:C,title:"售后确认单",order_type:e.obj.sale_mode_name,sale_user:e.obj.sale_user_name,order_created_time:(0,p.formatDateTime)(e.obj.create_time),order_no:e.obj.return_order_no,pay_account:e.obj.transfer_remittance_account,bank_account_name:e.obj.account_name,bank_name:e.obj.bank_of_deposit,client:e.obj.purchaser_name,order_total_length:(e.obj.total_number/100).toString(),order_total_price:(e.obj.refund_amount/100).toString(),order_total_num:g.toString(),order_total_settle_weight:(e.obj.order_total_settle_weight/1e3).toString(),order_total_deduction_weight:(e.obj.order_total_deduction_weight/1e3).toString(),order_total_deduction_amount:(e.obj.order_total_deduction_amount/100).toString(),order_total_weight_error:(e.obj.total_weight_error/1e3).toString(),show_sale_price:(e===null||e===void 0?void 0:(o=e.obj)===null||o===void 0?void 0:o.sale_mode)===0&&e!==null&&e!==void 0&&(i=e.obj)!==null&&i!==void 0&&i.is_display_price?true:!!((e===null||e===void 0?void 0:(a=e.obj)===null||a===void 0?void 0:a.sale_mode)===1||(e===null||e===void 0?void 0:(n=e.obj)===null||n===void 0?void 0:n.sale_mode)===2),show_total_price:(e===null||e===void 0?void 0:(l=e.obj)===null||l===void 0?void 0:l.sale_mode)===0&&e!==null&&e!==void 0&&(u=e.obj)!==null&&u!==void 0&&u.is_display_price?true:!!((e===null||e===void 0?void 0:(s=e.obj)===null||s===void 0?void 0:s.sale_mode)===1||(e===null||e===void 0?void 0:(c=e.obj)===null||c===void 0?void 0:c.sale_mode)===2),show_deduction_amount:(e===null||e===void 0?void 0:(v=e.obj)===null||v===void 0?void 0:v.sale_mode)===0&&e!==null&&e!==void 0&&(_=e.obj)!==null&&_!==void 0&&_.is_display_price?true:!!((e===null||e===void 0?void 0:(m=e.obj)===null||m===void 0?void 0:m.sale_mode)===1||(e===null||e===void 0?void 0:(f=e.obj)===null||f===void 0?void 0:f.sale_mode)===2),show_order_total_price:(e===null||e===void 0?void 0:(b=e.obj)===null||b===void 0?void 0:b.sale_mode)===0&&e!==null&&e!==void 0&&(h=e.obj)!==null&&h!==void 0&&h.is_display_price?true:!!((e===null||e===void 0?void 0:(w=e.obj)===null||w===void 0?void 0:w.sale_mode)===1||(e===null||e===void 0?void 0:(x=e.obj)===null||x===void 0?void 0:x.sale_mode)===2),show_order_total_deduction_amount:(e===null||e===void 0?void 0:(y=e.obj)===null||y===void 0?void 0:y.sale_mode)===0&&e!==null&&e!==void 0&&(S=e.obj)!==null&&S!==void 0&&S.is_display_price?true:!!((e===null||e===void 0?void 0:(k=e.obj)===null||k===void 0?void 0:k.sale_mode)===1||(e===null||e===void 0?void 0:(P=e.obj)===null||P===void 0?void 0:P.sale_mode)===2)};r.next=8;return t(D);case 8:R=r.sent;if(R.data){j(R.data.base64);d().hideLoading()}case 10:case"end":return r.stop()}}),_callee)})));return function getPic(){return o.apply(this,arguments)}}();var x=(0,u.useRef)({filePath:"",base64:""});var y=function showImage(){var e=(new Date).valueOf();var o=/data:image\/(\w+);base64,(.*)/.exec(h)||[],t=(0,a["default"])(o,3),r=t[1],i=t[2];var n="".concat(d().env.USER_DATA_PATH,"/img").concat(e,".").concat(r);x.current.filePath=n;x.current.base64=i;var l=d().getFileSystemManager();l.writeFile({filePath:x.current.filePath,data:x.current.base64,encoding:"base64"});d().previewImage({current:x.current.filePath,urls:[x.current.filePath]})};var S=(0,v["default"])({scope:"scope.writePhotosAlbum",msg:"您没授权,无法保存图片"}),k=S.check;(0,u.useEffect)((function(){var o=Object.keys(e.obj);if(o.length>0){w()}}),[e.obj]);var P=function saveImage(){var e=(new Date).valueOf();var o=/data:image\/(\w+);base64,(.*)/.exec(h)||[],t=(0,a["default"])(o,3),r=t[1],i=t[2];var n="".concat(d().env.USER_DATA_PATH,"/img").concat(e,".").concat(r);x.current.filePath=n;x.current.base64=i;var l=d().getFileSystemManager();l.writeFile({filePath:x.current.filePath,data:x.current.base64,encoding:"base64"});_.alert.loading("正在保存图片");d().saveImageToPhotosAlbum({filePath:x.current.filePath,success:function success(){_.alert.success("图片保存成功")},fail:function fail(e){console.log("err::",e)}})};var C=function(){var e=(0,i["default"])((0,r["default"])().mark((function _callee2(){var e;return(0,r["default"])().wrap((function _callee2$(o){while(1)switch(o.prev=o.next){case 0:o.next=2;return k();case 2:e=o.sent;e&&P();case 4:case"end":return o.stop()}}),_callee2)})));return function saveImageCheck(){return e.apply(this,arguments)}}();return(0,f.jsx)(c["default"],{show:e.showPopup,title:"退款码单",onClose:function onClose(){var o;return(o=e.popupClose)===null||o===void 0?void 0:o.call(e)},children:(0,f.jsxs)(n.View,{className:s["default"].popupBox,children:[(0,f.jsx)(n.ScrollView,{enhanced:true,scrollY:true,className:s["default"].scroStyle,children:(0,f.jsx)(n.View,{className:s["default"].pic,children:(0,f.jsx)(n.Image,{lazyLoad:true,mode:"widthFix",style:{width:"100%",height:"100%"},src:h,onClick:function onClick(){return y()}})})}),(0,f.jsx)(n.View,{className:s["default"].sure,onClick:function onClick(){return C()},children:"保存图片"})]})})};o["default"]=(0,u.memo)(b)}}]); |