interceptionStr(str) {/*判断字符串是否有小数,如果有只取后8位*/ if (str === undefined || str === null || isNaN(str) || str === '') { return 0 } str = String(str) let strSplitArr = [], first = null, strSecond = null if (str.indexOf('.') != -1) { /*是否有小数*/ strSplitArr = str.split('.') if (strSplitArr[1].length > 8) { strSecond = strSplitArr[1].slice(0, 8) first = strSplitArr[0] strSplitArr = `${first}.${strSecond}` } else { strSplitArr = str } } else { strSplitArr = str } return Number(strSplitArr) }