qj-b2c-store 1.6.3 → 1.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{createContext as t,useReducer as e,useContext as n,useSyncExternalStore as c,useRef as i,useCallback as r,useEffect as s,useState as d,useMemo as a}from"react";import{addShoppingGoodsBySpec as l,addShoppingGoods as u,queryToContract as p,getTotalDiscountPrice as m,getResourceGoodsInfoBySkuCode as y,saveUsercoupon as g,getSetsupDisUtil as f,checkCollectExit as h,queryCollectPage as v,saveCollect as S,deleteCollectByCode as C,queryCouponListBySkuCode as b,queryPromotionListByGoodsCode as O,queryEvaluateGoodsPagetrue as P,saveFootprint as k,saveAddress as N,queryAddressBymerberCode as L,deleteAddress as I,updateAddress as M,updateShoppingGoodsNum as B,queryShoppingPage as T,queryShoppingToContract as j,deleteShoppingGoodsBatch as G,updateShoppingGoodsPmInfo as D,updateShoppingGoodsCheckState as A,queryUsercouponPageForC as w,find as R,syncContractBatchState as x,saveOrderToPay as E,paymentCommit as F,getFalgSettingForPaydate as J,calculateFreightFare as U,saveContract as q,queryUserConByGoods as $,syncContractPayState as V,confirmReceive as _,cancelContractC as z,queryContractPageC as W,cancelUnpayOrder as H,getContractByCode as K,checkRefund as Q,queryExpressInfo as X,queryGoodsClassTree as Y,deleteCollectByCodeStr as Z,queryUseTemplate as oo,saveEvaluateGoods as to,saveEvaluateShop as eo,queryFootprintPagePlat as no,deleteFootprintByCodeStr as co,queryNoticePage as io,getNotice as ro,getDoclist as so,queryPromotioByCodePage as ao,queryPromotioPage as lo,getRefundGoods as uo,saveRefund as po,queryRefCause as mo,getRefundByCode as yo,sendGoods as go,queryExpressPageForProp as fo,cancelAfterSales as ho,queryRefundPageBuy as vo,miniLogout as So}from"qj-b2c-api";export{calculateFreightFare,getFalgSettingForPaydate,paymentCommit,queryAddressBymerberCode,queryShoppingToContract,saveContract,saveOrderToPay,syncContractBatchState,syncContractPayState,syncContractState,updateShoppingGoodsNum}from"qj-b2c-api";import{getTotalDiscountPriceCache as Co,queryUpmupointsPageByPC as bo,queryUserServicePage as Oo}from"b2c-api";import{getEnv as Po,taroMessage as ko,getPagesRefreshStore as No,updatePagesRefreshStore as Lo,navigatorHandler as Io,getTaro as Mo,navigatorBackImpl as Bo,reLaunchHandler as To,setStorage as jo,getStorage as Go,taroModule as Do,getBaseUrl as Ao}from"@brushes/utils";import{noop as wo,isFunction as Ro,get as xo,isEmpty as Eo,orderBy as Fo,groupBy as Jo,difference as Uo,set as qo,isUndefined as $o,isEqual as Vo}from"lodash-es";import{fullPath as _o,extendAddressData as zo}from"@brushes/shared-utils";import{removeRequestCacheByKey as Wo}from"@brushes/optimize";import{post as Ho}from"@brushes/request";function Ko(c,i){const r=t(null),s=t(null);return[({children:t})=>{const[n,d]=e(c,i);return o(r.Provider,{value:d,children:o(s.Provider,{value:n,children:t})})},function(){return n(s)},function(){return n(r)}]}function Qo(o){let t=o;const e=new Set;return{getState:()=>t,setState:o=>{t=Object.assign(Object.assign({},t),o),e.forEach((o=>o(t)))},subscribe:o=>(e.add(o),()=>e.delete(o))}}const Xo=Qo({count:1,memberCode:"",isNeedButton:!1,goodsNum:1,spec:[],orderType:0,offShelf:!1});function Yo(o=o=>o){return c(Xo.subscribe,(()=>o(Xo.getState())))}function Zo(o,t){var e={};for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&t.indexOf(n)<0&&(e[n]=o[n]);if(null!=o&&"function"==typeof Object.getOwnPropertySymbols){var c=0;for(n=Object.getOwnPropertySymbols(o);c<n.length;c++)t.indexOf(n[c])<0&&Object.prototype.propertyIsEnumerable.call(o,n[c])&&(e[n[c]]=o[n[c]])}return e}function ot(o,t,e,n){return new(e||(e=Promise))((function(c,i){function r(o){try{d(n.next(o))}catch(o){i(o)}}function s(o){try{d(n.throw(o))}catch(o){i(o)}}function d(o){var t;o.done?c(o.value):(t=o.value,t instanceof e?t:new e((function(o){o(t)}))).then(r,s)}d((n=n.apply(o,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const tt=o=>o.detail?o.detail.value:o.value?o.value:o,et=(o,t)=>ot(void 0,void 0,void 0,(function*(){const e={specStr:JSON.stringify(o),goodsCode:t};return yield l(e)})),nt=(o,t)=>ot(void 0,void 0,void 0,(function*(){const e={skuId:o,goodsNum:t};return yield u(e)})),ct=(o,t)=>ot(void 0,void 0,void 0,(function*(){const e=Po(),n={skuId:o,goodsNum:t,isLocalMock:!e};return yield p(n)})),it=(o,...t)=>ot(void 0,[o,...t],void 0,(function*(o,t=!1){return yield t?Co(o):m(o)}));function rt(o){const t=Po();return y({skuCode:o,isLocalMock:!t})}function st(o=wo){const t=o=>{const t=(o=>{const t=Xo.getState();switch(o.type){case"plus":return Object.assign(Object.assign({},t),{count:t.count+1});case"minus":return Object.assign(Object.assign({},t),{count:t.count-1});case"select":case"initGoodSku":case"popupImpl":return Object.assign(Object.assign({},t),o.payload);default:return t}})(o);Xo.setState(t)},e=()=>{o({visible:!0})};return{dispatch:t,openPopup:()=>{e(),t({type:"popupImpl",payload:{isNeedButton:!1}})},closePopup:()=>{o({visible:!1})},addCardPopup:()=>{e(),t({type:"popupImpl",payload:{orderType:0,isNeedButton:!0}})},buyOpenPopup:()=>{e(),t({type:"popupImpl",payload:{orderType:1,isNeedButton:!0}})}}}function dt(o){const t=i(null);return t.current=Ro(o)?o:wo,r(((...o)=>t.current(...o)),[t])}function at(o,t,e,n=wo){const{dispatch:c,closePopup:i}=st(n);s((()=>{const o=xo(t,"spec",[]),n=xo(e,"[0]goodsMinnum",1);Eo(o)||c({type:"initGoodSku",payload:{offShelf:!1,count:n||1,spec:o}})}),[t]);const r=dt(((o,t)=>{const n=Xo.getState(),{spec:i}=n;i[t]=o;const r=(s=Fo(i).join("/"),e.find((o=>o.skuName===s))||{});var s;const d=Eo(r);c({type:"select",payload:{offShelf:d,count:r.goodsMinnum||1,spec:[...i]}}),d&&ko("该规格已下架","none")})),d=()=>ot(this,void 0,void 0,(function*(){try{const t=Xo.getState(),{spec:e,count:n}=t,c=yield et(e,o),{CartList:r=0}=No();Lo({CartList:r+1});const s=xo(c,"dataObj.skuId"),d=yield nt(s,n);yield ko(d.msg||"添加成功"),i()}catch(o){yield ko(o,"error")}})),a=()=>ot(this,void 0,void 0,(function*(){const t=Xo.getState(),{spec:e,count:n}=t,c=yield et(e,o),i=xo(c,"dataObj.skuId"),r=xo(c,"dataObj.goodsType");Io("orderDetermine",{skuId:i,goodsNum:n,goodsType:r})}));return{closePopup:i,addCardImpl:d,cashImpl:a,handleChooseSize:r,handleStep:(o,t,e)=>{const{count:n}=Xo.getState();n!==t||"minus"!==e?"plus"!==e||n!==o?c({type:e}):ko("超库存","none"):ko(`不能小于${t}`,"none")},addShoppingImpl:()=>{const o=Xo.getState(),{orderType:t}=o;0===t?d():a()}}}const lt=()=>{const[o,t]=d(!1);return{save:e=>ot(void 0,void 0,void 0,(function*(){if(!o)try{yield g(e),t(!0)}catch(o){}})),isPick:o}},ut=()=>{const o=i(null),t=Mo(),e=o=>{if(!o)return;const e=document.createElement("a");e.href=o,e.download="poster.png",t.showToast({title:"生成成功",icon:"none",duration:2e3}),e.click()};return{init:(t,n)=>{const c=_o(xo(t,"[0].dataPic","")),i=o.current;if(!i)return;const r=i.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,300,340),r.fillStyle="#333",r.font="bold 14px sans-serif",r.fillText(n,10,300);const s=new Image;s.crossOrigin="Anonymous",s.src=c,s.onload=function(){r.drawImage(s,0,0,300,260)},setTimeout((()=>{const o=i.toDataURL("image/png");e(o)}),200)},canvasRef:o}},pt={rsGoodsFileDomainList:[],rsSpecValueDomainList:[],goodsRemark:"",pricesetNprice:0,goodsName:"",dataPic:"",goodsShowname:"",goodsNum:0,goodsCode:"",skuNo:"",classtreeCode:"",brandCode:"",pntreeCode:"",memberCode:"",goodsThdate:"",goodsOdate:"",goodsDayinfo:"",rsSkuDomainList:[]},mt=(o,t="")=>{const[e,n]=d(pt);return s((()=>{ot(void 0,void 0,void 0,(function*(){try{let e=o;t&&(e=(yield f({key:t})).split("_")[0]);const c=yield rt(e);n(c||pt)}catch(o){}}))}),[]),e},yt=o=>a((()=>o.map((o=>({imgUrl:o.goodsFileUrl,link:""})))),[o]),gt={dataObj:""};function ft({skuCode:o,dataPic:t,goodsName:e,pricesetNprice:n}){const[c,i]=d(gt);s((()=>{r()}),[]);const r=()=>ot(this,void 0,void 0,(function*(){const t={collectType:0,collectOpcode:o};try{const o=yield h(t);i(o)}catch(o){console.log(o)}})),a=()=>ot(this,void 0,void 0,(function*(){const c={collectType:0,collectOpcode:o,collectOppic:t,collectOpcont:e,collectOpnum:n,goodsOrigin:0};return yield S(c)})),l=()=>ot(this,void 0,void 0,(function*(){const o={collectType:0,collectCode:c.dataObj||""};return yield C(o)})),u=(o,t="success",e=1e3)=>{Mo().showToast({title:o,icon:t,duration:e})};return{handleCollect:()=>ot(this,void 0,void 0,(function*(){let o=gt;Eo(c.dataObj)?(o=yield a(),u("收藏成功")):(o=yield l(),u("取消收藏成功")),i(o),Wo(v)})),collection:c}}function ht(o,t){return a((()=>({skuList:function(o){const t=Jo(Fo(o,["specValueValue"]),"specName");return t?Object.keys(t).map((o=>({skuName:o,skuOption:t[o]}))):[]}(o),spec:xo(t,"[0]skuName","").split("/")})),[o])}const vt=(o=[],t)=>{const e=o.find((o=>o.skuCode===t))||{};if(Eo(e))return{};const{skuNo:n,classtreeCode:c,brandCode:i,pntreeCode:r,memberCode:s}=e;return{skuCode:t,skuNo:n,classtreeCode:c,brandCode:i,pntreeCode:r,memberCode:s}},St={promotionBegintime:"",pbName:"",discName:"",promotionCode:"",promotionName:"",couponOnceNums:0,couponOnceNumd:0,promotionEndtime:""};function Ct(o,t){const[e,n]=d([]),[c,i]=d(!1);return s((()=>{(()=>{ot(this,void 0,void 0,(function*(){const e=vt(o,t);if(Eo(e))return;const c=yield b(e);n(c)}))})()}),[t,o]),{coupon:e,visible:c,setVisible:i}}function bt(o,t){const[e,n]=d([]);return s((()=>{(()=>{ot(this,void 0,void 0,(function*(){const e=vt(o,t);if(Eo(e))return;const c=yield O(e);n(c)}))})()}),[t,o]),e}const Ot=o=>{const[t,e]=d([]);return s((()=>{ot(void 0,void 0,void 0,(function*(){try{if(!o)return;const t=yield P({goodsCode:o,page:1,rows:10});e(t.list||[])}catch(o){}}))}),[o]),t},Pt=()=>({handleShare:()=>{if(!Po())return;Mo().showShareMenu({withShareTicket:!0,success:()=>{console.log("share success")}})}}),kt=o=>{s((()=>{ot(void 0,void 0,void 0,(function*(){try{const t=yield rt(o);k({footprintType:0,footprintOpcode:o,footprintOppic:t.dataPic,footprintOpcont:t.goodsName,footprintOpnum:t.pricesetNprice,footprintOpurl:""})}catch(o){console.log(o)}}))}),[])},Nt=(o=[])=>{const t=Yo((o=>o.spec)),e=a((()=>o.find((o=>o.skuName===Fo(t).join("/")||o.skuName+"/"===Fo(t).join("/")))||{}),[t,o]);return{spec:t,goodInfo:e}};function Lt(){return{onSubmit:(o,t,e)=>ot(this,void 0,void 0,(function*(){try{yield N(Object.assign(Object.assign({},o),zo)),Wo(L);let{AddressList:e=0}=No();Lo({AddressList:++e}),t(),Bo(-1)}catch(o){e()}}))}}function It(o){const[t,e]=d([]),[n,c]=d(!0);s((()=>{i()}),[o]);const i=()=>ot(this,void 0,void 0,(function*(){const o=Po(),t=yield L({isLocalMock:!o});e(t),c(!1)})),r=(o,t)=>{const e=t[o];return t[o]=t[0],t[o].addressDefault="0",t[0]=e,t[0].addressDefault="1",[...t]};return{list:t,skullShow:n,delAddress:o=>{if(!Po())return;Mo().showModal({title:"提示",content:"确认删除该地址吗?",success:t=>ot(this,void 0,void 0,(function*(){(null==t?void 0:t.confirm)&&(yield I({addressId:o.addressId}),Wo(L),yield i())}))})},setDefault:(o,n)=>ot(this,void 0,void 0,(function*(){if("1"!==o.addressDefault){const{addressMember:c,addressPhone:s,provinceCode:d,provinceName:a,cityCode:l,cityName:u,areaCode:p,areaName:m,addressDetail:y,addressId:g,addressCode:f,dataState:h}=o,v={addressMember:c,addressPhone:s,provinceCode:d,provinceName:a,cityCode:l,cityName:u,areaCode:p,areaName:m,addressDetail:y,addressId:g,addressCode:f,dataState:h,addressDefault:"1"};e(r(n,t)),yield M(v),yield i()}})),getAddressList:i,navigator:()=>{Io("addressEditor")}}}function Mt(o){return{handlerImpl:()=>{Lo({PlaceOrderAddress:o.addressId,PlaceOrderAddressTabs:{addressId:o.addressId}}),Bo(-1)}}}const[Bt,Tt,jt]=Ko((function(o,t){switch(t.type){case"select":return Object.assign(Object.assign({},o),{select:t.payload});case"update":return Object.assign(Object.assign({},o),t.payload);default:return o}}),{id:"",count:0,loading:!1,select:[]}),Gt=()=>{const o=jt(),{select:t}=Tt();return{select:t,onChange:t=>{o({type:"select",payload:tt(t)})},handleStep:(t,e,n)=>ot(void 0,void 0,void 0,(function*(){if(0===e&&"minus"===n)return void ko("不能小于0","none");const c="plus"===n?++e:--e;o({type:"update",payload:{id:t,count:c,loading:!0}})}))}},Dt=o=>{const[t,e]=d([]),[n,c]=d(0),r=i([]),l=jt(),{select:u,id:p,count:m}=Tt(),y=a((()=>{let o=0,e=0;return t.forEach((t=>{u.includes(t.shoppingGoodsId)&&(o+=t.goodsCamount,e+=t.goodsCamount*t.pricesetNprice)})),{num:o,amount:e}}),[u,t]);s((()=>{ot(void 0,void 0,void 0,(function*(){yield f("isFirst")}))}),[o]),s((()=>{p&&g(p,m)}),[p,m]);const g=(o,t)=>ot(void 0,void 0,void 0,(function*(){try{yield B({shoppingGoodsId:o,amount:t,goodWeight:0}),yield f()}catch(o){console.log(o)}})),f=(...o)=>ot(void 0,[...o],void 0,(function*(o=""){try{const t=Po(),n=yield T({isLocalMock:!t}),i=xo(n,"list",[]),s=[];let d=0;i.forEach((o=>{const{shoppingGoodsList:t,disMoney:e=0}=xo(o,"shoppingpackageList[0]",{shoppingGoodsList:[],disMoney:0});s.push(...t),d+=e||0})),r.current=s.map((o=>o.shoppingGoodsId)),o&&l({type:"select",payload:r.current}),l({type:"update",payload:{loading:!1}}),c(d),e(s)}catch(o){ko(o.msg)}}));return{cartList:t,initImpl:f,disMoney:n,amount:y,selectAll:o=>{const t=tt(o);l({type:"select",payload:t.includes("true")?r.current:[]})},allCart:r,toOrderImpl:()=>{0!==u.length?(Wo(j),Io("orderDetermine",{shoppingGoodsId:u.join(",")})):ko("购物数量不能为空")},select:u,deleteCart:()=>ot(void 0,void 0,void 0,(function*(){try{yield G({shoppingGoodsIdStr:JSON.stringify(u)}),yield f()}catch(o){console.log(o)}}))}},At=(o,t,e=wo)=>{const[n,c]=d([]),[r,a]=d(!1),l=i([]);s((()=>{ot(void 0,void 0,void 0,(function*(){yield u("isFirst")}))}),[o,t]);const u=(...o)=>ot(void 0,[...o],void 0,(function*(o=""){try{a(!0);const t=Po(),e=yield T({isLocalMock:!t});p(e,o)}catch(o){console.log(o)}finally{a(!1)}})),p=(o,t)=>{const e=xo(o,"list",[]),n=[];e.forEach((o=>{const t=xo(o,"shoppingpackageList",[]);n.push(...t)})),c(n),m(n,t)},m=(o,t)=>{const{list:n,disMoney:c}=y(o);l.current=n;const i=l.current.map((o=>o.shoppingGoodsId)),r={};t&&(r.select=i),e(Object.assign({disMoney:c,cartInfo:l.current},r))},y=o=>{let t=[],e=0;return o.forEach((o=>{e+=o.disMoney||0,t.push(...o.shoppingGoodsList)})),{list:t,disMoney:e}};return{cartList:n,loading:r,onChange:o=>{const t=tt(o).map((o=>Number(o)||o));e((o=>{var e,n;return e=t,n=o.select,ot(void 0,void 0,void 0,(function*(){console.log("updateGoodCheck",e,n);let o="";o=e.length>n.length?Uo(e,n).join(""):Uo(n,e).join("");const{shoppingCode:t}=l.current.find((t=>t.shoppingGoodsId===o))||{};try{yield A({shoppingGoodsIdStr:o,shoppingCode:t,checkState:+(n.length>e.length),channelCode:"channelCode"}),yield u()}catch(o){}})),{cartInfo:l.current,select:t}}))},handleStep:(o,t,e)=>{if(1===t&&"minus"===e)return void ko("不能小于1","none");((o,t)=>{ot(void 0,void 0,void 0,(function*(){try{yield B({shoppingGoodsId:o,amount:t,goodWeight:0}),yield u()}catch(o){console.log(o)}}))})(o,"plus"===e?++t:--t)},updatePm:(o,t)=>ot(void 0,void 0,void 0,(function*(){try{yield D({shoppingGoodsId:o,promotionCode:t}),yield u()}catch(o){console.log(o)}}))}},wt={register:"/account/register/index",accountLogin:"/account/accountLogin/index",mobileLogin:"/account/mobileLogin/index",forgetPwd:"/account/forgetPwd/index",agreement:"/account/agreement/index",auth:"/account/auth/index",confirmPhone:"/account/confirmPhone/index",bindPhone:"/account/bindPhone/index"},Rt=["pages/index/index"],xt={addressId:"",addressInfo:{},contractPumode:"0"},Et=(o,t="success",e=1e3)=>{Mo().showToast({title:o,icon:t,duration:e})};function Ft({target:o,defaultQuery:t,extendQuery:e},n){const c=o.value,i=((o,t,e)=>{const n=o.concat(t);let c={};for(let o of n)c[o]=e[o];return c})(t,e,n);Io(c,i)}const Jt=(o,t)=>{const e=Math.floor(o/1e3)%60,n=Math.floor(o/1e3/60)%60,c=Math.floor(o/1e3/60/60)%24;return`${Math.floor(o/1e3/60/60/24)}天 ${c}小时 ${n}分钟 ${e}秒${t}`};function Ut(o=[],t=[],e=wo){const n=a((()=>{console.log(111,o,t);let e=0,n=[],c=0;for(let i of t)o.includes(i.shoppingGoodsId)&&0===i.dataState&&(n.push(i.shoppingGoodsId),e+=i.goodsCamount,c+=i.goodsCamount*i.pricesetNprice);return{num:e,canPayIds:n,amount:c}}),[o,t]),c=dt((o=>(console.log(1111,o.map((o=>o.shoppingGoodsId))),o.map((o=>o.shoppingGoodsId))))),i=dt((o=>{const n=tt(o);console.log(39,n),e({select:n.includes("true")?c(t):[]})})),r=dt((()=>ot(this,void 0,void 0,(function*(){try{yield G({shoppingGoodsIdStr:JSON.stringify(o)}),e((o=>{let t=o.updateCount||0;return{updateCount:++t}}))}catch(o){console.log(o)}}))));return{toOrderImpl:dt((()=>{0!==n.canPayIds.length?(Wo(j),Io("orderDetermine",{shoppingGoodsId:n.canPayIds.join(",")})):ko("购物数量不能为空")})),deleteCart:r,selectAll:i,cartDetail:n}}function qt(o=wo){return{editorImpl:()=>{o((o=>({isEditor:!o.isEditor})))}}}const $t=()=>{const[o,t]=d([]),e=i(0),n=i(1),c=i(10),r=i([{id:1,label:"未使用",dataState:0,styleName:"unused",text:""},{id:2,label:"已使用",dataState:1,styleName:"used"},{id:3,label:"已失效",dataState:2,styleName:"overdue"}]);s((()=>{ot(void 0,void 0,void 0,(function*(){yield a()}))}),[]);const a=()=>ot(void 0,void 0,void 0,(function*(){try{const o=yield w({page:n.current,rows:c.current,dataState:r.current[e.current].dataState,pbCode:"0004,0005"});t((t=>t.concat(o.list||[]))),n.current+=1}catch(o){console.log(o)}}));return{config:r,coe:e,list:o,setList:t,getList:a,switchTab:o=>ot(void 0,void 0,void 0,(function*(){e.current=o,n.current=1,t([]),yield a()}))}},Vt=()=>{const[o,t]=d([]),e=i(1);s((()=>{ot(void 0,void 0,void 0,(function*(){yield n()}))}),[]);const n=()=>ot(void 0,void 0,void 0,(function*(){e.current=1,t([]),yield c()})),c=()=>ot(void 0,void 0,void 0,(function*(){try{const o=yield w({page:e.current,rows:100,dataState:0,pbCode:"0004,0005"});t(o.list),e.current+=1}catch(o){console.log(o)}}));return{unusedList:o,getData:c,init:n}},_t=()=>{const[o,t]=d([]),e=i(1);s((()=>{ot(void 0,void 0,void 0,(function*(){yield n()}))}),[]);const n=()=>ot(void 0,void 0,void 0,(function*(){e.current=1,t([]),yield c()})),c=()=>ot(void 0,void 0,void 0,(function*(){try{const o=yield w({page:e.current,rows:100,dataState:1,pbCode:"0004,0005"});t(o.list),e.current+=1}catch(o){console.log(o)}}));return{usedList:o,getData:c,init:n}},zt=()=>{const[o,t]=d([]),e=i(1);s((()=>{ot(void 0,void 0,void 0,(function*(){yield n()}))}),[]);const n=()=>ot(void 0,void 0,void 0,(function*(){e.current=1,t([]),yield c()})),c=()=>ot(void 0,void 0,void 0,(function*(){try{const o=yield w({page:e.current,rows:100,dataState:2,pbCode:"0004,0005"});t(o.list),e.current+=1}catch(o){console.log(o)}}));return{overdueList:o,getData:c,init:n}},Wt=(o,t,e)=>{const n=i(!0),c=i(0),[r,a]=d([]),[l,u]=d(!1);s((()=>{p("isFirst")}),[e]);const p=dt((o=>{c.current=0,n.current=!0,m(e,o)})),m=dt(((e,...i)=>ot(void 0,[e,...i],void 0,(function*({sortField:e="pricesetNprice",order:i=""},r=""){if(n.current){++c.current,u(!0);try{const s=yield R({distinctField:"goodsNo",sortField:e,order:i,goodsType:"00,40,50",page:c.current,rows:10,searchParam:t,classtreeCode:o});(Eo(s.list)||s.list.length<10)&&(n.current=!1),u(!1),a((o=>r?s.list:o.concat(s.list)))}catch(o){--c.current}}}))));return{loading:l,getData:m,list:r}};function Ht({contractBillcode:o,contractBbillcode:t}){const e=Mo(),[n,c]=d(!1),r=i(""),a=Po(),[l,u]=d([]),p=i({}),m=i({contMoney:0,orderMoney:0,logMoney:0,contractBillcode:""});s((()=>{(()=>{ot(this,void 0,void 0,(function*(){var e;try{const n=yield x({contractBbillcode:o||t,isLocalMock:!a}),c=yield E({contractBillcode:null!==(e=n.dataObj)&&void 0!==e?e:"",isLocalMock:!a});m.current=c,u(c.payChannelList),p.current=c}catch(o){console.log(44,o)}}))})()}),[]);const y=o=>{c(!0);const{ptradeSeqno:t,contractBlance:e,payChannelList:n}=p.current,{fchannelCode:i,faccountOuterNo:s=""}=g(n,o||r.current);return{ptradeSeqno:t,contractBlance:e,fchannelCode:i,faccountOuterNo:s}},g=(o,t)=>o.find((o=>"1"===t?o.ptfchannelAmt===t:o.fchannelCode===t))||{},f=()=>ot(this,void 0,void 0,(function*(){var o;const t=null!==(o=m.current.contractBillcode)&&void 0!==o?o:"";jo("contractBillcode",{contractBillcode:t});const{ptradeSeqno:e,contractBlance:n,fchannelCode:c,faccountOuterNo:i}=y(),r=[{faccountIdType:"ACCOUNT",fchannelCode:c,orderAmount:m.current.orderMoney,faccountId:i}];return yield F({ptradeSeqno:e,payCommitStr:JSON.stringify(r),contractBlance:n})})),h=()=>ot(this,void 0,void 0,(function*(){try{const o=yield f();document.getElementById("v_html").innerHTML="<div>"+o.dataObj.htmlStr+"</div>",document.forms[0].submit(),c(!1)}catch(o){c(!1)}})),v=()=>ot(this,void 0,void 0,(function*(){try{const o=yield f();document.getElementById("v_html").innerHTML="<div>"+o.dataObj.htmlStr+"</div>",document.getElementById("paaspaysubmit").submit(),c(!1)}catch(o){c(!1)}})),S=()=>ot(this,void 0,void 0,(function*(){try{let o=(yield f()).dataObj.requestData;wx.requestPayment({timeStamp:o.timeStamp,nonceStr:o.nonceStr,package:o.package,signType:o.signType,paySign:o.paySign,success:function(o){var t;const e=null!==(t=m.current.contractBillcode)&&void 0!==t?t:"";To("result",{code:e})},fail:function(o){c(!1)},complete:function(o){c(!1)}})}catch(o){c(!1)}}));return{paymentImpl:()=>{var o;switch(r.current||ko("请选择支付方式","none"),r.current){case"wechatmini":S();break;case"account":case"alipaywap":h();break;case"wechatwap":v();break;case"1":const{ptradeSeqno:t,contractBlance:n,fchannelCode:c,faccountOuterNo:i}=y("1"),r=[{faccountIdType:"ACCOUNT",fchannelCode:c,orderAmount:m.current.orderMoney,faccountId:i}],s=null!==(o=m.current.contractBillcode)&&void 0!==o?o:"";e.navigateTo({url:`/package/paypassword/index?code=${s}&ptradeSeqno=${t}&payCommitStr=${JSON.stringify(r)}&contractBlance=${n}`})}},channelList:l,handleRadio:o=>{r.current=tt(o)},contract:m,loading:n}}const Kt={provinceName:"",cityName:"",areaName:"",addressDetail:"",addressMember:"",addressPhone:"",addressDefault:""},Qt={contractSettlOpno:0,promotionCodes:null,shoppingCountPrice:0,totalDiscountPrice:0,accountsSumPrice:0,discount:0,freight:0,comDisMoney:0,copyComDisMoney:0},Xt={dataPic:"",goodsName:"",goodsCamount:0,skuName:"",pricesetNprice:0};function Yt({skuId:o,goodsNum:t,shoppingGoodsId:e},n,c){const r=i([{dataPic:"",goodsName:"",goodsCamount:0,skuName:"",pricesetNprice:0}]),[a,l]=d([]),[u,p]=d(Kt),m=i(""),y=i([]),g=i([]),f=i([]),[h,v]=d(0),S=Po(),C=i(Qt),b=i([]);s((()=>{(()=>{ot(this,void 0,void 0,(function*(){v(0),C.current={contractSettlOpno:0,promotionCodes:null,shoppingCountPrice:0,totalDiscountPrice:0,accountsSumPrice:0,discount:0,freight:0,comDisMoney:0,copyComDisMoney:0},g.current=[],y.current=[],e?yield P((()=>j({shoppingGoodsIdStr:`[${e}]`}))):yield P((()=>ct(o,t)))}))})()}),[n]);const O=()=>ot(this,void 0,void 0,(function*(){try{const o=yield $({pmContractGoodsDomainListStr:JSON.stringify(g.current)});l(o)}catch(o){console.log(74,o)}})),P=o=>ot(this,void 0,void 0,(function*(){try{const t=yield Promise.all([L({isLocalMock:!S}),o()]),[e=[],n=[]]=t,i=c?e.find((o=>o.addressId===c)):e.find((o=>"1"===o.addressDefault))||{};p(i),k(n,i),c=""}catch(o){console.log(o)}})),k=(o,t)=>{Eo(o)||o.forEach((o=>{o.shoppingpackageList.forEach((o=>{C.current.comDisMoney+=o.disMoney,C.current.copyComDisMoney+=o.disMoney,o.shoppingGoodsList.forEach((t=>{g.current.push(t),C.current.shoppingCountPrice+=t.pricesetNprice*t.goodsCamount,t.contractGoodsGtype=0,m.current=o.promotionCode,"00"==t.goodsType&&J().then((o=>{}))})),o.disMoney>0&&y.current.push({contractSettlBlance:0==o.promotionInType?"PM":"COP",contractPmode:"0",contractSettlGmoney:Number(o.disMoney.toFixed(2)),contractSettlPmoney:Number(o.disMoney.toFixed(2)),contractSettlOpno:o.promotionCode,contractSettlOpemo:o.promotionName}),o.giftList?(o.shoppingGoodsList.forEach((o=>{o.ginfoCode=o.pmPromotionList.find((o=>"0001"==o.pbCode)).promotionCode})),r.current=[...o.shoppingGoodsList,...o.giftList]):r.current=o.shoppingGoodsList})),N(),S&&(I(),O(),T(t))}))},N=()=>{const{shoppingCountPrice:o,totalDiscountPrice:t,discount:e,comDisMoney:n,freight:c}=C.current;v(o-t-e-n+c)},I=()=>ot(this,void 0,void 0,(function*(){let n={};n=e?{shoppingGoodsIdStr:`[${decodeURIComponent(e)}]`}:{skuIdStr:JSON.stringify([{skuId:o,goodsNum:t}])};try{const o=yield U(Object.assign({isLocalMock:!S},n));C.current.freight=o.dataObj,N()}catch(o){console.log(180,o)}})),M=()=>{const{shoppingCountPrice:o,copyComDisMoney:t,discount:e}=C.current;return(o-t-e).toFixed(2)},B=()=>{const{shoppingCountPrice:o,copyComDisMoney:t,freight:e}=C.current;return(o-t+e).toFixed(2)},T=e=>{f.current=(e=>{const{addressMember:n,userName:c,provinceName:i,cityName:s,areaName:d,addressDetail:a,areaCode:l}=e;return[{contractPaytime:(new Date).valueOf(),goodsPbillno:0,goodsPmbillno:C.current.promotionCodes,contractProperty:"0",contractBlance:0,contractPmode:0,contractPumode:"0",goodsSupplierName:"",goodsSupplierCode:"",packageList:[{contractGoodsList:r.current,shoppingGoodsIdList:[],promotionCode:m.current,packageRemark:null}],packageMode:"",contractType:"50",ocContractSettlList:[],contractInmoney:B(),contractMoney:M(),goodsReceiptMem:n,goodsReceiptPhone:c,goodsReceiptArrdess:i+s+d+a,areaCode:l,contractNbillcode:null,skuIdList:o?[{skuId:+o,goodsNum:+t}]:[],giftSkuIdList:[]}]})(e);let n={rsSkuListStr:JSON.stringify(f.current)};it(n).then((o=>{C.current.totalDiscountPrice=o.dataObj.totalDiscountPrice,C.current.contractSettlOpno=o.dataObj.contractSettlOpno,N()}))};return{savePayPrice:()=>{if(Eo(u))return;(()=>{const{contractSettlOpno:o,totalDiscountPrice:t}=C.current;o&&0!=t&&y.current.push({contractSettlBlance:"UR",contractPmode:"0",contractSettlPmoney:t,contractSettlOpno:o})})(),qo(f.current,"[0].ocContractSettlList",[...y.current,...b.current]);const o={orderDomainStr:JSON.stringify(f.current)};q(o).then((o=>{Io("paymentMode",{code:o.dataObj.contractBillcode})}))},address:u,list:r,payState:C,coupon:a,confirm:o=>{const{couponAmount:t,usercouponCode:e,promotionCode:n,discAmount:c}=o;b.current=[{contractSettlBlance:"COP",contractPmode:"0",contractSettlGmoney:+t,contractSettlPmoney:+c,contractSettlOpno:e,contractSettlOpemo:n}],C.current.discount=c,N()},amount:h}}const Zt={contractSettlBlance:"",contractEcurl:"",packageRemark:"",contractPmode:"",contractSettlGmoney:0,contractSettlPmoney:0,contractSettlOpno:"",contractSettlOpemo:"",freight:0,crp:{},_rechargeSmoney:0},oe=Qo(Zt);function te(o=o=>o){return c(oe.subscribe,(()=>o(oe.getState())))}function ee(o){const{shoppingCountPrice:t,comDisMoney:e,shoppingType:n,pricesetRefrice:c}=a((()=>{const t={shoppingCountPrice:0,comDisMoney:0,shoppingType:"",pricesetRefrice:""};return o.forEach((o=>{const{shoppingCountPrice:e,comDisMoney:n}=o;t.shoppingCountPrice+=e,t.comDisMoney+=n})),o.length>0&&(t.shoppingType=o[0].shoppingType||"",t.pricesetRefrice=o[0].pricesetRefrice||""),t}),[o]);return{shoppingCountPrice:t,comDisMoney:e,shoppingType:n,pricesetRefrice:c,changeContent:o=>{const t=tt(o);oe.setState({packageRemark:t})}}}const ne={provinceName:"",cityName:"",areaName:"",addressDetail:"",addressMember:"",addressPhone:"",addressDefault:"",addressId:"",provinceCode:"",userName:""};function ce(o,t,e,n){const[c,i]=d(ne);s((()=>{(()=>{ot(this,void 0,void 0,(function*(){try{const t=Po(),e=yield L({isLocalMock:!t,needCache:!0}),n=(()=>{const t=Fo(e,"addressDefault","asc"),n=t.find((t=>o===t.addressId))||{};return Eo(n)?t.at(-1):n})();xt.addressInfo=n,xt.contractPumode="0",i(n),r(null==n?void 0:n.provinceCode)}catch(o){}}))})()}),[o]);const r=o=>ot(this,void 0,void 0,(function*(){let c={};c=n?{shoppingGoodsIdStr:`[${decodeURIComponent(n)}]`}:{skuIdStr:JSON.stringify([{skuId:e,goodsNum:t}])};try{const t=Po(),e=yield U(Object.assign(Object.assign({isLocalMock:!t},c),{areaCode:o}));oe.setState({freight:e.dataObj})}catch(o){}}));return c}const ie={shoppingGoodsId:"",goodsNum:0,skuId:"",refreshNum:0},re={dataPic:"",goodsName:"",goodsCamount:0,skuName:"",pricesetNprice:0},se={contractSettlOpno:0,shoppingCountPrice:0,totalDiscountPrice:0,accountsSumPrice:0,discount:0,freight:0,comDisMoney:0,copyComDisMoney:0,shoppingType:"",promotionCode:"",promotionCodes:"",pricesetRefrice:"",upmMap:{}},de=({shoppingGoodsId:o,goodsNum:t,skuId:e})=>{const[n,c]=d([re]),[r,l]=d([]),[u,p]=d([]),m=i([]),[y,g]=d(0),[f,h]=d(0),[v,S]=d(0),C=te(),{freight:b=0,crp:O}=C,P=Zo(C,["freight","crp"]),k=i(0);s((()=>{ot(void 0,void 0,void 0,(function*(){oe.setState({freight:0,crp:{},packageRemark:"",_rechargeSmoney:0,contractSettlBlance:"",contractPmode:"",contractEcurl:"",contractSettlGmoney:0,contractSettlPmoney:0,contractSettlOpno:"",contractSettlOpemo:""}),o?yield T((()=>j({shoppingGoodsIdStr:`[${decodeURIComponent(o)}]`}))):yield T((()=>ct(e,t)))}))}),[]);const N=a((()=>P.contractSettlPmoney||0),[P]),L=a((()=>{const o=y-N+b-k.current-f-v;return o>=0?o:0}),[y,N,b,f,v]),I=a((()=>{const{contractSettlOpemo:o=0}=O;return L*+o/100}),[L,O]),M=a((()=>o=>{let t=0,e=0;o.forEach((o=>{t+=xo(o,"upmMap.disamount",0),e+=xo(o,"upmMap.integral",0)})),h(t),t>0&&m.current.push({contractSettlBlance:"INT",contractSettlPmoney:t,contractSettlGmoney:e})}),[]),B=(o,t)=>ot(void 0,void 0,void 0,(function*(){if(Eo(o))return;const e=o[0]&&o[0].shoppingType||"",n=o[0]&&o[0].pricesetRefrice||"";"06"===e?yield(o=>ot(void 0,void 0,void 0,(function*(){if(o)try{const t=yield bo(),e=xo(t,"list[0].upointsNum",0),n=Number(o)||0,c=Math.min(n,e);h(c),c>0&&m.current.push({contractSettlBlance:"INT",contractSettlPmoney:c,contractSettlGmoney:c})}catch(o){console.error("查询用户积分失败",o),h(0)}else h(0)})))(n):(M(o),yield(o=>ot(void 0,void 0,void 0,(function*(){if(Eo(o))S(0);else try{const t=[];o.forEach((o=>{t.push({packageList:[{contractGoodsList:o}]})}));const e=Po(),n={rsSkuListStr:JSON.stringify(t),isLocalMock:!e},c=yield it(n,!0),i=xo(c,"dataObj.totalDiscountPrice",0),r=xo(c,"dataObj.contractSettlOpno","");S(i),i>0&&m.current.push({contractSettlBlance:"UR",contractSettlPmoney:i,contractSettlOpno:r})}catch(o){console.error("查询会员权益优惠失败",o)}})))(t))})),T=o=>ot(void 0,void 0,void 0,(function*(){try{const t=yield o(),{payState:e,shoppingGoodsList:n}=G(t);yield B(e,n)}catch(o){}})),G=o=>{if(Eo(o))return{payState:[],shoppingGoodsList:[]};let t=[],e=[],n=[];return o.forEach((o=>{const c=Object.assign({},se);c.shoppingType=o.shoppingType,c.pricesetRefrice=o.pricesetRefrice,c.upmMap=o.upmMap,k.current+=o.rebMoney,o.shoppingpackageList.forEach((n=>{c.comDisMoney+=n.disMoney,c.copyComDisMoney+=n.disMoney,m.current=[];let i={channelCode:"",channelName:""};n.shoppingGoodsList.forEach(((o,e)=>{0===e&&(i=o),t.push(o),c.shoppingCountPrice+=o.pricesetNprice*o.goodsCamount,o.contractGoodsGtype=0,c.promotionCode=n.promotionCode,o.goodsType})),n.disMoney>0&&m.current.push({contractSettlBlance:0==n.promotionInType?"PM":"COP",contractSettlGmoney:Number(n.disMoney.toFixed(2)),contractSettlPmoney:Number(n.disMoney.toFixed(2)),contractSettlOpno2:i.channelCode,contractSettlOpno1:i.channelName,contractSettlOpno:n.promotionCode,contractSettlOpemo:n.promotionName}),o.rebMoney>0&&m.current.push({contractSettlBlance:"REB",contractSettlGmoney:Number(o.rebMoney.toFixed(2)),contractSettlPmoney:Number(o.rebMoney.toFixed(2)),contractSettlOpno:n.promotionCode,contractSettlOpemo:n.promotionName,contractSettlOpno2:i.channelCode,contractSettlOpno1:i.channelName}),n.giftList&&(n.shoppingGoodsList=n.shoppingGoodsList.map((o=>(o.ginfoCode=o.pmPromotionList.find((o=>"0001"==o.pbCode)).promotionCode,o)))),e.push(...n.shoppingGoodsList,...n.giftList||[])})),n.push(c)})),l(n),c(e),p(t),D(n),{payState:n,shoppingGoodsList:t}},D=o=>{let t=0;o.forEach((o=>{const{shoppingCountPrice:e,totalDiscountPrice:n,discount:c,comDisMoney:i}=o;t+=e-n-c-i})),g(t)};return{amount:y,list:n,shoppingGoodsList:u,payState:r,ocContractSettlList:m,disCount:N,payPrice:L,creditMoney:I,orderStoreInfo:P,freight:b,rebMoney:k,pointsDeduction:f,urDiscount:v}},ae=()=>{const[o,t]=d([]);return s((()=>{ot(void 0,void 0,void 0,(function*(){const{list:o}=yield Ho("/web/pte/ptfpmode/queryPtfpmodesToStr.json");t(o)}))}),[]),{payList:o}},le=(o=[])=>{const[t,e]=d([]),[n,c]=d(!1),[i,r]=d(),{payList:l}=ae(),[u,p]=d([]),[m,y]=d({urechargeId:""}),[g,f]=d(!1),[h,v]=d(!1),{crp:S,contractEcurl:C,contractPmode:b}=te();s((()=>{ot(void 0,void 0,void 0,(function*(){try{if(Eo(o))return;const t=yield $({pmContractGoodsDomainListStr:JSON.stringify(o)});e(t)}catch(o){console.log(74,o)}}))}),[o]),s((()=>{ot(void 0,void 0,void 0,(function*(){const o=yield Ho("web/crp/CrpUrecharge/queryCrpUrechargePage.json",{userinfoCode:Go("user").userInfoCode}),t=xo(o,"list[0]",{}),e=yield Ho("web/dd/falgSetting/queryFalgSettingPage.json",{flagSettingType:"creditSetting"});let n=xo(e,"list",[]);n.some((o=>0===o.flagSettingInfo))||n.unshift({flagSettingInfo:0}),p(n),oe.setState({_rechargeSmoney:t.rechargeSmoney}),y(t)}))}),[]);const O=a((()=>S.contractSettlOpemo),[S]),P=a((()=>{const{ptfpmodeName:o=""}=l.find((o=>o.ptfpmodeType===b))||{};return o}),[l,b]),k=a((()=>(t.find((o=>o.promotionCode===i))||{}).promotionName),[i]),N=o=>{const{couponAmount:t,usercouponCode:e,promotionCode:n,discAmount:c}=o,i={contractSettlBlance:"COP",contractSettlGmoney:+t,contractSettlPmoney:+c,contractSettlOpno:e,contractSettlOpemo:n};oe.setState(i)};return{coupon:t,visible:n,selectCoupon:k,onChange:o=>{const e=tt(o),n=t.find((o=>o.promotionCode===e))||{};r(e),c(!1),N(n)},setVisible:c,creditList:u,creditInfo:m,creditVisible:g,setCreditVisible:f,onCreditChange:o=>{const t=tt(o);f(!1),oe.setState({crp:{contractSettlOpemo:t,contractSettlBlance:"CRP"}})},selectCredit:O,onPayChange:o=>{const t=tt(o);v(!1),oe.setState({contractPmode:t,crp:{},contractEcurl:""})},contractPmode:b,setPayVisible:v,payVisible:h,payList:l,payName:P,handleChooseImg:()=>{const o=Mo(),t=process.env.REACT_APP_BASE_URL;o.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(e){o.uploadFile({url:`${process.env.REACT_APP_BASE_URL}web/oc/refund/uploadRefFile.json`,filePath:e.tempFilePaths[0],name:"file",header:{"saas-agent":"WEB"!==o.getEnv?"qj-wemini":"","saas-token":Go("saas-token")},success(o){const e=JSON.parse(o.data),n=Po();if("nologin"===e.errorCode)Io(n?"/account/auth/index":"/account/mobileLogin/index");else{const o=t+e.fileUrl;oe.setState({contractEcurl:o})}}})}})},contractEcurl:C}};function ue({ocContractSettlList:o,payState:t,list:e},n="",c){const r=i([]),[s,a]=d(!1),{crp:l,_rechargeSmoney:u,contractPmode:p,contractEcurl:m,packageRemark:y}=te(),g=o=>{const{addressMember:c,userName:i,provinceCode:r,provinceName:s,cityName:d,areaName:a,addressDetail:g}=o,f=(o=>{if(o)return decodeURIComponent(o).split(",");return[]})(n);let h={packageRemark:y};Eo(l)||(h.creditType=l.contractSettlOpemo,h.creditAccount=u),m&&(h.contractEcurl=m);const v=xt.contractPumode||"0";return t.map((o=>Object.assign({contractPaytime:(new Date).valueOf(),goodsPbillno:0,goodsPmbillno:o.promotionCodes,contractProperty:"0",contractBlance:0,contractPmode:p,contractPumode:v,goodsSupplierName:"",goodsSupplierCode:"",packageList:[{contractGoodsList:e,shoppingGoodsIdList:f,promotionCode:o.promotionCode,packageRemark:y}],packageMode:"",contractType:o.shoppingType,ocContractSettlList:[],goodsReceiptMem:c,goodsReceiptPhone:i,goodsReceiptArrdess:s+d+a+g,areaCode:r,contractNbillcode:null},h)))};return{savePayPrice:()=>ot(this,void 0,void 0,(function*(){const t=xt.addressInfo;if(Eo(t))return void ko("请选择收货地址");if(!p)return void ko("请选择支付方式");if("1"===p&&!m)return void ko("请上传附件");r.current=g(t);let e=Eo(l)?o.current:[...o.current,l];e=e.map((o=>Object.assign(Object.assign({},o),{contractPmode:p}))),qo(r.current,"[0].ocContractSettlList",e),a(!0);const i={orderDomainStr:JSON.stringify(r.current)};try{const o=yield q(i);(()=>{if(n){const{CartList:o=0}=No();Lo({CartList:o+1})}})();const{contractBillcode:t,contractBbillcode:e}=xo(o,"dataObj",{contractBillcode:"",contractBbillcode:""});p+""=="1"||"100"==l.creditType||0===c?To("result",{code:t}):Io("paymentMode",{contractBillcode:t,contractBbillcode:e})}catch(o){}finally{a(!1)}})),loading:s}}const pe={provinceName:"",cityName:"",areaName:"",addressDetail:"",addressMember:"",addressPhone:"",userinfoOcode:""};function me(o){const[t,e]=d(pe);return s((()=>{(()=>{ot(this,void 0,void 0,(function*(){try{const t={page:1,rows:10};o&&(t.userinfoOcode=o);const n=Po(),c=yield Oo(Object.assign(Object.assign({},t),{isLocalMock:!n})),i=Array.isArray(c&&c.list)?c.list.map((o=>Object.assign(Object.assign({},o),{addressMember:o.userinfoCompname||"",addressPhone:o.userinfoTel||"",addressDetail:o.companyAddress||""}))):[],r=(()=>{const t=i.find((t=>o===t.userinfoOcode))||{};return Eo(t)?i&&i[0]||{}:t})();xt.addressInfo=r,xt.contractPumode="1",e(r),oe.setState({freight:0})}catch(o){}}))})()}),[o]),t}const ye={success:{icon:"zhifuchenggong",msg:"支付成功",buttonText:"查看订单",menuCode:"orderDetail",color:"#2ed82e"},error:{icon:"zhifushibai",info:"您的订单将保留15分钟,可点击下方“去支付”完成订单",buttonText:"去支付",menuCode:"paymentMode",color:"red"}};function ge(o){const[t,e]=d({icon:"daifahuo1",msg:"支付中",color:"#2ed82e",buttonText:"去支付",dataObj:{}}),[n,c]=d(!1),i=Po();return s((()=>{(()=>{ot(this,void 0,void 0,(function*(){const t=xo(Do,"taroMenu[0].menuOpcode","index");if(i){Mo().setStorageSync("menuOpcode",t)}c(!0);try{const t=yield V({contractBillcode:o,isLocalMock:!i}),{sysRecode:n,dataObj:c}=t,r=Zo(t,["sysRecode","dataObj"]);e(Object.assign(Object.assign({dataObj:c,sysRecode:n},r),ye[n]))}catch(t){e(Object.assign({dataObj:{contractBillcode:o},msg:t},ye.error))}finally{c(!1)}}))})()}),[]),{result:t,loading:n}}function fe(o,t){const[e,n]=d(o);return s((()=>{const e=t.filter((o=>!($o(o)||Eo(o)))).filter((o=>!Object.values(o).every((t=>$o(t)||Eo(o)))));let c=o;Eo(e)||(c=e),n(c)}),[t]),e}const he=[{name:"全部",code:""},{name:"待付款",code:"1"},{name:"待发货",code:"2"},{name:"待确认",code:"30"},{name:"待收货",code:"3"},{name:"已完成",code:"4,5"},{name:"已取消",code:"-1"}],ve=o=>{const{name:t=""}=he.find((t=>t.code.split(",").includes(o+"")))||{};return t},Se={1:[{name:"取消订单",handler:"cancel"},{name:"立即支付",handler:"pay"}],3:[{name:"物流信息",handler:"expressInfo"},{name:"确认收货",handler:"confirmReceive"}],4:[{name:"去评价",handler:"evaluate"}],5:[{name:"去评价",handler:"evaluate"}]};function Ce({dataState:o="",contractId:t,contractBillcode:e,init:n}){const c=a((()=>Se[o+""]||[]),[o]),i=(()=>({expressInfo:()=>{Io("expressInfo",{code:e})},pay:()=>{Io("paymentMode",{contractBillcode:e})},evaluate:()=>{Io("evaluateDetail",{code:e})},confirmReceive:()=>ot(this,void 0,void 0,(function*(){try{const{msg:o}=yield _({contractBillcode:e});ko(o,"none"),setTimeout((()=>{null==n||n()}),500)}catch(o){}})),cancel:()=>ot(this,void 0,void 0,(function*(){try{const{msg:o}=yield z({contractId:t});ko(o,"none"),setTimeout((()=>{null==n||n()}),500)}catch(o){}}))}))();return{handlerImpl:o=>{i[o]()},operateArray:c}}const be={contractBillcode:"",goodsList:[{dataPic:"",goodsName:"",dataBmoney:0,goodsCamount:0,contractGoodsId:0,dataState:0}],dataBmoney:0,dataBnum:0,dataState:0,contractId:"",contractAppraise:0};function Oe(o,t){const e=i(!1),[n,c]=d(!1),[r,a]=d([be]),l=i(0);s((()=>{u()}),[t]);const u=dt((()=>{e.current=!1,l.current=0,p()})),p=dt((()=>ot(this,void 0,void 0,(function*(){if(e.current)return;c(!0),++l.current;const{code:t}=o;try{const o=Po(),n=(yield W({page:l.current,rows:10,isLocalMock:!o,childFlag:!0,dataStateStr:t})).list||[];e.current=Eo(n)||n.length<10,a((o=>1!==l.current?o.concat(n):n)),c(!1)}catch(o){}}))));return{onScroll:p,data:r,loading:n,init:u,countdownCancel:o=>ot(this,void 0,void 0,(function*(){yield H({contractId:o})}))}}const Pe={goodsList:[],contractPmode:"0",creditMoney:0,contractEcurl:"",dataState:"",goodsLogmoney:0,packageRemark:"",goodsReceiptMem:"",goodsReceiptPhone:"",goodsReceiptArrdess:"",dataBmoney:0,goodsPmoney:0,contractInmoney:0,contractBillcode:"",refundMoney:0,gmtCreate:"",goodsNum:0,contractId:0,contractPumode:"0"},ke=o=>{const[t,e]=d(""),n=Po(),[c,i]=d(Pe);s((()=>{ot(void 0,void 0,void 0,(function*(){try{const t=yield K({contractBillcode:o,isLocalMock:!n});if(Eo(t))return;e(ve(t.dataState)),i(t)}catch(o){console.log(45,o)}}))}),[]);const r=a((()=>xo(c,"packageList[0].packageRemark","")),[c]),l=a((()=>{const o=xo(c,"ocContractSettlList",[])||[],{contractSettlGmoney:t=0}=o.find((o=>"CRP"===o.contractSettlBlance))||{contractSettlGmoney:0};return t}),[c]);return{orderDetail:c,status:t,handleApplyBtn:(o,t)=>ot(void 0,void 0,void 0,(function*(){try{const{contractBillcode:e,skuCode:n}=o,c=yield Q({contractBillcode:e,skuCode:n});if(!1===c.success)return void Et(c.msg,"none");Io("refundType",{contractBillcode:e,skuCode:n,dataState:t})}catch(o){console.log(o)}})),creditMoney:l,packageRemark:r}},Ne={0:"在途",1:"揽收",2:"疑难",3:"签收",4:"退签",5:"派件",8:"清关",14:"拒签"},Le=o=>{const[t,e]=d({}),[n,c]=d({});return s((()=>{ot(void 0,void 0,void 0,(function*(){try{const t=Po(),n=yield K({contractBillcode:o,isLocalMock:!t});e(n);const i=xo(n,"packageList[0].expressCode",""),r=xo(n,"packageList[0].packageBillno"),s=yield X({expressNo:r,expressType:i,isLocalMock:!t});c(JSON.parse(s.dataObj))}catch(o){console.log(o)}}))}),[]),{info:t,detail:n,stateObj:Ne}};function Ie(){const[o,t]=d(""),[e,n]=d([]),c=Po();s((()=>{i()}),[]);const i=()=>ot(this,void 0,void 0,(function*(){try{let o=yield Y();n(o||[]);const e=xo(o,"[0].goodsClassCode");t(e)}catch(o){console.log(o)}}));return{activeKey:o,navList:e,flag:c,setActiveKey:t}}const Me=(o=0)=>{const[t,e]=d([{collectOpcont:"",collectOpnum:""}]),n=i(1),[c,r]=d(!1),[a,l]=d(""),[u,p]=d(!1),[m,y]=d(""),[g,f]=d(!1);s((()=>{h()}),[]);const h=()=>{n.current=1,e([]),S()},S=()=>ot(void 0,void 0,void 0,(function*(){try{const t=yield v({row:10,page:n.current,collectType:o});e((o=>o.concat(xo(t,"list",[])))),n.current+=1}catch(o){return console.log(o),[]}})),C=()=>{let o=[];for(let e=0;e<t.length;e++)o.push(t[e].collectCode);return o.toString()};return{collectionList:t,edit:c,setEdit:r,getData:S,collectCodeStr:a,getSelectItem:o=>{const e=tt(o);l(e.toString()),e.length===t.length?f(!0):f(!1)},delItem:()=>ot(void 0,void 0,void 0,(function*(){try{yield Z({collectCodeStr:a}),n.current=1,h()}catch(o){console.log(o)}})),init:h,checked:u,setChecked:p,handleSelectAll:o=>{tt(o).length?(p(!0),l(C())):p(!1)},selectAll:m,setSelectAll:y,selectAllChecked:g}},Be=o=>{const[t,e]=d([]),n=i([]),c=i({}),r=Po();s((()=>{ot(void 0,void 0,void 0,(function*(){yield u(),yield a()}))}),[]);const a=()=>ot(void 0,void 0,void 0,(function*(){try{const t=yield K({contractBillcode:o,isLocalMock:!r}),n=l(xo(t,"goodsList",[])),{contractBillcode:i,memberBcode:s,memberBname:d,memberCode:a,memberName:u}=n[0];c.current={contractBillcode:i,memberBcode:s,memberBname:d,memberCode:a,memberName:u},e(n)}catch(o){console.log(o)}})),l=o=>{for(let t=0;t<o.length;t++)o[t].upImgLength=!0,o[t].upImg=[],o[t].evaluateGoodsImgs="",o[t].evaluateScopeList=[n.current[0]],o[t].evaluateGoodsContent="";return o},u=()=>ot(void 0,void 0,void 0,(function*(){try{const o=yield oo({applyTarget:"goods",isLocalMock:!r});n.current=o[0].templateValuesReList}catch(o){console.log(o)}}));return{orderInfo:t,changeStar:(o,c)=>{const i=[...t],r=[];for(let o=0;o<c;o++)r.push(n.current[o]);i[o].evaluateScopeList=r,e(i)},Submit:()=>ot(void 0,void 0,void 0,(function*(){try{yield to({paramStr:JSON.stringify(t)}),yield eo(Object.assign({paramStr:JSON.stringify(t)},c.current)),Io("orderlist")}catch(o){console.log(o)}})),changeContent:(o,n)=>{const c=[...t];c[o].evaluateGoodsContent=tt(n),e(c)}}},Te=()=>{const[o,t]=d([]),e=i(1),[n,c]=d(!1),[r,a]=d(""),[l,u]=d(!1),[p,m]=d(""),[y,g]=d(!1),[f,h]=d(!1),v=i(!1);s((()=>{S()}),[]);const S=()=>ot(void 0,void 0,void 0,(function*(){e.current=1,v.current=!1,t([]),yield C()})),C=()=>ot(void 0,void 0,void 0,(function*(){var o;if(!v.current){h(!0);try{const n=yield no({rows:10,page:e.current});if(0===(null===(o=n.list)||void 0===o?void 0:o.length))return;if(t((o=>1===e.current?n.list:o.concat(n.list||[]))),n.list.length<10)return void(v.current=!0);e.current+=1}catch(o){return t([]),[]}finally{h(!1)}}})),b=()=>{let o=[];for(let t=0;t<collectionList.length;t++)o.push(collectionList[t].collectCode);return o.toString()};return{footprintList:o,edit:n,setEdit:c,getData:C,getSelectItem:o=>{const t=tt(o);a(t.toString())},delItem:()=>ot(void 0,void 0,void 0,(function*(){try{yield co({footprintCodeStr:r}),yield S(),c(!1)}catch(o){console.log(o)}})),init:S,checked:l,setChecked:u,handleSelectAll:o=>{tt(o).length?(u(!0),setCollectCodeStr(b())):u(!1)},selectAll:p,setSelectAll:m,selectAllChecked:y,loading:f}};function je(o){const[t,e]=d([]);s((()=>{(()=>{ot(this,void 0,void 0,(function*(){try{const t=yield io({page:1,rows:o,dataState:1}),n=xo(t,"list",[]);e(n)}catch(o){}}))})()}),[o]);return{content:a((()=>t.map((o=>o.noticeTitle))),[t]),navigator:o=>{const e=xo(t,`${o}.noticeId`,"");Io("noticeDetail",{noticeId:e})}}}const Ge=o=>{const[t,e]=d({});s((()=>{ot(void 0,void 0,void 0,(function*(){yield n()}))}),[]);const n=()=>ot(void 0,void 0,void 0,(function*(){try{const t=yield ro({noticeId:o});e(t)}catch(o){console.log(o)}}));return{info:t,setInfo:e}},De={doclistTitle:"",doclistTitle4:"",doclistContent:""},Ae=o=>{const[t,e]=d(De);return s((()=>{ot(void 0,void 0,void 0,(function*(){try{const t=Po(),n=yield so({doclistId:o,isLocalMock:!t});e(n)}catch(o){console.log(o)}}))}),[]),{info:t}},we=({defaultValue:o,goods:t},e)=>{const[n,c]=d(o),r=i();return s((()=>{Vo(r.current,t)||(r.current=t,Eo(t)?c(o):ot(void 0,void 0,void 0,(function*(){try{const o=yield R({[e]:t.toString(),distinctField:"goodsNo",goodsType:"00,40"});c(o.list)}catch(t){c(o)}})))}),[t]),{list:n}},Re=o=>{const[t,e]=d([]),[n,c]=d([]),{coupons:i,defaultValue:r}=o;s((()=>{a()}),[i]);const a=()=>ot(void 0,void 0,void 0,(function*(){if(0!==i.length)try{const o=yield ao({promotionCode:null==i?void 0:i.join(","),list:1});e(xo(o,"list",[]))}catch(o){console.log(o)}else e(r)}));return{list:t,setList:e,takeCoupon:o=>ot(void 0,[o],void 0,(function*({promotionCode:o,couponAmount:t,index:e}){try{yield g({promotionCode:o,couponAmount:t})}catch(o){console.log(41,o)}finally{c((o=>o.concat(e)))}})),takeList:n}},xe=t([{},wo]);function Ee({initialValue:t,children:e}){return o(xe.Provider,{value:d(t||{}),children:e})}function Fe(){const o=n(xe);return o||[{},wo]}const Je=()=>{const[,o]=Fe();return{goTop:()=>{o((o=>{const{scrollTop:t}=o;return Object.assign(Object.assign({},o),{scrollTop:0===t?1:0})}))}}},Ue=({params:o})=>{const t=i([]),[e,n]=d([]),c=i(0),r=i(10);s((()=>{c.current=0,t.current=[],a()}),[o]);const a=()=>ot(void 0,void 0,void 0,(function*(){const e=Po();++c.current;try{const i=yield lo({isLocalMock:!e,pbCode:o,list:1,page:c.current,rows:r.current}),s=xo(i,"list",[]);t.current.push(...s),n(t.current)}catch(o){console.log(o)}}));return{list:e,getData:a}},qe=({contractBillcode:o,skuCode:t})=>{const[e,n]=d({}),[c,i]=d(!1),[r,a]=d(1),[l,u]=d(0),[p,m]=d(!1),[y,g]=d(!1);s((()=>{ot(void 0,void 0,void 0,(function*(){yield f()}))}),[]);const f=()=>ot(void 0,void 0,void 0,(function*(){m(!0);try{const e=Po(),c=(yield uo({contractBillcode:o,skuCode:t,isLocalMock:!e})).dataObj,{contractGoodsMoney:i,contractGoodsAremoney:r,goodsCamount:s,contractGoodsArefnum:d}=c,l=+i-+r;if(n(c),.01===l)return u(l),g(!0),void a(+s-+d);u(c.contractGoodsPrice)}catch(o){console.log(o)}finally{m(!1)}}));return{typeTip:c,setTypeTip:i,goodsNum:r,handleStep:o=>{if(y)return;const{goodsCamount:t,contractGoodsArefnum:n,contractGoodsMoney:c,contractGoodsAremoney:i,contractGoodsPrice:s}=e;if("plus"===o){const o=+t-+n;if(r>=o)return;u(o===r+1?c-i:(r+1)*s),a((o=>o+1))}else if("minus"===o){if(1===r)return;u((r-1)*s),a((o=>o-1))}},goodsInfo:e,goApply:(o,t,e,n)=>{Io("afterSalesApply",{refundType:o,contractBillcode:t,skuCode:e,goodsNum:n,goodsPrice:l})},loading:p,goodsPrice:l,stepLock:y}},$e=Ao(),Ve=({contractBillcode:o,skuCode:t})=>{const[e,n]=d([]),[c,i]=d(!1),[r,a]=d(!1),[l,u]=d(""),[p,m]=d([]),[y,g]=d({}),[f,h]=d(""),[v,S]=d(!1),C=Po();s((()=>{ot(void 0,void 0,void 0,(function*(){yield O()}))}),[]);const b=(o=0)=>o?o.toLocaleString("en-Us",{minimumFractionDigits:2}):"0",O=()=>ot(void 0,void 0,void 0,(function*(){try{const e=yield uo({contractBillcode:o,skuCode:t,isLocalMock:!C});g(e.dataObj)}catch(o){console.log(o)}})),P=o=>o.map((o=>({refundFileUrl:o})));return{tip:"请与商家协商,确认达成一致后填写协商好的退款金额。",reasonList:e,popupVisible:c,popupLoading:r,handlePopupShow:()=>ot(void 0,void 0,void 0,(function*(){i((o=>!o)),c||0!==e.length||(yield ot(void 0,void 0,void 0,(function*(){a(!0);try{const o=yield mo({isLocalMock:!C});n(o)}catch(o){console.log(o)}finally{a(!1)}})))})),handleChooseReason:o=>{u(tt(o)),i(!1)},reason:l,handleChooseImg:()=>{const o=Mo();o.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(t){o.uploadFile({url:`${$e}web/oc/refund/uploadRefFile.json`,filePath:t.tempFilePaths[0],name:"file",header:{"saas-agent":"qj-wemini","saas-token":Go("saas-token")},success(o){const t=JSON.parse(o.data),e=Po();if("nologin"===t.errorCode)Io(e?"/account/auth/index":"/account/mobileLogin/index");else{const o=$e+t.fileUrl;m((t=>[...t,o]))}}})}})},placeholder:"描述补充,有助于商家更好的处理售后问题",imgGroup:p,handleDelImg:o=>{m((t=>[...t.slice(0,o),...t.slice(o+1)]))},limit:3,goodsInfo:y,handleFillInReason:o=>{h(tt(o))},handleSubmit:(o,t,e,n)=>ot(void 0,void 0,void 0,(function*(){const{contractGoodsCode:c,goodsCamount:i,contractGoodsPrice:r}=y;if(!l)return void Et("请填写退款信息","none");S(!0);const s={ocRefundGoodsBeanList:[{memberCcode:y.memberCcode,contractGoodsCode:c,goodsCamount:i,refundGoodsNum:+o,refundGoodsAmt:b(n/+o)}],contractBillcode:t,refundMoney:n,refundEx:l,refundMeo:f,ocRefundFileDomainList:P(p),refundType:e};try{const o=yield po({params:JSON.stringify(s)});o.success&&(Et(o.msg),setTimeout((()=>{Io("afterSalesList")}),1e3))}catch(o){console.log(o)}finally{S(!1)}})),loading:v}},_e=({refundCode:o})=>{const[t,e]=d({}),[n,c]=d([]),[i,r]=d(!1),[a,l]=d(""),[u,p]=d(""),[m,y]=d(""),[g,f]=d(!1),h=Po();s((()=>{ot(void 0,void 0,void 0,(function*(){yield v()}))}),[]);const v=()=>ot(void 0,void 0,void 0,(function*(){f(!0);try{Wo(yo);const t=yield yo({refundCode:o,isLocalMock:!h});1===t.dataState&&(yield S()),e(t)}catch(o){console.log(o)}finally{f(!1)}})),S=()=>ot(void 0,void 0,void 0,(function*(){try{const o=yield fo({dataState:1});c(o.list)}catch(o){console.log(o)}}));return{setAfterSalesDetailInfo:e,afterSalesDetailInfo:t,submitExpressInfo:()=>ot(void 0,void 0,void 0,(function*(){if(a&&u&&m)try{yield go({packageBillno:a,refundCode:o,packageCode:u,packageName:m}),Wo(yo),yield v()}catch(o){console.log(o)}else Et("请填写完成信息","error")})),companyList:n,handleCancelAfterSales:t=>ot(void 0,void 0,void 0,(function*(){try{yield ho({goodsCode:t,refundCode:o}),Wo(yo),yield v()}catch(o){console.log(o)}})),popupShow:i,handlePopupShow:()=>{r((o=>!o))},chooseCompany:o=>{const t=tt(o).split("-");y(t[0]),p(t[1]),r(!1)},packageName:m,setPackageBillno:l,loading:g}},ze=(o,t)=>{const e=i(!1),[n,c]=d(!1),[r,a]=d([]),l=i(0),[u,p]=d(!0),m=Po();s((()=>{y()}),[t]);const y=dt((()=>{l.current=0,a([]),g()})),g=dt(((...t)=>ot(void 0,[...t],void 0,(function*(t={}){if(e.current)return;c(!0),++l.current;const{code:n}=o;try{const o=yield vo({page:l.current,rows:10,dataStates:n,isLocalMock:!m});e.current=Eo(o.list)||o.list.length<10,0===o.list.length&&p(!1),a((t=>t.concat(o.list||[])))}catch(o){--l.current,console.log(o)}finally{c(!1)}}))));return{afterSalesList:r,onScroll:g,loading:n,init:y,goAfterSalesDetail:o=>{Io("afterSalesDetail",{refundCode:o})},haseData:u}},We=[{name:"全部",code:""},{name:"进行中",code:"0,1,2,3,4,5"}],He=()=>({mySettingGoBind:()=>{Io(wt.confirmPhone)},mySettingLogout:()=>ot(void 0,void 0,void 0,(function*(){const o=Mo();try{const t=yield So();o.removeStorage({key:"saas-token"}),Et(t.msg),setTimeout((()=>{Bo(1)}),1e3)}catch(o){console.log(o)}}))});function Ke(o){const t=i(!1),[e,n]=d(!1),[c,r]=d([]),[a,l]=d(!0),u=i(0);s((()=>{m()}),[o]);const p=dt((o=>ot(this,void 0,void 0,(function*(){n(!0);try{const e=Po(),n=((yield Oo({page:o,rows:10,isLocalMock:!e})).list||[]).map((o=>Object.assign(Object.assign({},o),{addressMember:o.userinfoCompname||"",addressPhone:o.userinfoTel||"",addressDetail:o.companyAddress||""})));t.current=Eo(n)||n.length<10,r((t=>1===o?n:t.concat(n))),u.current=o,l(!1)}catch(t){1!==o&&--u.current,l(!1)}finally{n(!1)}})))),m=dt((()=>{t.current=!1,u.current=0,r([]),l(!0),p(1)}));return{list:c,loading:e,skullShow:a,onScroll:dt((()=>ot(this,void 0,void 0,(function*(){if(t.current)return;const o=u.current+1;yield p(o)})))),init:m}}function Qe(o){return{handlerImpl:()=>{Lo({PlaceOrderPickupAddress:o.userinfoOcode,PlaceOrderAddressTabs:{userinfoOcode:o.userinfoOcode}}),Bo(-1)}}}export{Ee as ApplicationContext,Bt as StoreProvider,nt as addCardSku,ne as addressInitial,We as afterSalesTabConfig,et as checkSkuSpec,vt as computedParams,Qo as createStore,Se as detailButton,Jt as formatTime,rt as getGoodDetail,tt as getRadioValue,it as getTotalDiscountPriceImpl,re as goodListIntialValue,Xt as goodListMock,Xo as goodStore,Zt as initalOrderValue,St as initialCoupon,pt as initialValue,se as initialValueOrder,Ko as makeStore,Ft as navigator,ie as orderGoodValue,ve as orderStatusImpl,he as orderStatusList,oe as orderStore,be as orderType,pe as pickupAddressInitial,st as popupImplement,ct as queryToContractImpl,wt as routerMap,Rt as routerMapArr,Et as showToast,lt as useAddCoupon,at as useAddShopping,Mt as useAddressItem,It as useAddressList,Ve as useAfterSalesApply,qe as useAfterSalesChooseType,_e as useAfterSalesDetail,ze as useAfterSalesList,Re as useAllCoupon,Fe as useApplicationContext,Ae as useArticleDetail,yt as useBanner,Gt as useCartItem,Dt as useCartList,At as useCartListNext,Ut as useCartOperate,qt as useCartTop,Me as useCollectionList,Ct as useCoupon,$t as useCouponList,ut as useCreatePoster,fe as useCube,jt as useDispatchImpl,Lt as useEditAddress,Ot as useEvaluate,Be as useEvaluateDetail,Le as useExpressInfo,Te as useFootprint,Je as useGoTop,ft as useGoodCollection,mt as useGoodDetail,kt as useGoodFootprint,ht as useGoodSku,Yo as useGoodSkuStore,Nt as useGoodSpecAndPrice,we as useGoods,Ie as useGoodsClassify,Wt as useGoodsList,Pt as useGoodsShare,dt as useImmutableCallback,Ue as useMarketingPromotion,He as useMySetting,je as useNotice,Ge as useNoticeDetail,ce as useOrderAddress,le as useOrderCoupon,ke as useOrderDetail,de as useOrderGood,ee as useOrderInfo,Oe as useOrderList,Ce as useOrderOperate,ue as useOrderPay,me as useOrderPickupAddress,Ht as useOrderResult,ge as useOrderResultResult,zt as useOverdue,ae as usePayMode,Qe as usePickupPointItem,Ke as usePickupPointList,Yt as usePlaceOrder,bt as usePromotion,Tt as useStore,te as useSyncOrderStore,Vt as useUnused,_t as useUsed,xt as userAddressData};
1
+ import{jsx as o}from"react/jsx-runtime";import{createContext as t,useReducer as e,useContext as n,useSyncExternalStore as c,useRef as i,useCallback as r,useEffect as s,useState as d,useMemo as a}from"react";import{addShoppingGoodsBySpec as l,addShoppingGoods as u,queryToContract as p,getTotalDiscountPrice as m,getResourceGoodsInfoBySkuCode as y,saveUsercoupon as g,getSetsupDisUtil as f,checkCollectExit as h,queryCollectPage as v,saveCollect as S,deleteCollectByCode as C,queryCouponListBySkuCode as b,queryPromotionListByGoodsCode as O,queryEvaluateGoodsPagetrue as P,saveFootprint as k,saveAddress as N,queryAddressBymerberCode as L,deleteAddress as I,updateAddress as M,updateShoppingGoodsNum as D,queryShoppingPage as T,queryShoppingToContract as B,deleteShoppingGoodsBatch as G,updateShoppingGoodsPmInfo as j,updateShoppingGoodsCheckState as w,queryUsercouponPageForC as A,find as R,syncContractBatchState as x,paymentCommit as E,getFalgSettingForPaydate as F,calculateFreightFare as J,saveContract as U,queryUserConByGoods as q,syncContractPayState as $,confirmReceive as V,cancelContractC as _,queryContractPageC as Y,cancelUnpayOrder as z,getContractByCode as W,checkRefund as H,queryExpressInfo as K,queryGoodsClassTree as Q,deleteCollectByCodeStr as X,queryUseTemplate as Z,saveEvaluateGoods as oo,saveEvaluateShop as to,queryFootprintPagePlat as eo,deleteFootprintByCodeStr as no,queryNoticePage as co,getNotice as io,getDoclist as ro,queryPromotioByCodePage as so,queryPromotioPage as ao,getRefundGoods as lo,saveRefund as uo,queryRefCause as po,getRefundByCode as mo,sendGoods as yo,queryExpressPageForProp as go,cancelAfterSales as fo,queryRefundPageBuy as ho,miniLogout as vo}from"qj-b2c-api";export{calculateFreightFare,getFalgSettingForPaydate,paymentCommit,queryAddressBymerberCode,queryShoppingToContract,saveContract,saveOrderToPay,syncContractBatchState,syncContractPayState,syncContractState,updateShoppingGoodsNum}from"qj-b2c-api";import{getTotalDiscountPriceCache as So,queryUpmupointsPageByPC as Co,saveOrderToBatchPay as bo,queryUserServicePage as Oo,queryEvaluateGoodsPage as Po,deleteEvaluateGoods as ko,queryUpmpointsrulePage as No,querySignPage as Lo,saveSignForUser as Io}from"b2c-api";import{getEnv as Mo,taroMessage as Do,getPagesRefreshStore as To,updatePagesRefreshStore as Bo,navigatorHandler as Go,getTaro as jo,navigatorBackImpl as wo,reLaunchHandler as Ao,setStorage as Ro,getStorage as xo,taroModule as Eo,getBaseUrl as Fo}from"@brushes/utils";import{noop as Jo,isFunction as Uo,get as qo,isEmpty as $o,orderBy as Vo,groupBy as _o,difference as Yo,set as zo,isUndefined as Wo,isEqual as Ho}from"lodash-es";import{fullPath as Ko,extendAddressData as Qo}from"@brushes/shared-utils";import{removeRequestCacheByKey as Xo}from"@brushes/optimize";import{post as Zo}from"@brushes/request";import ot from"dayjs";function tt(c,i){const r=t(null),s=t(null);return[({children:t})=>{const[n,d]=e(c,i);return o(r.Provider,{value:d,children:o(s.Provider,{value:n,children:t})})},function(){return n(s)},function(){return n(r)}]}function et(o){let t=o;const e=new Set;return{getState:()=>t,setState:o=>{t=Object.assign(Object.assign({},t),o),e.forEach((o=>o(t)))},subscribe:o=>(e.add(o),()=>e.delete(o))}}const nt=et({count:1,memberCode:"",isNeedButton:!1,goodsNum:1,spec:[],orderType:0,offShelf:!1});function ct(o=o=>o){return c(nt.subscribe,(()=>o(nt.getState())))}function it(o,t){var e={};for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&t.indexOf(n)<0&&(e[n]=o[n]);if(null!=o&&"function"==typeof Object.getOwnPropertySymbols){var c=0;for(n=Object.getOwnPropertySymbols(o);c<n.length;c++)t.indexOf(n[c])<0&&Object.prototype.propertyIsEnumerable.call(o,n[c])&&(e[n[c]]=o[n[c]])}return e}function rt(o,t,e,n){return new(e||(e=Promise))((function(c,i){function r(o){try{d(n.next(o))}catch(o){i(o)}}function s(o){try{d(n.throw(o))}catch(o){i(o)}}function d(o){var t;o.done?c(o.value):(t=o.value,t instanceof e?t:new e((function(o){o(t)}))).then(r,s)}d((n=n.apply(o,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const st=o=>o.detail?o.detail.value:o.value?o.value:o,dt=(o,t)=>rt(void 0,void 0,void 0,(function*(){const e={specStr:JSON.stringify(o),goodsCode:t};return yield l(e)})),at=(o,t)=>rt(void 0,void 0,void 0,(function*(){const e={skuId:o,goodsNum:t};return yield u(e)})),lt=(o,t)=>rt(void 0,void 0,void 0,(function*(){const e=Mo(),n={skuId:o,goodsNum:t,isLocalMock:!e};return yield p(n)})),ut=(o,...t)=>rt(void 0,[o,...t],void 0,(function*(o,t=!1){return yield t?So(o):m(o)}));function pt(o){const t=Mo();return y({skuCode:o,isLocalMock:!t})}function mt(o=Jo){const t=o=>{const t=(o=>{const t=nt.getState();switch(o.type){case"plus":return Object.assign(Object.assign({},t),{count:t.count+1});case"minus":return Object.assign(Object.assign({},t),{count:t.count-1});case"select":case"initGoodSku":case"popupImpl":return Object.assign(Object.assign({},t),o.payload);default:return t}})(o);nt.setState(t)},e=()=>{o({visible:!0})};return{dispatch:t,openPopup:()=>{e(),t({type:"popupImpl",payload:{isNeedButton:!1}})},closePopup:()=>{o({visible:!1})},addCardPopup:()=>{e(),t({type:"popupImpl",payload:{orderType:0,isNeedButton:!0}})},buyOpenPopup:()=>{e(),t({type:"popupImpl",payload:{orderType:1,isNeedButton:!0}})}}}function yt(o){const t=i(null);return t.current=Uo(o)?o:Jo,r(((...o)=>t.current(...o)),[t])}function gt(o,t,e,n=Jo){const{dispatch:c,closePopup:i}=mt(n);s((()=>{const o=qo(t,"spec",[]),n=qo(e,"[0]goodsMinnum",1);$o(o)||c({type:"initGoodSku",payload:{offShelf:!1,count:n||1,spec:o}})}),[t]);const r=yt(((o,t)=>{const n=nt.getState(),{spec:i}=n;i[t]=o;const r=(s=Vo(i).join("/"),e.find((o=>o.skuName===s))||{});var s;const d=$o(r);c({type:"select",payload:{offShelf:d,count:r.goodsMinnum||1,spec:[...i]}}),d&&Do("该规格已下架","none")})),d=()=>rt(this,void 0,void 0,(function*(){try{const t=nt.getState(),{spec:e,count:n}=t,c=yield dt(e,o),{CartList:r=0}=To();Bo({CartList:r+1});const s=qo(c,"dataObj.skuId"),d=yield at(s,n);yield Do(d.msg||"添加成功"),i()}catch(o){yield Do(o,"error")}})),a=()=>rt(this,void 0,void 0,(function*(){const t=nt.getState(),{spec:e,count:n}=t,c=yield dt(e,o),i=qo(c,"dataObj.skuId"),r=qo(c,"dataObj.goodsType");if("06"===r)try{const o=Number(qo(c,"dataObj.pricesetRefrice",0)),t=yield Co({},!1);if(o>Number(qo(t,"list[0].upointsNum",0)))return void Do("用户积分不足,不能兑换","none")}catch(o){return void console.log(o)}Go("orderDetermine",{skuId:i,goodsNum:n,goodsType:r})}));return{closePopup:i,addCardImpl:d,cashImpl:a,handleChooseSize:r,handleStep:(o,t,e)=>{const{count:n}=nt.getState();n!==t||"minus"!==e?"plus"!==e||n!==o?c({type:e}):Do("超库存","none"):Do(`不能小于${t}`,"none")},addShoppingImpl:()=>{const o=nt.getState(),{orderType:t}=o;0===t?d():a()}}}const ft=()=>{const[o,t]=d(!1);return{save:e=>rt(void 0,void 0,void 0,(function*(){if(!o)try{yield g(e),t(!0)}catch(o){}})),isPick:o}},ht=()=>{const o=i(null),t=jo(),e=o=>{if(!o)return;const e=document.createElement("a");e.href=o,e.download="poster.png",t.showToast({title:"生成成功",icon:"none",duration:2e3}),e.click()};return{init:(t,n)=>{const c=Ko(qo(t,"[0].dataPic","")),i=o.current;if(!i)return;const r=i.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,300,340),r.fillStyle="#333",r.font="bold 14px sans-serif",r.fillText(n,10,300);const s=new Image;s.crossOrigin="Anonymous",s.src=c,s.onload=function(){r.drawImage(s,0,0,300,260)},setTimeout((()=>{const o=i.toDataURL("image/png");e(o)}),200)},canvasRef:o}},vt={rsGoodsFileDomainList:[],rsSpecValueDomainList:[],goodsRemark:"",pricesetNprice:0,goodsName:"",dataPic:"",goodsShowname:"",goodsNum:0,goodsCode:"",skuNo:"",classtreeCode:"",brandCode:"",pntreeCode:"",memberCode:"",goodsThdate:"",goodsOdate:"",goodsDayinfo:"",rsSkuDomainList:[]},St=(o,t="")=>{const[e,n]=d(vt);return s((()=>{rt(void 0,void 0,void 0,(function*(){try{let e=o;t&&(e=(yield f({key:t})).split("_")[0]);const c=yield pt(e);n(c||vt)}catch(o){}}))}),[]),e},Ct=o=>a((()=>o.map((o=>({imgUrl:o.goodsFileUrl,link:""})))),[o]),bt={dataObj:""};function Ot({skuCode:o,dataPic:t,goodsName:e,pricesetNprice:n}){const[c,i]=d(bt);s((()=>{r()}),[]);const r=()=>rt(this,void 0,void 0,(function*(){const t={collectType:0,collectOpcode:o};try{const o=yield h(t);i(o)}catch(o){console.log(o)}})),a=()=>rt(this,void 0,void 0,(function*(){const c={collectType:0,collectOpcode:o,collectOppic:t,collectOpcont:e,collectOpnum:n,goodsOrigin:0};return yield S(c)})),l=()=>rt(this,void 0,void 0,(function*(){const o={collectType:0,collectCode:c.dataObj||""};return yield C(o)})),u=(o,t="success",e=1e3)=>{jo().showToast({title:o,icon:t,duration:e})};return{handleCollect:()=>rt(this,void 0,void 0,(function*(){let o=bt;$o(c.dataObj)?(o=yield a(),u("收藏成功")):(o=yield l(),u("取消收藏成功")),i(o),Xo(v)})),collection:c}}function Pt(o,t){return a((()=>({skuList:function(o){const t=_o(Vo(o,["specValueValue"]),"specName");return t?Object.keys(t).map((o=>({skuName:o,skuOption:t[o]}))):[]}(o),spec:qo(t,"[0]skuName","").split("/")})),[o])}const kt=(o=[],t)=>{const e=o.find((o=>o.skuCode===t))||{};if($o(e))return{};const{skuNo:n,classtreeCode:c,brandCode:i,pntreeCode:r,memberCode:s}=e;return{skuCode:t,skuNo:n,classtreeCode:c,brandCode:i,pntreeCode:r,memberCode:s}},Nt={promotionBegintime:"",pbName:"",discName:"",promotionCode:"",promotionName:"",couponOnceNums:0,couponOnceNumd:0,promotionEndtime:""};function Lt(o,t){const[e,n]=d([]),[c,i]=d(!1);return s((()=>{(()=>{rt(this,void 0,void 0,(function*(){const e=kt(o,t);if($o(e))return;const c=yield b(e);n(c)}))})()}),[t,o]),{coupon:e,visible:c,setVisible:i}}function It(o,t){const[e,n]=d([]);return s((()=>{(()=>{rt(this,void 0,void 0,(function*(){const e=kt(o,t);if($o(e))return;const c=yield O(e);n(c)}))})()}),[t,o]),e}const Mt=o=>{const[t,e]=d([]);return s((()=>{rt(void 0,void 0,void 0,(function*(){try{if(!o)return;const t=yield P({goodsCode:o,page:1,rows:10});e(t.list||[])}catch(o){}}))}),[o]),t},Dt=()=>({handleShare:()=>{if(!Mo())return;jo().showShareMenu({withShareTicket:!0,success:()=>{console.log("share success")}})}}),Tt=o=>{s((()=>{rt(void 0,void 0,void 0,(function*(){try{const t=yield pt(o);k({footprintType:0,footprintOpcode:o,footprintOppic:t.dataPic,footprintOpcont:t.goodsName,footprintOpnum:t.pricesetNprice,footprintOpurl:""})}catch(o){console.log(o)}}))}),[])},Bt=(o=[])=>{const t=ct((o=>o.spec)),e=a((()=>o.find((o=>o.skuName===Vo(t).join("/")||o.skuName+"/"===Vo(t).join("/")))||{}),[t,o]);return{spec:t,goodInfo:e}};function Gt(){return{onSubmit:(o,t,e)=>rt(this,void 0,void 0,(function*(){try{yield N(Object.assign(Object.assign({},o),Qo)),Xo(L);let{AddressList:e=0}=To();Bo({AddressList:++e}),t(),wo(-1)}catch(o){e()}}))}}function jt(o){const[t,e]=d([]),[n,c]=d(!0);s((()=>{i()}),[o]);const i=()=>rt(this,void 0,void 0,(function*(){const o=Mo(),t=yield L({isLocalMock:!o});e(t),c(!1)})),r=(o,t)=>{const e=t[o];return t[o]=t[0],t[o].addressDefault="0",t[0]=e,t[0].addressDefault="1",[...t]};return{list:t,skullShow:n,delAddress:o=>{if(!Mo())return;jo().showModal({title:"提示",content:"确认删除该地址吗?",success:t=>rt(this,void 0,void 0,(function*(){(null==t?void 0:t.confirm)&&(yield I({addressId:o.addressId}),Xo(L),yield i())}))})},setDefault:(o,n)=>rt(this,void 0,void 0,(function*(){if("1"!==o.addressDefault){const{addressMember:c,addressPhone:s,provinceCode:d,provinceName:a,cityCode:l,cityName:u,areaCode:p,areaName:m,addressDetail:y,addressId:g,addressCode:f,dataState:h}=o,v={addressMember:c,addressPhone:s,provinceCode:d,provinceName:a,cityCode:l,cityName:u,areaCode:p,areaName:m,addressDetail:y,addressId:g,addressCode:f,dataState:h,addressDefault:"1"};e(r(n,t)),yield M(v),yield i()}})),getAddressList:i,navigator:()=>{Go("addressEditor")}}}function wt(o){return{handlerImpl:()=>{Bo({PlaceOrderAddress:o.addressId,PlaceOrderAddressTabs:{addressId:o.addressId}}),wo(-1)}}}const[At,Rt,xt]=tt((function(o,t){switch(t.type){case"select":return Object.assign(Object.assign({},o),{select:t.payload});case"update":return Object.assign(Object.assign({},o),t.payload);default:return o}}),{id:"",count:0,loading:!1,select:[]}),Et=()=>{const o=xt(),{select:t}=Rt();return{select:t,onChange:t=>{o({type:"select",payload:st(t)})},handleStep:(t,e,n)=>rt(void 0,void 0,void 0,(function*(){if(0===e&&"minus"===n)return void Do("不能小于0","none");const c="plus"===n?++e:--e;o({type:"update",payload:{id:t,count:c,loading:!0}})}))}},Ft=o=>{const[t,e]=d([]),[n,c]=d(0),r=i([]),l=xt(),{select:u,id:p,count:m}=Rt(),y=a((()=>{let o=0,e=0;return t.forEach((t=>{u.includes(t.shoppingGoodsId)&&(o+=t.goodsCamount,e+=t.goodsCamount*t.pricesetNprice)})),{num:o,amount:e}}),[u,t]);s((()=>{rt(void 0,void 0,void 0,(function*(){yield f("isFirst")}))}),[o]),s((()=>{p&&g(p,m)}),[p,m]);const g=(o,t)=>rt(void 0,void 0,void 0,(function*(){try{yield D({shoppingGoodsId:o,amount:t,goodWeight:0}),yield f()}catch(o){console.log(o)}})),f=(...o)=>rt(void 0,[...o],void 0,(function*(o=""){try{const t=Mo(),n=yield T({isLocalMock:!t}),i=qo(n,"list",[]),s=[];let d=0;i.forEach((o=>{const{shoppingGoodsList:t,disMoney:e=0}=qo(o,"shoppingpackageList[0]",{shoppingGoodsList:[],disMoney:0});s.push(...t),d+=e||0})),r.current=s.map((o=>o.shoppingGoodsId)),o&&l({type:"select",payload:r.current}),l({type:"update",payload:{loading:!1}}),c(d),e(s)}catch(o){Do(o.msg)}}));return{cartList:t,initImpl:f,disMoney:n,amount:y,selectAll:o=>{const t=st(o);l({type:"select",payload:t.includes("true")?r.current:[]})},allCart:r,toOrderImpl:()=>{0!==u.length?(Xo(B),Go("orderDetermine",{shoppingGoodsId:u.join(",")})):Do("购物数量不能为空")},select:u,deleteCart:()=>rt(void 0,void 0,void 0,(function*(){try{yield G({shoppingGoodsIdStr:JSON.stringify(u)}),yield f()}catch(o){console.log(o)}}))}},Jt=(o,t,e=Jo)=>{const[n,c]=d([]),[r,a]=d(!1),l=i([]);s((()=>{rt(void 0,void 0,void 0,(function*(){yield u("isFirst")}))}),[o,t]);const u=(...o)=>rt(void 0,[...o],void 0,(function*(o=""){try{a(!0);const t=Mo(),e=yield T({isLocalMock:!t});p(e,o)}catch(o){console.log(o)}finally{a(!1)}})),p=(o,t)=>{const e=qo(o,"list",[]),n=[];e.forEach((o=>{const t=qo(o,"shoppingpackageList",[]);n.push(...t)})),c(n),m(n,t)},m=(o,t)=>{const{list:n,disMoney:c}=y(o);l.current=n;const i=l.current.map((o=>o.shoppingGoodsId)),r={};t&&(r.select=i),e(Object.assign({disMoney:c,cartInfo:l.current},r))},y=o=>{let t=[],e=0;return o.forEach((o=>{e+=o.disMoney||0,t.push(...o.shoppingGoodsList)})),{list:t,disMoney:e}};return{cartList:n,loading:r,onChange:o=>{const t=st(o).map((o=>Number(o)||o));e((o=>{var e,n;return e=t,n=o.select,rt(void 0,void 0,void 0,(function*(){console.log("updateGoodCheck",e,n);let o="";o=e.length>n.length?Yo(e,n).join(""):Yo(n,e).join("");const{shoppingCode:t}=l.current.find((t=>t.shoppingGoodsId===o))||{};try{yield w({shoppingGoodsIdStr:o,shoppingCode:t,checkState:+(n.length>e.length),channelCode:"channelCode"}),yield u()}catch(o){}})),{cartInfo:l.current,select:t}}))},handleStep:(o,t,e)=>{if(1===t&&"minus"===e)return void Do("不能小于1","none");((o,t)=>{rt(void 0,void 0,void 0,(function*(){try{yield D({shoppingGoodsId:o,amount:t,goodWeight:0}),yield u()}catch(o){console.log(o)}}))})(o,"plus"===e?++t:--t)},updatePm:(o,t)=>rt(void 0,void 0,void 0,(function*(){try{yield j({shoppingGoodsId:o,promotionCode:t}),yield u()}catch(o){console.log(o)}}))}},Ut={register:"/account/register/index",accountLogin:"/account/accountLogin/index",mobileLogin:"/account/mobileLogin/index",forgetPwd:"/account/forgetPwd/index",agreement:"/account/agreement/index",auth:"/account/auth/index",confirmPhone:"/account/confirmPhone/index",bindPhone:"/account/bindPhone/index"},qt=["pages/index/index"],$t={addressId:"",addressInfo:{},contractPumode:"0"},Vt=(o,t="success",e=1e3)=>{jo().showToast({title:o,icon:t,duration:e})};function _t({target:o,defaultQuery:t,extendQuery:e},n){const c=o.value,i=((o,t,e)=>{const n=o.concat(t);let c={};for(let o of n)c[o]=e[o];return c})(t,e,n);Go(c,i)}const Yt=(o,t)=>{const e=Math.floor(o/1e3)%60,n=Math.floor(o/1e3/60)%60,c=Math.floor(o/1e3/60/60)%24;return`${Math.floor(o/1e3/60/60/24)}天 ${c}小时 ${n}分钟 ${e}秒${t}`};function zt(o=[],t=[],e=Jo){const n=a((()=>{console.log(111,o,t);let e=0,n=[],c=0;for(let i of t)o.includes(i.shoppingGoodsId)&&0===i.dataState&&(n.push(i.shoppingGoodsId),e+=i.goodsCamount,c+=i.goodsCamount*i.pricesetNprice);return{num:e,canPayIds:n,amount:c}}),[o,t]),c=yt((o=>(console.log(1111,o.map((o=>o.shoppingGoodsId))),o.map((o=>o.shoppingGoodsId))))),i=yt((o=>{const n=st(o);console.log(39,n),e({select:n.includes("true")?c(t):[]})})),r=yt((()=>rt(this,void 0,void 0,(function*(){try{yield G({shoppingGoodsIdStr:JSON.stringify(o)}),e((o=>{let t=o.updateCount||0;return{updateCount:++t}}))}catch(o){console.log(o)}}))));return{toOrderImpl:yt((()=>{0!==n.canPayIds.length?(Xo(B),Go("orderDetermine",{shoppingGoodsId:n.canPayIds.join(",")})):Do("购物数量不能为空")})),deleteCart:r,selectAll:i,cartDetail:n}}function Wt(o=Jo){return{editorImpl:()=>{o((o=>({isEditor:!o.isEditor})))}}}const Ht=()=>{const[o,t]=d([]),e=i(0),n=i(1),c=i(10),r=i([{id:1,label:"未使用",dataState:0,styleName:"unused",text:""},{id:2,label:"已使用",dataState:1,styleName:"used"},{id:3,label:"已失效",dataState:2,styleName:"overdue"}]);s((()=>{rt(void 0,void 0,void 0,(function*(){yield a()}))}),[]);const a=()=>rt(void 0,void 0,void 0,(function*(){try{const o=yield A({page:n.current,rows:c.current,dataState:r.current[e.current].dataState});t((t=>t.concat(o.list||[]))),n.current+=1}catch(o){console.log(o)}}));return{config:r,coe:e,list:o,setList:t,getList:a,switchTab:o=>rt(void 0,void 0,void 0,(function*(){e.current=o,n.current=1,t([]),yield a()}))}},Kt=()=>{const[o,t]=d([]),e=i(1);s((()=>{rt(void 0,void 0,void 0,(function*(){yield n()}))}),[]);const n=()=>rt(void 0,void 0,void 0,(function*(){e.current=1,t([]),yield c()})),c=()=>rt(void 0,void 0,void 0,(function*(){try{const o=yield A({page:e.current,rows:100,dataState:0,pbCode:"0004,0005"});t(o.list),e.current+=1}catch(o){console.log(o)}}));return{unusedList:o,getData:c,init:n}},Qt=()=>{const[o,t]=d([]),e=i(1);s((()=>{rt(void 0,void 0,void 0,(function*(){yield n()}))}),[]);const n=()=>rt(void 0,void 0,void 0,(function*(){e.current=1,t([]),yield c()})),c=()=>rt(void 0,void 0,void 0,(function*(){try{const o=yield A({page:e.current,rows:100,dataState:1,pbCode:"0004,0005"});t(o.list),e.current+=1}catch(o){console.log(o)}}));return{usedList:o,getData:c,init:n}},Xt=()=>{const[o,t]=d([]),e=i(1);s((()=>{rt(void 0,void 0,void 0,(function*(){yield n()}))}),[]);const n=()=>rt(void 0,void 0,void 0,(function*(){e.current=1,t([]),yield c()})),c=()=>rt(void 0,void 0,void 0,(function*(){try{const o=yield A({page:e.current,rows:100,dataState:2,pbCode:"0004,0005"});t(o.list),e.current+=1}catch(o){console.log(o)}}));return{overdueList:o,getData:c,init:n}},Zt=(o,t,e)=>{const n=i(!0),c=i(0),[r,a]=d([]),[l,u]=d(!1);s((()=>{p("isFirst")}),[e]);const p=yt((o=>{c.current=0,n.current=!0,m(e,o)})),m=yt(((e,...i)=>rt(void 0,[e,...i],void 0,(function*({sortField:e="pricesetNprice",order:i=""},r=""){if(n.current){++c.current,u(!0);try{const s=yield R({distinctField:"goodsNo",sortField:e,order:i,goodsType:"00,40,50",page:c.current,rows:10,searchParam:t,classtreeCode:o});($o(s.list)||s.list.length<10)&&(n.current=!1),u(!1),a((o=>r?s.list:o.concat(s.list)))}catch(o){--c.current}}}))));return{loading:l,getData:m,list:r}};function oe({contractBillcode:o,contractBbillcode:t}){const e=jo(),[n,c]=d(!1),r=i(""),a=Mo(),[l,u]=d([]),p=i({}),m=i({contMoney:0,orderMoney:0,logMoney:0,contractBillcode:""});s((()=>{(()=>{rt(this,void 0,void 0,(function*(){var e;try{const n=yield x({contractBbillcode:o||t,isLocalMock:!a}),c=yield bo({contractBbillcode:null!==(e=n.dataObj)&&void 0!==e?e:"",isLocalMock:!a});m.current=c,u(c.payChannelList),p.current=c}catch(o){console.log(44,o)}}))})()}),[]);const y=o=>{c(!0);const{ptradeSeqno:t,contractBlance:e,payChannelList:n}=p.current,{fchannelCode:i,faccountOuterNo:s=""}=g(n,o||r.current);return{ptradeSeqno:t,contractBlance:e,fchannelCode:i,faccountOuterNo:s}},g=(o,t)=>o.find((o=>"1"===t?o.ptfchannelAmt===t:o.fchannelCode===t))||{},f=()=>rt(this,void 0,void 0,(function*(){var o;const t=null!==(o=m.current.contractBillcode)&&void 0!==o?o:"";Ro("contractBillcode",{contractBillcode:t});const{ptradeSeqno:e,contractBlance:n,fchannelCode:c,faccountOuterNo:i}=y(),r=[{faccountIdType:"ACCOUNT",fchannelCode:c,orderAmount:m.current.orderMoney,faccountId:i}];return yield E({ptradeSeqno:e,payCommitStr:JSON.stringify(r),contractBlance:n})})),h=()=>rt(this,void 0,void 0,(function*(){try{const o=yield f();document.getElementById("v_html").innerHTML="<div>"+o.dataObj.htmlStr+"</div>",document.forms[0].submit(),c(!1)}catch(o){c(!1)}})),v=()=>rt(this,void 0,void 0,(function*(){try{const o=yield f();document.getElementById("v_html").innerHTML="<div>"+o.dataObj.htmlStr+"</div>",document.getElementById("paaspaysubmit").submit(),c(!1)}catch(o){c(!1)}})),S=()=>rt(this,void 0,void 0,(function*(){try{let o=(yield f()).dataObj.requestData;wx.requestPayment({timeStamp:o.timeStamp,nonceStr:o.nonceStr,package:o.package,signType:o.signType,paySign:o.paySign,success:function(o){var t;const e=null!==(t=m.current.contractBillcode)&&void 0!==t?t:"";Ao("result",{code:e})},fail:function(o){c(!1)},complete:function(o){c(!1)}})}catch(o){c(!1)}}));return{paymentImpl:()=>{var o;switch(r.current||Do("请选择支付方式","none"),r.current){case"wechatmini":S();break;case"account":case"alipaywap":h();break;case"wechatwap":v();break;case"1":const{ptradeSeqno:t,contractBlance:n,fchannelCode:c,faccountOuterNo:i}=y("1"),r=[{faccountIdType:"ACCOUNT",fchannelCode:c,orderAmount:m.current.orderMoney,faccountId:i}],s=null!==(o=m.current.contractBillcode)&&void 0!==o?o:"";e.navigateTo({url:`/package/paypassword/index?code=${s}&ptradeSeqno=${t}&payCommitStr=${JSON.stringify(r)}&contractBlance=${n}`})}},channelList:l,handleRadio:o=>{r.current=st(o)},contract:m,loading:n}}const te={provinceName:"",cityName:"",areaName:"",addressDetail:"",addressMember:"",addressPhone:"",addressDefault:""},ee={contractSettlOpno:0,promotionCodes:null,shoppingCountPrice:0,totalDiscountPrice:0,accountsSumPrice:0,discount:0,freight:0,comDisMoney:0,copyComDisMoney:0},ne={dataPic:"",goodsName:"",goodsCamount:0,skuName:"",pricesetNprice:0};function ce({skuId:o,goodsNum:t,shoppingGoodsId:e},n,c){const r=i([{dataPic:"",goodsName:"",goodsCamount:0,skuName:"",pricesetNprice:0}]),[a,l]=d([]),[u,p]=d(te),m=i(""),y=i([]),g=i([]),f=i([]),[h,v]=d(0),S=Mo(),C=i(ee),b=i([]);s((()=>{(()=>{rt(this,void 0,void 0,(function*(){v(0),C.current={contractSettlOpno:0,promotionCodes:null,shoppingCountPrice:0,totalDiscountPrice:0,accountsSumPrice:0,discount:0,freight:0,comDisMoney:0,copyComDisMoney:0},g.current=[],y.current=[],e?yield P((()=>B({shoppingGoodsIdStr:`[${e}]`}))):yield P((()=>lt(o,t)))}))})()}),[n]);const O=()=>rt(this,void 0,void 0,(function*(){try{const o=yield q({pmContractGoodsDomainListStr:JSON.stringify(g.current)});l(o)}catch(o){console.log(74,o)}})),P=o=>rt(this,void 0,void 0,(function*(){try{const t=yield Promise.all([L({isLocalMock:!S}),o()]),[e=[],n=[]]=t,i=c?e.find((o=>o.addressId===c)):e.find((o=>"1"===o.addressDefault))||{};p(i),k(n,i),c=""}catch(o){console.log(o)}})),k=(o,t)=>{$o(o)||o.forEach((o=>{o.shoppingpackageList.forEach((o=>{C.current.comDisMoney+=o.disMoney,C.current.copyComDisMoney+=o.disMoney,o.shoppingGoodsList.forEach((t=>{g.current.push(t),C.current.shoppingCountPrice+=t.pricesetNprice*t.goodsCamount,t.contractGoodsGtype=0,m.current=o.promotionCode,"00"==t.goodsType&&F().then((o=>{}))})),o.disMoney>0&&y.current.push({contractSettlBlance:0==o.promotionInType?"PM":"COP",contractPmode:"0",contractSettlGmoney:Number(o.disMoney.toFixed(2)),contractSettlPmoney:Number(o.disMoney.toFixed(2)),contractSettlOpno:o.promotionCode,contractSettlOpemo:o.promotionName}),o.giftList?(o.shoppingGoodsList.forEach((o=>{o.ginfoCode=o.pmPromotionList.find((o=>"0001"==o.pbCode)).promotionCode})),r.current=[...o.shoppingGoodsList,...o.giftList]):r.current=o.shoppingGoodsList})),N(),S&&(I(),O(),T(t))}))},N=()=>{const{shoppingCountPrice:o,totalDiscountPrice:t,discount:e,comDisMoney:n,freight:c}=C.current;v(o-t-e-n+c)},I=()=>rt(this,void 0,void 0,(function*(){let n={};n=e?{shoppingGoodsIdStr:`[${decodeURIComponent(e)}]`}:{skuIdStr:JSON.stringify([{skuId:o,goodsNum:t}])};try{const o=yield J(Object.assign({isLocalMock:!S},n));C.current.freight=o.dataObj,N()}catch(o){console.log(180,o)}})),M=()=>{const{shoppingCountPrice:o,copyComDisMoney:t,discount:e}=C.current;return(o-t-e).toFixed(2)},D=()=>{const{shoppingCountPrice:o,copyComDisMoney:t,freight:e}=C.current;return(o-t+e).toFixed(2)},T=e=>{f.current=(e=>{const{addressMember:n,userName:c,provinceName:i,cityName:s,areaName:d,addressDetail:a,areaCode:l}=e;return[{contractPaytime:(new Date).valueOf(),goodsPbillno:0,goodsPmbillno:C.current.promotionCodes,contractProperty:"0",contractBlance:0,contractPmode:0,contractPumode:"0",goodsSupplierName:"",goodsSupplierCode:"",packageList:[{contractGoodsList:r.current,shoppingGoodsIdList:[],promotionCode:m.current,packageRemark:null}],packageMode:"",contractType:"50",ocContractSettlList:[],contractInmoney:D(),contractMoney:M(),goodsReceiptMem:n,goodsReceiptPhone:c,goodsReceiptArrdess:i+s+d+a,areaCode:l,contractNbillcode:null,skuIdList:o?[{skuId:+o,goodsNum:+t}]:[],giftSkuIdList:[]}]})(e);let n={rsSkuListStr:JSON.stringify(f.current)};ut(n).then((o=>{C.current.totalDiscountPrice=o.dataObj.totalDiscountPrice,C.current.contractSettlOpno=o.dataObj.contractSettlOpno,N()}))};return{savePayPrice:()=>{if($o(u))return;(()=>{const{contractSettlOpno:o,totalDiscountPrice:t}=C.current;o&&0!=t&&y.current.push({contractSettlBlance:"UR",contractPmode:"0",contractSettlPmoney:t,contractSettlOpno:o})})(),zo(f.current,"[0].ocContractSettlList",[...y.current,...b.current]);const o={orderDomainStr:JSON.stringify(f.current)};U(o).then((o=>{Go("paymentMode",{code:o.dataObj.contractBillcode})}))},address:u,list:r,payState:C,coupon:a,confirm:o=>{const{couponAmount:t,usercouponCode:e,promotionCode:n,discAmount:c}=o;b.current=[{contractSettlBlance:"COP",contractPmode:"0",contractSettlGmoney:+t,contractSettlPmoney:+c,contractSettlOpno:e,contractSettlOpemo:n}],C.current.discount=c,N()},amount:h}}const ie={contractSettlBlance:"",contractEcurl:"",packageRemark:"",contractPmode:"",contractSettlGmoney:0,contractSettlPmoney:0,contractSettlOpno:"",contractSettlOpemo:"",freight:0,crp:{},_rechargeSmoney:0},re=et(ie);function se(o=o=>o){return c(re.subscribe,(()=>o(re.getState())))}function de(o){const{shoppingCountPrice:t,comDisMoney:e,shoppingType:n,pricesetRefrice:c}=a((()=>{const t={shoppingCountPrice:0,comDisMoney:0,shoppingType:"",pricesetRefrice:0};return o.forEach((o=>{const{shoppingCountPrice:e,comDisMoney:n}=o;t.shoppingCountPrice+=e,t.comDisMoney+=n})),o.length>0&&(t.shoppingType=o[0].shoppingType||"",t.pricesetRefrice=o[0].pricesetRefrice||0),t}),[o]);return{shoppingCountPrice:t,comDisMoney:e,shoppingType:n,pricesetRefrice:c,changeContent:o=>{const t=st(o);re.setState({packageRemark:t})}}}const ae={provinceName:"",cityName:"",areaName:"",addressDetail:"",addressMember:"",addressPhone:"",addressDefault:"",addressId:"",provinceCode:"",userName:""};function le(o,t,e,n){const[c,i]=d(ae);s((()=>{(()=>{rt(this,void 0,void 0,(function*(){try{const t=Mo(),e=yield L({isLocalMock:!t,needCache:!0}),n=(()=>{const t=Vo(e,"addressDefault","asc"),n=t.find((t=>o===t.addressId))||{};return $o(n)?t.at(-1):n})();$t.addressInfo=n,$t.contractPumode="0",i(n),r(null==n?void 0:n.provinceCode)}catch(o){}}))})()}),[o]);const r=o=>rt(this,void 0,void 0,(function*(){let c={};c=n?{shoppingGoodsIdStr:`[${decodeURIComponent(n)}]`}:{skuIdStr:JSON.stringify([{skuId:e,goodsNum:t}])};try{const t=Mo(),e=yield J(Object.assign(Object.assign({isLocalMock:!t},c),{areaCode:o}));re.setState({freight:e.dataObj})}catch(o){}}));return c}const ue={shoppingGoodsId:"",goodsNum:0,skuId:"",refreshNum:0},pe={dataPic:"",goodsName:"",goodsCamount:0,skuName:"",pricesetNprice:0},me={contractSettlOpno:0,upmMap:{},pricesetRefrice:0,rebMoney:0,goodsCamount:0,shoppingCountPrice:0,totalDiscountPrice:0,accountsSumPrice:0,discount:0,freight:0,comDisMoney:0,copyComDisMoney:0,shoppingType:"",promotionCode:"",promotionCodes:""},ye=({shoppingGoodsId:o,goodsNum:t,skuId:e})=>{const[n,c]=d([]),[r,l]=d([]),[u,p]=d([]),m=i([]),[y,g]=d(0),[f,h]=d(0),[v,S]=d(0),C=se(),{freight:b=0,crp:O}=C,P=it(C,["freight","crp"]),k=i(0);s((()=>{rt(void 0,void 0,void 0,(function*(){re.setState({freight:0,crp:{},packageRemark:"",_rechargeSmoney:0,contractSettlBlance:"",contractPmode:"",contractEcurl:"",contractSettlGmoney:0,contractSettlPmoney:0,contractSettlOpno:"",contractSettlOpemo:""}),o?yield T((()=>B({shoppingGoodsIdStr:`[${decodeURIComponent(o)}]`}))):yield T((()=>lt(e,t)))}))}),[]);const N=a((()=>P.contractSettlPmoney||0),[P]),L=a((()=>{const o=y-N+b-k.current-f-v;return o>=0?o:0}),[y,N,b,f,v]),I=a((()=>{const{contractSettlOpemo:o=0}=O;return L*+o/100}),[L,O]),M=a((()=>o=>{let t=0,e=0;o.forEach((o=>{t+=qo(o,"upmMap.disamount",0),e+=qo(o,"upmMap.integral",0)})),h(t),t>0&&m.current.push({contractSettlBlance:"INT",contractSettlPmoney:t,contractSettlGmoney:e})}),[]),D=(o,t)=>rt(void 0,void 0,void 0,(function*(){if($o(o))return;const e=o[0]&&o[0].shoppingType||"",n=o[0]&&o[0].pricesetRefrice||0;"06"===e?yield(o=>rt(void 0,void 0,void 0,(function*(){if(o)try{const t=yield Co({},!0),e=qo(t,"list[0].upointsNum",0),n=Number(o)||0,c=Math.min(n,e);h(c),c>0&&m.current.push({contractSettlBlance:"INT",contractSettlPmoney:c,contractSettlGmoney:c})}catch(o){console.error("查询用户积分失败",o),h(0)}else h(0)})))(n):(M(o),yield(o=>rt(void 0,void 0,void 0,(function*(){if($o(o))S(0);else try{const t=[];o.forEach((o=>{t.push({packageList:[{contractGoodsList:o}]})}));const e=Mo(),n={rsSkuListStr:JSON.stringify(t),isLocalMock:!e},c=yield ut(n,!0),i=qo(c,"dataObj.totalDiscountPrice",0),r=qo(c,"dataObj.contractSettlOpno","");S(i),i>0&&m.current.push({contractSettlBlance:"UR",contractSettlPmoney:i,contractSettlOpno:r})}catch(o){console.error("查询会员权益优惠失败",o)}})))(t))})),T=o=>rt(void 0,void 0,void 0,(function*(){try{const t=yield o(),{payState:e,shoppingGoodsList:n}=G(t);yield D(e,n)}catch(o){}})),G=o=>{if($o(o))return{payState:[],shoppingGoodsList:[]};let t=[],e=[],n=[];return m.current=[],o.forEach((o=>{const c=Object.assign({},me);c.shoppingType=o.shoppingType,c.pricesetRefrice=o.pricesetRefrice,c.upmMap=o.upmMap,k.current+=o.rebMoney;let i=[];o.shoppingpackageList.forEach((e=>{c.comDisMoney+=e.disMoney,c.copyComDisMoney+=e.disMoney;let n={channelCode:"",channelName:""};e.shoppingGoodsList.forEach(((o,i)=>{0===i&&(n=o),t.push(o),c.shoppingCountPrice+=o.pricesetNprice*o.goodsCamount,o.contractGoodsGtype=0,c.promotionCode=e.promotionCode,o.goodsType})),e.disMoney>0&&m.current.push({contractSettlBlance:0==e.promotionInType?"PM":8==e.promotionInType?"BMP":"COP",contractSettlGmoney:Number(e.disMoney.toFixed(2)),contractSettlPmoney:Number(e.disMoney.toFixed(2)),contractSettlOpno2:n.channelCode,contractSettlOpno1:n.channelName,contractSettlOpno:e.promotionCode,contractSettlOpemo:e.promotionName}),o.rebMoney>0&&m.current.push({contractSettlBlance:"REB",contractSettlGmoney:Number(o.rebMoney.toFixed(2)),contractSettlPmoney:Number(o.rebMoney.toFixed(2)),contractSettlOpno:e.promotionCode,contractSettlOpemo:e.promotionName,contractSettlOpno2:n.channelCode,contractSettlOpno1:n.channelName}),e.giftList&&(e.shoppingGoodsList=e.shoppingGoodsList.map((o=>(o.ginfoCode=o.pmPromotionList.find((o=>"0001"==o.pbCode)).promotionCode,o)))),i.push(...e.shoppingGoodsList,...e.giftList||[])})),n.push(c),e.push(i)})),l(n),c(e),p(t),j(n),{payState:n,shoppingGoodsList:t}},j=o=>{let t=0;o.forEach((o=>{const{shoppingCountPrice:e,totalDiscountPrice:n,discount:c,comDisMoney:i}=o;t+=e-n-c-i})),g(t)};return{amount:y,list:n,shoppingGoodsList:u,payState:r,ocContractSettlList:m,disCount:N,payPrice:L,creditMoney:I,orderStoreInfo:P,freight:b,rebMoney:k,pointsDeduction:f,urDiscount:v}},ge=()=>{const[o,t]=d([]);return s((()=>{rt(void 0,void 0,void 0,(function*(){const{list:o}=yield Zo("/web/pte/ptfpmode/queryPtfpmodesToStr.json");t(o)}))}),[]),{payList:o}},fe=(o=[])=>{const[t,e]=d([]),[n,c]=d(!1),[i,r]=d(),{payList:l}=ge(),[u,p]=d([]),[m,y]=d({urechargeId:""}),[g,f]=d(!1),[h,v]=d(!1),{crp:S,contractEcurl:C,contractPmode:b}=se();s((()=>{rt(void 0,void 0,void 0,(function*(){try{if($o(o))return;const t=yield q({pmContractGoodsDomainListStr:JSON.stringify(o)});e(t)}catch(o){console.log(74,o)}}))}),[o]),s((()=>{rt(void 0,void 0,void 0,(function*(){const o=yield Zo("web/crp/CrpUrecharge/queryCrpUrechargePage.json",{userinfoCode:xo("user").userInfoCode}),t=qo(o,"list[0]",{}),e=yield Zo("web/dd/falgSetting/queryFalgSettingPage.json",{flagSettingType:"creditSetting"});let n=qo(e,"list",[]);n.some((o=>0===o.flagSettingInfo))||n.unshift({flagSettingInfo:0}),p(n),re.setState({_rechargeSmoney:t.rechargeSmoney}),y(t)}))}),[]);const O=a((()=>S.contractSettlOpemo),[S]),P=a((()=>{const{ptfpmodeName:o=""}=l.find((o=>o.ptfpmodeType===b))||{};return o}),[l,b]),k=a((()=>(t.find((o=>o.promotionCode===i))||{}).promotionName),[i]),N=o=>{const{couponAmount:t,usercouponCode:e,promotionCode:n,discAmount:c}=o,i={contractSettlBlance:"COP",contractSettlGmoney:+t,contractSettlPmoney:+c,contractSettlOpno:e,contractSettlOpemo:n};re.setState(i)};return{coupon:t,visible:n,selectCoupon:k,onChange:o=>{const e=st(o),n=t.find((o=>o.promotionCode===e))||{};r(e),c(!1),N(n)},setVisible:c,creditList:u,creditInfo:m,creditVisible:g,setCreditVisible:f,onCreditChange:o=>{const t=st(o);f(!1),re.setState({crp:{contractSettlOpemo:t,contractSettlBlance:"CRP"}})},selectCredit:O,onPayChange:o=>{const t=st(o);v(!1),re.setState({contractPmode:t,crp:{},contractEcurl:""})},contractPmode:b,setPayVisible:v,payVisible:h,payList:l,payName:P,handleChooseImg:()=>{const o=jo(),t=process.env.REACT_APP_BASE_URL;o.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(e){o.uploadFile({url:`${process.env.REACT_APP_BASE_URL}web/oc/refund/uploadRefFile.json`,filePath:e.tempFilePaths[0],name:"file",header:{"saas-agent":"WEB"!==o.getEnv?"qj-wemini":"","saas-token":xo("saas-token")},success(o){const e=JSON.parse(o.data),n=Mo();if("nologin"===e.errorCode)Go(n?"/account/auth/index":"/account/mobileLogin/index");else{const o=t+e.fileUrl;re.setState({contractEcurl:o})}}})}})},contractEcurl:C}};function he({ocContractSettlList:o,payState:t,list:e},n="",c){const r=i([]),[s,a]=d(!1),{crp:l,_rechargeSmoney:u,contractPmode:p,contractEcurl:m,packageRemark:y}=se(),g=o=>{const{addressMember:c,userName:i,provinceCode:r,provinceName:s,cityName:d,areaName:a,addressDetail:g}=o;(o=>{if(o)return decodeURIComponent(o).split(",")})(n);let f={packageRemark:y};$o(l)||(f.creditType=l.contractSettlOpemo,f.creditAccount=u),m&&(f.contractEcurl=m),console.log(49,e);const h=$t.contractPumode||"0";return t.map(((o,t)=>Object.assign({contractPaytime:(new Date).valueOf(),goodsPbillno:0,goodsPmbillno:o.promotionCodes,contractProperty:"0",contractBlance:0,contractPmode:p,contractPumode:h,goodsSupplierName:"",goodsSupplierCode:"",packageList:[{contractGoodsList:e[t],shoppingGoodsIdList:(e[t]||[]).map((o=>o.shoppingGoodsId)),promotionCode:o.promotionCode,packageRemark:y}],packageMode:"",contractType:o.shoppingType,ocContractSettlList:[],goodsReceiptMem:c,goodsReceiptPhone:i,goodsReceiptArrdess:s+d+a+g,areaCode:r,contractNbillcode:null},f)))};return{savePayPrice:()=>rt(this,void 0,void 0,(function*(){const t=$t.addressInfo;if($o(t))return void Do("请选择收货地址");if(!p)return void Do("请选择支付方式");if("1"===p&&!m)return void Do("请上传附件");r.current=g(t);let e=$o(l)?o.current:[...o.current,l];e=e.map((o=>Object.assign(Object.assign({},o),{contractPmode:p}))),zo(r.current,"[0].ocContractSettlList",e),a(!0);const i={orderDomainStr:JSON.stringify(r.current)};try{const o=yield U(i);(()=>{if(n){const{CartList:o=0}=To();Bo({CartList:o+1})}})();const{contractBillcode:t,contractBbillcode:e}=qo(o,"dataObj",{contractBillcode:"",contractBbillcode:""});p+""=="1"||"100"==l.creditType||0===c?Ao("result",{code:t}):Go("paymentMode",{contractBillcode:t,contractBbillcode:e})}catch(o){}finally{a(!1)}})),loading:s}}const ve={provinceName:"",cityName:"",areaName:"",addressDetail:"",addressMember:"",addressPhone:"",userinfoOcode:""};function Se(o){const[t,e]=d(ve);return s((()=>{(()=>{rt(this,void 0,void 0,(function*(){try{const t={page:1,rows:10};o&&(t.userinfoOcode=o);const n=Mo(),c=yield Oo(Object.assign(Object.assign({},t),{isLocalMock:!n})),i=Array.isArray(c&&c.list)?c.list.map((o=>Object.assign(Object.assign({},o),{addressMember:o.userinfoCompname||"",addressPhone:o.userinfoTel||"",addressDetail:o.companyAddress||""}))):[],r=(()=>{const t=i.find((t=>o===t.userinfoOcode))||{};return $o(t)?i&&i[0]||{}:t})();$t.addressInfo=r,$t.contractPumode="1",e(r),re.setState({freight:0})}catch(o){}}))})()}),[o]),t}const Ce={success:{icon:"zhifuchenggong",msg:"支付成功",buttonText:"查看订单",menuCode:"orderDetail",color:"#2ed82e"},error:{icon:"zhifushibai",info:"您的订单将保留15分钟,可点击下方“去支付”完成订单",buttonText:"去支付",menuCode:"paymentMode",color:"red"}};function be(o){const[t,e]=d({icon:"daifahuo1",msg:"支付中",color:"#2ed82e",buttonText:"去支付",dataObj:{}}),[n,c]=d(!1),i=Mo();return s((()=>{(()=>{rt(this,void 0,void 0,(function*(){const t=qo(Eo,"taroMenu[0].menuOpcode","index");if(i){jo().setStorageSync("menuOpcode",t)}c(!0);try{const t=yield $({contractBillcode:o,isLocalMock:!i}),{sysRecode:n,dataObj:c}=t,r=it(t,["sysRecode","dataObj"]);e(Object.assign(Object.assign({dataObj:c,sysRecode:n},r),Ce[n]))}catch(t){e(Object.assign({dataObj:{contractBillcode:o},msg:t},Ce.error))}finally{c(!1)}}))})()}),[]),{result:t,loading:n}}function Oe(o,t){const[e,n]=d(o);return s((()=>{const e=t.filter((o=>!(Wo(o)||$o(o)))).filter((o=>!Object.values(o).every((t=>Wo(t)||$o(o)))));let c=o;$o(e)||(c=e),n(c)}),[t]),e}const Pe=[{name:"全部",code:""},{name:"待付款",code:"1"},{name:"待发货",code:"2"},{name:"待确认",code:"30"},{name:"待收货",code:"3"},{name:"已完成",code:"4,5"},{name:"待评价",code:"4,5"},{name:"已评价",code:"4,5"},{name:"已取消",code:"-1"}],ke=o=>{const{name:t=""}=Pe.find((t=>t.code.split(",").includes(o+"")))||{};return t},Ne={1:[{name:"取消订单",handler:"cancel"},{name:"立即支付",handler:"pay"}],3:[{name:"物流信息",handler:"expressInfo"},{name:"确认收货",handler:"confirmReceive"}],4:[{name:"去评价",handler:"evaluate"}],5:[{name:"查看评价",handler:"openEvaluate"}]};function Le({dataState:o="",contractId:t,contractBillcode:e,init:n}){const c=a((()=>Ne[o+""]||[]),[o]),i=(()=>({expressInfo:()=>{Go("expressInfo",{code:e})},pay:()=>{Go("paymentMode",{contractBillcode:e})},evaluate:()=>{Go("evaluateDetail",{code:e})},openEvaluate:()=>{Go("evaluateViewDetail",{code:e})},confirmReceive:()=>rt(this,void 0,void 0,(function*(){try{const{msg:o}=yield V({contractBillcode:e});Do(o,"none"),setTimeout((()=>{null==n||n()}),500)}catch(o){}})),cancel:()=>rt(this,void 0,void 0,(function*(){try{const{msg:o}=yield _({contractId:t});Do(o,"none"),setTimeout((()=>{null==n||n()}),500)}catch(o){}}))}))();return{handlerImpl:o=>{i[o]()},operateArray:c}}const Ie={contractBillcode:"",goodsList:[{dataPic:"",goodsName:"",dataBmoney:0,goodsCamount:0,contractGoodsId:0,dataState:0}],dataBmoney:0,dataBnum:0,dataState:0,contractId:"",contractAppraise:0};function Me(o,t){const e=i(!1),[n,c]=d(!1),[r,a]=d([Ie]),l=i(0);s((()=>{u()}),[t]);const u=yt((()=>{e.current=!1,l.current=0,p()})),p=yt((()=>rt(this,void 0,void 0,(function*(){if(e.current)return;c(!0),++l.current;const{code:t}=o;try{const o=Mo(),n=(yield Y({page:l.current,rows:10,isLocalMock:!o,childFlag:!0,dataStateStr:t})).list||[];e.current=$o(n)||n.length<10,a((o=>1!==l.current?o.concat(n):n)),c(!1)}catch(o){}}))));return{onScroll:p,data:r,loading:n,init:u,countdownCancel:o=>rt(this,void 0,void 0,(function*(){yield z({contractId:o})}))}}const De={goodsList:[],contractPmode:"0",creditMoney:0,contractEcurl:"",dataState:"",goodsLogmoney:0,packageRemark:"",goodsReceiptMem:"",goodsReceiptPhone:"",goodsReceiptArrdess:"",dataBmoney:0,goodsPmoney:0,contractInmoney:0,contractBillcode:"",refundMoney:0,gmtCreate:"",goodsNum:0,contractId:0,contractPumode:"0"},Te=o=>{const[t,e]=d(""),n=Mo(),[c,i]=d(De);s((()=>{rt(void 0,void 0,void 0,(function*(){try{const t=yield W({contractBillcode:o,isLocalMock:!n});if($o(t))return;e(ke(t.dataState)),i(t)}catch(o){console.log(45,o)}}))}),[]);const r=a((()=>qo(c,"packageList[0].packageRemark","")),[c]),l=a((()=>{const o=qo(c,"ocContractSettlList",[])||[],{contractSettlGmoney:t=0}=o.find((o=>"CRP"===o.contractSettlBlance))||{contractSettlGmoney:0};return t}),[c]);return{orderDetail:c,status:t,handleApplyBtn:(o,t)=>rt(void 0,void 0,void 0,(function*(){try{const{contractBillcode:e,skuCode:n}=o,c=yield H({contractBillcode:e,skuCode:n});if(!1===c.success)return void Vt(c.msg,"none");Go("refundType",{contractBillcode:e,skuCode:n,dataState:t})}catch(o){console.log(o)}})),creditMoney:l,packageRemark:r}},Be={0:"在途",1:"揽收",2:"疑难",3:"签收",4:"退签",5:"派件",8:"清关",14:"拒签"},Ge=o=>{const[t,e]=d({}),[n,c]=d({});return s((()=>{rt(void 0,void 0,void 0,(function*(){try{const t=Mo(),n=yield W({contractBillcode:o,isLocalMock:!t});e(n);const i=qo(n,"packageList[0].expressCode",""),r=qo(n,"packageList[0].packageBillno"),s=yield K({expressNo:r,expressType:i,isLocalMock:!t});c(JSON.parse(s.dataObj))}catch(o){console.log(o)}}))}),[]),{info:t,detail:n,stateObj:Be}};function je(){const[o,t]=d(""),[e,n]=d([]),c=Mo();s((()=>{i()}),[]);const i=()=>rt(this,void 0,void 0,(function*(){try{let o=yield Q();n(o||[]);const e=qo(o,"[0].goodsClassCode");t(e)}catch(o){console.log(o)}}));return{activeKey:o,navList:e,flag:c,setActiveKey:t}}const we=(o=0)=>{const[t,e]=d([{collectOpcont:"",collectOpnum:""}]),n=i(1),[c,r]=d(!1),[a,l]=d(""),[u,p]=d(!1),[m,y]=d(""),[g,f]=d(!1);s((()=>{h()}),[]);const h=()=>{n.current=1,e([]),S()},S=()=>rt(void 0,void 0,void 0,(function*(){try{const t=yield v({row:10,page:n.current,collectType:o});e((o=>o.concat(qo(t,"list",[])))),n.current+=1}catch(o){return console.log(o),[]}})),C=()=>{let o=[];for(let e=0;e<t.length;e++)o.push(t[e].collectCode);return o.toString()};return{collectionList:t,edit:c,setEdit:r,getData:S,collectCodeStr:a,getSelectItem:o=>{const e=st(o);l(e.toString()),e.length===t.length?f(!0):f(!1)},delItem:()=>rt(void 0,void 0,void 0,(function*(){try{yield X({collectCodeStr:a}),n.current=1,h()}catch(o){console.log(o)}})),init:h,checked:u,setChecked:p,handleSelectAll:o=>{st(o).length?(p(!0),l(C())):p(!1)},selectAll:m,setSelectAll:y,selectAllChecked:g}},Ae=o=>{const[t,e]=d([]),n=i([]),c=i({}),r=Mo();s((()=>{rt(void 0,void 0,void 0,(function*(){yield u(),yield a()}))}),[]);const a=()=>rt(void 0,void 0,void 0,(function*(){try{const t=yield W({contractBillcode:o,isLocalMock:!r}),n=l(qo(t,"goodsList",[])),{contractBillcode:i,memberBcode:s,memberBname:d,memberCode:a,memberName:u}=n[0];c.current={contractBillcode:i,memberBcode:s,memberBname:d,memberCode:a,memberName:u},e(n)}catch(o){console.log(o)}})),l=o=>{for(let t=0;t<o.length;t++)o[t].upImgLength=!0,o[t].upImg=[],o[t].evaluateGoodsImgs="",o[t].evaluateScopeList=[n.current[0]],o[t].evaluateGoodsContent="";return o},u=()=>rt(void 0,void 0,void 0,(function*(){try{const o=yield Z({applyTarget:"goods",isLocalMock:!r});n.current=o[0].templateValuesReList}catch(o){console.log(o)}}));return{orderInfo:t,changeStar:(o,c)=>{const i=[...t],r=[];for(let o=0;o<c;o++)r.push(n.current[o]);i[o].evaluateScopeList=r,e(i)},Submit:()=>rt(void 0,void 0,void 0,(function*(){try{yield oo({paramStr:JSON.stringify(t)}),yield to(Object.assign({paramStr:JSON.stringify(t)},c.current)),Go("orderlist")}catch(o){console.log(o)}})),changeContent:(o,n)=>{const c=[...t];c[o].evaluateGoodsContent=st(n),e(c)}}},Re=o=>{const[t,e]=d([]),n=Mo(),c=jo();s((()=>{rt(void 0,void 0,void 0,(function*(){yield i()}))}),[o]);const i=()=>rt(void 0,void 0,void 0,(function*(){try{const t=yield Po({contractBillcode:o,isLocalMock:!n}),c=qo(t,"list",[]);e(c)}catch(o){console.log(o)}}));return{orderInfo:t,handleDelete:()=>rt(void 0,void 0,void 0,(function*(){try{const o=(t[0]||{}).evaluateGoodsId||8215;if(!o)return;yield ko({evaluateGoodsId:o,isLocalMock:!n}),yield Do("删除成功","none"),c.navigateBack({delta:1})}catch(o){console.log(o)}}))}},xe=()=>{const[o,t]=d([]),e=i(1),[n,c]=d(!1),[r,a]=d(""),[l,u]=d(!1),[p,m]=d(""),[y,g]=d(!1),[f,h]=d(!1),v=i(!1);s((()=>{S()}),[]);const S=()=>rt(void 0,void 0,void 0,(function*(){e.current=1,v.current=!1,t([]),yield C()})),C=()=>rt(void 0,void 0,void 0,(function*(){var o;if(!v.current){h(!0);try{const n=yield eo({rows:10,page:e.current});if(0===(null===(o=n.list)||void 0===o?void 0:o.length))return;if(t((o=>1===e.current?n.list:o.concat(n.list||[]))),n.list.length<10)return void(v.current=!0);e.current+=1}catch(o){return t([]),[]}finally{h(!1)}}})),b=()=>{let o=[];for(let t=0;t<collectionList.length;t++)o.push(collectionList[t].collectCode);return o.toString()};return{footprintList:o,edit:n,setEdit:c,getData:C,getSelectItem:o=>{const t=st(o);a(t.toString())},delItem:()=>rt(void 0,void 0,void 0,(function*(){try{yield no({footprintCodeStr:r}),yield S(),c(!1)}catch(o){console.log(o)}})),init:S,checked:l,setChecked:u,handleSelectAll:o=>{st(o).length?(u(!0),setCollectCodeStr(b())):u(!1)},selectAll:p,setSelectAll:m,selectAllChecked:y,loading:f}};function Ee(o){const[t,e]=d([]);s((()=>{(()=>{rt(this,void 0,void 0,(function*(){try{const t=yield co({page:1,rows:o,dataState:1}),n=qo(t,"list",[]);e(n)}catch(o){}}))})()}),[o]);return{content:a((()=>t.map((o=>o.noticeTitle))),[t]),navigator:o=>{const e=qo(t,`${o}.noticeId`,"");Go("noticeDetail",{noticeId:e})}}}const Fe=o=>{const[t,e]=d({});s((()=>{rt(void 0,void 0,void 0,(function*(){yield n()}))}),[]);const n=()=>rt(void 0,void 0,void 0,(function*(){try{const t=yield io({noticeId:o});e(t)}catch(o){console.log(o)}}));return{info:t,setInfo:e}},Je={doclistTitle:"",doclistTitle4:"",doclistContent:""},Ue=o=>{const[t,e]=d(Je);return s((()=>{rt(void 0,void 0,void 0,(function*(){try{const t=Mo(),n=yield ro({doclistId:o,isLocalMock:!t});e(n)}catch(o){console.log(o)}}))}),[]),{info:t}},qe=({defaultValue:o,goods:t},e)=>{const[n,c]=d(o),r=i();return s((()=>{Ho(r.current,t)||(r.current=t,$o(t)?c(o):rt(void 0,void 0,void 0,(function*(){try{const o=yield R({[e]:t.toString(),distinctField:"goodsNo",goodsType:"00,40"});c(o.list)}catch(t){c(o)}})))}),[t]),{list:n}},$e=o=>{const[t,e]=d([]),[n,c]=d([]),{coupons:i,defaultValue:r}=o;s((()=>{a()}),[i]);const a=()=>rt(void 0,void 0,void 0,(function*(){if(0!==i.length)try{const o=yield so({promotionCode:null==i?void 0:i.join(","),list:1});e(qo(o,"list",[]))}catch(o){console.log(o)}else e(r)}));return{list:t,setList:e,takeCoupon:o=>rt(void 0,[o],void 0,(function*({promotionCode:o,couponAmount:t,index:e}){try{yield g({promotionCode:o,couponAmount:t})}catch(o){console.log(41,o)}finally{c((o=>o.concat(e)))}})),takeList:n}},Ve=t([{},Jo]);function _e({initialValue:t,children:e}){return o(Ve.Provider,{value:d(t||{}),children:e})}function Ye(){const o=n(Ve);return o||[{},Jo]}const ze=()=>{const[,o]=Ye();return{goTop:()=>{o((o=>{const{scrollTop:t}=o;return Object.assign(Object.assign({},o),{scrollTop:0===t?1:0})}))}}},We=({params:o})=>{const t=i([]),[e,n]=d([]),c=i(0),r=i(10);s((()=>{c.current=0,t.current=[],a()}),[o]);const a=()=>rt(void 0,void 0,void 0,(function*(){const e=Mo();++c.current;try{const i=yield ao({isLocalMock:!e,pbCode:o,list:1,page:c.current,rows:r.current}),s=qo(i,"list",[]);t.current.push(...s),n(t.current)}catch(o){console.log(o)}}));return{list:e,getData:a}},He=({contractBillcode:o,skuCode:t})=>{const[e,n]=d({}),[c,i]=d(!1),[r,a]=d(1),[l,u]=d(0),[p,m]=d(!1),[y,g]=d(!1);s((()=>{rt(void 0,void 0,void 0,(function*(){yield f()}))}),[]);const f=()=>rt(void 0,void 0,void 0,(function*(){m(!0);try{const e=Mo(),c=(yield lo({contractBillcode:o,skuCode:t,isLocalMock:!e})).dataObj,{contractGoodsMoney:i,contractGoodsAremoney:r,goodsCamount:s,contractGoodsArefnum:d}=c,l=+i-+r;if(n(c),.01===l)return u(l),g(!0),void a(+s-+d);u(c.contractGoodsPrice)}catch(o){console.log(o)}finally{m(!1)}}));return{typeTip:c,setTypeTip:i,goodsNum:r,handleStep:o=>{if(y)return;const{goodsCamount:t,contractGoodsArefnum:n,contractGoodsMoney:c,contractGoodsAremoney:i,contractGoodsPrice:s}=e;if("plus"===o){const o=+t-+n;if(r>=o)return;u(o===r+1?c-i:(r+1)*s),a((o=>o+1))}else if("minus"===o){if(1===r)return;u((r-1)*s),a((o=>o-1))}},goodsInfo:e,goApply:(o,t,e,n)=>{Go("afterSalesApply",{refundType:o,contractBillcode:t,skuCode:e,goodsNum:n,goodsPrice:l})},loading:p,goodsPrice:l,stepLock:y}},Ke=Fo(),Qe=({contractBillcode:o,skuCode:t})=>{const[e,n]=d([]),[c,i]=d(!1),[r,a]=d(!1),[l,u]=d(""),[p,m]=d([]),[y,g]=d({}),[f,h]=d(""),[v,S]=d(!1),C=Mo();s((()=>{rt(void 0,void 0,void 0,(function*(){yield O()}))}),[]);const b=(o=0)=>o?o.toLocaleString("en-Us",{minimumFractionDigits:2}):"0",O=()=>rt(void 0,void 0,void 0,(function*(){try{const e=yield lo({contractBillcode:o,skuCode:t,isLocalMock:!C});g(e.dataObj)}catch(o){console.log(o)}})),P=o=>o.map((o=>({refundFileUrl:o})));return{tip:"请与商家协商,确认达成一致后填写协商好的退款金额。",reasonList:e,popupVisible:c,popupLoading:r,handlePopupShow:()=>rt(void 0,void 0,void 0,(function*(){i((o=>!o)),c||0!==e.length||(yield rt(void 0,void 0,void 0,(function*(){a(!0);try{const o=yield po({isLocalMock:!C});n(o)}catch(o){console.log(o)}finally{a(!1)}})))})),handleChooseReason:o=>{u(st(o)),i(!1)},reason:l,handleChooseImg:()=>{const o=jo();o.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(t){o.uploadFile({url:`${Ke}web/oc/refund/uploadRefFile.json`,filePath:t.tempFilePaths[0],name:"file",header:{"saas-agent":"qj-wemini","saas-token":xo("saas-token")},success(o){const t=JSON.parse(o.data),e=Mo();if("nologin"===t.errorCode)Go(e?"/account/auth/index":"/account/mobileLogin/index");else{const o=Ke+t.fileUrl;m((t=>[...t,o]))}}})}})},placeholder:"描述补充,有助于商家更好的处理售后问题",imgGroup:p,handleDelImg:o=>{m((t=>[...t.slice(0,o),...t.slice(o+1)]))},limit:3,goodsInfo:y,handleFillInReason:o=>{h(st(o))},handleSubmit:(o,t,e,n)=>rt(void 0,void 0,void 0,(function*(){const{contractGoodsCode:c,goodsCamount:i,contractGoodsPrice:r}=y;if(!l)return void Vt("请填写退款信息","none");S(!0);const s={ocRefundGoodsBeanList:[{memberCcode:y.memberCcode,contractGoodsCode:c,goodsCamount:i,refundGoodsNum:+o,refundGoodsAmt:b(n/+o)}],contractBillcode:t,refundMoney:n,refundEx:l,refundMeo:f,ocRefundFileDomainList:P(p),refundType:e};try{const o=yield uo({params:JSON.stringify(s)});o.success&&(Vt(o.msg),setTimeout((()=>{Go("afterSalesList")}),1e3))}catch(o){console.log(o)}finally{S(!1)}})),loading:v}},Xe=({refundCode:o})=>{const[t,e]=d({}),[n,c]=d([]),[i,r]=d(!1),[a,l]=d(""),[u,p]=d(""),[m,y]=d(""),[g,f]=d(!1),h=Mo();s((()=>{rt(void 0,void 0,void 0,(function*(){yield v()}))}),[]);const v=()=>rt(void 0,void 0,void 0,(function*(){f(!0);try{Xo(mo);const t=yield mo({refundCode:o,isLocalMock:!h});1===t.dataState&&(yield S()),e(t)}catch(o){console.log(o)}finally{f(!1)}})),S=()=>rt(void 0,void 0,void 0,(function*(){try{const o=yield go({dataState:1});c(o.list)}catch(o){console.log(o)}}));return{setAfterSalesDetailInfo:e,afterSalesDetailInfo:t,submitExpressInfo:()=>rt(void 0,void 0,void 0,(function*(){if(a&&u&&m)try{yield yo({packageBillno:a,refundCode:o,packageCode:u,packageName:m}),Xo(mo),yield v()}catch(o){console.log(o)}else Vt("请填写完成信息","error")})),companyList:n,handleCancelAfterSales:t=>rt(void 0,void 0,void 0,(function*(){try{yield fo({goodsCode:t,refundCode:o}),Xo(mo),yield v()}catch(o){console.log(o)}})),popupShow:i,handlePopupShow:()=>{r((o=>!o))},chooseCompany:o=>{const t=st(o).split("-");y(t[0]),p(t[1]),r(!1)},packageName:m,setPackageBillno:l,loading:g}},Ze=(o,t)=>{const e=i(!1),[n,c]=d(!1),[r,a]=d([]),l=i(0),[u,p]=d(!0),m=Mo();s((()=>{y()}),[t]);const y=yt((()=>{l.current=0,a([]),g()})),g=yt(((...t)=>rt(void 0,[...t],void 0,(function*(t={}){if(e.current)return;c(!0),++l.current;const{code:n}=o;try{const o=yield ho({page:l.current,rows:10,dataStates:n,isLocalMock:!m});e.current=$o(o.list)||o.list.length<10,0===o.list.length&&p(!1),a((t=>t.concat(o.list||[])))}catch(o){--l.current,console.log(o)}finally{c(!1)}}))));return{afterSalesList:r,onScroll:g,loading:n,init:y,goAfterSalesDetail:o=>{Go("afterSalesDetail",{refundCode:o})},haseData:u}},on=[{name:"全部",code:""},{name:"进行中",code:"0,1,2,3,4,5"}],tn=()=>({mySettingGoBind:()=>{Go(Ut.confirmPhone)},mySettingLogout:()=>rt(void 0,void 0,void 0,(function*(){const o=jo();try{const t=yield vo();o.removeStorage({key:"saas-token"}),Vt(t.msg),setTimeout((()=>{wo(1)}),1e3)}catch(o){console.log(o)}}))});function en(o){const t=i(!1),[e,n]=d(!1),[c,r]=d([]),[a,l]=d(!0),u=i(0);s((()=>{m()}),[o]);const p=yt((o=>rt(this,void 0,void 0,(function*(){n(!0);try{const e=Mo(),n=((yield Oo({page:o,rows:10,isLocalMock:!e})).list||[]).map((o=>Object.assign(Object.assign({},o),{addressMember:o.userinfoCompname||"",addressPhone:o.userinfoTel||"",addressDetail:o.companyAddress||""})));t.current=$o(n)||n.length<10,r((t=>1===o?n:t.concat(n))),u.current=o,l(!1)}catch(t){1!==o&&--u.current,l(!1)}finally{n(!1)}})))),m=yt((()=>{t.current=!1,u.current=0,r([]),l(!0),p(1)}));return{list:c,loading:e,skullShow:a,onScroll:yt((()=>rt(this,void 0,void 0,(function*(){if(t.current)return;const o=u.current+1;yield p(o)})))),init:m}}function nn(o){return{handlerImpl:()=>{Bo({PlaceOrderPickupAddress:o.userinfoOcode,PlaceOrderAddressTabs:{userinfoOcode:o.userinfoOcode}}),wo(-1)}}}const cn=()=>{const[o,t]=d(0),[e,n]=d([]),[c,i]=d(!1),[r,a]=d(!1);s((()=>{l()}),[]);const l=()=>rt(void 0,void 0,void 0,(function*(){i(!0);try{yield u(),yield p()}catch(o){console.log("初始化签到数据失败:",o)}finally{i(!1)}})),u=()=>rt(void 0,void 0,void 0,(function*(){var o;try{const e=null===(o=(yield No({})).list)||void 0===o?void 0:o.find((o=>"CheckIn"===o.pointsRuleApi));e&&t(e.pointsRuleNum||0)}catch(o){console.log("获取签到积分失败:",o)}})),p=()=>rt(void 0,void 0,void 0,(function*(){try{const o=ot(),t=o.year(),e=o.month()+1,c=((yield Lo({year:t,month:e})).list||[]).map((o=>ot(o.gmtCreate).format("YYYY-MM-DD")));n(c)}catch(o){console.log("获取签到记录失败:",o)}}));return{pointsNum:o,signedDates:e,loading:c,signing:r,handleSignin:()=>rt(void 0,void 0,void 0,(function*(){if(r)return;const t=ot(),n=t.format("YYYY-MM-DD");if(e.includes(n)){if(Mo()){jo().showToast({title:"今日已签到",icon:"none",duration:2e3})}}else{a(!0);try{yield Io({signMap:t.date(),pointsNum:o,signAddr:"0",signLat:"0",signLong:"0"}),yield p();if(Mo()){jo().showToast({title:`签到成功,获得${o}积分`,icon:"success",duration:2e3})}}catch(o){console.log("签到失败:",o);if(Mo()){jo().showToast({title:o.msg||"签到失败,请重试",icon:"none",duration:2e3})}}finally{a(!1)}}})),refreshSignList:p}},rn=o=>{const[t,e]=d([]),[n,c]=d(!1);s((()=>{i()}),[o]);const i=()=>rt(void 0,void 0,void 0,(function*(){c(!0);try{const t=o.year(),n=o.month()+1,c=((yield Lo({year:t,month:n})).list||[]).map((o=>({date:ot(o.signTime||o.gmtCreate).format("YYYY-MM-DD"),points:o.pointsNum||0})));e(c)}catch(o){console.log("获取签到明细失败:",o),e([])}finally{c(!1)}}));return{signinDetails:t,loading:n,refresh:i}};export{_e as ApplicationContext,At as StoreProvider,at as addCardSku,ae as addressInitial,on as afterSalesTabConfig,dt as checkSkuSpec,kt as computedParams,et as createStore,Ne as detailButton,Yt as formatTime,pt as getGoodDetail,st as getRadioValue,ut as getTotalDiscountPriceImpl,pe as goodListIntialValue,ne as goodListMock,nt as goodStore,ie as initalOrderValue,Nt as initialCoupon,vt as initialValue,me as initialValueOrder,tt as makeStore,_t as navigator,ue as orderGoodValue,ke as orderStatusImpl,Pe as orderStatusList,re as orderStore,Ie as orderType,ve as pickupAddressInitial,mt as popupImplement,lt as queryToContractImpl,Ut as routerMap,qt as routerMapArr,Vt as showToast,ft as useAddCoupon,gt as useAddShopping,wt as useAddressItem,jt as useAddressList,Qe as useAfterSalesApply,He as useAfterSalesChooseType,Xe as useAfterSalesDetail,Ze as useAfterSalesList,$e as useAllCoupon,Ye as useApplicationContext,Ue as useArticleDetail,Ct as useBanner,Et as useCartItem,Ft as useCartList,Jt as useCartListNext,zt as useCartOperate,Wt as useCartTop,we as useCollectionList,Lt as useCoupon,Ht as useCouponList,ht as useCreatePoster,Oe as useCube,xt as useDispatchImpl,Gt as useEditAddress,Mt as useEvaluate,Ae as useEvaluateDetail,Re as useEvaluateViewDetail,Ge as useExpressInfo,xe as useFootprint,ze as useGoTop,Ot as useGoodCollection,St as useGoodDetail,Tt as useGoodFootprint,Pt as useGoodSku,ct as useGoodSkuStore,Bt as useGoodSpecAndPrice,qe as useGoods,je as useGoodsClassify,Zt as useGoodsList,Dt as useGoodsShare,yt as useImmutableCallback,We as useMarketingPromotion,cn as useMemberSignin,tn as useMySetting,Ee as useNotice,Fe as useNoticeDetail,le as useOrderAddress,fe as useOrderCoupon,Te as useOrderDetail,ye as useOrderGood,de as useOrderInfo,Me as useOrderList,Le as useOrderOperate,he as useOrderPay,Se as useOrderPickupAddress,oe as useOrderResult,be as useOrderResultResult,Xt as useOverdue,ge as usePayMode,nn as usePickupPointItem,en as usePickupPointList,ce as usePlaceOrder,It as usePromotion,rn as useSigninDetail,Rt as useStore,se as useSyncOrderStore,Kt as useUnused,Qt as useUsed,$t as userAddressData};
@@ -0,0 +1 @@
1
+ export * from './useEvaluateViewDetail';
@@ -0,0 +1,4 @@
1
+ export declare const useEvaluateViewDetail: (code: string) => {
2
+ orderInfo: any[];
3
+ handleDelete: () => Promise<void>;
4
+ };
@@ -0,0 +1 @@
1
+ export * from './hooks';
@@ -1,8 +1,5 @@
1
1
  import { actionName } from '../utils';
2
- export declare function useAddShopping(goodsCode: string, skuInfo: Object, rsSkuDomainList: Array<any>, dispatchPageStore?: {
3
- (...args: any[]): void;
4
- (...args: any[]): void;
5
- }): {
2
+ export declare function useAddShopping(goodsCode: string, skuInfo: Object, rsSkuDomainList: Array<any>, dispatchPageStore?: (...args: any[]) => void): {
6
3
  closePopup: () => void;
7
4
  addCardImpl: () => Promise<void>;
8
5
  cashImpl: () => Promise<void>;
@@ -16,10 +16,7 @@ type ActionInterface = {
16
16
  payload?: Partial<GoodsDetailType>;
17
17
  };
18
18
  export declare function getGoodDetail(skuCode: string): any;
19
- export declare function popupImplement(dispatchPageStore?: {
20
- (...args: any[]): void;
21
- (...args: any[]): void;
22
- }): {
19
+ export declare function popupImplement(dispatchPageStore?: (...args: any[]) => void): {
23
20
  dispatch: (action: ActionInterface) => void;
24
21
  openPopup: () => void;
25
22
  closePopup: () => void;
@@ -16,6 +16,7 @@ export * from './expressInfo';
16
16
  export * from './goodsClassify';
17
17
  export * from './collectionList';
18
18
  export * from './evaluateDetail';
19
+ export * from './evaluateViewDetail';
19
20
  export * from './footprint';
20
21
  export * from './notice';
21
22
  export * from './noticeDetail';
@@ -27,3 +28,5 @@ export * from './marketing';
27
28
  export * from './afterSales';
28
29
  export * from './account';
29
30
  export * from './pickupPointList';
31
+ export * from './memberSignin';
32
+ export * from './signinDetail';
@@ -0,0 +1 @@
1
+ export * from './useMemberSignin';
@@ -0,0 +1,8 @@
1
+ export declare const useMemberSignin: () => {
2
+ pointsNum: number;
3
+ signedDates: string[];
4
+ loading: boolean;
5
+ signing: boolean;
6
+ handleSignin: () => Promise<void>;
7
+ refreshSignList: () => Promise<void>;
8
+ };
@@ -0,0 +1 @@
1
+ export * from './hooks';
@@ -13,6 +13,10 @@ export declare const goodListIntialValue: {
13
13
  };
14
14
  export declare const initialValueOrder: {
15
15
  contractSettlOpno: number;
16
+ upmMap: {};
17
+ pricesetRefrice: number;
18
+ rebMoney: number;
19
+ goodsCamount: number;
16
20
  shoppingCountPrice: number;
17
21
  totalDiscountPrice: number;
18
22
  accountsSumPrice: number;
@@ -23,21 +27,17 @@ export declare const initialValueOrder: {
23
27
  shoppingType: string;
24
28
  promotionCode: string;
25
29
  promotionCodes: string;
26
- pricesetRefrice: string;
27
- upmMap: {};
28
30
  };
29
31
  export declare const useOrderGood: ({ shoppingGoodsId, goodsNum, skuId }: Partial<typeof orderGoodValue>) => {
30
32
  amount: number;
31
- list: {
32
- dataPic: string;
33
- goodsName: string;
34
- goodsCamount: number;
35
- skuName: string;
36
- pricesetNprice: number;
37
- }[];
33
+ list: any[];
38
34
  shoppingGoodsList: any[];
39
35
  payState: {
40
36
  contractSettlOpno: number;
37
+ upmMap: {};
38
+ pricesetRefrice: number;
39
+ rebMoney: number;
40
+ goodsCamount: number;
41
41
  shoppingCountPrice: number;
42
42
  totalDiscountPrice: number;
43
43
  accountsSumPrice: number;
@@ -48,8 +48,6 @@ export declare const useOrderGood: ({ shoppingGoodsId, goodsNum, skuId }: Partia
48
48
  shoppingType: string;
49
49
  promotionCode: string;
50
50
  promotionCodes: string;
51
- pricesetRefrice: string;
52
- upmMap: {};
53
51
  }[];
54
52
  ocContractSettlList: import("react").MutableRefObject<any[]>;
55
53
  disCount: any;
@@ -3,6 +3,6 @@ export declare function useOrderInfo(payState: Array<typeof initialValueOrder>):
3
3
  shoppingCountPrice: number;
4
4
  comDisMoney: number;
5
5
  shoppingType: string;
6
- pricesetRefrice: string;
6
+ pricesetRefrice: number;
7
7
  changeContent: (e: any) => void;
8
8
  };
@@ -0,0 +1 @@
1
+ export * from './useSigninDetail';
@@ -0,0 +1,10 @@
1
+ import dayjs from 'dayjs';
2
+ export interface SigninDetailItem {
3
+ date: string;
4
+ points: number;
5
+ }
6
+ export declare const useSigninDetail: (selectedDate: dayjs.Dayjs) => {
7
+ signinDetails: SigninDetailItem[];
8
+ loading: boolean;
9
+ refresh: () => Promise<void>;
10
+ };
@@ -0,0 +1 @@
1
+ export * from './hooks';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qj-b2c-store",
3
- "version": "1.6.3",
3
+ "version": "1.6.5",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "scripts": {