welcome_pay.html
31.4 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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link href="__PUBLIC__/static/css/index.css" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/static/css/perfect-scrollbar.min.css" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/static/css/purebox.css" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/static/js/jquery-ui/jquery-ui.min.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__PUBLIC__/static/js/jquery.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/js/jquery-ui/jquery-ui.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/js/jquery.cookie.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/js/layer/layer.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/js/qrcode.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/js/md5.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/mchat_global.js"></script>
<style>
.contentWarp_item .section_select .item_comment {
padding: 83px 0 31px 38px;
}
.contentWarp_item .section_select .item {
padding: 83px 0 38px 38px;
}
.contentWarp_item .section_order_select li {
width: 23.8%;
}
.kfnum, .payment:hover {
cursor: pointer;
}
</style>
</head>
<body class="iframe_body">
<div class="warpper">
<div class="title">管理中心</div>
<div class="content start_content">
<div class="contentWarp">
<div class="contentWarp_item clearfix">
<div class="four_cro">
<div class="two_box bgf">
<div class="tit"><img class="titimg" src="__PUBLIC__/static/images/wel1.png" alt="">待处理事项</div>
<ul class="gridbox">
<li><span>待发货订单</span><span><em>{$count.dfh}</em>单</span></li>
<li><span>待处理退款订单</span><span><em>{$count.dcltk}</em>单</span></li>
<li><span>待处理提现</span><span><em>{$count.dcltx}</em>单</span></li>
<li><span>待完善商品详情</span><span><em>{$count.dwstp}</em>单</span></li>
<li><span>待处理评价</span><span><em>{$count.dclpj}</em>单</span></li>
</ul>
</div>
<div class="two_box bgf">
<div class="tit"><img class="titimg" src="__PUBLIC__/static/images/wel2.png" alt="">订单信息</div>
<ul class="gridbox">
<li><span>已付款订单</span><span><em>{$count.yfk}</em>单</span></li>
<li><span>待付款订单</span><span><em>{$count.dfk}</em>单</span></li>
<li><span>待收货订单</span><span><em>{$count.dsh}</em>单</span></li>
<li><span>已完成订单</span><span><em>{$count.ywc}</em>单</span></li>
<li><span>退款订单</span><span><em>{$count.tk}</em>单</span></li>
</ul>
</div>
<div class="clear"></div>
</div>
<div class="four_cro bgf">
<div class="tit"><img class="titimg" src="__PUBLIC__/static/images/wel3.png" alt="">商品信息</div>
<ul class="goodsli">
<li>
<img class="welgs" src="__PUBLIC__/static/images/welgs1.png" alt="">
<span><h4>{$count.goods}</h4><em>商品总数</em></span>
</li>
<li>
<img class="welgs" src="__PUBLIC__/static/images/welgs2.png" alt="">
<span><h4>{$count.cxs}</h4><em>促销数</em></span>
</li>
<li>
<img class="welgs" src="__PUBLIC__/static/images/welgs3.png" alt="">
<span><h4>{$count.sjs}</h4><em>上架数</em></span>
</li>
<li>
<img class="welgs" src="__PUBLIC__/static/images/welgs4.png" alt="">
<span><h4>{$count.xjs}</h4><em>下架数</em></span>
</li>
<li>
<img class="welgs" src="__PUBLIC__/static/images/welgs5.png" alt="">
<span><h4>{$count.wkcs}</h4><em>无库存数</em></span>
</li>
</ul>
</div>
<div class="four_cro bgf">
<div class="tit"><img class="titimg" src="__PUBLIC__/static/images/wel4.png" alt="">商城动态</div>
<ul class="shopli">
<li style="width: 16%">
<span><img class="scdt" src="__PUBLIC__/static/images/scdt1.png" alt="">今日总销售额/实际销售额</span>
<h3>¥{$count.jrxse}</h3>
</li>
<li>
<span><img class="scdt" src="__PUBLIC__/static/images/scdt2.png" alt="">今日成交订单</span>
<h3>{$count.new_order}</h3>
</li>
<li>
<span><img class="scdt" src="__PUBLIC__/static/images/scdt3.png" alt="">今日会员数</span>
<h3>{$count.new_users}</h3>
</li>
<li>
<span><img class="scdt" src="__PUBLIC__/static/images/scdt4.png" alt="">今日退款单数</span>
<h3>{$count.return_order}</h3>
</li>
<li>
<span><img class="scdt" src="__PUBLIC__/static/images/scdt5.png" alt="">今日访问量</span>
<h3>{$count.today_login}</h3>
</li>
<li style="width: 16%">
<span><img class="scdt" src="__PUBLIC__/static/images/scdt6.png" alt="">总销售额/实际销售额</span>
<h3>¥{$count.zxse}</h3>
</li>
<li>
<span><img class="scdt" src="__PUBLIC__/static/images/scdt7.png" alt="">总会员数</span>
<h3>{$count.users}</h3>
</li>
<li>
<span><img class="scdt" src="__PUBLIC__/static/images/scdt8.png" alt="">短信条数</span>
<h3>{$count.smsqty}</h3>
</li>
</ul>
</div>
<div class="four_cro bgf">
<div class="tit"><img class="titimg" src="__PUBLIC__/static/images/wel5.png" alt="">商家必备</div>
<ul class="sjbb">
<li><img class="sjbbs" src="__PUBLIC__/static/images/fxtg.png" alt="">
<span>
<h4>分销推广</h4>
<p>推广+吸粉+客户粘性,精准营销,快速促成订
单,打造以分销商为中心的全新分销体验。</p>
</span>
<a class="thisbtn thisbtn1" style="background-color:#39ca74;" onClick="$('#pay_type').val(1)">立即体验</a>
<input type="text" id="pay_type" hidden>
</li>
<li><img class="sjbbs" src="__PUBLIC__/static/images/zxkf.png" alt=""><span>
<h4>在线客服</h4>
<p>高效客服工作台,支持留言,推荐商品给顾客,
大幅度提升客户满意度。</p>
</span>
<a class="thisbtn thisbtn2" style="background-color: #609ee9;" onClick="$('#pay_type').val(2)">立即开通</a></li>
</ul>
</div>
</div>
<div class="contentWarp_item clearfix" style="margin-top: 0;">
<!--<div class="section_order_select dn">-->
<!--<ul>-->
<!--<li>-->
<!--<a style="cursor: default;">-->
<!--<i class="ice ice_w"></i>-->
<!--<div class="t">待处理订单</div>-->
<!--<span class="number">{$count.handle_order}</span>-->
<!--</a>-->
<!--</li>-->
<!--<li>-->
<!--<a style="cursor: pointer;" href="{:U('Goods/goodsList')}">-->
<!--<i class="ice ice_y"></i>-->
<!--<div class="t">商品数量</div>-->
<!--<span class="number">{$count.goods}</span>-->
<!--</a>-->
<!--</li>-->
<!--<li>-->
<!--<a style="cursor: pointer;" href="/index.php?m=Admin&c=System&a=index">-->
<!--<i class="ice ice_f"></i>-->
<!--<div class="t">短信条数</div>-->
<!--<span class="number">{$count.smsqty}</span>-->
<!--</a>-->
<!--</li>-->
<!--<li>-->
<!--<a style="cursor: default;">-->
<!--<i class="ice ice_n"></i>-->
<!--<div class="t">会员总数</div>-->
<!--<span class="number">{$count.users}</span>-->
<!--</a>-->
<!--</li>-->
<!--</ul>-->
<!--</div>-->
<div class="clear"></div>
<div class="section section_order_count">
<div class="sc_title" style="padding: 26px 0 14px;border-bottom: 1px solid #e4eaec;">
<i class="sc_icon"></i>
<h3>版本信息</h3>
</div>
<div class="sc_warp" style="padding-bottom: 30px;">
<table cellpadding="0" cellspacing="0" class="system_table">
<tbody>
<tr>
<td class="gray_bg">程序版本:</td>
<td>{$basiclist.sys_version}</td>
<td class="gray_bg">更新时间:</td>
<td>{$basiclist.sys_updatedate}</td>
</tr>
<tr>
<td class="gray_bg">程序开发:</td>
<td>美得得科技(深圳)有限公司</td>
<td class="gray_bg">版权所有:</td>
<td>美得得科技(深圳)有限公司</td>
</tr>
<tr>
<td class="gray_bg">品牌官网:</td>
<td><a href="https://erp.meidd.com/" target="_blank">万信达官网</a></td>
<td class="gray_bg">公司官网:</td>
<td><a href="https://www.meidd.com" target="_blank">美得得官网</a></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!--<div class="contentWarp_item clearfix">-->
<!--<div class="section_select">-->
<!--<div class="item item_price">-->
<!--<a href="/index.php?m=Admin&c=Order&a=index&day=1">-->
<!--<i class="icon"><img src="__PUBLIC__/static/images/1.png" width="71" height="74"></i>-->
<!--<div class="desc">-->
<!--<div class="tit">{$count.new_order}</div>-->
<!--<span>今日订单总数</span>-->
<!--</div>-->
<!--</a>-->
<!--</div>-->
<!--<div class="item item_order">-->
<!--<i class="icon"><img src="__PUBLIC__/static/images/2.png"></i>-->
<!--<div class="desc">-->
<!--<div class="tit">{$count.new_users}</div>-->
<!--<span>今日会员总数</span>-->
<!--</div>-->
<!--<i class="icon"></i>-->
<!--</div>-->
<!--<div class="item item_comment">-->
<!--<a href="/index.php?m=Admin&c=Comment&a=index&day=1">-->
<!--<i class="icon"><img src="__PUBLIC__/static/images/3.png" width="71" height="74"></i>-->
<!--<div class="desc">-->
<!--<div class="tit">{$count.comment}</div>-->
<!--<span>今日待审评论数</span>-->
<!--</div>-->
<!--</a>-->
<!--</div>-->
<!--<div class="item item_flow">-->
<!--<i class="icon"><img src="__PUBLIC__/static/images/4.png" width="71"></i>-->
<!--<div class="desc">-->
<!--<div class="tit">{$count.today_login}</div>-->
<!--<span>今日访问量</span>-->
<!--</div>-->
<!--<i class="icon"></i>-->
<!--</div>-->
<!--<div class="item item_flow item_five">-->
<!--<a href="/index.php?m=Admin&c=Order&a=return_list&day=1">-->
<!--<i class="icon"><img src="__PUBLIC__/static/images/5.png" width="71"></i>-->
<!--<div class="desc">-->
<!--<div class="tit">{$count.return_order}</div>-->
<!--<span>今日退款单量</span>-->
<!--</div>-->
<!--<i class="icon"></i>-->
<!--</a>-->
<!--</div>-->
<!--<div class="item_li">-->
<!--<a style="cursor: default;">-->
<!--<i class="ice ice_w"></i>-->
<!--<div class="t">待处理订单</div>-->
<!--<span class="number">{$count.handle_order}</span>-->
<!--</a>-->
<!--</div>-->
<!--<div class="item_li">-->
<!--<a style="cursor: pointer;" href="{:U('Goods/goodsList')}">-->
<!--<i class="ice ice_y"></i>-->
<!--<div class="t">商品数量</div>-->
<!--<span class="number">{$count.goods}</span>-->
<!--</a>-->
<!--</div>-->
<!--<div class="item_li">-->
<!--<a style="cursor: pointer;" href="/index.php?m=Admin&c=System&a=index">-->
<!--<i class="ice ice_f"></i>-->
<!--<div class="t">短信条数</div>-->
<!--<span class="number">{$count.smsqty}</span>-->
<!--</a>-->
<!--</div>-->
<!--<div class="item_li">-->
<!--<a style="cursor: default;">-->
<!--<i class="ice ice_n"></i>-->
<!--<div class="t">会员总数</div>-->
<!--<span class="number">{$count.users}</span>-->
<!--</a>-->
<!--</div>-->
<!--<div class="clear"></div>-->
<!--</div>-->
<!--</div>-->
</div>
<!--<div class="contentWarp">-->
<!--<div class="section system_section" style="float: none;width: inherit;">-->
<!--<div class="system_section_con">-->
<!--<div class="sc_title" style="padding: 26px 0 14px;border-bottom: 1px solid #e4eaec;">-->
<!--<i class="sc_icon"></i>-->
<!--<h3>系统信息</h3>-->
<!--<!–<span class="stop stop_jia" id="system_section" title="展开详情"></span>–>-->
<!--</div>-->
<!--<div class="sc_warp" id="system_warp" style="display: block;padding-bottom: 30px;">-->
<!--<table cellpadding="0" cellspacing="0" class="system_table">-->
<!--<tbody><tr>-->
<!--<td class="gray_bg">服务器操作系统:</td>-->
<!--<td>{$sys_info.os}</td>-->
<!--<td class="gray_bg">服务器域名/IP:</td>-->
<!--<td>{$sys_info.domain} [ {$sys_info.ip} ]</td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td class="gray_bg">服务器环境:</td>-->
<!--<td>{$sys_info.web_server}</td>-->
<!--<td class="gray_bg">PHP 版本:</td>-->
<!--<td>{$sys_info.phpv}</td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td class="gray_bg">Mysql 版本:</td>-->
<!--<td>{$sys_info.mysql_version}</td>-->
<!--<td class="gray_bg">GD 版本:</td>-->
<!--<td>{$sys_info.gdinfo}</td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td class="gray_bg">文件上传限制:</td>-->
<!--<td>{$sys_info.fileupload}</td>-->
<!--<td class="gray_bg">最大占用内存:</td>-->
<!--<td>{$sys_info.memory_limit}</td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td class="gray_bg">最大执行时间:</td>-->
<!--<td>{$sys_info.max_ex_time}</td>-->
<!--<td class="gray_bg">安全模式:</td>-->
<!--<td>{$sys_info.safe_mode}</td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td class="gray_bg">Zlib支持:</td>-->
<!--<td>{$sys_info.zlib}</td>-->
<!--<td class="gray_bg">Curl支持:</td>-->
<!--<td>{$sys_info.curl}</td>-->
<!--</tr>-->
<!--</tbody></table>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
</div>
</div>
<div id="footer" style="position: static; bottom: 0px;">
<p>版权所有 © 美得得科技(深圳)有限公司,并保留所有权利。</p>
</div>
<div class="laybox" hidden>
<dl style="text-align: center;color: #333;">
<dt style="font-size: 30px;">在线客服系统</dt>
<dd style="font-size: 14px;">推广+吸粉+客户粘性,精准营销,快速促成订单,打造以分销商为中心的全新分销体验。
</dd>
<dd>
<div class="kfnum on" flag="1000">
<div class=""><em>1000</em>元/年</div>
<div>2个客服</div>
<img class="ribot" src="__PUBLIC__/static/images/ribot.png" alt="">
</div>
<div class="kfnum" flag="400">
<div class=""><em>400</em>元/个/年</div>
<div>3个及以上客服</div>
<img class="ribot" src="__PUBLIC__/static/images/ribot.png" alt="">
</div>
</dd>
<dd>
<div class="ware_ewm">
<div id="ewm_box" class="ewm"></div>
<!--<img id="ewm_box" class="ewm" src="" alt="">-->
<span class="sjbox lt"></span>
<span class="sjbox rt"></span>
<span class="sjbox lb"></span>
<span class="sjbox rb"></span>
</div>
<div class="ware_more">
<ul>
<li>购买数量:
<input type="text" value="2" id="buy_num" readonly="readonly" maxlength="4"
onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}
else{this.value=this.value.replace(/\D/g,'')}"
onpaste="return false"
>
</li>
<li>支付金额:<em id="buy_money">1000</em> 元</li>
<li>扫一扫二维码,支付更轻松</li>
<li>
<span class="wx payment" flag="WEIXIN"></span>
<span class="zfb payment" flag="ALIPAY"></span>
</li>
</ul>
</div>
</dd>
</dl>
</div>
<script type="text/javascript">
$(function () {
$("*[data-toggle='tooltip']").tooltip({
position: {
my: "left top+5",
at: "left bottom"
}
});
});
</script>
<script type="text/javascript" src="__PUBLIC__/static/js/jquery.purebox.js"></script>
<script type="text/javascript" src="__WEBPUBLIC__/static/js/echart/echarts.min.js"></script>
<script type="text/javascript">
// 语音提示
var getis_voice = "{$is_voice}";
if (getis_voice == 1) {
playSound();
}
function playSound()
{
var borswer = window.navigator.userAgent.toLowerCase();
if ( borswer.indexOf( "ie" ) >= 0 )
{
//IE内核浏览器
var strEmbed = '<embed name="embedPlay" src="{:QCLOUD_IMGURL}/public/mp3/ts.mp3?v={:QCLOUD_CSSVERSION}" autostart="true" hidden="true" loop="false"></embed>';
if ( $( "body" ).find( "embed" ).length <= 0 )
$( "body" ).append( strEmbed );
var embed = document.embedPlay;
//浏览器不支持 audion,则使用 embed 播放
embed.volume = 100;
embed.play();
} else
{
//非IE内核浏览器
var strAudio = "<audio id='audioPlay' src='{:QCLOUD_IMGURL}/public/mp3/ts.mp3?v={:QCLOUD_CSSVERSION}' hidden='true'>";
if ( $( "body" ).find( "audio" ).length <= 0 )
$( "body" ).append( strAudio );
var audio = document.getElementById( "audioPlay" );
//浏览器支持 audion
audio.play();
}
}
set_statistical_chart(".section_order_count .filter_date a:first", "order", "week"); //初始设置
set_statistical_chart(".section_total_count .filter_date a:first", "sale", "week"); //初始设置
function set_statistical_chart(obj, type, date) {
var obj = $(obj);
obj.addClass("active");
obj.siblings().removeClass("active");
$.ajax({
type: 'get',
url: 'index.php',
data: 'act=set_statistical_chart&type=' + type + '&date=' + date,
dataType: 'json',
success: function (data) {
if (type == 'order') {
var div_id = "order_main";
}
if (type == 'sale') {
var div_id = "total_main";
}
var myChart = echarts.init(document.getElementById(div_id));
myChart.setOption(data);
}
})
}
var option = {
title: {
text: ''
},
tooltip: {
trigger: 'axis',
backgroundColor: "#f5fdff",
borderColor: "#8cdbf6",
borderRadius: "4",
borderWidth: "1",
padding: "10",
textStyle: {
color: "#272727",
},
axisPointer: {
lineStyle: {
color: "#6cbd40",
}
}
},
toolbox: {
show: true,
orient: "vertical",
x: "right",
y: "60",
feature: {
magicType: {show: true, type: ['line', 'bar']},
saveAsImage: {show: true}
},
},
calculable: true,
xAxis: [
{
type: 'category',
boundaryGap: false,
axisLine: {
lineStyle: {
color: "#ccc",
width: "0",
}
},
data: ['07-01', '07-02', '07-03', '07-04', '07-05', '07-06', '07-07']
}
],
yAxis: [
{
type: 'value',
axisLine: {
lineStyle: {
color: "#ccc",
width: "0",
}
},
axisLabel: {
formatter: '{value}个',
}
}
],
series: [
{
name: '订单个数',
type: 'line',
itemStyle: {
normal: {
color: "#6cbd40",
lineStyle: {
color: "#6cbd40",
}
}
},
data: [0, 5, 8, 3, 10, 15, 2],
markPoint: {
itemStyle: {
normal: {
color: "#6cbd40"
}
},
data: [
{type: 'max', name: '最大值'},
{type: 'min', name: '最小值'}
]
}
}
]
};
// $("#system_section").click(function(){
// $("#system_warp").slideDown();
// });
var QRCode = new QRCode(document.getElementById("ewm_box"), {
width: $('#ewm_box').width(),
height: $('#ewm_box').height(),
});
var trxNo = '';
var payUrl = '';
var recharge_no = '';
var bankOrderNo = '';
var pay_userNo = '{:pay_userNo}';
var pay_url = '{:pay_url}';
var pay_qurl = '{:pay_qurl}';
$(document).on("click", ".kfnum", function () {
$(".kfnum").removeClass("on");
$(this).addClass("on");
if ($(this).attr('flag') == '1000') {
$('#buy_num').val('2');
$('#buy_money').text('1000');
$('#buy_num').attr("readonly", true);
} else {
$('#buy_num').val('3');
$('#buy_money').text($('#buy_num').val() * 400);
$('#buy_num').attr("readonly", false);
}
});
//数量改变金额
$('#buy_num').on('input propertychange', function () {
if (!$('#buy_num').readOnly) {
var N = $('#buy_num').val();
if (N == '') {
$('#buy_money').text(0);
return false;
} else {
N = parseInt(N);
if (N < 3 || isNaN(N)) {
$('#buy_num').val(3);
} else {
$('#buy_num').val(N);
}
}
}
$('#buy_money').text($('#buy_num').val() * 400);
});
//支付方式
$(document).on("click", ".payment", function () {
$(".payment").removeClass("on");
$(this).addClass("on");
$("#ewm_box img").attr('src', '');//清空二维码
trxNo = '';
payUrl = '';
recharge_no = '';
bankOrderNo = '';
if ($('#buy_money').text() == 0){
layer.msg('金额不正确!', {icon: 2, time: 2000});
return false;
} else {
var buy_money = parseInt($('#buy_money').text());
if (isNaN(buy_money)) {
layer.msg('金额不正确!', {icon: 2, time: 2000});
return false;
};
}
var orderNo = getNowFormatDate('udatetimes');
var API = {
'payWay': $(this).attr('flag'),//支付方式:ALIPAY、WEIXIN
'price': 0.01,//金额
'notifyUrl':"{:curHostURL()}" +'/admin/Index/notify',//回调地址
'orderNo': orderNo,//订单号:以毫秒级时间
'businessType': 'ERP_MALL_RCG',//业务类型
'productName': 'mshop_kf_recharge',//商品名称,encodeURI('')
'userNo': pay_userNo,//测试
};
var param = 'businessType=' + API['businessType'] +
'¬ifyUrl=' + API['notifyUrl'] +
'&orderNo=' + API['orderNo'] +
'&payWay=' + API['payWay'] +
'&price=' + API['price'] +
'&productName=' + API['productName'] +
'&userNo=' + API['userNo'];
var sign = '&sign=' + (hex_md5(param + '&key=ab84b084c841d444')).toUpperCase(); //param+key->md5->大写->sign,注参数为空时不带入签名
var url = pay_url + '?' + param + sign;
var shadow = layer.msg('加载中...', {icon: 16,shade: [0.5, '#f5f5f5'],scrollbar: false,offset: '10px', time:1000000});
var r = ajax_return(url, '', false, 'GET', 2);
console.log(r);
//支付接口
if (r['code'] == 0) {
var data = {
'trxNo': r['data']['trxNo'],//流水号
'payUrl': r['data']['payUrl'],//支付链接
'recharge_no': r['data']['orderNo'],//传入的orderNo
'bankOrderNo': r['data']['bankOrderNo'],//银行订单号=流水号
'buy_num': $('#buy_num').val(),//数量
'buy_money': buy_money,//金额
'recharge_type': $(this).attr('flag')=='WEIXIN'?1:2,//支付方式:ALIPAY、WEIXIN
'type': $('#pay_type').val(),//开通类型
};
var res = ajax_return('{:url("Index/recharge_add")}', data, false, 'post', 2);
console.log(res);
//生成recharge_state=0的支付记录
if (res['code'] == 1) {
trxNo = r['data']['trxNo']; //流水号
payUrl = r['data']['payUrl']; //支付链接
recharge_no = r['data']['orderNo']; //传入orderNo
bankOrderNo = r['data']['bankOrderNo']; //银行订单号=流水号
QRCode.makeCode(payUrl); //生成二维码
$("#ewm_box").attr('title', '');
layer.close(shadow);
}
} else {
layer.close(shadow);
layer.msg(r['msg'], {icon: 2, time: 2000});
}
});
$(".thisbtn").click(function () {
layer.open({
type: 1,
title: ['商城在线客服系统开通', 'font-size:14px;'],
skin: 'layui-layer-rim', //加上边框
area: ['650px', 'auto'], //宽高
content: $('.laybox'),
cancel: function () {
if (bankOrderNo != '') {
var shadow = layer.msg('加载中...', {icon: 16,shade: [0.5, '#f5f5f5'],scrollbar: false,offset: '10px', time:1000000});
var r = ajax_return(pay_qurl + '?bankOrderNo=' + bankOrderNo, '', false, 'GET', 2);
layer.close(shadow);
if (r['code'] == 0) {
if (r['data']['status'] == 100) {
//充值成功,却点取消按钮的情况
layer.closeAll();
layer.alert('支付成功,本次购买客服个数:' + $('#buy_num').val() + ',支付金额:' + $('#buy_money').text(),
{icon: 6, time: 5000});
}
} else {
//删除未成功的记录
// ajax_return('{:url("Index/recharge_del")}', {'bankOrderNo':bankOrderNo}, true, 'post', 2);
ajax_return('{:url("Index/recharge_del")}', '', true, 'get', 2);
}
}
},
});
});
var T = window.setInterval("submit_wx()", 2000); //自动校验
//关闭支付页面
function submit_wx() {
var No = bankOrderNo;
if (No != '') {
//支付状态查询
var arr = ajax_return(pay_qurl + '?bankOrderNo=' + No, '', false, 'GET', 2);
//客户支付完成
if (arr['code'] == 0) {
//支付完成&&处理完成
if (arr['data']['status'] == 100) {
trxNo = '';
payUrl = '';
recharge_no = '';
bankOrderNo = '';
layer.closeAll();
layer.alert('支付成功,本次购买客服个数:' + $('#buy_num').val() + ',支付金额:' + buy_money,
{icon: 6, time: 3000});
}
}
}
}
</script>
</body>
</html>