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
6dd59967
Commit
6dd59967
authored
Mar 11, 2019
by
agping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
活动列表修改
parent
cd4a8368
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
146 additions
and
51 deletions
+146
-51
redEnvelopeList.html
application/index/view/redEnvelope/redEnvelopeList.html
+22
-18
cashBackList.js
public/resource/js/cashBackList.js
+1
-1
redEnvelopeList.js
public/resource/js/redEnvelopeList.js
+110
-22
red_envelope_list_template_tpl.html
public/resource/template/red_envelope_list_template_tpl.html
+13
-10
No files found.
application/index/view/redEnvelope/redEnvelopeList.html
View file @
6dd59967
...
...
@@ -38,7 +38,8 @@
<div
class=
"pull-right"
>
<ul
class=
"bread_btn"
>
<li>
<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>
<!--<a href="#modal" data-toggle="modal" class="btn btn-info"><i class="icon-plus"></i>新增活动</a>-->
</li>
</ul>
</div>
...
...
@@ -91,49 +92,52 @@
<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=
"请输入"
>
<input
type=
"text"
value=
""
name=
"title"
class=
"input-width-l input-width"
placeholder=
"请输入"
id=
"red-title"
>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
奖励类型:
</label>
<input
type=
"radio"
name=
"
user_status"
value=
"1
"
><label
class=
"control-label"
>
返现红包
</label>
<input
type=
"radio"
name=
"
user_status"
value=
"0
"
><label
class=
"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
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
金额:
</label>
<input
type=
"number"
name=
"user_status"
class=
"input-width-s input-width"
value=
"0
"
>
<input
type=
"number"
class=
"input-width-s input-width"
value=
"0"
id=
"red-money
"
>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
奖励动作:
</label>
<input
type=
"radio"
name=
"
user_status
"
value=
"1"
><label
class=
"control-label"
>
首次登陆
</label>
<input
type=
"radio"
name=
"
user_status
"
value=
"0"
><label
class=
"control-label"
>
邀请登陆
</label>
<input
type=
"radio"
name=
"
user_status
"
value=
"0"
><label
class=
"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>
</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"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"start_date"
name=
"start_date"
type=
"date"
>
<input
class=
"input-width-m input-width"
type=
"text"
value=
""
id=
"red_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"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"end_date"
name=
"end_date"
type=
"date"
>
<input
class=
"input-width-m input-width"
type=
"text"
value=
""
id=
"red_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"
name=
"user_status"
value=
"0"
class=
"input-width-s input-width
"
><label>
天内有效
</label>
<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=
"
user_status"
value=
"
1"
><label
class=
"control-label"
>
不限
</label>
<input
type=
"radio"
name=
"
user_status
"
value=
"0"
><label
class=
"control-label"
>
最多
</label>
<input
type=
"number"
name=
"user_status"
value=
"0"
class=
"input-width-s input-width
"
>
个
<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
"
>
个
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
用户可得红包数:
</label>
<input
type=
"radio"
name=
"
user_status"
value=
"
1"
><label
class=
"control-label"
>
不限
</label>
<input
type=
"radio"
name=
"
user_status
"
value=
"0"
><label
class=
"control-label"
>
最多
</label>
<input
type=
"number"
name=
"user_status"
value=
"0"
class=
"input-width-s input-width
"
>
个
<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
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
活动规则:
</label>
<textarea
name=
""
rows=
""
cols=
""
style=
"height: 80px;width: 300px;border-radius: 6px;"
></textarea>
<textarea
name=
""
rows=
""
cols=
""
style=
"height: 80px;width: 300px;border-radius: 6px;"
id=
"red-rule"
></textarea>
</div>
</form>
</div>
...
...
public/resource/js/cashBackList.js
View file @
6dd59967
...
...
@@ -41,7 +41,7 @@ define (['doT', 'text!temp/cash_back_list_template_tpl.html', 'css!style/home.cs
params
.
label
=
$
(
'#yetai_type option:selected'
).
val
()
==-
1
?
''
:
$
(
'#yetai_type option:selected'
).
html
();
}
$
.
ajax
({
url
:
'/index/
getImageDepot
List'
,
//获取列表
url
:
'/index/
coupon
List'
,
//获取列表
type
:
'GET'
,
async
:
true
,
data
:
params
,
...
...
public/resource/js/redEnvelopeList.js
View file @
6dd59967
...
...
@@ -2,6 +2,8 @@ define (['doT', 'text!temp/red_envelope_list_template_tpl.html', 'css!style/home
redEnvelope
=
{
pageNo
:
1
,
/*第几页*/
pageSize
:
10
,
/*每页显示多少条*/
isSubmitId
:
1
,
activityId
:
''
,
init
:
function
()
{
//初始化dot
$
(
"body"
).
append
(
template
);
...
...
@@ -9,39 +11,42 @@ define (['doT', 'text!temp/red_envelope_list_template_tpl.html', 'css!style/home
redEnvelope
.
getList
(
1
);
},
event
:
function
()
{
//图片,附件上传删除键事件
$
(
document
).
on
(
'click'
,
'.delet-pic-btn'
,
function
(
e
)
{
//点击编辑按钮
$
(
document
).
on
(
'click'
,
'.edit-activity'
,
function
(
e
)
{
var
_this
=
$
(
this
);
e
.
preventDefault
();
e
.
stopPropagation
();
$
(
this
).
parent
().
parent
().
remove
();
/*if(confirm('确定删除该图片吗?')) {
var _imgId = _this.parent().attr('data-imgid');
var file_id = $(this).parent('li').attr('id') - 0 ;
_this.parent().remove();
user.addDeleteNewsEvent(file_id);
};*/
redEnvelope
.
isSubmitId
=
1
;
//编辑活动的话 提交活动id
redEnvelope
.
activityId
=
$
(
this
).
attr
(
"data-id"
);
redEnvelope
.
getActivityDetails
(
$
(
this
).
attr
(
"data-id"
));
});
$
(
document
).
on
(
'click'
,
'.add-activity'
,
function
(
e
)
{
var
_this
=
$
(
this
);
e
.
preventDefault
();
e
.
stopPropagation
();
redEnvelope
.
isSubmitId
=
0
;
//新增活动的话 不提交活动id
});
//提交编辑 新增的活动详情
$
(
document
).
on
(
'click'
,
'.submit_add'
,
function
(
e
)
{
var
_this
=
$
(
this
);
e
.
preventDefault
();
e
.
stopPropagation
();
redEnvelope
.
submitAdd
();
});
},
//获取列表
getList
:
function
(
pageNo
)
{
redEnvelope
.
pageNo
=
pageNo
;
var
params
=
{
"AuthToken"
:
JSON
.
parse
(
decodeURIComponent
(
localStorage
.
getItem
(
'pcUserInfo'
))).
AuthToken
,
};
var
params
=
{};
params
.
pageNo
=
redEnvelope
.
pageNo
;
params
.
pageSize
=
redEnvelope
.
pageSize
;
params
.
img_type
=
$
(
'#p_type option:selected'
).
val
()
==
-
1
?
''
:
$
(
'#p_type option:selected'
).
val
();
if
(
params
.
img_type
==
2
){
params
.
label
=
''
;
}
else
{
params
.
label
=
$
(
'#yetai_type option:selected'
).
val
()
==-
1
?
''
:
$
(
'#yetai_type option:selected'
).
html
();
}
$
.
ajax
({
url
:
'/index/get
ImageDepot
List'
,
//获取列表
url
:
'/index/get
Activity
List'
,
//获取列表
type
:
'GET'
,
async
:
true
,
data
:
params
,
...
...
@@ -49,14 +54,96 @@ define (['doT', 'text!temp/red_envelope_list_template_tpl.html', 'css!style/home
success
:
function
(
data
)
{
var
temp
=
document
.
getElementById
(
'red_envelope_template_tpl'
).
innerHTML
;
var
doTtmpl
=
doT
.
template
(
temp
);
$
(
"#picture_list"
).
html
(
doTtmpl
(
data
.
data
.
list
));
$
(
"#picture_list"
).
html
(
doTtmpl
(
data
.
data
));
/*分页代码*/
add_page
(
data
.
data
.
total
,
pageNo
,
redEnvelope
.
pageSize
,
redEnvelope
.
getList
);
$
(
'.J_preview'
).
preview
();
}
});
},
//获取活动详情
getActivityDetails
:
function
(
id
)
{
var
params
=
{};
params
.
id
=
id
;
$
.
ajax
({
url
:
'/index/getActivityList'
,
//获取列表
type
:
'GET'
,
async
:
true
,
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"
);
}
else
{
$
(
"input[name='red-total'][value='"
+
0
+
"']"
).
prop
(
"checked"
,
"checked"
);
}
if
(
data
.
data
[
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"
);
}
}
});
},
//新增 编辑活动详情
submitAdd
:
function
(
id
)
{
var
params
=
{};
if
(
redEnvelope
.
isSubmitId
==
1
){
params
.
id
=
redEnvelope
.
activityId
;
}
params
.
title
=
$
(
'#red-title'
).
val
();
params
.
return_type
=
$
(
"input[name='return_type']:checked"
).
val
();
params
.
money
=
$
(
'#red-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
.
total
=
-
1
;
}
else
{
params
.
total
=
$
(
'#red-total-num'
).
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
();
$
.
ajax
({
url
:
'/index/saveActivity'
,
//获取列表
type
:
'POST'
,
async
:
true
,
data
:
params
,
dataType
:
'json'
,
success
:
function
(
data
)
{
alert
(
data
.
msg
)
}
});
},
};
return
redEnvelope
;
});
\ No newline at end of file
public/resource/template/red_envelope_list_template_tpl.html
View file @
6dd59967
<script
id=
"red_envelope_template_tpl"
type=
"text/template"
>
[
%
var
swType
=
function
(
s
){
switch
(
Number
(
s
)){
case
0
:
return
"返现红包"
;
case
1
:
return
"现金"
;
default
:
return
s
}};
%
]
[
%
var
swAction
=
function
(
s
){
switch
(
Number
(
s
)){
case
0
:
return
"首次登陆"
;
case
1
:
return
"邀请登陆"
;
case
2
:
return
"邀请成交"
;
default
:
return
s
}};
%
]
[
%
var
swStatus
=
function
(
s
){
switch
(
Number
(
s
)){
case
0
:
return
"正常"
;
case
1
:
return
"手动停止"
;
case
3
:
return
"时间过期"
;
case
4
:
return
"删除"
;
case
5
:
return
"未开始"
;
default
:
return
s
}};
%
]
[
%
if
(
it
!=
''
)
{
%
]
[
%
for
(
var
item
in
it
){
%
]
<
tr
class
=
"text-center"
>
<
td
>
[
%=
it
[
item
][
'create_time'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'
create_time
'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'
create_tim
e'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'
create_time
'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'create_time'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'create_time'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'
create_time'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'create_time'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'
id
'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'
titl
e'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'
money
'
]
%
]
<
/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
>
<
td
>
<
a
class
=
"btn1 btn-success
is_show
"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["id"] %]'
href
=
"#modal-add"
>
编辑
<
/a
>
<
a
class
=
"btn1 btn-success
edit-activity
"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["id"] %]'
href
=
"#modal-add"
>
编辑
<
/a
>
<
/td
>
<
/tr
>
[
%
}
%
]
...
...
@@ -20,4 +24,4 @@
<
td
colspan
=
"12"
style
=
"text-align:center;"
>
暂无数据
<
/td
>
<
/tr
>
[
%
}
%
]
</script>
\ No newline at end of file
</script>
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