Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sfp-program
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sweet Zhang
sfp-program
Commits
4ba71484
Commit
4ba71484
authored
Sep 07, 2022
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改bug和弹窗
parent
8b993217
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
24 deletions
+18
-24
main.js
+0
-4
pages/dataImport/data-import.vue
+17
-1
pages/index/index.vue
+0
-0
unpackage/dist/build/h5/index.html
+1
-1
util/numberPipe.ts
+0
-18
No files found.
main.js
View file @
4ba71484
...
...
@@ -9,10 +9,6 @@ import api from '@api/api.ts'
Vue
.
config
.
productionTip
=
false
;
Vue
.
prototype
.
axios
=
axios
;
Vue
.
prototype
.
$api
=
api
;
import
{
numberToCurrencyNo
}
from
'./util/numberPipe'
;
// 配置全局过滤器,实现数字千分位格式
Vue
.
filter
(
'numberToCurrency'
,
numberToCurrencyNo
)
App
.
mpType
=
'app'
const
app
=
new
Vue
({
api
,
...
...
pages/dataImport/data-import.vue
View file @
4ba71484
...
...
@@ -92,7 +92,7 @@
name
:
'dataImport'
,
onLoad
()
{
this
.
bindPickerChange
({
detail
:{
value
:
this
.
index
}});
this
.
calcuteData
=
uni
.
getStorageSync
(
'calcuteData'
);
this
.
calcuteData
=
uni
.
getStorageSync
(
'calcuteData'
)
?
JSON
.
parse
(
uni
.
getStorageSync
(
'calcuteData'
))
:
null
;
},
methods
:{
// 选择间隔
...
...
@@ -193,8 +193,24 @@
this
.
pasteData
=
''
;
this
.
irrAndSimpleInfos
.
forEach
(
item
=>
item
.
cashValue
=
''
);
},
// 开始计算
calcuteIrr
(){
this
.
policyYearLists
=
this
.
irrAndSimpleInfos
.
filter
(
item
=>
item
.
cashValue
!==
''
)
if
(
this
.
policyYearLists
.
length
<=
0
){
uni
.
showModal
({
title
:
'必填提醒'
,
content
:
`系统检测到您并未录入有效的现金价值数据!`
,
showCancel
:
false
,
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
console
.
log
(
'用户点击确定'
);
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
}
}
});
return
;
}
console
.
log
(
this
.
policyYearLists
)
for
(
let
i
=
0
;
i
<
this
.
policyYearLists
.
length
;
i
++
){
if
(
this
.
policyYearLists
[
i
].
cashValue
<
0
||
isNaN
(
this
.
policyYearLists
[
i
].
cashValue
)){
...
...
pages/index/index.vue
View file @
4ba71484
This diff is collapsed.
Click to expand it.
unpackage/dist/build/h5/index.html
View file @
4ba71484
...
...
@@ -14,7 +14,7 @@
<title>
sfp
</title>
<!--preload-links-->
<!--app-context-->
<script
type=
"module"
crossorigin
src=
"/sfp/assets/index.
ac2778ca
.js"
></script>
<script
type=
"module"
crossorigin
src=
"/sfp/assets/index.
154fcd7e
.js"
></script>
<link
rel=
"stylesheet"
href=
"/sfp/assets/index.13d2da89.css"
>
</head>
<body>
...
...
util/numberPipe.ts
deleted
100644 → 0
View file @
8b993217
export
function
numberToCurrencyNo
(
value
)
{
debugger
;
if
(
!
value
)
return
0
;
// 获取整数部分
const
intPart
=
Math
.
trunc
(
value
)
// 整数部分处理,增加,
const
intPartFormat
=
intPart
.
toString
().
replace
(
/
(\d)(?=(?:\d{3})
+$
)
/g
,
'$1,'
)
// 预定义小数部分
let
floatPart
=
''
// 将数值截取为小数部分和整数部分
const
valueArray
=
value
.
toString
().
split
(
'.'
)
if
(
valueArray
.
length
===
2
)
{
// 有小数部分
floatPart
=
valueArray
[
1
].
toString
()
// 取得小数部分
return
intPartFormat
+
'.'
+
floatPart
}
return
intPartFormat
+
floatPart
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment