Files
anmo/server/public/shop/assets/price.6545feda.js
2025-08-19 14:16:51 +08:00

2 lines
1.6 KiB
JavaScript
Executable File

import{g as e,y as t,o as s,c as a,w as l,b as r,m as i,f as o,e as f,d as n,t as u,j as c,n as p,bp as d,i as x,s as y}from"./index-b1ac9181.js";import{_}from"./_plugin-vue_export-helper.1b428a4d.js";const m=_(e({__name:"price",props:{content:{default:""},prec:{default:2},autoPrec:{type:Boolean,default:!0},color:{default:"#FA8919"},mainSize:{default:"36rpx"},minorSize:{default:"28rpx"},lineThrough:{type:Boolean,default:!1},fontWeight:{default:"normal"},prefix:{default:"¥"},suffix:{default:""}},setup(e){const _=e,m=t((()=>d({price:_.content,take:"int"}))),S=t((()=>{let e=d({price:_.content,take:"dec",prec:_.prec});return e=e%10==0?e.substr(0,e.length-1):e,_.autoPrec?1*e?"."+e:"":_.prec?"."+e:""}));return(t,d)=>{const _=x,z=y;return s(),a(_,{class:"price-container"},{default:l((()=>[r(_,{class:p(["price-wrap",{"price-wrap--disabled":e.lineThrough}]),style:o({color:e.color})},{default:l((()=>[i(" Prefix "),r(_,{class:"fix-pre",style:o({fontSize:e.minorSize})},{default:l((()=>[f(t.$slots,"prefix",{},(()=>[n(u(e.prefix),1)]),!0)])),_:3},8,["style"]),i(" Content "),r(_,{style:o({"font-weight":e.fontWeight})},{default:l((()=>[i(" Integer "),r(z,{style:o({fontSize:e.mainSize})},{default:l((()=>[n(u(c(m)),1)])),_:1},8,["style"]),i(" Decimals "),r(z,{style:o({fontSize:e.minorSize})},{default:l((()=>[n(u(c(S)),1)])),_:1},8,["style"])])),_:1},8,["style"]),i(" Suffix "),r(_,{class:"fix-suf",style:o({fontSize:e.minorSize})},{default:l((()=>[f(t.$slots,"suffix",{},(()=>[n(u(e.suffix),1)]),!0)])),_:3},8,["style"])])),_:3},8,["class","style"])])),_:3})}}}),[["__scopeId","data-v-a74822ce"]]);export{m as _};