4.19(优化

This commit is contained in:
Hong
2024-04-19 14:42:03 +08:00
parent acefcd1112
commit 25e196a09b
19 changed files with 684 additions and 475 deletions

View File

@@ -191,21 +191,21 @@ export function convertNumberToChinese(number) {
//输入100000展示10.0万输入1000000展示100万
export function formatNumber(num) {
if (num >= 10000 && num < 100000000) {
if (num % 10000 === 0) {
return (num / 10000) + '万';
} else {
return (num / 10000).toFixed(1) + '万';
}
} else if (num >= 100000000) {
if (num % 1000000 === 0) {
return (num / 1000000) + '百万';
} else {
return (num / 1000000).toFixed(1) + '百万';
}
} else {
return num.toString();
}
if (num >= 10000 && num < 100000000) {
if (num % 10000 === 0) {
return (num / 10000) + '万';
} else {
return (num / 10000).toFixed(1) + '万';
}
} else if (num >= 100000000) {
if (num % 1000000 === 0) {
return (num / 1000000) + '百万';
} else {
return (num / 1000000).toFixed(1) + '百万';
}
} else {
return num.toString();
}
}
@@ -227,17 +227,15 @@ export function paymentFn(type, data) {
//分享维修/朋友圈
export function shareApi(type, data) {
// type:分享类型 聊天:WXSceneSession 朋友圈:WXSceneTimeline
console.log(type, data);
return new Promise((resolve, reject) => {
// uni.showLoading({
// title: '分享中',
// })
uni.share({
provider: "weixin",
scene: type,
type: data.type,
summary: data.summary,
href: data.href,
type: data.type == 2 ? 2 : 5,
imageUrl: data.imageUrl,
title: data.content,
miniProgram: config.miniProgram,
success: (res) => {
uni.hideLoading();
resolve(res)
@@ -308,7 +306,7 @@ export const getTimeDifference = (time) => {
return diffInHours + "小时前";
} else if (diffInMinutes > 0) {
return diffInMinutes + "分钟前";
} else if(diffInSeconds>0){
} else if (diffInSeconds > 0) {
return diffInSeconds + "秒前";
}
}