You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
893 B
32 lines
893 B
// 设置页面元素对应高亮
|
|
export function setHighActive(dom) {
|
|
const ele = document.getElementById(dom)
|
|
ele.classList.add('ceshi')
|
|
ele.scrollIntoView({behavior:'smooth',block:'start'})
|
|
setTimeout(()=>{
|
|
ele.classList.remove('ceshi')
|
|
},1000)
|
|
}
|
|
|
|
export function getServicePriceDesc(price, price_unit, unit_num) {
|
|
let unit = 0;
|
|
let unit_str = "";
|
|
|
|
if (unit_num == 1) return price + price_unit +'/篇';
|
|
|
|
if (unit_num/10000 < 10) {
|
|
unit = Math.ceil(unit_num/10000);
|
|
unit_str = unit == 1 ? '万' : unit+'万';
|
|
}
|
|
if (unit_num/1000 < 10) {
|
|
unit = Math.ceil(unit_num/1000);
|
|
unit_str = unit == 1 ? '千' : unit+'千';
|
|
}
|
|
if (unit_num/100 < 10) {
|
|
unit = Math.ceil(unit_num/100);
|
|
unit_str = unit == 1 ? '百' : unit+'百';
|
|
}
|
|
|
|
return price + price_unit + "/" +unit_str + "字符";
|
|
}
|
|
|
|
|