1 |
- import{b9 as t,aw as s,U as u}from"./index-9880b451.js";import{a as n}from"./index.df38848e.js";function a(t,s){return o("exact"!==t&&s<10?"销量":"已售",t,s)}function e(t,s){return o("库存",t,s)}function o(t,s,u){if(u=u||0,"exact"===s)return t+u;if(u<10)return`${t}≤10`;let n=Math.pow(10,`${u}`.length-1);return`${t}${u/n*n}+`}const r=[".avi",".mp4"];function i(s){return(null==s?void 0:s.filter((t=>t)).map(((s,u)=>({type:r.some((t=>s.includes(t)))?"video":"image",src:t.cdn(s)}))))||[]}function c(t){return 0===t.status?"info-color":10===t.status||20===t.status||30===t.status&&!t.commentStatus?"warning-color":30===t.status&&t.commentStatus?"success-color":"danger-color"}function p(t){return 0===t.status?"待付款":10===t.status&&1===t.deliveryType?"待发货":10===t.status&&2===t.deliveryType?"待核销":20===t.status?"待收货":30!==t.status||t.commentStatus?30===t.status&&t.commentStatus?"已完成":"已关闭":"待评价"}function m(t){return 0===t.status?`请在 ${n(orderInfo.payExpireTime)} 前完成支付`:10===t.status?"商家未发货,请耐心等待":20===t.status?"商家已发货,请耐心等待":30!==t.status||t.commentStatus?30===t.status&&t.commentStatus?"交易完成,感谢您的支持":"交易关闭":"已收货,快去评价一下吧"}function d(t){t.buttons=[],3===t.type&&t.buttons.push("combination"),20===t.status&&t.buttons.push("confirm"),t.logisticsId>0&&t.buttons.push("express"),0===t.status&&(t.buttons.push("cancel"),t.buttons.push("pay")),30!==t.status||t.commentStatus||t.buttons.push("comment"),40===t.status&&t.buttons.push("delete")}function l(t){return 10===t.status?"申请售后":20===t.status?"商品待退货":30===t.status?"商家待收货":40===t.status?"等待退款":50===t.status?"退款成功":61===t.status?"买家取消":62===t.status?"商家拒绝":63===t.status?"商家拒收货":"未知状态"}function f(t){return 10===t.status?"退款申请待商家处理":20===t.status?"请退货并填写物流信息":30===t.status?"退货退款申请待商家处理":40===t.status?"等待退款":50===t.status?"退款成功":61===t.status?"退款关闭":62===t.status?`商家不同意退款申请,拒绝原因:${t.auditReason}`:63===t.status?`商家拒绝收货,不同意退款,拒绝原因:${t.auditReason}`:"未知状态"}function h(t){t.buttons=[],[10,20,30].includes(t.status)&&t.buttons.push("cancel"),20===t.status&&t.buttons.push("delivery")}function v(t,n=""){t=function(t){if((t=t.toString()).indexOf("-")>0)return s(t);if(t.length>10)return s(parseInt(t));if(10===t.length)return s.unix(parseInt(t))}(t),""===n&&(n=s());let a=u(t-n);a.value>0&&setTimeout((()=>{a.value>0&&(a.value-=1e3)}),1e3);let e=s.duration(a.value);return{h:(30*e.months()*24+24*e.days()+e.hours()).toString().padStart(2,"0"),m:e.minutes().toString().padStart(2,"0"),s:e.seconds().toString().padStart(2,"0"),ms:e.$ms}}function y(t){return(t/100).toFixed(2)}function b(t){let s=[];for(const u of t)if(u.properties)for(const t of u.properties){let u=s.find((s=>s.id===t.propertyId));u||(u={id:t.propertyId,name:t.propertyName,values:[]},s.push(u)),u.values.find((s=>s.id===t.valueId))||u.values.push({id:t.valueId,name:t.valueName})}return s}function S(t,s){return 10===t.conditionType?`满 ${y(s.limit)} 元减 ${y(s.discountPrice)} 元`:20===t.conditionType?`满 ${s.limit} 件减 ${y(s.discountPrice)} 元`:""}export{e as a,S as b,b as c,i as d,a as e,y as f,p as g,d as h,m as i,c as j,h as k,l,f as m,v as u};
|