Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
施宇
/
icsales
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
9136b592
authored
Jul 17, 2019
by
梁建民
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
js
parent
cf3ed074
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
27 deletions
Application/Home/View/Notice/index.html
dist/js/global/api.js
dist/js/notice/index.js
Application/Home/View/Notice/index.html
View file @
9136b592
...
...
@@ -39,7 +39,7 @@
<script
type=
"text/html"
id=
"msgHtml"
>
<
div
class
=
"notice_list"
>
{{
#
layui
.
each
(
d
,
function
(
index
,
item
){
}}
<
div
class
=
"notice_item clr"
data
-
status
=
"{{item.status
}}"
>
<
div
class
=
"notice_item clr"
data
-
id
=
"{{item.log_id}}"
data
-
type
=
"{{item.msg_type
}}"
>
<
div
class
=
"item_right fr"
>
<
p
>
{{
item
.
create_time
}}
<
/p
>
<
/div
>
...
...
dist/js/global/api.js
View file @
9136b592
...
...
@@ -177,7 +177,11 @@
/**
* 获取会员活动通知
*/
userActmsg
:
user_url
+
'/user/actmsg'
userActmsg
:
user_url
+
'/user/actmsg'
,
/**
* 标记会员通知(已读)
*/
userMarkmsg
:
user_url
+
'/user/markmsg'
};
if
(
typeof
define
===
"function"
&&
define
.
amd
)
{
return
apis
;
...
...
dist/js/notice/index.js
View file @
9136b592
...
...
@@ -13,7 +13,7 @@
return
this
;
},
render
:
function
(
opt
,
params
,
curr
,
url
)
{
render
:
function
(
opt
,
params
,
curr
,
url
,
flag
)
{
var
getTpl
=
msgHtml
.
innerHTML
;
...
...
@@ -40,35 +40,38 @@
}
layui
.
laytpl
(
getTpl
).
render
(
data
.
data
,
function
(
html
)
{
$
(
"#notice"
).
empty
().
html
(
html
);
if
(
flag
==
undefined
)
{
layui
.
laypage
.
render
({
elem
:
'pagination'
,
theme
:
'#1080d0'
,
count
:
data
.
count
,
limit
:
10
,
curr
:
curr
,
jump
:
function
(
obj
,
first
)
{
if
(
!
first
)
{
//分页回调调用
var
json
=
{
page
:
obj
.
curr
};
var
param
=
$
.
extend
({},
params
,
json
);
NoticeController
.
render
(
opt
,
param
,
obj
.
curr
,
url
);
layui
.
laytpl
(
getTpl
).
render
(
data
.
data
,
function
(
html
)
{
$
(
"#notice"
).
empty
().
html
(
html
);
layui
.
laypage
.
render
({
elem
:
'pagination'
,
theme
:
'#1080d0'
,
count
:
data
.
count
,
limit
:
10
,
curr
:
curr
,
jump
:
function
(
obj
,
first
)
{
if
(
!
first
)
{
//分页回调调用
var
json
=
{
page
:
obj
.
curr
};
var
param
=
$
.
extend
({},
params
,
json
);
NoticeController
.
render
(
opt
,
param
,
obj
.
curr
,
url
);
}
}
}
});
});
}
);
}
}
else
{
...
...
@@ -101,6 +104,44 @@
}
});
//活动标记
$
(
document
).
on
(
'click'
,
'.notice_list .notice_item'
,
function
()
{
var
id
=
$
(
this
).
attr
(
'data-id'
);
var
type
=
$
(
this
).
attr
(
'data-type'
);
IcController
.
getData
(
apis
.
userMarkmsg
,
'GET'
,
{
token
:
opt
.
token
,
log_id
:
id
},
function
(
res
)
{
if
(
res
.
errcode
===
0
)
{
if
(
type
===
2
)
{
opt
.
render
(
opt
,
{
token
:
opt
.
token
,
page
:
1
,
limit
:
10
},
1
,
apis
.
userActmsg
,
false
);
}
else
{
opt
.
render
(
opt
,
{
token
:
opt
.
token
,
page
:
1
,
limit
:
10
},
1
,
apis
.
userSysmsg
,
false
);
}
//顶部信息数量恭喜
IcController
.
getData
(
apis
.
userInfo
,
'GET'
,
{
token
:
opt
.
token
},
function
(
res
)
{
if
(
res
.
errcode
===
0
)
{
//消息数量
$
(
"#count_num"
).
empty
().
html
(
res
.
data
[
'msg_notification'
]);
}
});
}
});
});
return
this
;
},
...
...
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