Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
8d50020e
Commit
8d50020e
authored
Mar 14, 2019
by
agping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
1d9a166a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
54 deletions
+70
-54
redEnvelopeList.html
application/index/view/redEnvelope/redEnvelopeList.html
+27
-21
redEnvelopeList.js
public/resource/js/redEnvelopeList.js
+42
-32
red_envelope_list_template_tpl.html
public/resource/template/red_envelope_list_template_tpl.html
+1
-1
No files found.
application/index/view/redEnvelope/redEnvelopeList.html
View file @
8d50020e
...
...
@@ -38,8 +38,7 @@
<div
class=
"pull-right"
>
<ul
class=
"bread_btn"
>
<li>
<a
class=
"btn btn-info add-activity"
data-toggle=
"modal"
href=
"#modal-add"
>
新增活动
</a>
<!--<a href="#modal" data-toggle="modal" class="btn btn-info"><i class="icon-plus"></i>新增活动</a>-->
<!--<a class="btn btn-info add-activity" data-toggle="modal" href="#modal-add">新增活动</a>-->
</li>
</ul>
</div>
...
...
@@ -54,7 +53,7 @@
<th
class=
"text-center"
>
活动ID
</th>
<th
class=
"text-center"
>
活动名称
</th>
<th
class=
"text-center"
>
金额(元)
</th>
<
th
class=
"text-center"
>
奖励类型
</th
>
<
!--<th class="text-center">奖励类型</th>--
>
<th
class=
"text-center"
>
奖励动作
</th>
<th
class=
"text-center"
>
开始时间-结束时间
</th>
<th
class=
"text-center"
>
状态
</th>
...
...
@@ -92,52 +91,59 @@
<form
class=
"form-horizontal"
id=
'form_reset'
>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
活动名称:
</label>
<input
type=
"text"
value=
""
name=
"title"
class=
"input-width-l input-width"
placeholder=
"请输入"
id=
"
red
-title"
>
<input
type=
"text"
value=
""
name=
"title"
class=
"input-width-l input-width"
placeholder=
"请输入"
id=
"
activity
-title"
>
</div>
<div
class=
"form-group"
>
<
!--<
div class="form-group">
<label class="col-sm-3 control-label">奖励类型:</label>
<input type="radio" name="return_type" value="0"><label class="control-label">返现红包</label>
<input type="radio" name="return_type" value="1"><label class="control-label">现金</label>
</div>
</div>
-->
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
金额:
</label>
<input
type=
"number"
class=
"input-width-s input-width"
value=
"0"
id=
"red-money"
>
<input
type=
"number"
class=
"input-width-s input-width"
value=
"0"
id=
"activity-money"
>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
发放动作:
</label>
<input
type=
"radio"
name=
"return_action"
value=
"0"
><label
class=
"control-label"
>
首次登陆
</label>
<input
type=
"radio"
name=
"return_action"
value=
"1"
><label
class=
"control-label"
>
邀请登陆
</label>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
奖励动作:
</label>
<input
type=
"radio"
name=
"return_action"
value=
"1"
><label
class=
"control-label"
>
首次登陆
</label>
<input
type=
"radio"
name=
"return_action"
value=
"0"
><label
class=
"control-label"
>
邀请登陆
</label>
<input
type=
"radio"
name=
"return_action"
value=
"0"
><label
class=
"control-label"
>
邀请成交
</label>
<label
class=
"col-sm-3 control-label"
>
兑现动作:
</label>
<label
class=
"control-label"
>
自己的订单确认分佣
</label>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
活动有效期:
</label>
<label
class=
"control-label"
>
创建时间:
</label>
<input
class=
"input-width-m input-width"
type=
"text"
value=
""
id=
"
red
_start_date"
<input
class=
"input-width-m input-width"
type=
"text"
value=
""
id=
"
activity
_start_date"
onClick=
"WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'%y-%M-%d',readOnly:true})"
/>
<label
class=
"control-label"
>
—
</label>
<input
class=
"input-width-m input-width"
type=
"text"
value=
""
id=
"
red
_end_date"
<input
class=
"input-width-m input-width"
type=
"text"
value=
""
id=
"
activity
_end_date"
onClick=
"WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'%y-%M-%d',readOnly:true})"
/>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
奖励的有效期:
</label>
<label>
发放日后的
</label><input
type=
"number"
value=
"0"
class=
"input-width-s input-width"
id=
"red-day"
><label>
天内有效
</label>
<label
class=
"col-sm-3 control-label"
>
奖励有效期:
</label>
<input
type=
"radio"
name=
"award-period"
value=
"-1"
><label
class=
"control-label"
>
不限
</label>
<input
type=
"radio"
name=
"award-period"
value=
"0"
><label
class=
"control-label"
>
发放日后的
</label>
<input
type=
"number"
value=
"0"
class=
"input-width-s input-width"
id=
"activity-day"
>
天内有效
<!--<label>发放日后的</label><input type="number" value="0" class="input-width-s input-width" id="red-day"><label>天内有效</label>-->
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
活动发放总次数:
</label>
<input
type=
"radio"
name=
"
red
-total"
value=
"-1"
><label
class=
"control-label"
>
不限
</label>
<input
type=
"radio"
name=
"
red
-total"
value=
"0"
><label
class=
"control-label"
>
最多
</label>
<input
type=
"number"
value=
"0"
class=
"input-width-s input-width"
id=
"
red
-total-num"
>
个
<input
type=
"radio"
name=
"
activity
-total"
value=
"-1"
><label
class=
"control-label"
>
不限
</label>
<input
type=
"radio"
name=
"
activity
-total"
value=
"0"
><label
class=
"control-label"
>
最多
</label>
<input
type=
"number"
value=
"0"
class=
"input-width-s input-width"
id=
"
activity
-total-num"
>
个
</div>
<div
class=
"form-group"
>
<
!--<
div class="form-group">
<label class="col-sm-3 control-label">用户可得红包数:</label>
<input type="radio" name="red-total-bag" value="-1"><label class="control-label">不限</label>
<input type="radio" name="red-total-bag" value="0"><label class="control-label">最多</label>
<input type="number" value="0" class="input-width-s input-width" id="red-bag-num">个
</div>
</div>
-->
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
活动规则:
</label>
<textarea
name=
""
rows=
""
cols=
""
style=
"height: 80px;width: 300px;border-radius: 6px;"
id=
"
red
-rule"
></textarea>
<textarea
name=
""
rows=
""
cols=
""
style=
"height: 80px;width: 300px;border-radius: 6px;"
id=
"
activity
-rule"
></textarea>
</div>
</form>
</div>
...
...
public/resource/js/redEnvelopeList.js
View file @
8d50020e
...
...
@@ -72,33 +72,37 @@ define (['doT', 'text!temp/red_envelope_list_template_tpl.html', 'css!style/home
data
:
params
,
dataType
:
'json'
,
success
:
function
(
data
)
{
$
(
'#red-title'
).
val
(
data
.
data
[
0
].
title
);
$
(
"input[name='return_type'][value='"
+
data
.
data
[
0
].
return_type
+
"']"
).
prop
(
"checked"
,
"checked"
);
$
(
'#red-money'
).
val
(
data
.
data
[
0
].
money
);
$
(
"input[name='return_action'][value='"
+
data
.
data
[
0
].
return_action
+
"']"
).
prop
(
"checked"
,
"checked"
);
$
(
'#red_start_date'
).
val
(
data
.
data
[
0
].
activity_start_time
);
console
.
log
(
data
.
data
[
0
].
activity_start_time
);
$
(
'#red_end_date'
).
val
(
data
.
data
[
0
].
activity_end_time
);
$
(
'#red-day'
).
val
(
data
.
data
[
0
].
use_period
);
$
(
'#red-title'
).
val
(
data
.
data
[
0
].
total
);
$
(
'#red-bag-num'
).
val
(
data
.
data
[
0
].
available
);
$
(
'#red-rule'
).
val
(
data
.
data
[
0
].
activity_rule
);
if
(
data
.
data
[
0
].
total
*
1
==
-
1
){
$
(
"input[name='red-total'][value='"
+
-
1
+
"']"
).
prop
(
"checked"
,
"checked"
);
$
(
'#activity-title'
).
val
(
data
.
data
.
list
[
0
].
title
);
$
(
"input[name='return_type'][value='"
+
data
.
data
.
list
[
0
].
return_type
+
"']"
).
prop
(
"checked"
,
"checked"
);
$
(
'#activity-money'
).
val
(
data
.
data
.
list
[
0
].
money
);
$
(
"input[name='return_action'][value='"
+
data
.
data
.
list
[
0
].
return_action
+
"']"
).
prop
(
"checked"
,
"checked"
);
$
(
'#activity_start_date'
).
val
(
data
.
data
.
list
[
0
].
activity_start_time
);
$
(
'#activity_end_date'
).
val
(
data
.
data
.
list
[
0
].
activity_end_time
);
$
(
'#activity-day'
).
val
(
data
.
data
.
list
[
0
].
use_period
);
$
(
'#activity-title'
).
val
(
data
.
data
.
list
[
0
].
total
);
$
(
'#activity-bag-num'
).
val
(
data
.
data
.
list
[
0
].
available
);
$
(
'#activity-rule'
).
val
(
data
.
data
.
list
[
0
].
activity_rule
);
//奖励的有效期
if
(
data
.
data
.
list
[
0
].
use_period
*
1
==
-
1
){
$
(
"input[name='award-period'][value='"
+
-
1
+
"']"
).
prop
(
"checked"
,
"checked"
);
}
else
{
$
(
"input[name='
red-total
'][value='"
+
0
+
"']"
).
prop
(
"checked"
,
"checked"
);
$
(
"input[name='
award-period
'][value='"
+
0
+
"']"
).
prop
(
"checked"
,
"checked"
);
}
if
(
data
.
data
[
0
].
available
*
1
==
-
1
){
$
(
"input[name='
red-total-bag
'][value='"
+
-
1
+
"']"
).
prop
(
"checked"
,
"checked"
);
//活动发放总次数
if
(
data
.
data
.
list
[
0
].
total
*
1
==
-
1
){
$
(
"input[name='
activity-total
'][value='"
+
-
1
+
"']"
).
prop
(
"checked"
,
"checked"
);
}
else
{
$
(
"input[name='red-total-bag'][value='"
+
0
+
"']"
).
prop
(
"checked"
,
"checked"
);
$
(
"input[name='activity-total'][value='"
+
0
+
"']"
).
prop
(
"checked"
,
"checked"
);
}
//
// if(data.data.list[0].available*1 == -1){
// $("input[name='red-total-bag'][value='" + -1 + "']").prop("checked", "checked");
//
// }else{
// $("input[name='red-total-bag'][value='" + 0 + "']").prop("checked", "checked");
// }
}
});
...
...
@@ -110,27 +114,33 @@ define (['doT', 'text!temp/red_envelope_list_template_tpl.html', 'css!style/home
params
.
id
=
redEnvelope
.
activityId
;
}
params
.
title
=
$
(
'#
red
-title'
).
val
();
params
.
title
=
$
(
'#
activity
-title'
).
val
();
params
.
return_type
=
$
(
"input[name='return_type']:checked"
).
val
();
params
.
money
=
$
(
'#
red
-money'
).
val
();
params
.
money
=
$
(
'#
activity
-money'
).
val
();
params
.
return_action
=
$
(
"input[name='return_action']:checked"
).
val
();
params
.
activity_start_time
=
(
new
Date
(
$
(
'#
red
_start_date'
).
val
())).
getTime
()
*
0.001
;
params
.
activity_end_time
=
(
new
Date
(
$
(
'#
red
_end_date'
).
val
())).
getTime
()
*
0.001
;
params
.
use_period
=
$
(
'#red-day'
).
val
();
if
(
$
(
"input[name='
red
-total']:checked"
).
val
()
==
-
1
){
params
.
activity_start_time
=
(
new
Date
(
$
(
'#
activity
_start_date'
).
val
())).
getTime
()
*
0.001
;
params
.
activity_end_time
=
(
new
Date
(
$
(
'#
activity
_end_date'
).
val
())).
getTime
()
*
0.001
;
//
params.use_period= $('#red-day').val();
if
(
$
(
"input[name='
activity
-total']:checked"
).
val
()
==
-
1
){
params
.
total
=
-
1
;
}
else
{
params
.
total
=
$
(
'#
red
-total-num'
).
val
();
params
.
total
=
$
(
'#
activity
-total-num'
).
val
();
}
if
(
$
(
"input[name='
red-total-bag
']:checked"
).
val
()
==
-
1
){
params
.
available
=
-
1
;
if
(
$
(
"input[name='
award-period
']:checked"
).
val
()
==
-
1
){
params
.
use_period
=
-
1
;
}
else
{
params
.
available
=
$
(
'#red-bag-num
'
).
val
();
params
.
use_period
=
$
(
'#activity-day
'
).
val
();
}
// if($("input[name='red-total-bag']:checked").val() == -1){
// params.available= -1;
// }else{
// params.available= $('#red-bag-num').val();
//
// }
params
.
activity_rule
=
$
(
'#
red
-rule'
).
val
();
params
.
activity_rule
=
$
(
'#
activity
-rule'
).
val
();
$
.
ajax
({
url
:
'/index/saveActivity'
,
//获取列表
...
...
public/resource/template/red_envelope_list_template_tpl.html
View file @
8d50020e
...
...
@@ -10,7 +10,7 @@
<
td
>
[
%=
it
[
item
][
'id'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'title'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'money'
]
%
]
<
/td
>
<
td
>
[
%=
swType
(
it
[
item
][
'return_type'
])
%
]
<
/td
>
<
!--<
td
>
[
%=
swType
(
it
[
item
][
'return_type'
])
%
]
<
/td>--
>
<
td
>
[
%=
swAction
(
it
[
item
][
'return_action'
])
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'activity_start_time'
]
%
]
至
[
%=
it
[
item
][
'activity_end_time'
]
%
]
<
/td
>
<
td
>
[
%=
swStatus
(
it
[
item
][
'status'
])
%
]
<
/td
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment