user_help_info.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
738
739
740
741
742
743
744
745
746
747
<include file="public/layout" />
<style>
.btn {
color: #999;
cursor: pointer !important;
}
.prom_table {
width: 90%;
margin: 30px 0;
float: right;
}
.w10 {
line-height: 20px;
width: 10%;
text-align: center;
}
.w15 {
line-height: 20px;
width: 15%;
text-align: center;
}
.w30 {
line-height: 20px;
width: 30%;
text-align: center;
}
.ellipsis1{
white-space:nowrap;
text-overflow:ellipsis;
overflow:hidden;
}
th{
text-align: center;
}
.h40{
height: 40px;
}
.operations{
padding: 2px 10px;
padding-top: 5px;
border-radius: 4px;
margin-right: 5px;
color: #fff;
background: #169bd5;
}
.operation{
border: 1px solid #eee;
padding: 2px 10px;
padding-top: 5px;
border-radius: 4px;
margin-right: 5px;
}
.prom_info{
border: 1px #ddd solid;
max-width: 1000px;
}
.prom_info .prom_bottom {
padding: 10px 15px;
border-top: 1px #ddd solid;
}
.prom_info_tit{
padding: 5px 0;
background-color: #F5F5F5;
}
.prom_info_tit span{
display: inline-block;
*zoom: 1;
*display: inline;
text-align: center;
}
.prom_info .prom_bottom .add {
display: inline-block;
*zoom: 1;
*display: inline;
font-size: 12px;
line-height: 24px;
color: #ff3c3c;
background-color: #FFFFFF;
height: 24px;
padding: 2px 7px;
border: solid 1px #ff3c3c;
border-radius: 4px;
}
.prom_table {
margin: 30px 0;
text-align: center;
}
.prom_table td {
padding: 6px 5px;
max-height: 61px;
line-height: 30px;
overflow: hidden;
}
.prom_top{
border-top: 1px solid #ddd;
}
.prom_center1{
height: 55px;
line-height: 55px;
}
.prom_center div{
text-align: center;
}
.delete_task{
padding: 4px 10px;
border: 1px solid #ddd;
border-radius: 5px;
}
</style>
<!--以下是在线编辑器 代码 -->
<script type="text/javascript">
/*
* 在线编辑器相 关配置 js
* 参考 地址 http://fex.baidu.com/ueditor/
*/
window.UEDITOR_Admin_URL = "/public/plugins/Ueditor/";
var URL_upload = "{$URL_upload}";
var URL_fileUp = "{$URL_fileUp}";
var URL_scrawlUp = "{$URL_scrawlUp}";
var URL_getRemoteImage = "{$URL_getRemoteImage}";
var URL_imageManager = "{$URL_imageManager}";
var URL_imageUp = "{$URL_imageUp}";
var URL_getMovie = "{$URL_getMovie}";
var URL_home = "{$URL_home}";
</script>
<script src="__PUBLIC__/static/js/layer/laydate/laydate.js"></script>
<script type="text/javascript" charset="utf-8" src="/public/plugins/Ueditor/ueditor.config.js?v=__CSSVERSION__"></script>
<script type="text/javascript" charset="utf-8" src="/public/plugins/Ueditor/ueditor.all.js"></script>
<script type="text/javascript" charset="utf-8" src="/public/plugins/Ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" charset="utf-8" src="/public/plugins/Ueditor/lang/en/en.js"></script>
<script type="text/javascript">
var url = "{:url('Ueditor/index',array('savepath'=>'userhelp'))}";
var editor;
$(function () {
//具体参数配置在 editor_config.js 中
var options = {
zIndex: 999,
initialFrameWidth: "95%", //初化宽度
initialFrameHeight: 400, //初化高度
focus: false, //初始化时,是否让编辑器获得焦点true或false
maximumWords: 99999, removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign'
, //允许的最大字符数 'fullscreen',
pasteplain: false, //是否默认为纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴
autoHeightEnabled: true,
serverUrl: url
};
editor = new UE.ui.Editor(options);
editor.render("remark"); // 指定 textarea 的 id 为 goods_content
});
</script>
<body style="background-color: #FFF; overflow: auto;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
<div class="fixed-bar">
<div class="item-title">
<div class="fixed-bar">
<div class="item-title">
<a class="back" href="javascript:window.history.back()" title="返回列表">
<i class="fa fa-arrow-circle-o-left"></i>
</a>
<div class="subject">
<h3>助力活动-活动设置</h3>
</div>
</div>
</div>
</div>
</div>
<!-- 操作说明 -->
<div id="explanation" class="explanation" style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); width: 99%; height: 100%; min-height: 30px;min-width: 100px;">
<div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
<h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
<span title="收起提示" id="explanationZoom" style="display: block;"></span>
</div>
<ul>
<li><p>1、用于针对活动设置,可通过好友助力的形式完成商家既定的条件获取相关的奖励;</p>
<p>2、礼品包含:代金券﹑成长值﹑服务项目﹑积分﹑商品等5种类型;</p>
</li>
</ul>
</div>
<form method="post" id="addlbform" action="{:U('Admin/UserHelp/addindex')}">
<input type="hidden" name="lbid" value="{$help.id}"/>
<input type="hidden" id="is_use" name="isuse" value="{$help.isuse}" class="input-txt">
<!--通用信息-->
<div class="ncap-form-default tab_div_1">
<dl class="row">
<dt class="tit">
<label for="act_name"><em>*</em>活动名称</label>
</dt>
<dd class="opt">
<input id="act_name" type="text" value="{$help.act_name}"
onkeydown="strkeydown(event, this, 'sumbbtn')"
name="act_name" style="width: 400px;"/> 排序: <input type="text" value="<if condition='$md'>$md<else/>{$help.sort_order|default=0}</if>" class="t_mane" name="sort_order"
onkeydown="strkeydown(event, this, 'sumbbtn')" style="width: 60px;"
onKeyUp="this.value=this.value.replace(/[^\d.]/g,'')" onpaste="this.value=this.value.replace(/[^\d.]/g,'')" /><label><input class="checkbox" id="isuse"onclick="click_isuse()" onkeydown="strkeydown(event, this, 'sumbitbtn')" type="checkbox" <if condition="$help[isuse] eq 1">checked</if>>启用</label>
<span class="err cr" id="err_goods_name" ></span>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="begindate"><em>*</em>活动时间</label>
</dt>
<dd class="opt">
<input type="text" id="begindate" name="begindate" value="{$help.begindate|date='Y-m-d H:i:s',###}" style="width: 150px;" maxlength="15"> 至 <input type="text" id="enddate" name="enddate" value="{$help.enddate|date='Y-m-d H:i:s',###}" style="width: 150px;" maxlength="15">
<input type="hidden" id="hidenddate" value="{$help.enddate}">
</dd>
</dl>
<!--<dl class="row">-->
<!--<dt class="tit">-->
<!--<label for="begindate"><em>*</em>兑换时间</label>-->
<!--</dt>-->
<!--<dd class="opt">-->
<!--<input type="text" id="exchange_begindate" name="exchange_begindate" value="{$help.exchange_begindate|date='Y-m-d H:i:s',###}" style="width: 150px;" maxlength="15"> 至-->
<!--<input type="text" id="exchange_enddate" name="exchange_enddate" value="{$help.exchange_enddate|date='Y-m-d H:i:s',###}" style="width: 150px;" maxlength="15">-->
<!--<input type="hidden" id="hidexchange_enddate" value="{$help.exchange_enddate}">-->
<!--</dd>-->
<!--</dl>-->
<dl class="row dn">
<dt class="tit"><label for="lburl2"><em>*</em>活动主图</label></dt>
<dd class="opt">
<div class="ncsc-goods-default-pic">
<div class="goodspic-uplaod">
<div style="">
<img id="img_url2" style="width: 240px; border:#eee solid 1px"
src="{:getImg($help.imageurl,'/public/images/default_goods_image_240.gif')}"
onmouseover="layer.tips('<img src='+this.src+'>',this, {tips: [1, '#fff']});"
onmouseout="layer.closeAll();">
<!-- <img id="lburl2" src="{$deatillp.imageurl|default='__QCLOUD_IMGURL__/miniapp/images/newpeople/newreceive.png'}" style="width: 240px; border:#eee solid 1px" onmouseover="layer.tips('<img src={$deatillp.imageurl}>',this, {tips: [1, '#fff']});" onmouseout="layer.closeAll();">-->
</div>
<input type="hidden" id="imageurl" name="imageurl"
onkeydown="strkeydown(event, this, 'submitbtn')"
value="{$help.imageurl}" class="type-file-text">
<p class="hint">请上传图片格式文件<Font color="red" style="margin-left: 2px">大小建议为:615*876像素</Font> <span style="margin-left: 3px">用于首页弹窗提示</span></p>
<div class="handle">
<div class="ncsc-upload-btn">
<a onClick="GetUploadify_new(1,'lburl2','newpeoplegift','{$erpid}','marketing_newpeople_gift','id','imageurl','{$deatillp.id}','img_call_back')">
<p><i class="icon-upload-alt"></i>图片上传</p>
</a>
</div>
</div>
</div>
</div>
</dd>
</dl>
<dl class="row">
<dt class="tit"><em>*</em>参与次数</dt>
<dd class="opt" style="width: 81%;">
同一会员次数:
<select name="vip_act_type">
<option value="1" <if condition="$help['vip_act_type'] eq 1"> selected</if> >活动时间段</option>
<option value="2" <if condition="$help['vip_act_type'] eq 2"> selected</if> >每日</option>
<input type="text" size="2"oninput = "value=value.replace(/[^\d]/g,'')" maxlength="3" name="vip_act_num" class="qsbox" style="vertical-align: middle;height:18px;margin-left: 5px;margin-right: 5px;" value="{$help.vip_act_num|default=1}">次
</select>
</dd>
</dl>
<dl class="row">
<dt class="tit"><em>*</em>助力设置</dt>
<dd class="opt">
同一个微信账号对参与会员助力次数:
<select name="help_act_type">
<option value="1" <if condition="$help['help_act_type'] eq 1"> selected</if> >活动时间段</option>
<option value="2" <if condition="$help['help_act_type'] eq 2"> selected</if> >每日</option>
<input type="text" size="2"oninput = "value=value.replace(/[^\d]/g,'')" maxlength="3" name="help_act_num" class="qsbox" style="vertical-align: middle;height:18px;margin-left: 5px;margin-right: 5px;" value="{$help.help_act_num|default=1}">次
</select>
<div>
<label style="font-size: 12px"><input class="checkbox" name="help_condition1" id="help_condition1" onkeydown="strkeydown(event, this, 'sumbitbtn')" value="1" type="checkbox" <if condition="stripos($help[help_condition],',1,') nheq false">checked</if>>助力需关注</label>
<label style="font-size: 12px"><input class="checkbox" name="help_condition2" id="help_condition2" onkeydown="strkeydown(event, this, 'sumbitbtn')" value="2" type="checkbox" <if condition="stripos($help[help_condition],',2,') nheq false">checked</if>>助力需注册会员</label>
</div>
</dd>
</dl>
<if condition="$grade_list">
<dl class="row" >
<dt class="tit">
<label for="grade_state"><em></em>会员权益等级</label>
</dt>
<dd class="opt" id="user_dj">
<volist name="grade_list" id="grade_list">
<label>
<input class="checkbox userqy_cb user_qy" name="grade_state[]" value="{$grade_list.Id}" onkeydown="strkeydown(event, this, 'sumbitbtn')" type="checkbox"
<if condition="stripos($help[grade],','.$grade_list[Id].',') nheq false">checked</if>>{$grade_list['GradeName']}
<input type="hidden" name="grade_str[]" value="{$grade_list.Id}" />
</label>
</volist>
</dd>
</dl>
</if>
<if condition="$arrlist">
<dl class="row" >
<dt class="tit">
<label for="plus_state"><em></em>PLUS会员</label>
</dt>
<dd class="opt" id="is_plus">
<volist name="arrlist" id="arrlist">
<label><input class="checkbox userqy_cb plus_list" name="plus_state[]" value="{$arrlist.CardId}" onkeydown="strkeydown(event, this, 'sumbitbtn')" type="checkbox"
<if condition="stripos($help[plus_list],','.$arrlist[CardId].',') nheq false">checked</if>>{$arrlist['CardName']}
<input type="hidden" name="plus_str[]" value="{$arrlist.CardId}" />
</label>
</volist>
</dd>
</dl>
</if>
<dl class="row">
<dt class="tit"><em>*</em>任务奖励设置</dt>
<dd class="opt">
<div class="prom_info">
<div class="prom_info_tit"><span style="width: 20%">任务名称</span><span style="width:18%">助力次数</span><span style="width: 22%;">奖品礼包</span><span style="width: 18%;">库存</span><span style="width: 20%;">操作</span></div>
<div class="prom_top_list">
<empty name="help_list">
<div class="prom_top" id="tab0">
<div class="prom_center prom_center1" style="display: flex">
<div style="width: 20%"><input type="text" name="data[0][help_taskname]"class="t_mane" value="{$help_list.help_taskname}"></div>
<div style="width:18%">
<input type="text" size="2"oninput = "value=value.replace(/[^\d]/g,'')" maxlength="3" name="data[0][help_num]" class="qsbox zl_num" style="vertical-align: middle;height:18px;margin-left: 5px;margin-right: 5px;" value="{$help_list.help_num}">
</div>
<div style="width: 22%;">
<select style="width: 95%" name="data[0][giftbagid]" >
<volist name="lblist" id="list">
<option value="{$list.id},{$list.lbtitle}" <if condition="$help_list['giftbagid'] eq $list.id"> selected</if> >{$list.lbtitle}</option>
</volist>
</select>
</div>
<div style="width:18%;"><input type="text" size="2" oninput = "value=value.replace(/[^\d]/g,'')" maxlength="3" name="data[0][gift_qty]" class="qsbox kc_num" style="vertical-align: middle;height:18px;margin-left: 5px;margin-right: 5px;" value="{$help_list.gift_qty}"></div>
<div style="width: 20%;">
<text class="delete_task" onclick="tab_del(this)">删除</text>
</div>
</div>
</div>
<else/>
<volist name="help_list" id="help_list" key="k">
<div class="prom_top" id="delet{$help_list.id}">
<div class="prom_center prom_center1" style="display: flex">
<input type="hidden" name="data[{$k-1}][id]" value="{$help_list.id}"/>
<div style="width: 20%"><input type="text" name="data[{$k-1}][help_taskname]"class="t_mane" value="{$help_list.help_taskname}"></div>
<div style="width:18%">
<input type="text" size="2"oninput = "value=value.replace(/[^\d]/g,'')" maxlength="3" name="data[{$k-1}][help_num]" class="qsbox zl_num" style="vertical-align: middle;height:18px;margin-left: 5px;margin-right: 5px;" value="{$help_list.help_num}">
</div>
<div style="width: 22%;">
<select style="width: 95%" name="data[{$k-1}][giftbagid]">
<volist name="lblist" id="list">
<option value="{$list.id},{$list.lbtitle}" <if condition="$help_list['giftbagid'] eq $list.id"> selected</if> >{$list.lbtitle}</option>
<!-- <input type="hidden" name="data[{$k-1}]['giftbagid]" value="{$list.lbtitle}" />-->
</volist>
</select>
</div>
<div style="width: 18%;"><input type="text"oninput = "value=value.replace(/[^\d]/g,'')" size="2" id="gift_qty" maxlength="3" name="data[{$k-1}][gift_qty]" class="qsbox kc_num" style="vertical-align: middle;height:18px;margin-left: 5px;margin-right: 5px;" value="{$help_list.gift_qty}"></div>
<div style="width: 20%;">
<text class="delete_task" onclick="tab_del(this,'{$help_list.id}')">删除</text>
</div>
</div>
</div>
</volist>
</empty>
</div>
<div class="prom_bottom">
<a href="javascript:void(0);" onclick="add_tab()">
<div class="add" title="新增任务奖励">
<span><i class="fa fa-plus"></i>新增任务奖励</span>
</div>
</a>
<!-- <span>(最多可设置五个层级,每级优惠不累加)</span>-->
</div>
</div>
</dd>
</dl>
<dl class="row" style="display: flex;">
<dt class="tit"><em></em>活动说明</dt>
<dt style="display: flex;align-items: flex-end;">
<textarea class="span12 ckeditor" id="remark" name="remark" title="">{$help.remark}</textarea>
</dt>
</dl>
</div>
<!-- 确认提交-->
<div class="ncap-form-default">
<div class="bot">
<if condition='$deatillp[isdel] eq 0'>
<a onclick="submit()" class="ncap-btn-big ncap-btn-green">确认提交</a>
</if>
</div>
</div>
</form>
<!--表单数据-->
<input type="hidden" id="qclurl" value="{$qclurl}">
<input type="hidden" id="distr_type">
<input type="hidden" id="quan_s_time" value="{$quan_s_time}">
<input type="hidden" id="quan_e_time" value="{$quan_e_time}">
</div>
<script type="text/javascript">
var gift_list=null;
var getis_stime="{$is_stime}";
$(function () {
console.log("是什么东西111",getis_stime);
var brithday_id="{$help.id}";
if(brithday_id==""){
//默认权益的复选框全选
$(".userqy_cb").prop("checked",true);
}
//调取礼包的数据
get_gift_list();
//活动开始
$('#begindate').layDate();
$('#enddate').layDate();
//兑换时间
// $('#exchange_begindate').layDate();
// $('#exchange_enddate').layDate();
<if condition='$is_stime eq 1'>
$("input").attr("disabled","disabled");
$("select").attr("disabled","disabled");
$("#enddate").attr("disabled",false);
// $("#exchange_enddate").attr("disabled",false);
</if>
})
// 上传图片回调
function img_call_back(fileurl_tmp) {
console.log(fileurl_tmp,"上传图片的回调");
var getqclurl = $("#qclurl").val();
$("#imageurl").val(fileurl_tmp);
$("#img_url2").attr('src', getqclurl + fileurl_tmp);
}
//确认保存
function submit() {
/* 活动名称*/
if ($('#act_name').val() == '') {
layer.msg('请输入活动名称', {icon: 2, time: 2000});
return false;
}
/*---活动时间---*/
var startdate = new Date($('#begindate').val().replace(/-/g, "/"));
var enddate = new Date($('#enddate').val().replace(/-/g, "/"));
if(startdate=="") {
layer.msg('请输入开始开始时间', {icon: 2, time: 2000});
return false;
}
if(enddate=="") {
layer.msg('请输入开始结束时间', {icon: 2, time: 2000});
return false;
}
if (enddate <= startdate) {
$('#enddate').next().removeClass('dn');
layer.msg('活动结束时间必须大于开始时间', {icon: 2, time: 2000});
return false;
}
var quan_s_time=$("#quan_s_time").val();
var quan_e_time=$("#quan_e_time").val();
if (quan_s_time != "") quan_s_time = new Date(quan_s_time.replace(/-/g, "/"));
if (quan_e_time != "") quan_e_time = new Date(quan_e_time.replace(/-/g, "/"));
if(quan_s_time!=""){
if(enddate>=quan_s_time && startdate<=quan_e_time){
layer.msg('指定的活动时间与已设置的活动时间不能重叠!', {icon: 2, time: 1000});
return false;
}
}
/*兑换时间*/
// var exchange = new Date($('#exchange_begindate').val().replace(/-/g, "/"));
// var exchange_endd= new Date($('#exchange_enddate').val().replace(/-/g, "/"));
// if(exchange=="") {
// layer.msg('请输入开始开始时间', {icon: 2, time: 2000});
// return false;
// }
// if(exchange_endd=="") {
// layer.msg('请输入开始结束时间', {icon: 2, time: 2000});
// return false;
// }
// if (exchange_endd <= exchange) {
// $('#exchange_enddate').next().removeClass('dn');
// layer.msg('兑换结束时间必须大于开始时间', {icon: 2, time: 2000});
// return false;
// }
//
//
// if (getis_stime=="1") {
// if ($("#enddate").val() < $("#hidenddate").val()) {
// layer.msg('兑换结束时间不能小于' + $("#hidenddate").val(), {icon: 2, time: 2000});
// return false;
// }
// if ($("#exchange_enddate").val() < $("#hidexchange_enddate").val()) {
// layer.msg('兑换结束时间不能小于' + $("#hidexchange_enddate").val(), {icon: 2, time: 2000});
// return false;
// }
// }
// /*图片路径*/
// if ($('#imageurl').val() == '') {
// layer.msg('请选择活动图片', {icon: 2, time: 2000});
// return false;
// }
$("input").attr("disabled",false);
$("select").attr("disabled",false);
//判断会员权益
var arr = [];
$("label").children(".user_qy").is(":checked");
$(".user_qy").each(function(index,obj){
var checked=$(obj).is(":checked");
var data={};
data=checked;
arr.push(data);
})
var result= arr.indexOf(true);
// if(result==-1){
// layer.msg('请选择权益等级', {icon: 2, time: 2000});
// return false;
// }
/*判断PLUS会员*/
var arr_plus = [];
$(".plus_list").each(function(index,obj){
var checked=$(obj).is(":checked");
var data={};
data=checked;
arr_plus.push(data);
})
var result= arr_plus.indexOf(true)
// if(result==-1){
// layer.msg('请选择PLUS会员', {icon: 2, time: 2000});
// return false;
// }
var data_name=$("form").serializeArray();
var gifid_name=data_name[22].value;
var gifid_num=data_name[23].value;
var gift_qty=data_name[25].value;
if(data_name.length===0){
layer.msg('至少填写一个任务奖励', {icon: 2, time: 2000});
return false;
}
if(gifid_name==""||gifid_num==""||gift_qty==""){
layer.msg('至少完成填写一个任务奖励', {icon: 2, time: 2000});
return false;
}
//任务名
var btns = new Array();
$('.prom_top input.t_mane').each(function(key,value){
btns[key] = $(this).val();
});
console.log(btns,"是什么鬼");
for(var r=0;r<btns.length;r++){
if(btns[r]==""||btns[r]==null){
layer.msg('请填写任务名', {icon: 2, time: 2000});
return false;
}
}
//助力次数
var btns_a = new Array();
$('.prom_center input.zl_num').each(function(key,value){
btns_a[key] = $(this).val();
});
for(var r=0;r<btns_a.length;r++){
if(btns_a[r]==""||btns_a[r]==null||btns_a[r]<1){
layer.msg('助力数不能为空或小于0', {icon: 2, time: 2000});
return false;
}
}
//库存数
var btns_b = new Array();
$('.kc_num').each(function(key,value){
btns_b[key] = $(this).val();
});
console.log(btns_b,"是什么鬼");
for(var r=0;r<btns_b.length;r++){
if(btns_b[r]==""||btns_b[r]==null||btns_b[r]<1){
layer.msg('库存数不能为空或小于0', {icon: 2, time: 2000});
return false;
}
}
layer.msg('加载中...', {icon: 16, shade: [0.5, '#f5f5f5'], scrollbar: false, offset: '10px', time: 100000});
$('#addlbform').submit();
}
var num=0;
//活动卡添加
function add_tab(){
if(getis_stime==1){
layer.msg('活动已开始,不能添加任务', {icon: 2, time: 2000});
return false;
}
var div_len=$(".prom_top_list").children().length;
for (var i = 0; i < 5; i++) {
num=div_len;
var html = '<div class="prom_top" id="tab' + num + '">\n' +
' <div class="prom_center prom_center1" style="display: flex">\n' +
' <div style="width: 20%"><input type="text" name="data['+num+'][help_taskname]"class="t_mane"></div>' +
'<div style="width:18%"><input type="text" oninput = "value=value.replace(/[^\\d]/g,\'\')"size="2" maxlength="3" name="data['+num+'][help_num]" class="qsbox zl_num" style="vertical-align: middle;height:18px;margin-left: 5px;margin-right: 5px;" value=""></div>' +
'<div style="width: 22%;">'+
'<select style="width: 95%" name="data['+num+'][giftbagid]" >\n';
for (var v = 0; v < gift_list.length; v++) {
html += '<option value=\"' + gift_list[v].id +","+ gift_list[v].lbtitle +'\">' + gift_list[v].lbtitle + '</option>';
}
html += '</select></div><div style="width: 18%;"><input type="text" oninput = "value=value.replace(/[^\\d]/g,\'\')"size="2" maxlength="3" name="data['+num+'][gift_qty]" class="qsbox kc_num" style="vertical-align: middle;height:18px;margin-left: 5px;margin-right: 5px;" value=""></div><div style="width: 20%;"> <text class="delete_task" onclick="tab_del(this)">删除</text></div>';
html += '</div>\n';
html += '</div>';
$('.prom_top_list').append(html);
break;
}
if (document.getElementById("tab4")) {
$('.prom_bottom').hide();
}
}
// 活动卡删除事件
function tab_del(obj,id) {
if(id!=""&&id!=null&&id!=undefined) {
if (getis_stime=="1")
{
layer.msg('活动已开始无法删除!', {icon: 2, time: 2000});
return false;
}
$.ajax({
type: "get",
url: "/index.php/admin/UserHelp/del_help_list?id="+id,
dataType: "json",
success: function (data) {
if(data.code==0){
num=num-1;
$("#delet"+id).remove();
}
}
})
}else {
var prom_list=$(".prom_top_list").children().length;
if(prom_list>1){
num=num-1;
var div_list=$(obj).parent().parent().parent();
var butse=div_list[0].attributes.id.nodeValue;
$("#"+butse).remove();
}else{
layer.msg('至少要填写一个任务奖励设置', {icon: 2, time: 2000});
return false;
}
}
}
//是否启用
function click_isuse(){
var isuse_val=$("#is_use").val();
if(isuse_val==0){
$("#is_use").val(1);
}else{
$("#is_use").val(0);
}
}
//调取礼包的数据
function get_gift_list(){
$.ajax({
type: "get",
url: "/index.php/admin/UserHelp/get_gift_list",
dataType: "json",
success: function (data) {
if(data.code==0){
gift_list=data.msg;
}
}
})
}
</script>
</body>
</html>