完善页面
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import Decimal from 'decimal.js'
|
||||
import { allowedNodeEnvironmentFlags } from 'process';
|
||||
import { allowedNodeEnvironmentFlags } from 'process'
|
||||
import { toast } from './toast'
|
||||
|
||||
/**
|
||||
* 页面跳转方法
|
||||
@ -34,7 +35,7 @@ export const router = {
|
||||
}, time);
|
||||
},
|
||||
|
||||
//关闭当前所有页面跳转至非table页面
|
||||
//关闭所有页面,打开到应用内的某个页面
|
||||
reLaunch: (url: string, time = 0) => {
|
||||
setTimeout(function() {
|
||||
uni.reLaunch({
|
||||
@ -63,7 +64,6 @@ export function toTimes(num1: number, num2: number) {
|
||||
const value1 = new Decimal(num1)
|
||||
const value2 = new Decimal(num2)
|
||||
const result = value1.times(value2).toDecimalPlaces(2, Decimal.ROUND_DOWN)
|
||||
console.log("🚀 ~ toPlus ~ result:", result)
|
||||
|
||||
return result.toString()
|
||||
}
|
||||
@ -122,4 +122,17 @@ export function toMinus(...args: any[]): string {
|
||||
}
|
||||
}
|
||||
return result.toDecimalPlaces(2, Decimal.ROUND_DOWN).toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制内容到剪贴板
|
||||
* @param data 复制的内容
|
||||
*/
|
||||
export function copy(data: any) {
|
||||
uni.setClipboardData({
|
||||
data: data,
|
||||
success: () => {
|
||||
toast.info('已复制到剪贴板')
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user