withdraw.html
10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta content="telephone=no" name="format-detection">
<meta name="wap-font-scale" content="no">
<title>小券提现</title>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/layer.css">
<link rel="stylesheet" href="css/index.css?v=201904170201">
<script src="lib/fsize.js"></script>
<style>
.layui-layer-ico {
display: none !important;
}
.layui-layer{
box-shadow: none !important;
}
.yourclass{
background: rgba(0,0,0,0) !important;
border-radius: 0.4rem !important;
}
.layui-layer-page .layui-layer-content{
border-radius: 0.4rem !important;
}
.yourclass2{
border-radius: 0rem !important;
background: rgba(0,0,0,0) !important;
}
.yourclass2 .layui-layer-content{
border-radius: 0rem !important;
}
</style>
</head>
<body>
<div style="background: rgb(245,245,245);height: 0.15rem;"></div>
<div style="display: block" class="withdraw-bg">
<div class="withdraw-div"><span style="width: 2.25rem;display: inline-block;">到账银行卡</span> <span class="withdraw-bank"></span><span class="r-arrow"></span></div>
<div><span style="width: 2.25rem;display: inline-block;">提现金额</span>¥ <input oninput="value=value.replace(/[^\d]/g,'')" placeholder="请输入提现金额" class="withdraw-money" type="text"></div>
<p class="withdraw-p">可提现小券:<span>--</span></p>
<p class="withdraw-tips"><span>温馨提示 : </span>提现金额最低为100且必须为100的倍数,10000小券=100元</p>
<p style="text-align: center"><button class="with-btn">提现</button></p>
<p class="withdraw-bottom-tips">绑定的银行卡持有人必须与您实名认证的身份证姓名相符</p>
</div>
<div class="layer-msgBox">
<p>点击授权即同意</p>
<p>授权果冻直播代为缴纳相关税款</p>
<div class="msgBox-bottom">
<div class="msgBox-btn-no">取消</div>
<div class="msgBox-btn-yes">授权</div>
</div>
</div>
</body>
<script src="lib/jquery-3.1.1.min.js"></script>
<script src="layer-v3.1.0/layer/layer.js"></script>
<script>
// $ip = 'http://test.api.lvdou66.com/';
$ip = 'https://zhibo.lvdou66.com/';
// $ip = 'https://zhibo.lvdou66.com/87server/'
// $ip = 'https://zhibo.lvdou66.com/';
cdn = 'http://zhibocdn.ishuaji.cn/comm';
var bbb = location.href;
var data = url_get_params(bbb)
function url_get_params(url_path) {
var url = url_path;
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(url.indexOf("?") + 1);
strs = str.split("&");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
}
}
return theRequest;
}
//ajax设置默认参数
$.ajaxSetup({
global: false,
type: 'post',
data: {
uid:localStorage.uid,
token:localStorage.token
},
dataType:"JSON"
})
var obj = {
"cid": 11,
"reqCode": new Date().getTime(),
"data": {
msg:"修改导航栏",
titleName:"小券提现",
color:'#000000',
background:'#ffffff'
}
}
var obj2 = JSON.stringify(obj);
appCollaboration(obj2)
var rightTopObj = {
"cid": 13,
"reqCode": new Date().getTime(),
"data": {
'msg':'添加右上角图标',
'function':'more()',
show:0
}
}
var rightTop = JSON.stringify(rightTopObj);
appCollaboration(rightTop)
$(".withdraw-money").val(100)
$(".withdraw-p span").text(sessionStorage.activebonds)
$.ajax({
url:$ip+'account/client/withdraw/bankmanage.html',
success: function (data) {
console.log(data);
$(".withdraw-bank").text(data.bank+" ("+data.cardnum+") ")
sessionStorage.firstwithdraw=data.firstwithdraw;
}
})
$(".withdraw-money").on("input", function () {
if($(".withdraw-money").val()>($(".withdraw-p span").text()-$(".withdraw-p span").text()%10000)/100){
$(".withdraw-money").val(($(".withdraw-p span").text()-$(".withdraw-p span").text()%10000)/100)
layer.msg("金额超出可提现金额");
}
if($(".withdraw-money").val().length==0){
$(".with-btn").unbind("click")
$(".with-btn").addClass("with-btn-no")
}else{
$(".with-btn").unbind("click")
$(".with-btn").removeClass("with-btn-no")
$(".with-btn").on("click", function () {
if(sessionStorage.firstwithdraw==1){
layer.open({
type: 1,
title: false,
shadeClose: false,
skin: "yourclass",
area: ["7.22rem", "4rem"],
content: $(".layer-msgBox")
})
return
}
if($(".withdraw-p span").text()<10000){
layer.msg('可提现小券数不足10000');
return
}
if($(".withdraw-money").val()<100){
layer.msg('提现金额最低为100');
return
}
if($(".withdraw-money").val()>20000){
layer.msg('单笔提现金额不能超过20000');
return;
}
if($(".withdraw-money").val()%100!=0){
layer.msg('提现金额必须为100的倍数');
return;
}
if(withBtn){
withBtn=false
$.ajax({
url:$ip+'account/client/withdraw/apply.html',
data:{
money:$(".withdraw-money").val()
},
success: function (data) {
console.log(data);
if(data.code==1){
sessionStorage.review=1
sessionStorage.title='小券提现'
window.location.href='review.html';
}else{
setTimeout(function () {
layer.msg(data.msg)
withBtn=true
},300)
}
}
})
}
})
}
})
var withBtn=true
$(".with-btn").on("click", function () {
if(sessionStorage.firstwithdraw==1){
layer.open({
type: 1,
title: false,
shadeClose: false,
skin: "yourclass",
area: ["7.22rem", "4rem"],
content: $(".layer-msgBox")
})
return
}
if($(".withdraw-p span").text()<10000){
layer.msg('可提现小券数不足10000');
return
}
if($(".withdraw-money").val()<100){
layer.msg('提现金额最低为100');
return
}
if($(".withdraw-money").val()>20000){
layer.msg('单笔提现金额不能超过20000');
return;
}
if($(".withdraw-money").val()%100!=0){
layer.msg('提现金额必须为100的倍数');
return;
}
if(withBtn){
withBtn=false
$.ajax({
url:$ip+'account/client/withdraw/apply.html',
data:{
money:$(".withdraw-money").val()
},
success: function (data) {
console.log(data);
if(data.code==1){
sessionStorage.review=1
sessionStorage.title='小券提现'
window.location.href='review.html';
}else{
setTimeout(function () {
layer.msg(data.msg)
withBtn=true
},300)
}
}
})
}
})
$(".msgBox-btn-no").on("click", function () {
layer.closeAll();
})
$(".msgBox-btn-yes").on("click", function () {
if($(".withdraw-p span").text()<10000){
layer.closeAll()
layer.msg('可提现小券数不足10000');
return
}
if($(".withdraw-money").val()<100){
layer.closeAll()
layer.msg('提现金额最低为100');
return
}
if($(".withdraw-money").val()>20000){
layer.closeAll()
layer.msg('单笔提现金额不能超过20000');
return;
}
if($(".withdraw-money").val()%100!=0){
layer.closeAll()
layer.msg('提现金额必须为100的倍数');
return;
}
if(withBtn){
withBtn=false
$.ajax({
url:$ip+'account/client/withdraw/apply.html',
data:{
money:$(".withdraw-money").val()
},
success: function (data) {
console.log(data);
if(data.code==1){
sessionStorage.review=1
sessionStorage.title='小券提现'
window.location.href='review.html';
}else{
setTimeout(function () {
layer.msg(data.msg)
withBtn=true
},300)
}
}
})
}
})
function appCollaboration(msg) {
var ua = window.navigator.userAgent.toLowerCase();
try{
if (/iphone|ipad|ipod/.test(ua)) {
window.webkit.messageHandlers.appCollaboration.postMessage(msg);
}else if(/android/.test(ua)){
window.yazhai.appCollaboration(msg);
}
}catch (e){}
}
//客户端回调结果
function appCallback(msg) {
console.log(msg);
}
</script>
</html>