Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
李洋
/
消息系统
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
dacdde13
authored
Dec 18, 2017
by
李洋
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update code
parent
1a91bd70
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
94 additions
and
26 deletions
public/js/Message/addtemplate.js
public/js/Message/sendmanualmessage.js
resources/views/message/addtemplate.blade.php
resources/views/message/allhistorylist.blade.php
resources/views/message/manualhistorylist.blade.php
resources/views/message/sendmanualmessage.blade.php
public/js/Message/addtemplate.js
View file @
dacdde13
...
...
@@ -151,6 +151,21 @@ $('#sms-tpl-content').bind('input propertychange', function() {
$
(
'#sms-content-length'
).
html
(
'预计'
+
Math
.
ceil
(
$
(
this
).
val
().
length
/
70
)
+
'条短信'
);
});
//监听模板描述长度
$
(
'#msg-tpl-desc'
).
bind
(
'input propertychange'
,
function
()
{
$
(
'#msg-tpl-desc-length'
).
html
(
$
(
this
).
val
().
length
+
'/'
+
'32'
);
});
//监听站内信标题长度
$
(
'#inner-tpl-title'
).
bind
(
'input propertychange'
,
function
()
{
$
(
'#inner-tpl-title-length'
).
html
(
$
(
this
).
val
().
length
+
'/'
+
'64'
);
});
//监听邮件标题长度
$
(
'#email-tpl-title'
).
bind
(
'input propertychange'
,
function
()
{
$
(
'#email-tpl-title-length'
).
html
(
$
(
this
).
val
().
length
+
'/'
+
'64'
);
});
//获取点选了的消息渠道复选框
function
getChosenMsgChannels
()
{
...
...
public/js/Message/sendmanualmessage.js
View file @
dacdde13
...
...
@@ -2,16 +2,17 @@
//选择定时推送时间
layui
.
use
(
'laydate'
,
function
(){
var
laydate
=
layui
.
laydate
;
var
currentDate
=
new
Date
();
//执行一个laydate实例
laydate
.
render
({
elem
:
'#Choice_start'
//指定元素
,
type
:
'datetime'
,
format
:
'yyyy-MM-dd HH:mm'
,
min
:
currentDate
.
getTime
()
});
});
var
sendTime
=
''
;
$
(
'#msg_tpl_submit'
).
click
(
function
()
{
//前端校验
...
...
@@ -106,6 +107,18 @@ $('#msg_tpl_submit').click(function()
return
false
;
}
//4.目前群发功能仅支持站内信
if
(
$
(
"input[id='user-range-all']"
).
is
(
':checked'
)
&&
getChosenMsgChannels
()
!==
'1'
)
{
Prompt
(
'目前群发功能只支持站内信'
,
5
);
return
false
;
}
//发送时间时间转为时间戳
if
(
$
(
"input[id='send-time-specified']"
).
is
(
':checked'
)
&&
$
(
'#Choice_start'
).
val
())
{
sendTime
=
Date
.
parse
(
new
Date
(
$
(
'#Choice_start'
).
val
()))
/
1000
;
}
sendManualMessage
();
})
...
...
@@ -137,7 +150,7 @@ function sendManualMessage()
wechat_tpl_id
:
$
(
'#wechat-notify_tpl_title'
).
val
()?
$
(
'#wechat-notify_tpl_title'
).
val
():
''
,
//存放的是微信模板的id
obj_user
:
$
(
'#msg-specified-users-text'
).
val
()?
$
(
'#msg-specified-users-text'
).
val
():
'is_to_all'
,
expect_send_time
:
$
(
'#Choice_start'
).
val
()?
$
(
'#Choice_start'
).
val
()
:
''
,
expect_send_time
:
sendTime
?
sendTime
:
''
,
},
dataType
:
'json'
,
success
:
function
(
resp
){
...
...
@@ -161,11 +174,6 @@ function sendManualMessage()
});
}
//监听短信内容,计算短信条数
$
(
'#sms-tpl-content'
).
bind
(
'input propertychange'
,
function
()
{
$
(
'#sms-content-length'
).
html
(
'预计'
+
Math
.
ceil
(
$
(
this
).
val
().
length
/
70
)
+
'条短信'
);
});
//选择了模板要刷新整页,并带入请求的值
$
(
'#choose-tpl'
).
change
(
function
()
{
var
tpl_id
=
$
(
'#choose-tpl option:selected'
)
.
val
();
...
...
@@ -185,4 +193,24 @@ function getChosenMsgChannels()
});
var
chk_str
=
chk_values
.
join
(
","
);
return
chk_str
;
}
\ No newline at end of file
}
//监听短信内容,计算短信条数
$
(
'#sms-tpl-content'
).
bind
(
'input propertychange'
,
function
()
{
$
(
'#sms-content-length'
).
html
(
'预计'
+
Math
.
ceil
(
$
(
this
).
val
().
length
/
70
)
+
'条短信'
);
});
//监听模板描述长度
$
(
'#msg-tpl-desc'
).
bind
(
'input propertychange'
,
function
()
{
$
(
'#msg-tpl-desc-length'
).
html
(
$
(
this
).
val
().
length
+
'/'
+
'32'
);
});
//监听站内信标题长度
$
(
'#inner-tpl-title'
).
bind
(
'input propertychange'
,
function
()
{
$
(
'#inner-tpl-title-length'
).
html
(
$
(
this
).
val
().
length
+
'/'
+
'64'
);
});
//监听邮件标题长度
$
(
'#email-tpl-title'
).
bind
(
'input propertychange'
,
function
()
{
$
(
'#email-tpl-title-length'
).
html
(
$
(
this
).
val
().
length
+
'/'
+
'64'
);
});
\ No newline at end of file
resources/views/message/addtemplate.blade.php
View file @
dacdde13
...
...
@@ -121,6 +121,7 @@
<label
class=
"col-sm-2 control-label"
><span
style=
"color: red"
>
*
</span>
模板描述:
</label>
<div
class=
"col-sm-3"
>
<input
type=
"text"
id=
"msg-tpl-desc"
class=
"form-control"
placeholder=
"请输入描述"
value=
"{{ $info->description }}"
/>
<label
id=
"msg-tpl-desc-length"
></label>
</div>
</div>
</div>
...
...
@@ -180,21 +181,24 @@
<label
class=
"col-sm-2 control-label"
><span
style=
"color: red"
>
*
</span>
站内信标题:
</label>
<div
class=
"col-sm-3"
>
<input
type=
"text"
id=
"inner-tpl-title"
class=
"form-control"
placeholder=
"请输入标题"
value=
@if(!empty($info-
>
channel_tpls['1'])) "{{ $info->channel_tpls['1']->title }}" @endif>
<label
id=
"inner-tpl-title-length"
></label>
</div>
</div>
<div
class=
"col-sm-10"
style=
"margin-top: 20px"
>
<label><span
style=
"color: red"
>
*
</span>
站内信内容:
</label>
<script
type=
"text/plain"
id=
"inner-tpl-content"
name=
"inner-tpl-content"
>
@
if
(
!
empty
(
$info
->
channel_tpls
[
'1'
]
->
content
))
{
!!
$info
->
channel_tpls
[
'1'
]
->
content
!!
}
@
endif
</script>
<script
type=
"text/plain"
id=
"inner-tpl-content"
>
@
if
(
!
empty
(
$info
->
channel_tpls
[
'1'
]
->
content
))
{
!!
$info
->
channel_tpls
[
'1'
]
->
content
!!
}
@
endif
</script>
<script
type=
"text/javascript"
>
UE
.
getEditor
(
'inner-tpl-content'
);
</script>
</div>
<div
class=
"col-sm-10 form-inline"
style=
"margin-top: 20px"
>
<label
class=
"col-sm-2 control-label"
><span
style=
"color: red"
>
*
</span>
点击消息操作:
</label>
<div
class=
"col-sm-
5
"
>
<div
class=
"col-sm-
8
"
>
<input
type=
"radio"
id=
"inner-tpl-op-open"
name=
"inner-tpl-op"
value=
"1"
@
if
(!
empty
($
info-
>
channel_tpls['1'])
&&
1==$info->channel_tpls['1']->op_type) checked @endif/>
<label
for=
"inner-tpl-op-open"
>
打开消息
</label>
</div>
<div
class=
"col-sm-offset-2 col-sm-8"
>
<input
type=
"radio"
id=
"inner-tpl-op-url"
name=
"inner-tpl-op"
value=
"2"
@
if
(!
empty
($
info-
>
channel_tpls['1'])
&&
2==$info->channel_tpls['1']->op_type) checked @endif/>
<label
for=
"inner-tpl-op-url"
>
打开URL
</label>
<input
type=
"text"
id=
"inner-tpl-op-url-text"
name=
"inner-tpl-url-text"
placeholder=
"请输入URL"
value=
@if(!empty($info-
>
channel_tpls['1'])
&&
2==$info->channel_tpls['1']->op_type) "{{ $info->channel_tpls['1']->url }}" @endif>
<input
class=
"form-control"
type=
"text"
id=
"inner-tpl-op-url-text"
name=
"inner-tpl-url-text"
placeholder=
"请输入URL"
value=
@if(!empty($info-
>
channel_tpls['1'])
&&
2==$info->channel_tpls['1']->op_type) "{{ $info->channel_tpls['1']->url }}" @endif>
</div>
</div>
...
...
@@ -219,12 +223,13 @@
<label
class=
"col-sm-2 control-label"
><span
style=
"color: red"
>
*
</span>
邮件标题:
</label>
<div
class=
"col-sm-3"
>
<input
type=
"text"
id=
"email-tpl-title"
class=
"form-control"
placeholder=
"请输入邮件标题"
value=
@if(!empty($info-
>
channel_tpls['3'])) "{{ $info->channel_tpls['3']->title }}" @endif>
<label
id=
"email-tpl-title-length"
></label>
</div>
</div>
<div
class=
"col-sm-10"
style=
"margin-top: 20px"
>
<label><span
style=
"color: red"
>
*
</span>
邮件内容:
</label>
<script
type=
"text/plain"
id=
"email-tpl-content"
name=
"email-tpl-content"
>
@
if
(
!
empty
(
$info
->
channel_tpls
[
'3'
]
->
content
))
{
!!
$info
->
channel_tpls
[
'3'
]
->
content
!!
}
@
endif
</script>
<script
type=
"text/plain"
id=
"email-tpl-content"
>
@
if
(
!
empty
(
$info
->
channel_tpls
[
'3'
]
->
content
))
{
!!
$info
->
channel_tpls
[
'3'
]
->
content
!!
}
@
endif
</script>
<script
type=
"text/javascript"
>
UE
.
getEditor
(
'email-tpl-content'
);
</script>
</div>
</div>
...
...
resources/views/message/allhistorylist.blade.php
View file @
dacdde13
...
...
@@ -66,11 +66,11 @@
<thead>
<tr
role=
"row"
>
<th
style=
"width:100px;"
class=
"text-center"
>
消息编号
</th>
<th
style=
"width:100px;"
class=
"text-center"
>
发送时间
</th>
<th
style=
"width:150px;"
class=
"text-center"
>
消息标题
</th>
<th
style=
"width:100px;"
class=
"text-center"
>
消息内容
</th>
<th
style=
"width:100px;"
class=
"text-center"
>
消息渠道
</th>
<th
style=
"width:100px;"
class=
"text-center"
>
推送人员
</th>
<th
style=
"width:100px;"
class=
"text-center"
>
推送目标
</th>
<th
style=
"width:100px;"
class=
"text-center"
>
推送时间
</th>
<th
style=
"width:100px;"
class=
"text-center"
>
推送状态
</th>
</tr>
</thead>
...
...
@@ -79,7 +79,6 @@
@foreach($info as $obj)
<tr
role=
"row"
style=
"text-align: center"
>
<td>
{{ $obj->log_id }}
</td>
<td>
{{ $obj->actual_send_time }}
</td>
<td>
{{ $obj->title }}
</td>
<td>
{{ $obj->content }}
</td>
<?php
...
...
@@ -103,9 +102,13 @@
?>
<td>
{{ $obj->channel_type }}
</td>
<td>
{{ $obj->obj_user }}
</td>
<td>
{{ $obj->actual_send_time }}
</td>
<?php
switch
(
$obj
->
status
)
{
case
-
4
:
$obj
->
status
=
"删除"
;
break
;
case
-
3
:
$obj
->
status
=
"已取消"
;
break
;
...
...
@@ -118,6 +121,9 @@
case
1
:
$obj
->
status
=
"发送成功"
;
break
;
case
2
:
$obj
->
status
=
"已读"
;
break
;
default
:
break
;
}
...
...
resources/views/message/manualhistorylist.blade.php
View file @
dacdde13
...
...
@@ -51,7 +51,7 @@
<th
style=
"width:100px;"
class=
"text-center"
>
消息标题
</th>
<th
style=
"width:150px;"
class=
"text-center"
>
消息描述
</th>
<th
style=
"width:100px;"
class=
"text-center"
>
消息渠道
</th>
<th
style=
"width:100px;"
class=
"text-center"
>
推送
人员
</th>
<th
style=
"width:100px;"
class=
"text-center"
>
推送
目标
</th>
<th
style=
"width:100px;"
class=
"text-center"
>
发送时间
</th>
<th
style=
"width:100px;"
class=
"text-center"
>
操作
</th>
</tr>
...
...
@@ -64,7 +64,11 @@
<td>
{{ $info[$i]->title }}
</td>
<td>
{{ $info[$i]->description }}
</td>
<td>
{{ $info[$i]->channels_str }}
</td>
<td>
{{ $info[$i]->obj_user }}
</td>
@if($info[$i]->obj_user=='is_to_all')
<td>
全部用户
</td>
@else
<td>
{{ $info[$i]->obj_user }}
</td>
@endif
<td>
{{ $info[$i]->actual_send_time }}
</td>
<td><a
href=
"{{url('message/sendmanualmessage')}}?log_id={{$info[$i]->log_id}}"
class=
"btn btn-xs btn-outline btn-primary"
>
编辑
</a></td>
</tr>
...
...
resources/views/message/sendmanualmessage.blade.php
View file @
dacdde13
...
...
@@ -118,6 +118,7 @@
<label
class=
"col-sm-2 control-label"
><span
style=
"color: red"
>
*
</span>
模板描述:
</label>
<div
class=
"col-sm-3"
>
<input
type=
"text"
id=
"msg-tpl-desc"
class=
"form-control"
placeholder=
"请输入描述"
value=
"{{ $info->desc }}"
/>
<label
id=
"msg-tpl-desc-length"
></label>
</div>
</div>
...
...
@@ -174,7 +175,7 @@
{{--渠道模板内容--}}
<div
class=
"tab-content tabs"
>
{{--站内信--}}
<div
role=
"tabpanel"
class=
"tab-pane fade in active"
id=
"inn
n
er"
>
<div
role=
"tabpanel"
class=
"tab-pane fade in active"
id=
"inner"
>
<div
class=
"col-sm-10 form-inline"
style=
"margin-top: 40px"
>
<label
class=
"col-sm-2 control-label"
><span
style=
"color: red"
>
*
</span>
站内信类型:
</label>
...
...
@@ -191,19 +192,22 @@
<label
class=
"col-sm-2 control-label"
><span
style=
"color: red"
>
*
</span>
站内信标题:
</label>
<div
class=
"col-sm-3"
>
<input
type=
"text"
id=
"inner-tpl-title"
class=
"form-control"
placeholder=
"请输入标题"
value=
@if(!empty($info-
>
channel_tpls['1'])) "{{ $info->channel_tpls['1']->title }}" @endif>
<label
id=
"inner-tpl-title-length"
></label>
</div>
</div>
<div
class=
"col-sm-10"
style=
"margin-top: 20px"
>
<label><span
style=
"color: red"
>
*
</span>
站内信内容:
</label>
<script
type=
"text/plain"
id=
"inner-tpl-content"
name=
"inner-tpl-content"
>
@
if
(
!
empty
(
$info
->
channel_tpls
[
'1'
]
->
content
))
{
!!
$info
->
channel_tpls
[
'1'
]
->
content
!!
}
@
endif
</script>
<script
type=
"text/plain"
id=
"inner-tpl-content"
>
@
if
(
!
empty
(
$info
->
channel_tpls
[
'1'
]
->
content
))
{
!!
$info
->
channel_tpls
[
'1'
]
->
content
!!
}
@
endif
</script>
<script
type=
"text/javascript"
>
UE
.
getEditor
(
'inner-tpl-content'
);
</script>
</div>
<div
class=
"col-sm-10 form-inline"
style=
"margin-top: 20px"
>
<label
class=
"col-sm-2 control-label"
><span
style=
"color: red"
>
*
</span>
点击消息操作:
</label>
<div
class=
"col-sm-
5
"
>
<div
class=
"col-sm-
8
"
>
<input
type=
"radio"
id=
"inner-tpl-op-open"
name=
"inner-tpl-op"
value=
"1"
@
if
(!
empty
($
info-
>
channel_tpls['1'])
&&
1==$info->channel_tpls['1']->op_type) checked @endif/>
<label
for=
"inner-tpl-op-open"
>
打开消息
</label>
</div>
<div
class=
"col-sm-offset-2 col-sm-8"
>
<input
type=
"radio"
id=
"inner-tpl-op-url"
name=
"inner-tpl-op"
value=
"2"
@
if
(!
empty
($
info-
>
channel_tpls['1'])
&&
2==$info->channel_tpls['1']->op_type) checked @endif/>
<label
for=
"inner-tpl-op-url"
>
打开URL
</label>
<input
class=
"form-control"
type=
"text"
id=
"inner-tpl-op-url-text"
name=
"inner-tpl-url-text"
placeholder=
"请输入URL"
value=
@if(!empty($info-
>
channel_tpls['1'])
&&
2==$info->channel_tpls['1']->op_type) "{{ $info->channel_tpls['1']->url }}" @endif>
</div>
...
...
@@ -228,12 +232,13 @@
<label
class=
"col-sm-2 control-label"
><span
style=
"color: red"
>
*
</span>
邮件标题:
</label>
<div
class=
"col-sm-3"
>
<input
type=
"text"
id=
"email-tpl-title"
class=
"form-control"
placeholder=
"请输入邮件标题"
value=
@if(!empty($info-
>
channel_tpls['3'])) "{{ $info->channel_tpls['3']->title }}" @endif >
<label
id=
"email-tpl-title-length"
></label>
</div>
</div>
<div
class=
"col-sm-10"
style=
"margin-top: 20px"
>
<label><span
style=
"color: red"
>
*
</span>
邮件内容:
</label>
<script
type=
"text/plain"
id=
"email-tpl-content"
name=
"email-tpl-content"
>
@
if
(
!
empty
(
$info
->
channel_tpls
[
'3'
]
->
content
))
{
!!
$info
->
channel_tpls
[
'3'
]
->
content
!!
}
@
endif
</script>
<script
type=
"text/plain"
id=
"email-tpl-content"
>
@
if
(
!
empty
(
$info
->
channel_tpls
[
'3'
]
->
content
))
{
!!
$info
->
channel_tpls
[
'3'
]
->
content
!!
}
@
endif
</script>
<script
type=
"text/javascript"
>
UE
.
getEditor
(
'email-tpl-content'
);
</script>
</div>
</div>
...
...
@@ -256,18 +261,23 @@
{{--用户范围(全局)--}}
<div
class=
"col-sm-10 form-inline"
style=
"margin-top: 20px;margin-left: 40px"
>
<label
class=
"col-sm-2 control-label"
><span
style=
"color: red"
>
*
</span>
用户范围:
</label>
<div
class=
"col-sm-
5
"
>
<div
class=
"col-sm-
8
"
>
<input
type=
"radio"
name=
"user-range"
id=
"user-range-all"
class=
"form-control"
value=
"1"
@
if
(
empty
($
info-
>
obj_user)) checked @endif/>
<label
for=
"user-range-all"
>
所有用户
</label>
</div>
<div
class=
"col-sm-offset-2 col-sm-8"
>
<input
type=
"radio"
name=
"user-range"
id=
"user-range-specified"
class=
"form-control"
value=
"3"
@
if
(!
empty
($
info-
>
obj_user)) checked @endif/>
<label
for=
"user-range-specified"
>
指定用户
</label>
<input
type=
"text"
class=
"form-control"
id=
"msg-specified-users-text"
name=
"msg-specified-users-text"
placeholder=
"请输入指定用户"
style=
"width: 200px"
value=
"{{ $info->obj_user }}"
/>
<textarea
rows=
"2"
cols=
"100"
id=
"msg-specified-users-text"
name=
"msg-specified-users-text"
class=
"form-control"
placeholder=
"请输入指定用户"
>
{{ $info->obj_user }}
</textarea>
可输入多个目标用户,多个用户用','隔开
</div>
</div>
{{--发送时间(全局)--}}
<div
class=
"col-sm-10 form-inline"
style=
"margin-top: 20px;margin-left: 40px"
>
<label
class=
"col-sm-2 control-label"
><span
style=
"color: red"
>
*
</span>
发送时间:
</label>
<div
class=
"col-sm-
5
"
>
<div
class=
"col-sm-
8
"
>
<input
type=
"radio"
name=
"send-time"
id=
"send-time-immediately"
class=
"form-control"
value=
"1"
@
if
(
empty
($
info-
>
expect_send_time)) checked @endif/>
<label
for=
"send-time-immediately"
>
立即推送
</label>
</div>
<div
class=
"col-sm-offset-2 col-sm-8"
>
<input
type=
"radio"
name=
"send-time"
id=
"send-time-specified"
class=
"form-control"
value=
"2"
@
if
(!
empty
($
info-
>
expect_send_time)) checked @endif/>
<label
for=
"send-time-specified"
>
定时推送
</label>
<input
type=
"text"
class=
"form-control"
id=
"Choice_start"
name=
"create_time_start/condition"
value=
"{{ $info->expect_send_time }}"
/>
</div>
...
...
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