8fd04550 by yangjianbin

init

1 parent 32c16488
...@@ -94,43 +94,18 @@ ...@@ -94,43 +94,18 @@
94 contentType: "application/json; charset=UTF-8", 94 contentType: "application/json; charset=UTF-8",
95 success:function(data){ 95 success:function(data){
96 if(data.code != 0){ 96 if(data.code != 0){
97 layer.alert('请求失败');
98 } else {
99 $('#totalRepay').val(data.data.totalRepay);
100 $('#totalAmount').val(data.data[0].totalAmount);
101 }
102
103 },
104 error:function(){
105 layer.alert("请求失败")
106 }
107 })
108 })
109 function submit (){
110 var borrowAmount = $('[name=borrowAmount]').val();
111 var productId = $('[name=productId]').val();
112 var str = 'borrowAmount=' + borrowAmount + '&productId=' + productId;
113 $.ajax({
114 type:'get',
115 url:apiBaseUrl + 'application/tool/interest?' + str,
116 cache: false,
117 dataType:'json',
118 contentType: "application/json; charset=UTF-8",
119 success:function(data){
120 if(data.code != 0){
121 var msg = data.msg ? data.msg : '请求失败'; 97 var msg = data.msg ? data.msg : '请求失败';
122 layer.alert(msg); 98 layer.alert(msg);
123 } else { 99 } else {
124 $('#totalRepay').val(data.data.totalRepay); 100 $('#totalRepay').val(data.data.totalRepay);
125 $('#totalAmount').val(data.data.repayPlans[0].totalAmount); 101 $('#totalAmount').val(data.data.repayPlans[0].totalAmount);
126 } 102 }
127
128 }, 103 },
129 error:function(){ 104 error:function(){
130 layer.alert("请求失败") 105 layer.alert("请求失败")
131 } 106 }
132 }) 107 })
133 } 108 })
134 </script> 109 </script>
135 </body> 110 </body>
136 <html> 111 <html>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!