addindex.html
12.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
<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;
}
</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'=>'newpeoplegift'))}";
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、在活动时间内新人礼包1个会员ID仅可领取1次;</p>
<p>2、同一活动时间内活动不能重叠;</p>
</li>
</ul>
</div>
<form method="post" id="addlbform" action="{:U('Admin/Newpeoplegift/addindexhand')}">
<input id="lbid" type="hidden" name="id" value="{$deatillp.id}"/>
<input type="hidden" id="oldurl" name="oldurl" value="{$oldurl}" class="input-txt">
<!--通用信息-->
<if class="ncap-form-default tab_div_1">
<dl class="row">
<dt class="tit">
<label for="activity_name">*活动名称</label>
</dt>
<dd class="opt">
<input id="activity_name" type="text" value="{$deatillp.activity_name}"
onkeydown="strkeydown(event, this, 'sumbbtn')"
name="activity_name" style="width: 300px;"/> 排序: <input type="text" value="<if condition='$md'>$md<else/>{$deatillp.sort_order|default=0}</if>" class="t_mane" name="sort_order"
onkeydown="strkeydown(event, this, 'sumbbtn')"
onKeyUp="this.value=this.value.replace(/[^\d.]/g,'')" onpaste="this.value=this.value.replace(/[^\d.]/g,'')" /><label><input class="checkbox" name="is_show" id="is_show" onkeydown="strkeydown(event, this, 'sumbitbtn')" value="1" type="checkbox" <if condition="$deatillp[is_show] 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">*活动时间</label>
</dt>
<dd class="opt">
<input type="text" id="begindate" name="begindate" value="{$deatillp.begindate|date='Y-m-d H:i:s',###}" style="width: 150px;" maxlength="15">
<span>至</span>
<input type="text" id="enddate" name="enddate" value="{$deatillp.enddate|date='Y-m-d H:i:s',###}" style="width: 150px;" maxlength="15">
</dd>
</dl>
<dl class="row">
<dt class="tit"><label for="lburl2">*活动主图</label></dt>
<dd class="opt">
<div class="ncsc-goods-default-pic">
<div class="goodspic-uplaod">
<div style="">
<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="{$deatillp.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">*首页弹窗周期</dt>
<dd class="opt">
<input id="cycle0" type="radio" name="cycle" value="0"
<if condition="$deatillp.cycle eq 0"> checked</if>>
<label for="cycle0">新会员首次登入提醒</label>
<input id="cycle1" type="radio" name="cycle" value="1"
<if condition="$deatillp.cycle eq 1"> checked</if>>
<label for="cycle1">新会员前(<input maxlength="6" id="cycle_times" name="cycle_times" value="{$deatillp.cycle_times|default=1}" style="width: 45px" oninput="value=value.replace(/[^\d]/g,'')"/>)天每日首次登入提醒
</label>
</dd>
</dl>
<dl class="row">
<dt class="tit">*奖品明细</dt>
<dd class="opt">
<span style="margin-right: 3px;">礼包</span>
<select name="gifbagid" id="gifbagid" class="select ellipsis1" style="width: 120px;height: 27px;">
<volist name="lblist" id="list">
<option value="{$list.id}" <if condition="$deatillp.gifbagid eq $list.id"> selected</if>>{$list.lbtitle}</option>
</volist>
</select>
<font color="red" style="margin-left: 20px">获取礼包为仅限活动使用</font>
</dd>
</dl>
<dl class="row" style="display: flex;">
<dt class="tit">*活动说明</dt>
<dt style="display: flex;align-items: flex-end;">
<textarea class="span12 ckeditor" id="remark" name="remark" title="">{$deatillp.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">
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#begindate').layDate();
$('#enddate').layDate();
//历史的话,只能查看
<if condition='$deatillp[isdel] eq 1'>
$(".ncsc-upload-btn").hide();
$("input").attr("disabled","disabled");
$("select").attr("disabled","disabled");
</if>
<if condition='$is_stime eq 1'>
$("input").attr("disabled","disabled");
$("select").attr("disabled","disabled");
$("#enddate").attr("disabled",false);
</if>
})
// 选择礼包类型
$("#cycle").change(function(){
})
// 上传图片回调
function img_call_back(fileurl_tmp) {
console.log(fileurl_tmp,"上传图片的回调");
var getqclurl = $("#qclurl").val();
$("#imageurl").val(fileurl_tmp);
$("#lburl2").attr('src', getqclurl + fileurl_tmp);
}
//确认保存
function submit() {
$("input").attr("disabled",false);
$("select").attr("disabled",false);
/*---时间---*/
var startdate = new Date($('#begindate').val().replace(/-/g, "/"));
var enddate = new Date($('#enddate').val().replace(/-/g, "/"));
if (enddate <= startdate) {
$('#enddate').next().removeClass('dn');
layer.msg('结束时间必须大于开始时间', {icon: 2, time: 2000});
return false;
}
if ($('#activity_name').val() == '') {
layer.msg('请输入活动名称', {icon: 2, time: 2000});
return false;
}
if($("#cycle1").val()==1 && ($('#expday').val() == '' || $('#expday').val() == '0'))
{
layer.msg('活动有效天数必须大于0', {icon: 2, time: 2000});
return false;
}
var p_data={};
p_data.begindate=$('#begindate').val();
p_data.enddate=$('#enddate').val();
if($("#lbid").val()) p_data.id=$("#lbid").val();
var ui=layer.msg('加载中...', {icon: 16, shade: [0.5, '#f5f5f5'], scrollbar: false, offset: '10px', time: 0});
$.ajax({
url:"/index.php/admin/newpeoplegift/is_time_ok",
data:p_data,
success:function (e) {
layer.close(ui);
if(e.code==0){
$('#addlbform').submit();
}else{
layer.msg(e.msg, {icon: 2, time: 2000});
}
}
})
}
</script>
</body>
</html>