show_dj.html
14.9 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
<include file="public/layout"/>
<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/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>
.payment:hover {cursor: pointer; }
.kfnum{margin: 0}
.market_price{ text-decoration: line-through; font-size: 12px}
.buttom{ display: inline-block; width: 70px; height: 20px; text-align: center; line-height: 20px; border-radius:5px; border: solid 1px #333 }
.buttom.on{ background: #169bd5;color:#fff;border: solid 1px #169bd5 }
.ware_more{ float: right; width: 570px}
.ware_ewm{float: left; margin-left: 20px}
</style>
<body style="background-color: rgb(255, 255, 255); overflow: hidden; cursor: default; -moz-user-select: inherit;">
<div class="laybox" style="width: 820px">
<dl style="text-align: center;color: #333;">
<if condition="$Max_end_time">
<div style="float: right"><span onclick="go_xufei()" class="buttom" style="margin-right: 5px">续期</span><span class="buttom on">升级</span></div>
</if>
<dt style="font-size: 30px;">PLUS会员</dt>
<dd style="font-size: 14px;">在普通会员基础上通过付费的方式获得相应PLUS会员,享受相应的价格,商家可设置会员推荐奖励,让会员将商家平台进行扩散吸引更多的新会员,大大提高会员的活跃性</dd>
<dd>
<foreach name="price_arr" key="k" item="v">
<if condition="$v.money gt 0">
<div class="kfnum" flag="{$v.money}" num="{$v.user_num}" pid="{$v.id}" is_buy="{$v.is_buy}" onclick="setkfnum(this)">
<div class="">
<em>{$v.money}</em>元/年
</div>
<div>{$v.user_num}人</div>
<img class="ribot" src="__PUBLIC__/static/images/ribot.png" alt="">
</div>
<else/>
<if condition="$v.type eq 1">
<div class="kfnum">
<div class="">
<em>面谈</em>
</div>
<div>{$v.title}</div>
<img class="ribot" src="__PUBLIC__/static/images/ribot.png" alt="">
</div>
<else/>
<div class="kfnum" onclick="freeTast()">
<div class="">
<em>免费</em>
</div>
<div>免费体验{$v.user_num}人</div>
<img class="ribot" src="__PUBLIC__/static/images/ribot.png" alt="">
</div>
</if>
</if>
</foreach>
</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>
<!-- 1年有效期内 -->
<if condition="$Max_end_time">
<li>支付金额:<em id="buy_money"></em>元 <span class="market_price">(原价:<font id="market_money"></font>元)</span> (支付金额=<font id="old_money"></font>\12*{$two_time}(剩余月份包含当月))</li>
<li>购买人数:<em id="buy_num"></em>人</li>
<li>预计可用:<em id="buy_can_num"></em>人</li>
<li>当前剩余:<em id="enablenum1"></em>人</li>
<li>有效时间:<em style="color: black;font-size:16px;">{$Max_end_time|date='Y-m-d',###}</em></li>
<else/>
<li>支付金额:<em id="buy_money"></em>元</li>
<li>购买人数:<em id="buy_num"></em>人</li>
<li>预计可用:<em id="buy_can_num"></em>人</li>
<li>当前有效人数:<em id="enablenum1"></em>人</li>
<li>有效时间:<em style="color: black;font-size:16px;">{$exp_date|date='Y-m-d',###}</em></li>
</if>
<li style="color: red">注:请确认可用人数再进行支付!</li>
<li>
<span class="wx payment" flag="WEIXIN"></span>
<span class="zfb payment" flag="ALIPAY"></span>
</li>
<li style="color:#fe6e18;">支付完成之前不要关闭此窗体</li>
</ul>
</div>
</dd>
</dl>
</div>
<script>
var trxNo = '';
var payUrl = '';
var recharge_no = '';
var bankOrderNo = '';
var pay_qurl = '{:pay_qurl}';
var pid=0;
var ucount="{$ucount}";
var is_buyed="{$is_buyed}";
var two_time="{$two_time}";
var old_max_num="{$old_max_num}";
//默认选择价格最低的
$(function () {
var minprice=0;
//--- 如果由买过 ---
if(is_buyed=="1"){
$('.kfnum').each(function () {
var flag=$(this).attr('flag');
var is_by=$(this).attr('is_buy');
if(flag!=undefined && minprice==0 && is_by=="1"){
minprice=flag;
var ob=this;
$(".kfnum").removeClass('on');
$(ob).addClass('on');
var money=$(ob).attr('flag');
var bnum= parseInt($(ob).attr('num'));
var num=bnum;
if(ucount!="") num= parseInt(old_max_num)-parseInt(ucount);
pid=$(ob).attr('pid');
//--购买有效期内---
<if condition="$Max_end_time">
var cur_money=(money/12*parseInt(two_time)).toFixed(2);
$("#buy_money").text(cur_money);
$("#old_money").text(money);
$("#market_money").text(money);
$("#buy_num").text(bnum);
$("#buy_can_num").text(bnum+num);
$("#enablenum1").text(num);
<else/>
$("#buy_money").text(money);
$("#buy_num").text(bnum);
$("#buy_can_num").text(bnum);
$("#enablenum1").text(ucount);
</if>
$("#ewm_box img").attr('src', '');//清空二维码
$(".payment").removeClass("on");
//默认微信支付
$('.wx.payment').click();
return false;
}
});
}else{
$('.kfnum').each(function () {
var flag=$(this).attr('flag');
var is_buy=$(this).attr('is_buy');
if(flag!=undefined && minprice==0 ){
minprice=flag;
var ob=this;
$(".kfnum").removeClass('on');
$(ob).addClass('on');
var money=$(ob).attr('flag');
var num=parseInt($(ob).attr('num'));
if(ucount!="")
num=num-parseInt(ucount);
pid=$(ob).attr('pid');
$("#buy_money").text(money);
$("#buy_num").text(bnum);
$("#buy_can_num").text(bnum);
$("#enablenum1").text(ucount);
$("#ewm_box img").attr('src', '');//清空二维码
$(".payment").removeClass("on");
//默认微信支付
$('.wx.payment').click();
return false;
}
});
}
});
/*--支付--*/
var QRCode = new QRCode(document.getElementById("ewm_box"), {
width: $('#ewm_box').width(),
height: $('#ewm_box').height(),
});
//支付方式
$(document).on("click", ".payment", function () {
$(".payment").removeClass("on");
$(this).addClass("on");
$("#ewm_box img").attr('src', '');//清空二维码
trxNo = '';
payUrl = '';
recharge_no = '';
bankOrderNo = '';
create_QRCode(this);
});
//数量改变金额
$('#buy_num').on('input propertychange', function () {
if (!$('#buy_num').readOnly) {
var num = $('#buy_num').val();
if (num == '' || isNaN(parseInt(num))) {
num = 0;
}
$('#buy_num').val(parseInt(num));
$('#buy_money').text($('#buy_num').val() * dis_price);
$('#enablenum1').text(dis_num);
$('#enablenum2').text(dis_num+parseInt(num));
}
$(".payment").removeClass("on");
$("#ewm_box img").attr('src', '');//清空二维码
});
//选择购买项目
function setkfnum(ob)
{
$(".kfnum").removeClass('on');
$(ob).addClass('on');
/*---
var money=$(ob).attr('flag');
var num=$(ob).attr('num');
if(ucount!="")
num=num-parseInt(ucount);
pid=$(ob).attr('pid');
$("#buy_money").text(money);
$("#enablenum1").text(num);
$("#ewm_box img").attr('src', '');//清空二维码
$(".payment").removeClass("on");
//默认选择微信
$('.wx.payment').click();--*/
//--- 如果由买过 ---
if(is_buyed=="1"){
$(".kfnum").removeClass('on');
$(ob).addClass('on');
var money=$(ob).attr('flag');
var bnum= parseInt($(ob).attr('num'));
var num=bnum;
if(ucount!="") num= parseInt(old_max_num)-parseInt(ucount);
pid=$(ob).attr('pid');
//--购买有效期内---
<if condition="$Max_end_time">
var cur_money=(money/12*parseInt(two_time)).toFixed(2);
$("#buy_money").text(cur_money);
$("#old_money").text(money);
$("#market_money").text(money);
$("#buy_num").text(bnum);
$("#buy_can_num").text(bnum+num);
$("#enablenum1").text(num);
<else/>
$("#buy_money").text(money);
$("#buy_num").text(bnum);
$("#buy_can_num").text(parseInt(bnum)-parseInt(ucount));
$("#enablenum1").text(ucount);
</if>
$("#ewm_box img").attr('src', '');//清空二维码
$(".payment").removeClass("on");
//默认微信支付
$('.wx.payment').click();
return false;
}else{
$(".kfnum").removeClass('on');
$(ob).addClass('on');
var money=$(ob).attr('flag');
var num=$(ob).attr('num');
if(ucount!="")
num=num-parseInt(ucount);
pid=$(ob).attr('pid');
$("#buy_money").text(money);
$("#enablenum1").text(num);
$("#ewm_box img").attr('src', '');//清空二维码
$(".payment").removeClass("on");
//默认微信支付
$('.wx.payment').click();
return false;
}
};
//生成二维码
function create_QRCode(obj)
{
if(pid==0) {
layer.alert('请选择购买的价格!',{icon: 6, time: 3000});
return;
}
var payway=$(obj).attr('flag');
var data = {
'buy_num': 1,//数量
'payWay': payway,
'type':8, //等级卡
'pid':pid
};
var shadow = layer.msg('加载中...', {icon: 16,shade: [0.5, '#f5f5f5'],scrollbar: false,offset: '150px',time: 0});
var r = ajax_return('{:url("Index/Create_QRCode")}', data, false, 'post', 2);
if (r['code'] == 1) {
trxNo = r['trxNo']; //流水号
payUrl = r['payUrl']; //支付链接
recharge_no = r['orderNo']; //传入orderNo
bankOrderNo = r['bankOrderNo']; //银行订单号=流水号
QRCode.makeCode(payUrl); //生成二维码
$("#ewm_box").attr('title', '');
setTimeout(function () {
layer.close(shadow);
},500)
}
}
//定时校验支付状态,支付成功时关闭支付layer
var T = window.setInterval("submit_wx()", 1000);
function submit_wx()
{
if (bankOrderNo != '') {
$.ajax({
url: '/index.php/admin/index/recharge_query?bankOrderNo=' + bankOrderNo,
dataType:'json',
success: function (v) {
if (v.code == 0) {
//支付完成&&处理完成
if (v.data.status == 100) {
clearInterval(T);
trxNo = '';
payUrl = '';
recharge_no = '';
bankOrderNo = '';
parent.layer.closeAll();
parent.fxcallback();
}
}
}
});
}
}
//---免费体验----
function freeTast() {
if(confirm('您确定要免费体验吗?')){
var shadow = layer.msg('加载中...', {icon: 16,shade: [0.5, '#f5f5f5'],scrollbar: false,offset: '150px',time: 0});
$.ajax({
type: 'get',
url: '/index.php/admin/index/free_tast',
dataType: 'json',
success: function (data) {
layer.close(shadow);
if (data.code== 1) {
layer.alert('您提交体验成功!',{icon: 6, time: 3000});
}else{
layer.alert(data.msg,{icon: 6, time: 3000});
}
}
});
}
}
function go_xufei() {
window.location.href="/index.php/admin/index/show_dj?is_xuqi=1";
}
</script>
</body>
</html>