diff --git a/common/untool.js b/common/untool.js index 48779aa..9e2b345 100644 --- a/common/untool.js +++ b/common/untool.js @@ -1,7 +1,7 @@ const tabBarUrls = [ - 'sending/sending', - 'search/search', - 'mine/mine' + 'tabBar/sending/sending', + 'tabBar/search/search', + 'tabBar/mine/mine' ] const goto = (url, type = 1)=> { diff --git a/common/util.js b/common/util.js index eddb458..44be60b 100644 --- a/common/util.js +++ b/common/util.js @@ -66,7 +66,37 @@ var dateUtils = { } }; +const numberToChinese = (num)=> { + const chineseNums = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九']; + const chineseUnits = ['', '十', '百', '千', '万', '亿', '兆']; + + if (num === 0) { + return chineseNums[0]; + } + + const digits = Math.floor(num).toString().split(''); + const len = digits.length; + + let result = ''; + + for (let i = 0; i < len; i++) { + const digit = parseInt(digits[i]); + const unit = chineseUnits[len - 1 - i]; + + if (digit !== 0) { + result += chineseNums[digit] + unit; + } else { + if (result[result.length - 1] !== chineseNums[0]) { + result += chineseNums[digit] + } + } + } + + return result; +} + export { + numberToChinese, formatTime, formatLocation, dateUtils diff --git a/components/buns-country-sheet/buns-country-sheet.vue b/components/buns-country-sheet/buns-country-sheet.vue index 51e5f21..1f15836 100644 --- a/components/buns-country-sheet/buns-country-sheet.vue +++ b/components/buns-country-sheet/buns-country-sheet.vue @@ -5,7 +5,7 @@ - + diff --git a/components/buns-paytype-sheet/buns-paytype-sheet.vue b/components/buns-paytype-sheet/buns-paytype-sheet.vue index 76d1a3c..ab08443 100644 --- a/components/buns-paytype-sheet/buns-paytype-sheet.vue +++ b/components/buns-paytype-sheet/buns-paytype-sheet.vue @@ -1,6 +1,6 @@