123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- @{
- Layout = "~/Views/Shared/_MainLayoutPage.cshtml";
- }
- <!DOCTYPE html>
- <head>
- <meta charset="utf-8">
- <title>layui</title>
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
- <style>
- .message-title {
- font-size: 16px;
- font-weight: bold;
- padding: 1rem 1rem;
- width: 805px;
- word-wrap: break-word;
- }
- .message-detail {
- font-size: 14px;
- padding: 1rem 1rem;
- overflow-x:hidden
- }
- .message-detail p {
- width: 805px;
- word-wrap: break-word;
- }
- .message-person {
- font-size: 15px;
- font-weight: bold;
- padding: 0 1rem;
- color: #5840a0;
- }
- #notice div{
- overflow-y:auto
- }
- .messgeconfig{
- position:fixed;
- bottom:10px;
- right:10px;
- }
- .message-attachment
- {
- font-size: 15px;
- font-weight: bold;
- color:royalblue
- }
- </style>
- </head>
- <div class="layui-carousel" id="test1" lay-filter="test1" style="background-color:white;" >
- <div style="position:fixed;bottom:10px;right:10px;z-index:9999">
-
- </div>
- <div carousel-item="" id="notice">
- </div>
-
- </div>
- <script type="text/javascript">
- $(function () {
- Getcarousel(function () {
- $('.checkconfig').checkbox({
- onChange: function (checked) {
- var id = $('.layui-this').children('.message-title').attr("id");
- $.post("/Notice/SaveNoticeConfig", { NoticeId: id, IsOpen: checked }, function (data) {
- if (data == '1') {
-
- } else {
- top.ZLPMS.Msg('保存失败');
- }
- })
-
- }
- })
- layui.use(['carousel', 'form'], function () {
- var carousel = layui.carousel
- , form = layui.form;
- //常规轮播
- carousel.render({
- elem: '#test1'
- , arrow: 'hover'
- , indicator: "none"
- , width: "100%"
- , autoplay: false
- , full: true
- });
- });
- })
-
- })
- function Getcarousel(callback) {
- var FJID;
- $.get('/Notice/GetMessageOnIndex', function (data) {
- FJID=data[0].附件ID
- var html = "";
- for (item in data) {
- html = '<div style="background-color:antiquewhite;"><div id="'+data[item].ID+'" class="message-title" >' + data[item].标题 + '</div><div class="message-person" >' + data[item].添加人 + '-' + data[item].发布时间 + '</div><div class="message-detail" ><p>' + data[item].内容 + '</p></div> <div class="message-attachment"><a href="#" onclick="downloadfile(' + data[item].附件ID + ')">下载附件</a></div> <div class="messgeconfig"><input class="easyui-checkbox checkconfig" type="checkbox" label="不再提醒本公告" labelPosition="after" labelWidth="100px" /></div></div>'
- $("#notice").append(html);
- }
- if (FJID == null) {
- $(".message-attachment").attr("style", "display:none;")
- }
- callback();
- })
-
-
- }
- //下载附件文件
- function downloadfile(id) {
- window.open('/Problem/ViewProblemImage?id=' + id);
- }
- </script>
|