Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨建斌
/
page
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
a412b50c
authored
2018-03-24 16:09:52 +0800
by
yangjianbin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
init
1 parent
6cfae349
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
25 deletions
application/views/tool/cal.php
application/views/tool/cal.php
View file @
a412b50
<?php
$this
->
load
->
view
(
'common/header'
);
?>
<body>
<div
class=
"cl pd-5 bg-1"
>
<div
class=
"cl pd-5 bg-1"
>
<span
class=
"l"
>
<button
class=
"btn btn-primary radius"
onclick=
"layer_load('', '
<?=
site_url
(
'/tool/cal'
);
?>
');"
>
<button
class=
"btn btn-primary radius"
onclick=
"layer_load('', '
<?=
site_url
(
'/tool/cal'
);
?>
');"
>
<i
class=
"Hui-iconfont"
>

</i>
利息计算器
</button>
<button
class=
"btn btn-primary radius"
onclick=
"layer_load('', '
<?=
site_url
(
'/tool/web'
);
?>
');"
>
<button
class=
"btn btn-primary radius"
onclick=
"layer_load('', '
<?=
site_url
(
'/tool/web'
);
?>
');"
>
<i
class=
"Hui-iconfont"
>

</i>
网查网址
</button>
</span>
</div>
</div>
<form
id=
"form"
>
<form
id=
"form"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-body"
>
<div
class=
"row cl"
>
...
...
@@ -20,9 +20,11 @@
<label>
产品名称
</label>
<span
class=
"form-control select-box"
>
<select
id=
"product"
class=
"select"
size=
"1"
name=
"productId"
>
<?php
foreach
(
$this
->
session
->
products
as
$k
=>
$v
)
:?>
<
option
data
-
repaymentMode
=
"<?=
$v->repaymentMode
?>"
data
-
loanDeadline
=
"<?=
$v->loanDeadline
?>"
value
=
"<?=
$v->id
?>"
><?=
$v
->
productName
?>
</option>
<?php
endforeach
;
?>
<?php
foreach
(
$this
->
session
->
products
as
$k
=>
$v
)
:
?>
<option
data-repaymentMode=
"
<?=
$v
->
repaymentMode
?>
"
data-loanDeadline=
"
<?=
$v
->
loanDeadline
?>
"
value=
"
<?=
$v
->
id
?>
"
>
<?=
$v
->
productName
?>
</option>
<?php
endforeach
;
?>
</select>
</span>
</div>
...
...
@@ -34,16 +36,18 @@
<div
class=
"form-group col-sm-3 col-md-2"
>
<label>
借款期数
</label>
<span
class=
"form-control select-box"
>
<select
id=
"product"
class=
"select"
size=
"1"
name
=
"loanDeadline"
>
<?php
for
(
$i
=
1
;
$i
<=
$this
->
session
->
products
[
0
]
->
loanDeadline
;
$i
++
)
:
?>
<
option
value
=
"<?=
$i
?>"
><?=
$i
?>
</option>
<?php
endfor
;
?>
<select
class=
"select"
size=
"1"
id
=
"loanDeadline"
>
<?php
for
(
$i
=
1
;
$i
<=
$this
->
session
->
products
[
0
]
->
loanDeadline
;
$i
++
)
:
?>
<option
value=
"
<?=
$i
?>
"
>
<?=
$i
?>
</option>
<?php
endfor
;
?>
</select>
</span>
</div>
<div
class=
"form-group col-sm-3 col-md-2"
>
<label>
还款方式
</label>
<input
type=
"text"
class=
"form-control input-text"
readonly
value=
"
<?=
$this
->
session
->
products
[
0
]
?
$this
->
session
->
products
[
0
]
->
repaymentMode
:
''
;
?>
"
id=
"repaymentMode"
>
<input
type=
"text"
class=
"form-control input-text"
readonly
value=
"
<?=
$this
->
session
->
products
[
0
]
?
$this
->
session
->
products
[
0
]
->
repaymentMode
:
''
;
?>
"
id=
"repaymentMode"
>
</div>
</div>
</div>
...
...
@@ -69,21 +73,26 @@
<div
class=
"row cl pb-20 col-sm-12"
>
<div
class=
"col-sm-offset-4 col-sm-2"
>
<button
class=
"btn btn-primary btn-block"
>
计算
</button>
<button
class=
"btn btn-primary btn-block"
>
计算
</button>
</div>
<div
class=
"col-sm-2"
>
<input
class=
"btn btn-warning btn-block"
value=
"重置"
type=
"reset"
>
</div>
</div>
</form>
</form>
<?php
$this
->
load
->
view
(
'common/footer'
);
?>
<?php
$this
->
load
->
view
(
'common/footer'
);
?>
<script>
<script>
$
(
'#product'
).
change
(
function
()
{
var
data
=
$
(
this
).
find
(
':selected'
).
data
();
$
(
'#repaymentMode'
).
val
(
data
.
repaymentmode
);
$
(
'#loanDeadline'
).
val
(
data
.
loandeadline
);
$
(
'#loanDeadline'
).
empty
();
var
str
=
''
;
for
(
var
i
=
1
;
i
<=
parseInt
(
data
.
loandeadline
);
$i
++
)
{
str
+=
'<option value="'
+
i
+
'">'
+
i
+
'</option>'
;
}
$
(
'#loanDeadline'
).
append
(
str
);
})
$
(
'#form'
).
submit
(
function
(
e
)
{
...
...
@@ -93,13 +102,13 @@
var
productId
=
$
(
'[name=productId]'
).
val
();
var
str
=
'borrowAmount='
+
borrowAmount
+
'&productId='
+
productId
;
$
.
ajax
({
type
:
'get'
,
url
:
apiBaseUrl
+
'application/tool/interest?'
+
str
,
type
:
'get'
,
url
:
apiBaseUrl
+
'application/tool/interest?'
+
str
,
cache
:
false
,
dataType
:
'json'
,
dataType
:
'json'
,
contentType
:
"application/json; charset=UTF-8"
,
success
:
function
(
data
)
{
if
(
data
.
code
!=
0
)
{
success
:
function
(
data
)
{
if
(
data
.
code
!=
0
)
{
var
msg
=
data
.
msg
?
data
.
msg
:
'请求失败'
;
layer
.
alert
(
msg
);
}
else
{
...
...
@@ -107,11 +116,11 @@
$
(
'#totalAmount'
).
val
(
data
.
data
.
repayPlans
[
0
].
totalAmount
);
}
},
error
:
function
()
{
error
:
function
()
{
layer
.
alert
(
"请求失败"
)
}
})
})
</script>
</script>
</body>
<html>
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment