card.html
31.3 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
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
{php define('MUI', true);}
{template 'common/header'}
{if $op == 'receive_card'}
<style>
.membership-card-receive .card-panel .card-grade{position: absolute; right: 10px; top: 10px;}
.membership-card-receive .card-panel .card-logo{left: 10px; top: 10px;}
.membership-card-receive .card-panel .card-logo img{margin: 0; vertical-align: top;}
.membership-card-receive .card-panel .card-rank{font-size:20px; padding: 0 10px;}
</style>
<div class="mui-content membership-card-receive">
{if !empty($setting['grant']) && ($setting['grant']['credit1'] || $setting['grant']['credit2'] || !empty($coupon))}
<div class="mui-bg-warning mui-text-center tips">
领卡赠送:
{if $setting['grant']['credit2'] > 0}
¥<span class="mui-big">{$setting['grant']['credit2']}</span>
{/if}
{if $setting['grant']['credit1'] > 0}
+ <span class="mui-big">{$setting['grant']['credit1']}</span>积分
{/if}
{if !empty($coupon_title)}
卡券:{$coupon_title}
{/if}
</div>
{/if}
<div class="card-panel" style="background-image: url(
{if empty($setting['background']['image'])}
{php echo tomedia('images/global/card/1.png')}
{elseif $setting['background']['background'] == 'system'}
{php echo tomedia('images/global/card/' . $setting['background']['image'] . '.png')}
{else}
{php echo tomedia($setting['background']['image']);}
{/if}
);">
<div class="card-logo mui-text-center">
{if !empty($setting['logo'])}<img src="{php echo tomedia($setting['logo'])}" class="mui-img-rounded"/>{/if}
</div>
<div class="card-grade" style="color:{if !empty($setting['color']['rank'])}{$setting['color']['rank']}{/if}"></div>
<div class="card-info">
<div class="mui-text-center" style="height:48px">
<span class="card-rank" style="color:{if !empty($setting['color']['title'])}{$setting['color']['title']}{/if}">{if $basic_info['params']['card_label']['type'] == 1}{$basic_info['params']['card_label']['title']}{/if}</span>
</div>
{if !$setting['format_type']}
<div class="card-no mui-text-right">会员卡号:<span style="color: #fff;">{$setting['format']}</span></div>
{/if}
</div>
</div>
<form class="tab-content clearfix js-card-form" action="{php echo $this->createMobileurl('card', array('op' => 'receive_card'))}" method="post" enctype="multipart/form-data">
<div class="mui-input-group">
<div class="mui-input-row">
<label>
姓名<span title="必填项" style="color:red">*</span>
</label>
{php echo tpl_app_fans_form('realname', $member_info['realname'], '姓名');}
</div>
<div class="mui-input-row">
<label>
手机<span title="必填项" style="color:red">*</span>
</label>
{php echo tpl_app_fans_form('mobile', $member_info['mobile'], '手机号码');}
</div>
{loop $setting['fields'] $item}
{if $item['bind'] != 'realname' && $item['bind'] != 'mobile'}
<div class="mui-input-row">
<label>
{$item['title']} {if $item['require'] == 1}<span title="必填项" style="color:red">*</span>{else} {/if}
</label>
{if $item['bind'] == 'reside' || $item['bind'] == 'resideprovince' || $item['bind'] == 'residecity' || $item['bind'] == 'residedist'}
{php echo tpl_app_fans_form('reside', array('province' => $member_info['resideprovince'],'city' => $member_info['residecity'],'district' => $member_info['residedist']));}
{elseif $item['bind'] == 'birth' || $item['bind'] == 'birthyear' || $item['bind'] == 'birthmonth' || $item['bind'] == 'birthday'}
{php echo tpl_app_fans_form('birth', array('year' => $member_info['birthyear'], 'month' => $member_info['birthmonth'], 'day' => $member_info['birthday']))}
{else}
{php echo tpl_app_fans_form($item['bind'],$member_info[$item['bind']],$item['title'])}
{/if}
</div>
{/if}
{/loop}
</div>
<div class="mui-content-padded">
<input type="hidden" name="token" value="{$_W['token']}" />
<button class="mui-btn mui-btn-success mui-btn-block" id="receive-card" type="submit" name="submit" value="提交">领取</button>
</div>
</form>
</div>
<script type="text/javascript">
$('.js-card-form').submit(function(event) {
$(this).data('submit', 1);
$('button[type="submit"]').prop('disabled', true);
$.ajax(this.action, {
method : this.method.toUpperCase(),
data : new FormData(this),
cache : false,
processData : false,
contentType : false,
dataType : 'json'
}).done(function(result) {
$(this).data('submit', 0);
if (result.type == 'success') {
location.href = result.redirect;
} else {
util.toast(result.message, '', 'error');
$('button[type="submit"]').prop('disabled', false);
util.toast(result.message, result.redirect, 'error');
}
}).fail(function(res) {
$(this).data('submit', 0);
util.toast('操作失败,请重试', '', 'error');
});
event.preventDefault();
return false;
});
</script>
{/if}
<!-- 我的会员卡 -->
{if $op == 'mycard'}
<style>
.back pre{
display: block;
font-size: 13px;
line-height: 1.42857143;
color: #333;
word-break: break-all;
word-wrap: break-word;
border-radius: 4px;
padding: 0;
margin: 0;
border: 0;
background: 0 0;
white-space: pre-line;
height: 84px;
overflow: hidden;
}
.membership-card-home .card-panel.prev .card-grade{position: absolute; right: 10px; top: 10px;}
.membership-card-home .card-panel.prev .card-logo{left: 10px; top: 10px;}
.membership-card-home .card-panel.prev .card-logo img{margin: 0; vertical-align: top;}
.membership-card-home .card-panel.prev .card-rank{font-size:20px; padding: 0 10px;}
</style>
{if empty($mcard['status'])}
<div class="alert alert-warning" role="alert">
您的会员卡已被禁用,如有疑问,请联系{$_W['account']['name']}。
</div>
{else}
<div class="mui-content membership-card-home mc-we7-home" style="padding-bottom:55px;">
<div class="card-panel prev" onclick="$(this).hide();$('.back').show()" style="background-image:url(
{if empty($setting['background']['image'])}
{php echo tomedia('images/global/card/1.png')}
{elseif $setting['background']['background'] == 'system'}
{php echo tomedia('images/global/card/' . $setting['background']['image'] . '.png')}
{else}
{php echo tomedia($setting['background']['image']);}
{/if}
)">
<a href="javascript:;">
<div class="card-logo mui-text-center">
{if !empty($setting['logo'])}<img src="{php echo tomedia($setting['logo'])}" class="mui-img-rounded"/>{/if}
</div>
<div class="card-grade" style="color:{if !empty($setting['color']['rank'])}{$setting['color']['rank']}{/if}">{if $basic_info['params']['card_level']['type'] == 1}{$_W['member']['groupname']}{/if}</div>
<div class="card-info">
<div class="mui-text-center" style="height:48px">
<span class="card-rank" style="color:{if !empty($setting['color']['title'])}{$setting['color']['title']}{/if}">{if $basic_info['params']['card_label']['type'] == 1}{$basic_info['params']['card_label']['title']}{/if}</span>
</div>
<div class="card-no mui-text-right">会员卡号:<span>{$mcard['cardsn']}</span></div>
</div>
</a>
</div>
<div class="card-panel back" style="display:none;background-image:url(
{if empty($setting['background']['image'])}
{php echo tomedia('images/global/card/1.png')}
{elseif $setting['background']['background'] == 'system'}
{php echo tomedia('images/global/card/' . $setting['background']['image'] . '.png')}
{else}
{php echo tomedia($setting['background']['image']);}
{/if}
)" onclick="$(this).hide();$('.prev').show()">
<span>
<h3 style="font-size:14px;font-weight:100;margin:10px 0;">使用说明:</h3>
<pre>
{if empty($setting['description'])}
1、本卡采取记名消费方式
2、持卡人可享受会员专属优惠
3、本卡不能与其他优惠活动同时使用
4、持卡人可用卡内余额进行消费
{else}
{$setting['description']}
{/if}
</pre>
</span>
</div>
<div class="mui-table mui-table-inline mui-mt15 nav-action">
<div class="mui-table-cell">
<a href="{php echo url('entry', array('m' => 'recharge', 'do' => 'pay'));}" class="mui-block">
<img src="resource/images/sum-recharge.png" alt="" class="mui-mr5"/>充值
</a>
</div>
<div class="mui-table-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'consume')) . '&wxref=mp.weixin.qq.com#wechat_redirect'}">
<img src="resource/images/scan-pay.png" alt=""/>付款
</a>
</div>
</div>
<ul class="mui-table-view mui-table-view-chevron">
<li class="mui-table-view-cell">
<a href="{php echo url('entry', array('m' => 'recharge', 'do' => 'pay'));}" class="mui-navigate-right">
我的余额
<span class="mui-pull-right">{$_W['member']['credit2']}</span>
</a>
</li>
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('creditrecord', array('credittype' => 'credit1', 'type' => 'record', 'period' => '1'))}" class="mui-navigate-right">
我的积分
<span class="mui-pull-right">{$_W['member']['credit1']}</span>
</a>
</li>
{if $setting['nums_status'] == 1}
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'recharge_record', 'type' => 'nums'))}" class="mui-navigate-right">
{$setting['nums_text']}
<span class="mui-pull-right">{$mcard['nums']}次</span>
</a>
</li>
{/if}
{if $setting['times_status'] == 1}
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'recharge_record', 'type' => 'times'))}" class="mui-navigate-right">
{$setting['times_text']}
<span class="mui-pull-right">{if $mcard['endtime'] < time()}已过期{else}{php echo date('Y-m-d', $mcard['endtime']);}{/if}</span>
</a>
</li>
{/if}
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('activity', array('op' => 'mine', 'type' => 'coupon'))}" class="mui-navigate-right">
我的卡券
<span class="mui-pull-right">{$total}张</span>
</a>
</li>
</ul>
<ul class="mui-table-view mui-table-view-chevron">
{if !empty($setting['sign_status'])}
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'sign_display')) . '&wxref=mp.weixin.qq.com#wechat_redirect'}" class="mui-navigate-right">
签到
</a>
</li>
{/if}
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'notice')) . '&wxref=mp.weixin.qq.com#wechat_redirect'}" class="mui-navigate-right">
消息
<span class="mui-pull-right"><span class="mui-badge {if $new_notice_total > 0}mui-badge-primary{/if}">{$new_notice_total}</span></span>
</a>
</li>
</ul>
<ul class="mui-table-view mui-table-view-chevron">
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'personal_info')) . '&wxref=mp.weixin.qq.com#wechat_redirect';}" class="mui-navigate-right">
个人信息
</a>
</li>
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('creditrecord', array('credittype' => 'credit2', 'type' => 'record', 'period' => '1'))}" class="mui-navigate-right">
账单
</a>
</li>
</ul>
{if !empty($activity_description_show)}
<ul class="mui-table-view mui-table-view-chevron">
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'activity_description')) . '&wxref=mp.weixin.qq.com#wechat_redirect';}" class="mui-navigate-right">
优惠说明
</a>
</li>
</ul>
{/if}
</div>
{/if}
{/if}
{if $op == 'activity_description'}
<div class="mui-content">
<ul class="mui-table-view mui-table-view-chevron">
{if $activity_info['params']['discount_type'] != 0}
<li class="mui-table-view-cell js-activity-descrpition">
消费优惠信息
<span class="mui-pull-right">
<span class="fa fa-angle-down">
</span>
</li>
<div style="display:none;">
<ul class="mui-table-view mui-table-view-chevron">
{loop $activity_description $description}
<li class="mui-table-view-cell mui-content-padded">
{$description[0]}
<span style="margin-left:50px;" class="mui-text-center">{$description[1]}</span>
</li>
{/loop}
</ul>
{if $activity_info['params']['discount_style'] == 2}
<div style="background-color:{$activity_info['params']['bgColor']}">{$activity_info['params']['content']}</div>
{/if}
</div>
{/if}
{if $recharge_info['params']['recharge_type'] != 0}
<li class="mui-table-view-cell js-activity-descrpition">
充值优惠信息
<span class="mui-pull-right">
<span class="fa fa-angle-down">
</span>
</li>
<div style="display:none;">
<ul class="mui-table-view mui-table-view-chevron">
{loop $recharge_description $description}
<li class="mui-table-view-cell mui-content-padded mui-text-center">
<span style="margin-left:50px;">
{$description}
</span>
</li>
{/loop}
</ul>
</div>
{/if}
{if $nums_info['params']['nums_status'] != 0}
<li class="mui-table-view-cell js-activity-descrpition">
{$nums_info['params']['nums_text']}信息
<span class="mui-pull-right">
<span class="fa fa-angle-down">
</span>
</li>
<div style="display:none;">
<ul class="mui-table-view mui-table-view-chevron">
{loop $nums_description $description}
<li class="mui-table-view-cell mui-content-padded mui-text-center">
<span>
{$description}
</span>
</li>
{/loop}
</ul>
{if $nums_info['params']['nums_style'] == 2}
<div style="background-color:{$nums_info['params']['bgColor']}">{$nums_info['params']['content']}</div>
{/if}
</div>
{/if}
{if $times_info['params']['times_status'] != 0}
<li class="mui-table-view-cell js-activity-descrpition">
{$times_info['params']['times_text']}信息
<span class="mui-pull-right">
<span class="fa fa-angle-down">
</span>
</li>
<div style="display:none;">
<ul class="mui-table-view mui-table-view-chevron">
{loop $times_description $description}
<li class="mui-table-view-cell mui-content-padded mui-text-center">
<span>
{$description}
</span>
</li>
{/loop}
</ul>
{if $times_info['params']['times_style'] == 2}
<div style="background-color:{$times_info['params']['bgColor']}">{$times_info['params']['content']}</div>
{/if}
</div>
{/if}
</ul>
</div>
<script>
$('.js-activity-descrpition').click(function() {
$(this).next().toggle();
$(this).find('span.fa').toggleClass('fa-angle-up');
$(this).find('span.fa').toggleClass('fa-angle-down');
})
</script>
{/if}
{if $op == 'add_recharge'}
<div class="mui-content membership-card-add-times">
<div class="mui-section mui-text-center">
请选择您要增加的{if $type == 'nums'}次数{elseif $type == 'times'}时间{/if}
</div>
<div class="mui-row mui-mr5 mui-ml5">
{php $i = 0;}
{loop $setting $nums}
<div class="mui-col-xs-4 mui-pa5 mui-mt5">
<div class="mui-thumbnail mui-text-center mui-text-info {if $i == '0'}selected{/if}" data-nums="{if $type == 'nums'}{$nums['num']}{elseif $type == 'times'}{$nums['time']}{/if}" data-recharge="{$nums['recharge']}">
<div class="mui-big">{if $type == 'nums'}{php echo $nums['num'] . '次'}{elseif $type == 'times'}{php echo $nums['time'] . '天'}{/if}</div>
<div class="mui-small">{$nums['recharge']}元</div>
<div class="selected-status"></div>
</div>
</div>
{php $i++;}
{/loop}
</div>
<ul class="mui-table-view">
<li class="mui-table-view-cell">
实际增加的{if $type == 'nums'}次数{elseif $type == 'times'}时间{/if} <span class="mui-pull-right add-nums"></span>
</li>
<li class="mui-table-view-cell">
需要支付的金额 <span class="mui-pull-right mui-text-success mui-big add-pay"></span>
</li>
</ul>
<div class="mui-content-padded">
<a class="mui-btn mui-btn-success mui-btn-block dopay" href="javascript:;">确认支付</a>
</div>
</div>
<script>
$(function(){
$('.mui-thumbnail').click(function(){
$('.mui-thumbnail').removeClass('selected');
$(this).addClass('selected');
var type = '{$type}';
var addnums = $(this).data('nums');
var addpay = $(this).data('recharge');
var status = '<div class="selected-status"></div>';
if (type == 'nums') {
$('.add-nums').text(addnums + '次');
url = "{php echo url('entry', array('m' => 'recharge', 'do' => 'pay', 'type' => 'card_nums'), true)}&fee=" + addpay;
} else if(type == 'times') {
$('.add-nums').text(addnums + '天');
url = "{php echo url('entry', array('m' => 'recharge', 'do' => 'pay', 'type' => 'card_times'), true)}&fee=" + addpay;
}
$('.add-pay').text(addpay + '元');
$('.dopay').attr('href', url);
})
$('.mui-thumbnail:first').click();
})
</script>
{/if}
{if $op == 'recharge_record'}
<!-- 查看剩余次数或天数 -->
<div class="mui-content membership-card-times">
<div class="mui-section">
<div class="mui-text-success mui-text-center times">{if $type == 'nums'}{$card['nums']}{elseif $type == 'times'}{php echo date('Y-m-d', $card['endtime'])}{/if}</div>
<div class="mui-text-center mui-text-muted">{if $type == 'nums'}{$setting['nums_text']}{elseif $type == 'times'}{$setting['times_text']}{/if}</div>
{if $type == 'nums'}
<a class="mui-btn mui-btn-success mui-btn-outlined mui-btn-block" href="{php echo $this->createMobileurl('card', array('op' => 'add_recharge', 'type' => 'nums'));}">立即充值</a>
{elseif $type == 'times'}
<a class="mui-btn mui-btn-success mui-btn-outlined mui-btn-block" href="{php echo $this->createMobileurl('card', array('op' => 'add_recharge', 'type' => 'times'));}">立即充值</a>
{/if}
</div>
<ul class="mui-table-view">
<li class="mui-table-view-cell">
<div class="mui-row">
<div class="mui-col-xs-3">
<a href="#times-date">
<span class="date-filter">{$period_date}</span>
<span class="mui-text-muted"><i class="fa fa-angle-down"></i></span>
</a>
</div>
</div>
</li>
{loop $data $da}
<li class="mui-table-view-cell">
<div class="mui-row">
<div class="mui-col-xs-6">
{if $type == 'nums'}
{if $da['model'] == '1'}
次数充值
{else}
次数消费
{/if}
{else}
{if $da['model'] == '1'}
服务延长
{else}
服务减少
{/if}
{/if}
<span class="mui-block mui-text-muted mui-small"> <span class="mui-ml5 mui-rmb">{$da['fee']}</span></span>
</div>
<div class="mui-col-xs-6 mui-text-right">
<span class="mui-big">{if $da['model'] == '1'}+{else}-{/if}{$da['tag']}{if $type == 'nums'}次{elseif $type == 'times'}天{/if}</span>
<span class="mui-block mui-text-muted mui-small">{php echo date('Y-m-d', $da['addtime'])}</span>
</div>
</div>
</li>
{/loop}
</ul>
<div id="times-date" class="mui-popover mui-popover-top">
<ul class="mui-table-view">
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'recharge_record', 'period' => '1', 'type' => $type));}">{php echo date('Y.m', strtotime('now'))}</a>
</li>
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'recharge_record', 'period' => '-1', 'type' => $type));}">{php echo date('Y.m', strtotime('now - 1 month'))}</a>
</li>
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'recharge_record', 'period' => '-2', 'type' => $type));}">{php echo date('Y.m', strtotime('now - 2 month'))}</a>
</li>
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'recharge_record', 'period' => '-3', 'type' => $type));}">{php echo date('Y.m', strtotime('now - 3 month'))}</a>
</li>
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'recharge_record', 'period' => '-4', 'type' => $type));}">{php echo date('Y.m', strtotime('now - 4 month'))}</a>
</li>
</ul>
</div>
</div>
{/if}
{if $op == 'sign_display'}
<!--签到界面-->
<div class="mui-content membership-card-sign mui-text-center">
<div class="mui-table mui-table-inline nav-action">
<div class="mui-table-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'sign_record', 'period' => '1'))}" class="mui-block">
<img src="resource/images/icon-sign.png" alt="" />
签到记录
</a>
</div>
<div class="mui-table-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'sign_strategy'))}" class="mui-block">
<img src="resource/images/icon-integral-strategy.png" alt="" />
积分攻略
</a>
</div>
</div>
<div class="sign-table">
<div class="mui-bg-white sign-table-con mui-clearfix">
{php for ($i = 1; $i <= $current_month_days; $i++) {}
{if $i == $sign_set['first_group_day']}
<div class="sign-table-cell {if $i <= $total}active{/if}">
<span><img src="resource/images/icon-signed-5.png" alt="" class="{if $i > $total}gray-img{/if} signed-5"/></span>
+{$sign_set['first_group_num']}
</div>
{elseif $i == $sign_set['second_group_day']}
<div class="sign-table-cell {if $i <= $total}active{/if}">
<span><img src="resource/images/icon-signed-5.png" alt="" class="{if $i > $total}gray-img{/if} signed-5"/></span>
+{$sign_set['second_group_num']}
</div>
{elseif $i == $sign_set['third_group_day']}
<div class="sign-table-cell {if $i <= $total}active{/if}">
<span><img src="resource/images/icon-signed-5.png" alt="" class="{if $i > $total}gray-img{/if} signed-5"/></span>
+{$sign_set['third_group_num']}
</div>
{elseif $i == $current_month_days}
<div class="sign-table-cell {if $i <= $total}active{/if}">
<span><img src="resource/images/icon-signed-5.png" alt="" class="{if $i > $total}gray-img{/if} signed-5"/></span>
+{$sign_set['full_sign_num']}
</div>
{else}
<div class="sign-table-cell {if $i <= $total}active{/if}">
<span><img src="resource/images/icon-signed.png" alt="" class="{if $i > $total}gray-img{/if}"/></span>
+{$sign_set['everydaynum']}
</div>
{/if}
{php }}
</div>
</div>
{if !empty($today_signed['id'])}
<div class="sign-record">今日已签到<span class="mui-big">+{$today_sign_credit}</span>积分</div>
<div class="mui-text-muted sign-tips mui-mt10">明日可得 <span>+{$tomorrow_sign_credit}</span>积分</div>
{/if}
</div>
<script>
$(function() {
today_signed = "{$today_signed['id']}";
if (!today_signed) {
util.toast('签到成功');
setTimeout(function(){
location.reload();
},2500);
}
})
</script>
{/if}
{if $op == 'sign_record'}
<!--签到记录-->
<div class="mui-content">
<div class="mui-content-padded">
<a href="#sign-date" class="mui-text-muted">
<span>{if $_GPC['period'] <= 0}{php echo date('Y.m', strtotime($_GPC['period'] . 'month'))}{else}查看全部{/if}</span>
<span><i class="fa fa-angle-down"></i></span>
</a>
</div>
<div class="credits-display">
<ul class="mui-table-view js-card-sign">
{if !empty($data)}
{loop $data $da}
<li class="mui-table-view-cell">
<div class="mui-row">
<div class="mui-col-xs-6">
{$da['addtime']}
<span class="mui-block mui-text-muted mui-small">签到送积分</span>
</div>
<div class="mui-col-xs-6 mui-text-right mui-big">
+{$da['credit']}
</div>
</div>
</li>
{/loop}
{else}
<li class="mui-table-view-cell">
<div class="mui-row">无签到记录</div>
</li>
{/if}
</ul>
</div>
<div id="sign-date" class="mui-popover mui-popover-top">
<ul class="mui-table-view">
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'sign_record', 'period' => '1'))}">查看全部</a>
</li>
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'sign_record', 'period' => '0'))}">{php echo date('Y.m', strtotime('today'))}</a>
</li>
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'sign_record', 'period' => '-1'))}">{php echo date('Y.m', strtotime('-1month'))}</a>
</li>
<li class="mui-table-view-cell">
<a href="{php echo $this->createMobileurl('card', array('op' => 'sign_record', 'period' => '-2'))}">{php echo date('Y.m', strtotime('-2month'))}</a>
</li>
</ul>
</div>
</div>
<script>
require(['mui.pullrefresh'], function(mui) {
mui.init();
mui.ready(function() {
var page = 2;
var pagetotal = {$pagenums} + 1;
if (page < pagetotal) {
//循环初始化所有下拉刷新,上拉加载。
mui.each(document.querySelectorAll('.credits-display'), function(index, pullRefreshEl) {
mui(pullRefreshEl).pullToRefresh({
up: {
callback: function() {
var self = this;
setTimeout(function() {
$('.mui-pull-bottom-tips').hide();
var ul = self.element.querySelector('.js-card-sign');
ul.appendChild(createFragment(ul, index, 5));
if (pagetotal <= page) {
$('.mui-pull-bottom-tips').hide();
self.endPullUpToRefresh(true);
} else {
self.endPullUpToRefresh(false);
}
}, 1000);
}
}
});
});
var createFragment = function(ul, index, count, reverse) {
var length = ul.querySelectorAll('li').length;
var fragment = document.createDocumentFragment();
var li;
var url = "{php echo $this->createMobileurl('card', array('op' => 'sign_record', 'period' => $_GPC['period']), true)}";
mui.post(url, {'page' : page}, function(data){
data = $.parseJSON(data);
if (data.message.errno == '1') {
return false;
}
for (var i in data.message.message) {
li = document.createElement('li');
li.className = 'mui-table-view-cell';
li.innerHTML = '<div class="mui-row"><div class="mui-col-xs-6">' + data.message.message[i].addtime + '<span class="mui-block mui-text-muted mui-small">签到送积分</span></div><div class="mui-col-xs-6 mui-text-right mui-big">+' +data.message.message[i].credit + '</div></div>';
ul.appendChild(li, ul.firstChild);
}
$('.mui-pull-bottom-tips').show();
});
page++;
return fragment;
};
}
});
});
</script>
{/if}
{if $op == 'sign_strategy'}
<div class="mui-content membership-card-integral-strategy">
<div class="mui-big mui-text-info mui-text-center mui-mt15">积分攻略</div>
<div class="mui-content-padded">
{$content}
</div>
</div>
{/if}
{if $op == 'notice'}
<div class="mui-content">
<div class="mui-content-padded">
<div id="segmentedControl" class="mui-segmented-control mui-segmented-control-info">
<a class="mui-control-item mui-active" href="#broadcast">广播</a>
<a class="mui-control-item" href="#system-message">系统消息</a>
</div>
</div>
<div id="broadcast" class="mui-control-content mui-active">
<ul class="mui-table-view mui-table-view-chevron">
{if !empty($data)}
{loop $data $da}
{if $da['type'] == '1'}
<li class="mui-table-view-cell mui-media js-read" data-isnew="{$da['is_new']}" data-id="{$da['id']}">
<a href="javascript:;" class="mui-navigate-right">
<img class="mui-media-object mui-pull-left" src="{php echo tomedia($da['thumb']);}">
<div class="mui-media-body">
<p class="mui-ellipsis">{$da['title']}</p>
<div class="mui-small mui-text-muted">{php echo date('Y-m-d H:i', $da['addtime']);}</div>
</div>
</a>
<div style="display:none;" class="js-content">
<p>
{$da['content']}
</p>
</div>
</li>
{/if}
{/loop}
{else}
<li class="mui-table-view-cell mui-media"><i class="fa fa-info-circle"></i> 暂无消息</li>
{/if}
</ul>
</div>
<div id="system-message" class="mui-control-content">
<ul class="mui-table-view mui-table-view-chevron">
<li class="mui-table-view-cell mui-media">暂无消息</li>
</ul>
</div>
</div>
<script>
$(document).on('click', '.mui-control-item', function() {
$('.mui-backdrop').remove();
})
$('.js-read').click(function(){
$(this).find('.js-content').toggle();
//设置为已读
if($(this).data('isnew')) {
var id = $(this).data('id');
$.post("{php echo $this->createMobileurl('card', array('op' => 'notice'))}", {'id':id}, function(data){
if(data != 0) {
$('.nav-group .notice-count em').html(data);
} else {
$('.nav-group .notice-count em').remove();
}
});
return false;
}
});
</script>
{/if}
{if $op == 'personal_info'}
<form class="tab-content clearfix js-ajax-form {if $_W['container'] !== 'wechat'}profile-form{/if}" action="{url 'mc/profile/editprofile'}" method="post" enctype="multipart/form-data">
<div class="mui-content">
<ul class="mui-table-view mui-table-view-chevron">
<li class="mui-table-view-cell">
<a href="{php echo url('mc/bond/mobile', array('op' => 'index'))}" class="mui-navigate-right">
手机
<span class="mui-pull-right"><span class="mui-mr10">{if empty($_W['member']['mobile'])}请绑定手机号{else}{$_W['member']['mobile']}{/if}</span></span>
</a>
</li>
</ul>
<div class="mui-input-group mui-mt15">
{loop $mc_fields $fields}
<div class="mui-input-row">
<label>{php echo $fields['title']}</label>
{if $fields['bind'] == 'birth'}
{php echo tpl_app_fans_form('birth', array('year' => $profile['birthyear'], 'month' => $profile['birthmonth'], 'day' => $profile['birthday']), $fields['title']);}
{else if $fields['bind'] == 'reside'}
{php echo tpl_app_fans_form('reside', array('province' => $profile['resideprovince'], 'city' => $profile['residecity'], 'district' => $profile['residedist']), $fields['title']);}
{else}
{php echo tpl_app_fans_form($fields['bind'], $profile[$fields['bind']], $fields['title']);}
{/if}
</div>
{/loop}
</div>
<div class="mui-content-padded">
<div class="mui-text-center mui-mt15 mui-mb15">
开卡时间:{php echo date('Y-m-d', $mcard['createtime']);}
</div>
<button class="mui-btn mui-btn-success mui-btn-block" type="submit" value="提交" name="submit">保存</button>
<input type="hidden" name="token" value="{$_W['token']}" />
</div>
</div>
</form>
{/if}
{if $op == 'consume'}
<div class="mui-content scan-pay">
<form action="{php echo $this->createMobileurl('card', array('op' => 'consume'))}" method="post" id="pay-form">
<div class="mui-pa10 mui-bg-white">
<h5 class="mui-desc-title">请选择门店</h5>
<div class="mui-input-row">
<input class="js-user-options" type="text" placeholder="请选择门店">
<input type="hidden" name="store_id">
</div>
<h5 class="mui-desc-title">设置付款金额</h5>
<div class="mui-input-row"><input type="text" value="" name="fee" placeholder="输入金额"/></div>
<button class="mui-btn mui-btn-success mui-btn-block">付款</button>
<input type="hidden" name="token" value="{$_W['token']}"/>
<input type="hidden" name="submit" value="{$_W['token']}"/>
</div>
</form>
</div>
<script>
$(function() {
stores = {php echo json_encode($stores_data)};
$('#pay-form').submit(function(){
var fee = $.trim($('#pay-form :text[name="fee"]').val());
var store_id = $('input[name="store_id"]').val();
reg = /^[0-9]+([.]{1}[0-9]{1,2})?$/;
if (stores.data.length >= 1) {
if (!store_id) {
util.toast('请选择门店', '', 'error');
return false;
}
}
if(!fee) {
util.toast('付款金额应大于0', '', 'error');
return false;
}
if (!reg.test(fee)) {
$('#pay-form :text[name="fee"]').val('');
util.toast('付款金额有误', '', 'error')
return false;
}
return true;
});
$(".js-user-options").on("tap", function(){
if (stores.data.length == 0) {
util.toast('当前无可用门店');
return false;
}
var $this = $(this);
util.poppicker(stores, function(items){
$('input[name="store_id"]').val(items[0].value);
$this.val(items[0].text);
});
});
});
</script>
{/if}
{template 'common/footer'}