1 line
46 KiB
JavaScript
1 line
46 KiB
JavaScript
"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[4813],{9249:function(e,t,o){var n=o(2180),s=o(1413),l=o(3433),a=o(9439),i=o(4165),r=o(5861),u=o(1515),_=o(2954),c=o.n(_),d=o(7294),m=o(4184),h=o.n(m),p=o(5328),f=o(6252),x="index-module__passBackground___XAqOa",v="index-module__refuseBackground___Bd26B",g="index-module__pendingBackground___mgia3",j="index-module__status___I6BVL",b="index-module__statusLeft___qmmhM",w="index-module__statusRight___sPJJ4",y="index-module__name___lRaWB",N="index-module__time___sfWt1",k="index-module__buttonBar___TXzpH",S="index-module__refuseButton___wdKL6",G="index-module__passButton___Hx41e",Z="index-module__statusTitle___vsFUk",C="index-module__statusName___i10oP",T="index-module__refuseName___PF6xq",P="index-module__passName___Fdhru",B="index-module__pendingName___QzRXt",M="index-module__price___weFN5",D="index-module__statusDialog___jUxA3",E="index-module__closeDialog___D86yD",L="index-module__shareBtn___zvsmn",F="index-module__mainBox___L6pDq",I="index-module__pussBox___WdG0v",A="index-module__pussName___NQyJL",R="index-module__pussPhone___iG45_",z="index-module__total___Z8ixa",O="index-module__productBox___G9asj",$="index-module__flexMoney___nn1h3",K="index-module__flexTotalBox___4GcZM",U="index-module__totalFont___Y2unZ",W="index-module__shoudPay____CNT4",J="index-module__defaltBox___WynPs",H="index-module__titleBox___MbXwH",q="index-module__title___OmDr_",V="index-module__modeName___VVr4p",X="index-module__modeLine___MtffW",Q="index-module__goodsBox___JnMIj",Y="index-module__goodsProduct___YuM6v",ee="index-module__goodsLine___NlY3a",te="index-module__itemMoney___zLaAj",oe="index-module__lastBox___vJYaB",ne="index-module__itemMoneyOne___dG2mK",se="index-module__product_goods___XbVpQ",le="index-module__prodct_name___njHjA",ae="index-module__product_right___Zd497",ie="index-module__detailBox___Tn4vt",re="index-module__detailRightFlex___Hfz9j",ue="index-module__detailRight____ifae",_e="index-module__detailBtn___uePDy",ce="index-module__detailFont___rWsKA",de="index-module__remarkFont___WDPsx",me="index-module__safeBottom___cRxNR",he="index-module__bottomBox___PbBxu",pe="index-module__moreFontBox___vA9dI",fe="index-module__moreFont___xxzbg",xe="index-module__posssBox___xiujZ",ve="index-module__order_save_address___tpWvK",ge="index-module__platform_name___BF0sz",je="index-module__advance_main___c60x7",be="index-module__time_con___iqnuN",we="index-module__times___ReaPH",ye="index-module__text___jNCOO",Ne="index-module__num___I8Xo7",ke="index-module__separate___RFMl3",Se="index-module__refresh___L1B6H",Ge="index-module__mconfont___ubWlS",Ze="index-module__refresh_text___NVhyb",Ce=o(9498),Te={value:10,label:"预付款"},Pe={value:3,label:"账期"},Be={value:5,label:"货到付款"},Me=o(5893),De=function AdvanceOrderState(e){var t=e.orderInfo,o=e.onRefresh,n=(0,Ce.y3)(),s=n.showTime,l=n.onStart,a=n.timeStatus,i=Te,r=(0,d.useMemo)((function(){return(null==t?void 0:t.status)==i.value&&t.logistics_details.length>0?t.logistics_details[0].expire_time:""}),[t]);return(0,d.useEffect)((function(){r&&l(r)}),[r]),(0,d.useEffect)((function(){2==a&&(null==o||o())}),[a]),(0,Me.jsxs)(u.G7,{className:je,children:[(0,Me.jsxs)(u.G7,{className:be,children:[(0,Me.jsxs)(u.G7,{className:we,children:[(0,Me.jsx)(u.xv,{className:ye,children:"剩"}),(0,Me.jsx)(u.xv,{className:Ne,children:s.HH}),(0,Me.jsx)(u.xv,{className:ke,children:":"}),(0,Me.jsx)(u.xv,{className:Ne,children:s.MM}),(0,Me.jsx)(u.xv,{className:ke,children:":"}),(0,Me.jsx)(u.xv,{className:Ne,children:s.SS})]}),(0,Me.jsx)(u.xv,{children:"等待买家付款,超时自动取消"})]}),(0,Me.jsxs)(u.G7,{className:Se,onClick:function onClick(){return null==o?void 0:o()},children:[(0,Me.jsx)(u.xv,{className:h()(Ge,"iconfont icon-shuaxin")}),(0,Me.jsx)(u.xv,{className:h()(Ze),children:"刷新"})]})]})},Ee=(0,d.memo)(De),Le=o(5273),Fe="index-module__title___v_O0t",Ie=function BottomApply(e){var t=e.obj,o=void 0===t?{sale_mode:0,collect_status:"",status:"",payment_method:0,settle_mode:"",is_shipper_picks_up:!1}:t,n=e.handApplyGoods,s=e.handApplyMoney,i=e.handSureGoods,r=e.cancle,_=e.handShowCodeList,c=e.handEdit,m=e.goodsObj,h=void 0===m?{}:m,p=e.nextBuy,f=(0,d.useMemo)((function(){var e,t,n,s,l;return!!(0===o.sale_mode&&9==o.status&&0==o.collect_status&&null!=h&&null!==(e=h.av_return_product)&&void 0!==e&&e.length||0===o.sale_mode&&9==o.status&&1==o.collect_status&&null!=h&&null!==(t=h.av_return_product)&&void 0!==t&&t.length||0===o.sale_mode&&9==o.status&&2==o.collect_status&&null!=h&&null!==(n=h.av_return_product)&&void 0!==n&&n.length||0===o.sale_mode&&9==o.status&&3==o.settle_mode&&null!=h&&null!==(s=h.av_return_product)&&void 0!==s&&s.length||2===o.sale_mode&&9==o.status&&null!=h&&null!==(l=h.av_return_product)&&void 0!==l&&l.length)}),[o]),x=(0,d.useMemo)((function(){var e,t,n,s,l,a,i,r,u,_;return!!(0===o.sale_mode&&2==o.status&&1==o.collect_status&&null!=h&&null!==(e=h.av_return_product)&&void 0!==e&&e.length||0===o.sale_mode&&7==o.status&&2==o.collect_status&&null!=h&&null!==(t=h.av_return_product)&&void 0!==t&&t.length||0===o.sale_mode&&7==o.status&&3==o.collect_status&&null!=h&&null!==(n=h.av_return_product)&&void 0!==n&&n.length||0===o.sale_mode&&11==o.status&&(1==o.collect_status||2==o.collect_status)&&null!=h&&null!==(s=h.av_return_product)&&void 0!==s&&s.length||0===o.sale_mode&&3==o.status&&2==o.collect_status&&null!=h&&null!==(l=h.av_return_product)&&void 0!==l&&l.length&&!o.is_shipper_picks_up||0===o.sale_mode&&3==o.status&&1==o.collect_status&&null!=h&&null!==(a=h.av_return_product)&&void 0!==a&&a.length&&!o.is_shipper_picks_up||1===o.sale_mode&&0==o.status&&null!=h&&null!==(i=h.av_return_product)&&void 0!==i&&i.length||1===o.sale_mode&&9==o.status&&null!=h&&null!==(r=h.av_return_product)&&void 0!==r&&r.length||2===o.sale_mode&&0==o.status&&1==o.collect_status&&null!=h&&null!==(u=h.av_return_product)&&void 0!==u&&u.length||2===o.sale_mode&&0==o.status&&2==o.collect_status&&null!=h&&null!==(_=h.av_return_product)&&void 0!==_&&_.length)}),[o]),v=(0,d.useMemo)((function(){return 0===o.sale_mode||1===o.sale_mode&&10!==o.status||2===o.sale_mode&&10!==o.status}),[o]),g=(0,d.useMemo)((function(){return 0===o.sale_mode&&8==o.status&&0==o.collect_status||0===o.sale_mode&&8==o.status&&1==o.collect_status||0===o.sale_mode&&8==o.status&&2==o.collect_status||0===o.sale_mode&&8==o.status&&3==o.settle_mode||1===o.sale_mode&&8==o.status||2===o.sale_mode&&8==o.status}),[o]),j=(0,d.useMemo)((function(){return 3==o.status||8==o.status||11==o.status||9==o.status||4==o.status}),[o]),b=(0,d.useMemo)((function(){return 0===o.sale_mode&&0===o.status||0===o.sale_mode&&1===o.status||0===o.sale_mode&&2===o.status&&0==o.collect_status||0===o.sale_mode&&7===o.status&&0==o.collect_status||0===o.sale_mode&&11===o.status&&0==o.collect_status||0===o.sale_mode&&11===o.status&&3==o.settle_mode||0===o.sale_mode&&3===o.status&&3==o.settle_mode||1===o.sale_mode&&10===o.status||2===o.sale_mode&&10===o.status||2===o.sale_mode&&0===o.status&&(1==o.collect_status||2==o.collect_status)||2===o.sale_mode&&0===o.status&&0==o.collect_status||1===o.sale_mode&&10===o.status||2===o.sale_mode&&10===o.status||0===o.sale_mode&&13===o.status||0==o.collect_status}),[o]),w=(0,d.useMemo)((function(){return 0===o.sale_mode&&7===o.status&&1==o.collect_status||0===o.sale_mode&&7===o.status&&0==o.collect_status||0===o.sale_mode&&7===o.status&&3==o.settle_mode||0===o.sale_mode&&3===o.status&&1==o.collect_status||0===o.sale_mode&&3===o.status&&0==o.collect_status||0===o.sale_mode&&8===o.status&&1==o.collect_status||0===o.sale_mode&&8===o.status&&0==o.collect_status||0===o.sale_mode&&9===o.status&&1==o.collect_status||0===o.sale_mode&&9===o.status&&0==o.collect_status||2===o.sale_mode&&2===o.status||2===o.sale_mode&&7===o.status||1===o.sale_mode&&10===o.status||1===o.sale_mode&&7===o.status||2===o.sale_mode&&10===o.status}),[o]),y=(0,d.useMemo)((function(){return 0==o.status||1==o.status}),[o]),N=(0,d.useState)([]),k=(0,a.Z)(N,2),S=k[0],G=k[1];(0,d.useMemo)((function(){var e=[],t=0;b&&(t+=1,e.push({key:"showCancel",label:"取消订单",bgKind:1,sort:1})),w&&(t+=1,e.push({key:"canBuy",label:"去付款",bgKind:2,sort:20})),v&&(t+=1,e.push({key:"showBuy",label:"再次购买",bgKind:3,sort:10})),g&&(t+=1,e.push({key:"showTake",label:"确认收货",bgKind:1,sort:9})),j&&(t+=1,e.push({key:"showCodeList",label:"销售码单",bgKind:1,sort:12})),x&&(t+=1,e.push({key:"showTuikuan",label:"申请退款",bgKind:3,sort:3})),f&&(t+=1,e.push({key:"showTuihuo",label:"申请退货",bgKind:3,sort:2})),y&&(t+=1,console.log("101010"),e.push({key:"showEdit",label:"修改订单",bgKind:3,sort:9}));var o=e.sort((function(e,t){return e.sort-t.sort}));return G((0,l.Z)(o)),t}),[o]);return(0,Me.jsx)(Me.Fragment,{children:S.map((function(e,t){return t<S.length-3&&(0,Me.jsx)(u.G7,{className:Fe,onClick:function onClick(t){return function submitBtns(e,t){"showTuihuo"===t&&(null==n||n()),"showTuikuan"===t&&(null==s||s()),"showCodeList"===t&&(null==_||_(e)),"showTake"===t&&(null==i||i(e)),"showCancel"===t&&(null==r||r(e)),"showBuy"===t&&(null==p||p(e)),"showEdit"===t&&(null==c||c())}(t,e.key)},children:e.label},t)}))})},Ae=(0,d.memo)(Ie),Re="index-module__order_flow_state___LcDRn",ze="index-module__order_status_list___lqscW",Oe="index-module__order_status_list_show___mBCE5",$e="index-module__order_status_item___q4RWe",Ke="index-module__order_status_tail_end___mc6N3",Ue="index-module__order_status_tail___xoe3h",We="index-module__order_status_line___tssSh",Je="index-module__order_status_content___osIlz",He="index-module__flexBox___IhMV_",qe="index-module__order_status_title___jXwJC",Ve="index-module__order_status_time___pAiS0",Xe="index-module__order_status_select___PxFui",Qe="index-module__picBox___pJw8P",Ye="index-module__pic___NA4gR",et="index-module__order_status_des___w7lVZ",tt="index-module__order_status_des_select___vL2OI",ot="index-module__more___D2euv",nt="index-module__miconfonts___Fhnl6",st="index-module__open_miconfonts___jAmEF",lt="index-module__image_tag___kz5JR",at="index-module__image___qJkYf",it="index-module__pay_title_tag___znE07",rt="index-module__miconfont___LGs0b",ut=o(9579),_t=o(4812),ct=function OrderState(e){var t=e.orderInfo,o=void 0===t?{logistics_details:[],payment_method:0,status:0}:t,n=(e.onRefresh,e.picUrl),s=void 0===n?[]:n;(0,d.useEffect)((function(){console.log("orderInfo33::",o)}),[o]);var l=(0,d.useState)(!1),i=(0,a.Z)(l,2),r=i[0],_=i[1],m=(0,d.useMemo)((function(){return o.logistics_details?null==o?void 0:o.logistics_details.reverse():[]}),[o.logistics_details]),p=Pe,f=Be;return(0,Me.jsxs)(Me.Fragment,{children:[(null==m?void 0:m.length)>0&&(0,Me.jsxs)(u.G7,{className:Re,children:[(0,Me.jsx)(u.G7,{className:h()(ze,r&&Oe),children:m.map((function(e,t){var n;return(0,Me.jsxs)(u.G7,{className:$e,children:[m.length>1&&(0,Me.jsx)(u.G7,{className:h()(Ue,0==t&&Ke)}),m.length!=t+1&&(0,Me.jsx)(u.G7,{className:We}),(0,Me.jsxs)(u.G7,{className:Je,children:[(0,Me.jsxs)(u.G7,{className:He,children:[(0,Me.jsx)(u.G7,{className:h()(qe,0==t&&Xe),children:e.status}),(0,Me.jsx)(u.G7,{className:h()(Ve,0==t&&Xe),children:(0,_t.o0)(e.time)}),["待发货","已发货"].includes(e.status)&&(null==o?void 0:o.is_outbound)&&(0,Me.jsx)(ut.Z,{type:"primary",size:"small",circle:!0,children:"已出仓"})]}),["待发货","已发货"].includes(e.status)&&(null==o?void 0:o.is_outbound)&&(0,Me.jsx)(u.G7,{className:et,children:"订单货物已出仓,打包整理后火速发出"}),(0,Me.jsx)(u.G7,{className:Qe,children:null===(n=e.delivery_appendix_url)||void 0===n?void 0:n.map((function(e,t){return(0,Me.jsx)(u.Ee,{mode:"aspectFit",src:e,className:Ye,onClick:function onClick(){return function handSee(e){console.log(e,"itemmmm"),c().previewImage({current:e,urls:s})}(e)}},t)}))})]}),(0,Me.jsx)(u.xv,{className:h()(et,0==t&&tt),children:e.desc})]},t)}))}),m.length>2&&(0,Me.jsxs)(u.G7,{className:ot,onClick:function onClick(){return function changeMore(){_((function(){return!r}))}()},children:[(0,Me.jsx)(u.xv,{children:r?"收起详情":"点击查看详情"}),(0,Me.jsx)(u.xv,{className:h()("iconfont icon-a-moreback",nt,r&&st)})]}),(0,Me.jsxs)(u.G7,{className:lt,children:[o.payment_method==f.value&&(0,Me.jsx)(u.Ee,{mode:"aspectFit",src:(0,_t.z)("/mall/order_pay_status.png"),className:at}),o.payment_method==p.value&&(0,Me.jsx)(u.Ee,{mode:"aspectFit",src:(0,_t.z)("/mall/order_pay_status_day.png"),className:at})]})]}),o.payment_method==p.value&&(0,Me.jsxs)(u.G7,{className:it,children:[(0,Me.jsx)(u.xv,{className:h()(rt,"iconfont icon-zhuyi")}),"您使用了",o.account_period,"天账期支付,还款日期为",(0,_t.o0)(o.account_period_time)]})]})},dt=(0,d.memo)(ct),mt=o(527),ht=o(5989),pt=o(6281),ft=o(7227),xt=o(1251),vt=o(1115),gt=o(6028),jt=o(2495),bt={common_safe_area_y:"index-module__common_safe_area_y___uU1ax","flex-col":"index-module__flex-col___b3pGW","flex-row":"index-module__flex-row___jfE4p","justify-between":"index-module__justify-between___FbGmk","justify-center":"index-module__justify-center___JFyH4","items-center":"index-module__items-center___DkG62","flex-item":"index-module__flex-item___R26YL","full-100":"index-module__full-100___o92uh","color-blue":"index-module__color-blue___p1ooQ","color-yellow":"index-module__color-yellow___eH4vU","color-green":"index-module__color-green___Xrckl","color-grey":"index-module__color-grey___iAJ6e","color-white":"index-module__color-white___Nyxd9","s-w":"index-module__s-w___Fzm7I","s-e":"index-module__s-e___dfj_1",filter:"index-module__filter___I8jjL",popupBox:"index-module__popupBox___oZ7St",scroStyle:"index-module__scroStyle___UfFg_",sure:"index-module__sure___KRWzJ"},wt=o(4856),yt=function CodeList(e){var t=e.showPopup,o=(e.obj,(0,xt.fs)().fetchData),n=(0,d.useState)(""),s=(0,a.Z)(n,2),l=s[0],_=s[1],m=function(){var t=(0,r.Z)((0,i.Z)().mark((function _callee(){var t,n,s,l,a,r,u,d,m,h,p,f,x,v,g,j,b,w,y,N,k,S,G,Z,C,T,P,B,M,D,E,L;return(0,i.Z)().wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:return D=[],null===(t=e.obj.product_list)||void 0===t||t.forEach((function(e){e.product_colors.forEach((function(t){D.push({product_code:e.code,product_name:e.name,product_color_code:(0,_t.ZK)(t.code),product_color_name:t.name,num:t.roll.toString(),weight:(0,_t.$y)(t.actual_weight).toString(),sale_price:(t.sale_price/100).toString(),total_price:0!==t.total_sale_price?(t.total_sale_price/100).toString():(t.estimate_amount/100).toString(),length:(t.length/100).toString(),weight_error:(0,_t.$y)(t.weight_error).toString()})}))})),E={list:D,title:"面料销售电子确认单",order_type:null==e?void 0:e.obj.sale_mode_name,shipment_mode:null==e?void 0:e.obj.shipment_mode_name,company:null==e?void 0:e.obj.title_purchaser_name,sale_user:null==e?void 0:e.obj.sale_user_name,order_created_time:(0,_t.o0)(null==e?void 0:e.obj.create_time),order_no:null==e?void 0:e.obj.order_no,target_user_name:null==e?void 0:e.obj.target_user_name,target_address:null==e?void 0:e.obj.address_detail,target_description:null==e?void 0:e.obj.remark,pay_account:null==e?void 0:e.obj.transfer_remittance_account,bank_account_name:null==e?void 0:e.obj.account_name,bank_name:null==e?void 0:e.obj.bank_of_deposit,pay_type:null==e?void 0:e.obj.settle_mode_name,client:null==e?void 0:e.obj.purchaser_name,phone:null==e?void 0:e.obj.target_user_phone,order_total_length:((null==e?void 0:e.obj.total_number)/100).toString(),order_total_price:((null==e?void 0:e.obj.bill_total_sale_price)/100).toString(),total_weight_error_discount:((null==e?void 0:e.obj.total_weight_error_discount)/100).toString(),order_total_num:null==e?void 0:e.obj.total_number.toString(),qrcode:"".concat(jt.uQ,"?sale_order_no=").concat(null==e?void 0:e.obj.order_no),order_total_weight:((null==e?void 0:e.obj.total_weight)/1e3).toString(),estimate_amount:((null==e?void 0:e.obj.estimate_amount)/100).toString(),total_sale_price:((null==e?void 0:e.obj.total_sale_price)/100).toString(),actual_amount:((null==e?void 0:e.obj.actual_amount)/100).toString(),wait_pay_amount:((null==e?void 0:e.obj.wait_pay_amount)/100).toString(),order_total_weight_error:((null==e?void 0:e.obj.total_weight_error)/1e3).toString(),show_sale_price:!(0!==(null==e||null===(n=e.obj)||void 0===n?void 0:n.sale_mode)||null==e||null===(s=e.obj)||void 0===s||!s.is_display_price)||!(1!==(null==e||null===(l=e.obj)||void 0===l?void 0:l.sale_mode)&&2!==(null==e||null===(a=e.obj)||void 0===a?void 0:a.sale_mode)),show_total_price:!(0!==(null==e||null===(r=e.obj)||void 0===r?void 0:r.sale_mode)||null==e||null===(u=e.obj)||void 0===u||!u.is_display_price)||!(1!==(null==e||null===(d=e.obj)||void 0===d?void 0:d.sale_mode)&&2!==(null==e||null===(m=e.obj)||void 0===m?void 0:m.sale_mode)),show_estimate_amount:!(0!==(null==e||null===(h=e.obj)||void 0===h?void 0:h.sale_mode)||null==e||null===(p=e.obj)||void 0===p||!p.is_display_price)||!(1!==(null==e||null===(f=e.obj)||void 0===f?void 0:f.sale_mode)&&2!==(null==e||null===(x=e.obj)||void 0===x?void 0:x.sale_mode)),show_total_sale_price:!(0!==(null==e||null===(v=e.obj)||void 0===v?void 0:v.sale_mode)||null==e||null===(g=e.obj)||void 0===g||!g.is_display_price)||!(1!==(null==e||null===(j=e.obj)||void 0===j?void 0:j.sale_mode)&&2!==(null==e||null===(b=e.obj)||void 0===b?void 0:b.sale_mode)),show_total_weight_error_discount:!(0!==(null==e||null===(w=e.obj)||void 0===w?void 0:w.sale_mode)||null==e||null===(y=e.obj)||void 0===y||!y.is_display_price)||!(1!==(null==e||null===(N=e.obj)||void 0===N?void 0:N.sale_mode)&&2!==(null==e||null===(k=e.obj)||void 0===k?void 0:k.sale_mode)),show_actual_amount:!(0!==(null==e||null===(S=e.obj)||void 0===S?void 0:S.sale_mode)||null==e||null===(G=e.obj)||void 0===G||!G.is_display_price)||!(1!==(null==e||null===(Z=e.obj)||void 0===Z?void 0:Z.sale_mode)&&2!==(null==e||null===(C=e.obj)||void 0===C?void 0:C.sale_mode)),show_wait_pay_amount:!(0!==(null==e||null===(T=e.obj)||void 0===T?void 0:T.sale_mode)||null==e||null===(P=e.obj)||void 0===P||!P.is_display_price)||!(1!==(null==e||null===(B=e.obj)||void 0===B?void 0:B.sale_mode)&&2!==(null==e||null===(M=e.obj)||void 0===M?void 0:M.sale_mode)),show_tips:!0,tips:"请核对本单后验收, <b>如发现质量问题,请于收到货之日起3天内与平台客服联系协商解决,</b>逾期不作处理即表示购方默认对货物无异议;<b>购方确认无任何问题方可裁剪/加工,一经裁剪,缩水等工艺,平台概不负责;</b>\n 看布购货,请先试缩水,并注意分缸裁布!如需撞色拼接,请先试色牢度。非质量问题,恕不退换,谢谢合作!"},i.next=5,o(E);case 5:(L=i.sent).data&&(_(L.data.base64),c().hideLoading());case 7:case"end":return i.stop()}}),_callee)})));return function getPic(){return t.apply(this,arguments)}}(),h=(0,d.useRef)({filePath:"",base64:""}),p=(0,wt.Z)({scope:"scope.writePhotosAlbum",msg:"您没授权,无法保存图片"}).check,f=function saveImage(){var e=(new Date).valueOf(),t=/data:image\/(\w+);base64,(.*)/.exec(l)||[],o=(0,a.Z)(t,3),n=o[1],s=o[2],i="".concat(c().env.USER_DATA_PATH,"/img").concat(e,".").concat(n);h.current.filePath=i,h.current.base64=s,c().getFileSystemManager().writeFile({filePath:h.current.filePath,data:h.current.base64,encoding:"base64"}),vt.Z9.loading("正在保存图片"),c().saveImageToPhotosAlbum({filePath:h.current.filePath,success:function success(){vt.Z9.success("图片保存成功")},fail:function fail(e){console.log("err::",e)}})},x=function(){var e=(0,r.Z)((0,i.Z)().mark((function _callee2(){return(0,i.Z)().wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p();case 2:e.sent&&f();case 4:case"end":return e.stop()}}),_callee2)})));return function saveImageCheck(){return e.apply(this,arguments)}}();return(0,d.useEffect)((function(){var o=Object.keys(e.obj);console.log("PicUrl",l),o.length>0&&t&&m()}),[e.obj,t,l]),(0,Me.jsx)(ht.Z,{show:e.showPopup,title:"销售码单",onClose:function onClose(){var t;return null===(t=e.popupClose)||void 0===t?void 0:t.call(e)},children:(0,Me.jsxs)(u.G7,{className:bt.popupBox,children:[(0,Me.jsx)(u.pf,{enhanced:!0,scrollY:!0,className:bt.scroStyle,children:(0,Me.jsx)(u.G7,{className:bt.pic,children:(0,Me.jsx)(u.Ee,{lazyLoad:!0,mode:"widthFix",style:{width:"100%",height:"100%"},src:l,onClick:function onClick(){return function showImage(){var e=(new Date).valueOf(),t=/data:image\/(\w+);base64,(.*)/.exec(l)||[],o=(0,a.Z)(t,3),n=o[1],s=o[2],i="".concat(c().env.USER_DATA_PATH,"/img").concat(e,".").concat(n);h.current.filePath=i,h.current.base64=s,c().getFileSystemManager().writeFile({filePath:h.current.filePath,data:h.current.base64,encoding:"base64"}),c().previewImage({current:h.current.filePath,urls:[h.current.filePath]})}()}})})}),(0,Me.jsx)(u.G7,{className:bt.sure,onClick:function onClick(){return x()},children:"保存图片"})]})})},Nt=(0,d.memo)(yt),kt=o(4547),St=o(9742),Gt=o(4262),Zt=o(3929),Ct=function DefaultBox(e){var t=e.title,o=void 0===t?"标题":t,n=e.modeName,s=void 0===n?"大货":n,l=e.showMode,a=void 0!==l&&l,i=e.children,r=e.clickNode;return(0,Me.jsxs)(u.G7,{className:J,children:[(0,Me.jsxs)(u.G7,{className:H,children:[(0,Me.jsx)(u.G7,{className:q,children:o}),a&&(0,Me.jsx)(u.G7,{className:V,onClick:function onClick(){return null==r?void 0:r()},children:s})]}),(0,Me.jsx)(u.G7,{className:X}),i]})},Tt=function GoodsItem(e){var t=e.list,o=void 0===t?[]:t,n=e.obj,s=void 0===n?{}:n;(0,d.useCallback)((function(e){return{lab:e.lab,rgb:e.rgb,texture_url:e.texture_url}}),[]);return(0,Me.jsx)(Me.Fragment,{children:o.map((function(e,t){return(0,Me.jsxs)(u.G7,{className:Q,children:[(0,Me.jsxs)(u.G7,{className:Y,children:[e.code,"# ",e.name]}),(0,Me.jsx)(u.G7,{className:ee}),e.product_colors.map((function(e,t){return(0,Me.jsxs)(u.G7,{className:se,children:[(0,Me.jsxs)(u.G7,{className:le,children:[(0,_t.W7)(e.code,e.name)," x",(null==s?void 0:s.sale_mode)===kt.p.Bulk?e.roll:(0,_t.N6)(e.length),(null==s?void 0:s.sale_mode)===kt.p.Bulk?"条":"m"]}),(0,Me.jsxs)(u.G7,{className:ae,children:[(null==s?void 0:s.sale_mode)===kt.p.Bulk&&(null==e?void 0:e.sale_price)!==(null==e?void 0:e.standard_sale_price)?(0,Me.jsxs)(u.G7,{className:oe,children:["¥",(0,_t.yb)(null==e?void 0:e.standard_sale_price,100,!0),"/kg"]}):null,(0,Me.jsxs)(u.G7,{className:te,children:["¥",(0,_t.yb)(e.sale_price,100,!0),"/",(null==s?void 0:s.sale_mode)===kt.p.Plate?"m":"kg"]}),(0,Me.jsxs)(u.G7,{className:ne,children:["¥",(0,_t.yb)(e.total_sale_price,100,!0)]})]})]},t)}))]},t)}))})},Pt=function(e){return e[e.NONE=0]="NONE",e[e.PASS=3]="PASS",e[e.PENDING=1]="PENDING",e[e.REFUSE=2]="REFUSE",e}(Pt||{}),Bt=function ServicesNotification(e){var t=(0,Zt.Z)().userInfo,o=e.salesOrderId,n=e.auditStatus,s=e.baseData,l=e.onSuccess,_=e.isReadjust,m=e.saleUserId,p=(0,xt.BO)().fetchData,f=(0,xt.WQ)().fetchData,F=function(){var e=(0,r.Z)((0,i.Z)().mark((function _callee(){return(0,i.Z)().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f({sale_order_id:o});case 2:e.sent.success&&(c().showToast({title:"拒绝成功",icon:"success",duration:2e3}),l());case 4:case"end":return e.stop()}}),_callee)})));return function handleRefuse(){return e.apply(this,arguments)}}(),I=function(){var e=(0,r.Z)((0,i.Z)().mark((function _callee2(){return(0,i.Z)().wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p({sale_order_id:o});case 2:e.sent.success&&(c().showToast({title:"审核通过",icon:"success",duration:2e3}),l());case 4:case"end":return e.stop()}}),_callee2)})));return function handlePass(){return e.apply(this,arguments)}}(),A=(0,d.useState)(!1),R=(0,a.Z)(A,2),z=R[0],O=R[1],$=function handleShowDialog(e){O(e)};(0,d.useEffect)((function(){t.userInfo.user_id&&n===Pt.PENDING&&_&&t.userInfo.user_id===m&&$(!0)}),[_,n,m,t]);var K=(0,d.useMemo)((function(){var e={background:"",textColor:"",icon:null};return n===Pt.PENDING?(e.background=g,e.textColor=B,e.icon=(0,Me.jsx)(gt.Z,{name:"icon-daishenhe",size:56,color:"#337fff"})):n===Pt.PASS?(e.background=x,e.textColor=P,e.icon=(0,Me.jsx)(gt.Z,{name:"icon-shenhetongguo",size:56,color:"#03b15f"})):n===Pt.REFUSE&&(e.background=v,e.textColor=T,e.icon=(0,Me.jsx)(gt.Z,{name:"icon-shenhejujue",size:56,color:"#f64861"})),e}),[n]);return(0,Me.jsxs)(u.G7,{className:h()(j,K.background),children:[(0,Me.jsxs)(u.G7,{className:b,children:[(0,Me.jsxs)(u.G7,{className:Z,children:[K.icon,(0,Me.jsx)(u.xv,{className:h()(C,K.textColor),children:s.adjust_price_audit_status_name})]}),(0,Me.jsxs)(u.G7,{className:M,children:["单价调整超过 ",(0,_t.yb)(s.max_adjust_price)," 元"]})]}),(0,Me.jsx)(u.G7,{className:w,children:n===Pt.PENDING?(0,Me.jsxs)(u.G7,{className:k,children:[(0,Me.jsx)(St.Z,{customClassName:S,type:"primary",size:"small",circle:!0,plain:!0,onClick:F,children:"拒绝"}),(0,Me.jsx)(St.Z,{customClassName:G,type:"primary",size:"small",circle:!0,onClick:I,children:"同意"})]}):(0,Me.jsxs)(Me.Fragment,{children:[(0,Me.jsxs)(u.G7,{className:y,children:["审核人员:",s.adjust_price_audit_name]}),(0,Me.jsxs)(u.G7,{className:N,children:["审核时间:",(0,_t.o0)(s.adjust_price_audit_time)]})]})}),(0,Me.jsx)(Gt.Z,{show:z,onChange:$,children:(0,Me.jsxs)(u.G7,{className:h()(D,K.background),children:[(0,Me.jsxs)(u.G7,{className:b,children:[(0,Me.jsx)(u.G7,{className:E,onClick:function onClick(){return $(!1)},children:(0,Me.jsx)(gt.Z,{name:"icon-guanbi",size:50,color:"#6b6d71"})}),(0,Me.jsxs)(u.G7,{className:Z,children:[K.icon,(0,Me.jsx)(u.xv,{className:h()(C,K.textColor),children:s.adjust_price_audit_status_name})]}),(0,Me.jsxs)(u.G7,{className:M,children:["单价调整超过 ",(0,_t.yb)(s.max_adjust_price)," 元,请分享至上级"]})]}),(0,Me.jsx)(u.zx,{openType:"share",className:L,onClick:function handleShare(){console.log("handleShare"),$(!1)},children:"点击分享"})]})})]})},Mt=function OrderDetails(){var e,t,o=(0,_.useRouter)(),n=(0,d.useState)(null),m=(0,a.Z)(n,2),h=m[0],x=m[1],v=(0,xt.kZ)().fetchData,g=(0,ft.Ds)(function(){var e=(0,r.Z)((0,i.Z)().mark((function _callee3(e,t){var o;return(0,i.Z)().wrap((function _callee3$(n){for(;;)switch(n.prev=n.next){case 0:if(8!==S.status&&9!==S.status&&4!==S.status&&5!==S.status&&3!==S.status&&11!==S.status){n.next=3;break}return vt.Z9.error("不允许更改"),n.abrupt("return",!1);case 3:if(e.stopPropagation(),h!==t){n.next=7;break}return vt.Z9.error("不能选择相同的方式"),n.abrupt("return",!1);case 7:return c().showLoading({title:"请稍等...",mask:!0}),n.next=10,v({id:Number(S.id),shipment_mode:t});case 10:"success"===(o=n.sent).msg?(c().hideLoading(),c().showToast({title:"成功",icon:"success"}),x(t),Z()):70029==o.data.code?(c().hideLoading(),c().showToast({title:o.msg,icon:"error"})):(c().hideLoading(),c().showToast({title:"请先去新增地址",icon:"error"}));case 12:case"end":return n.stop()}}),_callee3)})));return function(t,o){return e.apply(this,arguments)}}(),300),j=(0,xt.e1)(),b=j.fetchData,w=j.state,y=(0,d.useMemo)((function(){var e;return null===(e=w.data.product_list)||void 0===e?void 0:e.some((function(e){var t;return null===(t=e.product_colors)||void 0===t?void 0:t.some((function(e){return(null==e?void 0:e.sale_price)!==(null==e?void 0:e.standard_sale_price)}))}))}),[w]),N=(0,d.useState)({}),k=(0,a.Z)(N,2),S=k[0],G=k[1],Z=function(){var e=(0,r.Z)((0,i.Z)().mark((function _callee4(){var e,t,n;return(0,i.Z)().wrap((function _callee4$(s){for(;;)switch(s.prev=s.next){case 0:return c().showLoading({title:"加载中...",mask:!0}),s.next=3,b({id:o.params.id});case 3:n=s.sent,c().hideLoading(),c().stopPullDownRefresh(),B.forEach((function(e){"订单编号:"===e.leftTitle&&(e.rightTitle=n.data.order_no),"创建时间:"===e.leftTitle&&(e.rightTitle=(0,_t.o0)(n.data.create_time)),"发货时间:"===e.leftTitle&&(e.rightTitle=(0,_t.o0)(n.data.delivery_time)),"业务员:"===e.leftTitle&&(e.rightTitle=n.data.sale_user_name),""!==n.data.change_time?"编辑时间:"===e.leftTitle&&(e.rightTitle=(0,_t.o0)(n.data.change_time)):"编辑时间:"===e.leftTitle&&(e.showFont=!1)})),n.data.picUrl=null===(e=n.data.delivery_appendix_url)||void 0===e?void 0:e.map((function(e){return e=jt.KC+e})),null===(t=n.data.logistics_details)||void 0===t||t.map((function(e){var t;"待收货"==e.status&&(e.delivery_appendix_url=null===(t=n.data.delivery_appendix_url)||void 0===t?void 0:t.map((function(e){return e=jt.KC+e})));return e})),G(n.data),M((0,l.Z)(B)),x(n.data.shipment_mode);case 12:case"end":return s.stop()}}),_callee4)})));return function getDetail(){return e.apply(this,arguments)}}(),C=c().getCurrentInstance().page;C&&C.onShareAppMessage&&(C.onShareAppMessage=function(e){console.log("useShareAppMessage",e);var t="订单".concat(S.order_no);return"button"===e.from&&(console.log(e.target),t+=",".concat(S.adjust_price_audit_status_name)),{title:t,path:"/pages/orderDetails/index?id=".concat(S.id)}});var T=(0,d.useState)([{leftTitle:"订单编号:",rightTitle:"------",showBtn:!0,showFont:!0},{leftTitle:"创建时间:",rightTitle:"------",showFont:!0},{leftTitle:"发货时间:",rightTitle:"------",showFont:!0},{leftTitle:"业务员:",rightTitle:"------",showFont:!0},{leftTitle:"编辑时间:",rightTitle:"------",showFont:!0}]),P=(0,a.Z)(T,2),B=P[0],M=P[1],D=(0,d.useState)(!1),E=(0,a.Z)(D,2),L=E[0],J=E[1],H=(0,xt.vE)().fetchData,q=function(){var e=(0,r.Z)((0,i.Z)().mark((function _callee5(){return(0,i.Z)().wrap((function _callee5$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,H({remark:S.remark,id:Number(o.params.id)});case 2:"success"===e.sent.msg&&(c().showToast({title:"成功",icon:"success"}),J(!1),Z());case 4:case"end":return e.stop()}}),_callee5)})));return function getRemark(){return e.apply(this,arguments)}}(),V=(0,d.useState)(!1),X=(0,a.Z)(V,2),Q=X[0],Y=X[1],ee=(0,d.useCallback)((function(){vt.Z9.loading("刷新中"),Z()}),[]),te=(0,xt.g7)().fetchData,oe=function(){var e=(0,r.Z)((0,i.Z)().mark((function _callee7(e,t){return(0,i.Z)().wrap((function _callee7$(o){for(;;)switch(o.prev=o.next){case 0:e.stopPropagation(),c().showModal({content:"确定要取消吗?",confirmText:"确认",cancelText:"取消",success:function success(e){return(0,r.Z)((0,i.Z)().mark((function _callee6(){var o;return(0,i.Z)().wrap((function _callee6$(n){for(;;)switch(n.prev=n.next){case 0:if(!e.confirm){n.next=6;break}return c().showLoading({title:"请稍等...",mask:!0}),n.next=4,te({id:t.id});case 4:"success"===(o=n.sent).msg?(c().showToast({title:"取消成功"}),c().hideLoading(),Z()):c().showToast({title:o.msg,icon:"error"});case 6:case"end":return n.stop()}}),_callee6)})))()}});case 2:case"end":return o.stop()}}),_callee7)})));return function cancle(t,o){return e.apply(this,arguments)}}(),ne=(0,xt.BV)().fetchData,se=function(){var e=(0,r.Z)((0,i.Z)().mark((function _callee8(e,t){var o,n,s;return(0,i.Z)().wrap((function _callee8$(l){for(;;)switch(l.prev=l.next){case 0:return e.stopPropagation(),c().showLoading({title:"请稍等...",mask:!0}),o=[],t.product_list.forEach((function(e){e.product_colors.forEach((function(e){o.push({length:e.length,roll:e.roll,product_color_id:e.id})}))})),n={purchaser_id:t.purchaser_id,sale_mode:t.sale_mode,color_list:o},l.next=7,ne(n);case 7:"success"===(s=l.sent).msg?(c().showToast({title:"加入购物车成功!"}),c().hideLoading(),Z()):c().showToast({title:s.msg,icon:"error"});case 9:case"end":return l.stop()}}),_callee8)})));return function nextBuy(t,o){return e.apply(this,arguments)}}(),le=(0,d.useState)(!0),ae=(0,a.Z)(le,2),je=ae[0],be=ae[1],we=(0,d.useState)(""),ye=(0,a.Z)(we,2),Ne=ye[0],ke=ye[1],Se=(0,d.useState)(""),Ge=(0,a.Z)(Se,2),Ze=Ge[0],Ce=Ge[1],Te=(0,d.useState)(!1),Pe=(0,a.Z)(Te,2),Be=Pe[0],De=Pe[1],Fe=(0,xt.P0)().fetchData,Ie=(0,xt.aA)().fetchData,Re=(0,d.useState)(vt.gT),ze=(0,a.Z)(Re,2),Oe=ze[0],$e=ze[1],Ke=function(){var e=(0,r.Z)((0,i.Z)().mark((function _callee9(e,t){var o,n,s,a,r,u;return(0,i.Z)().wrap((function _callee9$(i){for(;;)switch(i.prev=i.next){case 0:if(e.stopPropagation(),console.log("toPay",t),10===t.status){i.next=14;break}return i.next=5,Fe({id:t.should_collect_order_id});case 5:o=i.sent,He(o.data.md5_key),n=Oe.filter((function(e){return!([3,8,13,9].includes(t.status)||[7].includes(t.status)&&[kt.p.BulkCut,kt.p.Plate].includes(t.sale_mode))||![5,3].includes(e.id)})),console.log("filter",n),n.map((function(e){return 3===e.id&&(e.name="".concat(o.data.account_period,"天账期"),e.fonts="可用额度".concat((0,_t.yb)(o.data.account_period_credit_available_line).toLocaleString())),2===e.id&&(e.fonts="可用额度".concat((0,_t.yb)(o.data.advance_deposit_balance).toLocaleString())),e})),$e((0,l.Z)(n)),t.is_shipper_picks_up&&(s=n.filter((function(e){return 6===e.id})),console.log(s,"456456"),0===s.length&&(n.unshift({id:6,iconfont:"icon-huozhuziti",name:"货主自提",color:"#ffffff",fonts:"",money:"",isCheck:!1}),$e((0,l.Z)(n)))),i.next=22;break;case 14:return i.next=16,Ie({id:t.pre_collect_order_id});case 16:a=i.sent,He(a.data.md5_key),(r=[]).push({id:2,iconfont:"icon-yufukuan1",name:"预存款",fonts:"可用额度".concat((0,_t.yb)(a.data.advance_deposit_balance).toLocaleString()),money:"",isCheck:!1},{iconfont:"icon-yue",name:"线下汇款"},{iconfont:"icon-saomiao",name:"扫码支付",color:"#ffffff"}),t.is_shipper_picks_up&&(u=r.filter((function(e){return 6===e.id})),0===u.length&&r.unshift({id:6,iconfont:"icon-huozhuziti",name:"货主自提",fonts:"",money:"",isCheck:!1,color:"#ffffff"})),$e([].concat(r));case 22:be(!0),ke("待支付款项"),De(!0);case 25:case"end":return i.stop()}}),_callee9)})));return function toPay(t,o){return e.apply(this,arguments)}}();(0,_.useDidShow)((function(){Z()})),(0,_.usePullDownRefresh)((function(){console.log("usePullDownRefresh"),Z()}));var Ue=(0,d.useState)(""),We=(0,a.Z)(Ue,2),Je=We[0],He=We[1],qe=(0,xt.fs)().fetchData,Ve=function(){var e=(0,r.Z)((0,i.Z)().mark((function _callee10(){var e,t,o;return(0,i.Z)().wrap((function _callee10$(n){for(;;)switch(n.prev=n.next){case 0:return e=[],S.product_list.forEach((function(t){t.product_colors.forEach((function(o){e.push({product_code:t.code,product_name:t.name,product_color_code:(0,_t.ZK)(o.code),product_color_name:o.name,num:o.roll.toString(),weight:(0,_t.$y)(o.actual_weight).toString(),sale_price:(o.sale_price/100).toString(),total_price:0!==o.total_sale_price?(o.total_sale_price/100).toString():(o.estimate_amount/100).toString(),length:(o.length/100).toString(),weight_error:(0,_t.$y)(o.weight_error).toString()})}))})),t={list:e,title:"面料销售电子确认单",show_qrcode:!0,show_barcode:!0,order_type:S.sale_mode_name,shipment_mode:S.shipment_mode_name,company:S.title_purchaser_name,sale_user:S.sale_user_name,order_created_time:(0,_t.o0)(S.create_time),order_no:S.order_no,target_user_name:S.target_user_name,target_address:S.address_detail,target_description:S.remark,pay_account:S.transfer_remittance_account,bank_account_name:S.account_name,bank_name:S.bank_of_deposit,pay_type:S.settle_mode_name,client:S.purchaser_name,phone:S.target_user_phone,order_total_length:(S.total_number/100).toString(),order_total_price:(S.bill_total_sale_price/100).toString(),total_weight_error_discount:(S.total_weight_error_discount/100).toString(),order_total_num:S.total_number.toString(),qrcode:"".concat(jt.uQ,"?key=").concat(Je),order_total_weight:(S.total_weight/1e3).toString(),estimate_amount:(S.estimate_amount/100).toString(),total_sale_price:(S.total_sale_price/100).toString(),actual_amount:(S.actual_amount/100).toString(),wait_pay_amount:(S.wait_pay_amount/100).toString(),order_total_weight_error:(S.total_weight_error/1e3).toString(),show_sale_price:!(0!==(null==S?void 0:S.sale_mode)||null==S||!S.is_display_price)||!(1!==(null==S?void 0:S.sale_mode)&&2!==(null==S?void 0:S.sale_mode)),show_total_price:!(0!==(null==S?void 0:S.sale_mode)||null==S||!S.is_display_price)||!(1!==(null==S?void 0:S.sale_mode)&&2!==(null==S?void 0:S.sale_mode)),show_estimate_amount:!(0!==(null==S?void 0:S.sale_mode)||null==S||!S.is_display_price)||!(1!==(null==S?void 0:S.sale_mode)&&2!==(null==S?void 0:S.sale_mode)),show_total_sale_price:!(0!==(null==S?void 0:S.sale_mode)||null==S||!S.is_display_price)||!(1!==(null==S?void 0:S.sale_mode)&&2!==(null==S?void 0:S.sale_mode)),show_total_weight_error_discount:!(0!==(null==S?void 0:S.sale_mode)||null==S||!S.is_display_price)||!(1!==(null==S?void 0:S.sale_mode)&&2!==(null==S?void 0:S.sale_mode)),show_actual_amount:!(0!==(null==S?void 0:S.sale_mode)||null==S||!S.is_display_price)||!(1!==(null==S?void 0:S.sale_mode)&&2!==(null==S?void 0:S.sale_mode)),show_wait_pay_amount:!(0!==(null==S?void 0:S.sale_mode)||null==S||!S.is_display_price)||!(1!==(null==S?void 0:S.sale_mode)&&2!==(null==S?void 0:S.sale_mode)),show_tips:!0,tips:"请核对本单后验收, <b>如发现质量问题,请于收到货之日起3天内与平台客服联系协商解决,</b>逾期不作处理即表示购方默认对货物无异议;<b>购方确认无任何问题方可裁剪/加工,一经裁剪,缩水等工艺,平台概不负责;</b>\n 看布购货,请先试缩水,并注意分缸裁布!如需撞色拼接,请先试色牢度。非质量问题,恕不退换,谢谢合作!"},n.next=5,qe(t);case 5:(o=n.sent).data&&(console.log(o.data.base64),be(!1),ke("查看销售码单"),Ce(o.data.base64));case 7:case"end":return n.stop()}}),_callee10)})));return function handScanpay(){return e.apply(this,arguments)}}(),Xe=(0,xt._6)().fetchData,Qe=(0,xt.hj)().fetchData,Ye=(0,d.useState)(!1),et=(0,a.Z)(Ye,2),tt=et[0],ot=et[1],nt=(0,d.useMemo)((function(){return 8!==S.status&&9!==S.status&&4!==S.status&&5!==S.status&&11!==S.status&&3!==S.status}),[S]),st=(0,d.useMemo)((function(){return 1===S.shipment_mode?"自提商品":"物流"}),[S]),lt=function handApplyGood(){if(0==S.av_return_product.length)return vt.Z9.error("暂无货物退");c().navigateTo({url:"/pages/applyGoods/index?orderId=".concat(S.id)}),Y(!1)},at=function handApplyMoney(){8==(null==S?void 0:S.status)||9==(null==S?void 0:S.status)?c().navigateTo({url:"/pages/applyGoods/index?orderId=".concat(S.id)}):c().navigateTo({url:"/pages/applyMoney/index?orderId=".concat(S.id)}),Y(!1)},it=(0,xt.SJ)().fetchData,rt=function(){var e=(0,r.Z)((0,i.Z)().mark((function _callee13(){return(0,i.Z)().wrap((function _callee13$(e){for(;;)switch(e.prev=e.next){case 0:c().showModal({content:"确认收货吗?",confirmText:"确认",cancelText:"取消",success:function success(e){return(0,r.Z)((0,i.Z)().mark((function _callee12(){var t;return(0,i.Z)().wrap((function _callee12$(o){for(;;)switch(o.prev=o.next){case 0:if(!e.confirm){o.next=6;break}return c().showLoading({title:"请稍等...",mask:!0}),o.next=4,it({sale_order_id:Number(S.id)});case 4:"success"===(null==(t=o.sent)?void 0:t.msg)?(c().showToast({title:"成功"}),c().hideLoading(),Y(!1),Z()):(c().hideLoading(),c().showToast({title:null==t?void 0:t.msg,icon:"error"}));case 6:case"end":return o.stop()}}),_callee12)})))()}});case 1:case"end":return e.stop()}}),_callee13)})));return function handSureGoods(){return e.apply(this,arguments)}}();(0,d.useEffect)((function(){G(S)}),[S]);var ct=(0,d.useMemo)((function(){return 10===S.status||0==S.status||1==S.status||2==S.status||7==S.status?"填写/修改备注".concat(" >"):""}),[S]),gt=(0,d.useRef)(),bt=(0,d.useState)(!1),wt=(0,a.Z)(bt,2),yt=wt[0],St=wt[1];(0,d.useMemo)((function(){c().nextTick((function(){var e;return(null===(e=gt.current)||void 0===e?void 0:e.btnList.length)>3?(St(!0),!0):(St(!1),!1)}))}),[S]);var Gt=(0,d.useMemo)((function(){return 0===(null==S?void 0:S.status)||1===(null==S?void 0:S.status)||2===(null==S?void 0:S.status)?"预估金额":"合计金额"}),[S]),Zt=(0,d.useState)(!1),Mt=(0,a.Z)(Zt,2),Dt=Mt[0],Et=Mt[1],Lt=function handShowCodeList(){Et(!0)},Ft=function handEdit(){c().navigateTo({url:"/pages/orderEdit/index?orderId=".concat(S.id)})};return(0,Me.jsxs)(u.G7,{className:F,children:[(0,Me.jsxs)(u.G7,{style:S.adjust_price_audit_status!==Pt.NONE?{position:"relative",paddingTop:"75px"}:{},children:[S.adjust_price_audit_status!==Pt.NONE&&(0,Me.jsx)(Bt,{saleUserId:S.sale_user_id,isReadjust:y,salesOrderId:S.id,auditStatus:S.adjust_price_audit_status,baseData:S,onSuccess:function onSuccess(){Z()}}),10!=(null==S?void 0:S.status)&&(0,Me.jsx)(dt,{picUrl:null==S?void 0:S.picUrl,orderInfo:S}),10===S.status&&(0,Me.jsx)(Ee,{orderInfo:S,onRefresh:function onRefresh(){return ee()}})]}),(0,Me.jsx)(Le.Z,{showBtn:nt,showWhatFont:st,navSelect:function navSelect(e){return function handSelect(e){if(1===h||8===S.status||9===S.status||4===S.status||5===S.status||11===S.status||3===S.status)return vt.Z9.error("不允许更改"),!1;c().navigateTo({url:"/pages/addressManager/index?orderId=".concat(e.id,"&purchaser_id=").concat(e.purchaser_id)})}(e)},obj:S,receivingStatus:h,onReceivingStatus:function onReceivingStatus(e,t){return g(e,t)}}),(0,Me.jsx)(Ct,{showMode:!0,title:"客户信息",modeName:S.sale_mode_name,children:(0,Me.jsxs)(u.G7,{className:I,children:[(0,Me.jsx)(u.G7,{className:A,children:S.purchaser_name}),(0,Me.jsx)(u.G7,{className:A,children:1!==(null==S?void 0:S.platform_source)&&(0,Me.jsx)(ut.Z,{type:"primary",size:"normal",circle:!0,customClassName:ge,plain:!0,children:(null==S?void 0:S.platform_source_name)||"暂无"})}),(0,Me.jsx)(u.G7,{className:R,children:S.purchaser_phone})]})}),(0,Me.jsxs)(u.G7,{className:z,children:[" ",S.total_fabrics," 种面料,",S.total_colors," 个颜色,共 ",0===S.sale_mode?S.total_number:S.total_number/100," ",0===S.sale_mode?"条":"m"]}),(0,Me.jsxs)(u.G7,{className:O,children:[(0,Me.jsx)(Tt,{list:null==S?void 0:S.product_list,obj:S}),(0,Me.jsxs)(u.G7,{className:$,children:[(0,Me.jsx)(u.G7,{className:K,children:(0,Me.jsx)(u.G7,{className:U,children:Gt})}),(0,Me.jsxs)(u.G7,{className:W,children:["¥",(0,_t.yb)(S.bill_total_sale_price,100,!0)]})]}),(0,Me.jsxs)(u.G7,{className:$,children:[(0,Me.jsx)(u.G7,{className:K,children:(0,Me.jsx)(u.G7,{className:U,children:"实付金额"})}),(0,Me.jsxs)(u.G7,{className:W,children:["¥",(0,_t.yb)(S.actual_amount,100,!0)]})]}),(null==S?void 0:S.wait_pay_amount)<0&&(0,Me.jsxs)(u.G7,{className:$,children:[(0,Me.jsx)(u.G7,{className:K,children:(0,Me.jsx)(u.G7,{className:U,children:-1!==(null==S||null===(e=S.wait_pay_amount)||void 0===e?void 0:e.toString().indexOf("-"))?"退款金额":"待付金额"})}),(0,Me.jsxs)(u.G7,{className:W,children:["¥",(0,_t.yb)(S.refund_amount,100,!0)]})]}),(null==S?void 0:S.wait_pay_amount)>0&&(0,Me.jsxs)(u.G7,{className:$,children:[(0,Me.jsx)(u.G7,{className:K,children:(0,Me.jsx)(u.G7,{className:U,children:-1!==(null==S||null===(t=S.wait_pay_amount)||void 0===t?void 0:t.toString().indexOf("-"))?"退款金额":"待付金额"})}),(0,Me.jsxs)(u.G7,{className:W,children:["¥",(0,_t.yb)(S.wait_pay_amount,100,!0)]})]})]}),(0,Me.jsx)(Ct,{title:"订单信息",children:B.map((function(e,t){return e.showFont&&(0,Me.jsxs)(u.G7,{className:ie,children:[(0,Me.jsx)(u.G7,{className:ce,children:e.leftTitle}),(0,Me.jsxs)(u.G7,{className:re,children:[(0,Me.jsx)(u.G7,{className:ue,children:e.rightTitle}),e.showBtn&&(0,Me.jsx)(u.G7,{className:_e,onClick:function onClick(){return function clipboardData(){c().setClipboardData({data:(null==S?void 0:S.order_no)||"",success:function success(e){c().showToast({icon:"none",title:"复制成功"})}})}()},children:"复制"})]})]},t)}))}),(0,Me.jsx)(Ct,{title:"备注信息",showMode:!0,modeName:ct,clickNode:function clickNode(){return J(""!=ct)},children:(0,Me.jsx)(u.G7,{className:de,children:""===S.remark?"暂无":S.remark})}),(0,Me.jsx)(ht.Z,{show:L,title:"填写/编辑备注",showTitle:!0,onClose:function onClose(){return J(!1)},children:(0,Me.jsxs)(u.G7,{style:{margin:"24rpx"},children:[(0,Me.jsx)(mt.Z,{onChange:function onChange(e){return function onChange(e){G((function(t){return(0,s.Z)((0,s.Z)({},t),{},{remark:e})}))}(e)},defaultValue:S.remark}),(0,Me.jsx)(u.G7,{className:ve,onClick:function onClick(){return q()},children:"保存"})]})}),(0,Me.jsx)(u.G7,{className:me}),(0,Me.jsxs)(u.G7,{className:he,children:[yt&&(0,Me.jsxs)(Me.Fragment,{children:[!Q&&(0,Me.jsxs)(u.G7,{className:pe,children:[" ",(0,Me.jsx)(u.G7,{className:fe,onClick:function onClick(){return Y(!0)},children:"更多"})]}),Q&&(0,Me.jsxs)(u.G7,{className:pe,children:[" ",(0,Me.jsx)(u.G7,{className:fe,onClick:function onClick(){return Y(!1)},children:"关闭"})]}),Q&&(0,Me.jsx)(u.G7,{className:xe,children:(0,Me.jsx)(Ae,{obj:S,goodsObj:S,handApplyGoods:function handApplyGoods(){return null==lt?void 0:lt()},handApplyMoney:function handApplyMoney(){return null==at?void 0:at()},nextBuy:function nextBuy(e){return null==se?void 0:se(e,S)},handSureGoods:function handSureGoods(){return null==rt?void 0:rt()},handShowCodeList:function handShowCodeList(){return null==Lt?void 0:Lt()},cancle:function cancle(e){return null==oe?void 0:oe(e,S)}})})]}),(0,Me.jsx)(pt.Z,{ref:gt,showDetail:!0,goodsObj:S,obj:S,showTuiGoods:!0,cancle:function cancle(e){return null==oe?void 0:oe(e,S)},nextBuy:function nextBuy(e){return null==se?void 0:se(e,S)},toPay:function toPay(e){return null==Ke?void 0:Ke(e,S)},handShowCodeList:function handShowCodeList(){return null==Lt?void 0:Lt()},handSureGoods:function handSureGoods(){return null==rt?void 0:rt()},handApplyGoods:function handApplyGoods(){return null==lt?void 0:lt()},handApplyMoney:function handApplyMoney(){return null==at?void 0:at()},handEdit:function handEdit(){return null==Ft?void 0:Ft()}})]}),(0,Me.jsx)(f.Z,{list:Oe,obj:S,showPopup:Be,popupClose:function popupClose(){return De(!1)},clickItem:function clickItem(e){return function clickItem(e){"扫码支付"===e.name&&Ve(),"线下汇款"===e.name&&ot(!0),Oe.map((function(t){return e.id===t.id?t.checked=!0:t.checked=!1,t})),$e((0,l.Z)(Oe))}(e)},handsurePay:function handsurePay(e){return function handsurePay(e){var t;if(!(t=Oe.filter((function(e){return e.checked}))).length)return c().showToast({title:"请选择后再提交",icon:"error"}),!1;c().showModal({content:"确定交易吗?",confirmText:"确认",cancelText:"取消",success:function success(o){return(0,r.Z)((0,i.Z)().mark((function _callee11(){var n,s,l;return(0,i.Z)().wrap((function _callee11$(a){for(;;)switch(a.prev=a.next){case 0:if(!o.confirm){a.next=6;break}return c().showLoading({title:"请稍等...",mask:!0}),a.next=4,10!==e.status?Xe({id:Number(e.should_collect_order_id),payment_method:Number(null===(n=t[0])||void 0===n?void 0:n.id)}):Qe({id:Number(e.pre_collect_order_id),payment_method:Number(null===(s=t[0])||void 0===s?void 0:s.id)});case 4:"success"===(null==(l=a.sent)?void 0:l.msg)?(c().showToast({title:"交易成功"}),c().hideLoading(),De(!1),Z()):(c().hideLoading(),c().showToast({title:null==l?void 0:l.msg,icon:"error"}));case 6:case"end":return a.stop()}}),_callee11)})))()}})}(e)},showSide:je,title:Ne,picUrl:Ze}),(0,Me.jsx)(p.Z,{showKong:!1,show:tt,onClose:function onClose(){return ot(!1)},offlineInfo:S}),(0,Me.jsx)(Nt,{obj:S,showPopup:Dt,popupClose:function popupClose(){return Et(!1)}})]})};Mt.enableShareAppMessage=!0;Page((0,n.createPageConfig)(Mt,"pages/orderDetails/index",{root:{cn:[]}},{navigationBarTitleText:"订单详情",enablePullDownRefresh:!0,backgroundTextStyle:"dark",enableShareAppMessage:!0}||{}))}},function(e){e.O(0,[2107,1216,8592],(function(){return t=9249,e(e.s=t);var t}));e.O()}]); |