|
@@ -1,423 +1,463 @@
|
|
|
<!DOCTYPE html>
|
|
|
<html lang="zh">
|
|
|
<head>
|
|
|
- {{include "/common/meta.html"}}
|
|
|
- <link rel="stylesheet" type="text/css" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/layout.css"/>
|
|
|
- <link rel="stylesheet" type="text/css"
|
|
|
- href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/me/css/reset.css?v={{Msg "seo" "version"}}"/>
|
|
|
- <link rel="stylesheet" type="text/css"
|
|
|
- href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/css/font.css?v={{Msg "seo" "version"}}"/>
|
|
|
- <link rel="stylesheet" href="//cdn-common.jianyu360.com/cdn/lib/minirefresh/2.0.2/minirefresh.min.css">
|
|
|
- <link rel="stylesheet" type="text/css"
|
|
|
- href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/me/css/notice.css?v={{Msg "seo" "version"}}"/>
|
|
|
- <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/fastclick.min.js" type="text/javascript"
|
|
|
- charset="utf-8"></script>
|
|
|
- <script src="https://cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js" type="text/javascript"
|
|
|
- charset="utf-8"></script>
|
|
|
- <script src="//cdn-common.jianyu360.com/cdn/lib/minirefresh/2.0.2/minirefresh.min.js"></script>
|
|
|
- {{include "/common/js.html"}}
|
|
|
- <title>通知</title>
|
|
|
- <style>
|
|
|
- .app-layout-content-b {
|
|
|
- padding-top: 76px;
|
|
|
- }
|
|
|
- .msg-box {
|
|
|
- position: fixed;
|
|
|
- top: 21.33333vw;
|
|
|
- left: 0;
|
|
|
- width: 100%;
|
|
|
- z-index: 2;
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
- padding-left: 16px;
|
|
|
- box-sizing: border-box;
|
|
|
- background-color: #fff;
|
|
|
- min-height: 44px;
|
|
|
- border-bottom: 1px solid #f4f4f9;
|
|
|
- }
|
|
|
- #zc__sdk__sys__btn {
|
|
|
- display: none;
|
|
|
- }
|
|
|
- .ellipsis {
|
|
|
- overflow:hidden;
|
|
|
- text-overflow:ellipsis;
|
|
|
- white-space:nowrap;
|
|
|
- text-align: justify
|
|
|
- }
|
|
|
- /* 超过2行省略号显示 */
|
|
|
- .ellipsis-2 {
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- display: -webkit-box;
|
|
|
- -webkit-line-clamp: 2;
|
|
|
- -webkit-box-orient: vertical;
|
|
|
- text-align: justify
|
|
|
- }
|
|
|
- .noticeListBox {
|
|
|
- background: #fff;
|
|
|
- box-sizing: border-box;
|
|
|
- position: relative;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
- .msg-box-card:last-child {
|
|
|
- border-bottom-color: transparent;
|
|
|
- }
|
|
|
- .msg-box-card {
|
|
|
- width: 100%;
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
- align-items: center;
|
|
|
- padding: 16px;
|
|
|
- padding-left: 0;
|
|
|
- box-sizing: border-box;
|
|
|
- background-color: #fff;
|
|
|
- border-bottom: 1px solid rgb(240,240,240);
|
|
|
- }
|
|
|
- .info-content-box {
|
|
|
- flex: 1;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- justify-content: center;
|
|
|
- overflow: hidden;
|
|
|
- }
|
|
|
- .top-info-box {
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
- }
|
|
|
- .head-box {
|
|
|
- flex-shrink: 0;
|
|
|
- position: relative;
|
|
|
- margin-right: 12px;
|
|
|
- align-self: flex-start;
|
|
|
- }
|
|
|
- .head-box[data-badge-number-zero]::after,
|
|
|
- .head-box[data-badge-number]::after {
|
|
|
- content: '';
|
|
|
- position: absolute;
|
|
|
- top: 1px;
|
|
|
- right: 1px;
|
|
|
- display: inline-block;
|
|
|
- width: 8px;
|
|
|
- height: 8px;
|
|
|
- background: #FB483D;
|
|
|
- border-radius: 50%;
|
|
|
- border: 1px solid #FFFFFF;
|
|
|
- }
|
|
|
- .head-box[data-badge-number]::after {
|
|
|
- content: attr(data-badge-number);
|
|
|
- color: #fff;
|
|
|
- font-size: 11px;
|
|
|
- line-height: 15px;
|
|
|
- top: -4px;
|
|
|
- right: -3px;
|
|
|
- width: auto;
|
|
|
- height: auto;
|
|
|
- min-height: 15px;
|
|
|
- min-width: 15px;
|
|
|
- padding: 0 4px;
|
|
|
- border-radius: 20px;
|
|
|
- box-sizing: border-box;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- .head-box img {
|
|
|
- width: 44px;
|
|
|
- height: 44px;
|
|
|
- }
|
|
|
- .top-info-box p {
|
|
|
- font-size: 16px;
|
|
|
- line-height: 24px;
|
|
|
- color: #171826;
|
|
|
- }
|
|
|
- .top-info-box span {
|
|
|
- flex-shrink: 0;
|
|
|
- font-size: 12px;
|
|
|
- line-height: 18px;
|
|
|
- text-align: right;
|
|
|
- color: #9B9CA3;
|
|
|
- margin-left: 20px;
|
|
|
- }
|
|
|
- .info-content-box > p {
|
|
|
- margin-top: 4px;
|
|
|
- font-size: 13px;
|
|
|
- line-height: 20px;
|
|
|
- color: #5F5E64;
|
|
|
- }
|
|
|
- .noticeMain {
|
|
|
- margin-top: 14px;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
- #templateLi {
|
|
|
- display: none;
|
|
|
- }
|
|
|
- #dataList {
|
|
|
- padding-left: 16px;
|
|
|
- }
|
|
|
- .app-layout-content-b.no-message .noticeMain{
|
|
|
- margin-top: 0;
|
|
|
- }
|
|
|
- .app-layout-content-b.no-message .msg-box{
|
|
|
- display: none;
|
|
|
- }
|
|
|
- .app-layout-content-b.no-message {
|
|
|
- padding-top: 0;
|
|
|
- }
|
|
|
- </style>
|
|
|
+ {{include "/common/meta.html"}}
|
|
|
+ <link rel="stylesheet" type="text/css" href="{{Cdns .Host " seo
|
|
|
+ " "cdn"|SafeUrl}}/jyapp/local/layout.css"/>
|
|
|
+ <link rel="stylesheet" type="text/css"
|
|
|
+ href="{{Cdns .Host " seo
|
|
|
+ " "cdn"|SafeUrl}}/jyapp/me/css/reset.css?v={{Msg "seo" "version"}}"/>
|
|
|
+ <link rel="stylesheet" type="text/css"
|
|
|
+ href="{{Cdns .Host " seo
|
|
|
+ " "cdn"|SafeUrl}}/jyapp/css/font.css?v={{Msg "seo" "version"}}"/>
|
|
|
+ <link rel="stylesheet" href="//cdn-common.jianyu360.com/cdn/lib/minirefresh/2.0.2/minirefresh.min.css">
|
|
|
+ <link rel="stylesheet" type="text/css"
|
|
|
+ href="{{Cdns .Host " seo
|
|
|
+ " "cdn"|SafeUrl}}/jyapp/me/css/notice.css?v={{Msg "seo" "version"}}"/>
|
|
|
+ <script src="{{Cdns .Host " seo
|
|
|
+ " "cdn"|SafeUrl}}/jyapp/local/fastclick.min.js" type="text/javascript"
|
|
|
+ charset="utf-8"></script>
|
|
|
+ <script src="https://cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js" type="text/javascript"
|
|
|
+ charset="utf-8"></script>
|
|
|
+ <script src="//cdn-common.jianyu360.com/cdn/lib/minirefresh/2.0.2/minirefresh.min.js"></script>
|
|
|
+ {{include "/common/js.html"}}
|
|
|
+ <title>通知</title>
|
|
|
+ <style>
|
|
|
+ .app-layout-content-b {
|
|
|
+ padding-top: 76px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .msg-box {
|
|
|
+ position: fixed;
|
|
|
+ top: 21.33333vw;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ z-index: 2;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ padding-left: 16px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ background-color: #fff;
|
|
|
+ min-height: 44px;
|
|
|
+ border-bottom: 1px solid #f4f4f9;
|
|
|
+ }
|
|
|
+
|
|
|
+ #zc__sdk__sys__btn {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ellipsis {
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-align: justify
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 超过2行省略号显示 */
|
|
|
+ .ellipsis-2 {
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ display: -webkit-box;
|
|
|
+ -webkit-line-clamp: 2;
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
+ text-align: justify
|
|
|
+ }
|
|
|
+
|
|
|
+ .noticeListBox {
|
|
|
+ background: #fff;
|
|
|
+ box-sizing: border-box;
|
|
|
+ position: relative;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .msg-box-card:last-child {
|
|
|
+ border-bottom-color: transparent;
|
|
|
+ }
|
|
|
+
|
|
|
+ .msg-box-card {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ padding: 16px;
|
|
|
+ padding-left: 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+ background-color: #fff;
|
|
|
+ border-bottom: 1px solid rgb(240, 240, 240);
|
|
|
+ }
|
|
|
+
|
|
|
+ .info-content-box {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+
|
|
|
+ .top-info-box {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+
|
|
|
+ .head-box {
|
|
|
+ flex-shrink: 0;
|
|
|
+ position: relative;
|
|
|
+ margin-right: 12px;
|
|
|
+ align-self: flex-start;
|
|
|
+ }
|
|
|
+
|
|
|
+ .head-box[data-badge-number-zero]::after,
|
|
|
+ .head-box[data-badge-number]::after {
|
|
|
+ content: '';
|
|
|
+ position: absolute;
|
|
|
+ top: 1px;
|
|
|
+ right: 1px;
|
|
|
+ display: inline-block;
|
|
|
+ width: 8px;
|
|
|
+ height: 8px;
|
|
|
+ background: #FB483D;
|
|
|
+ border-radius: 50%;
|
|
|
+ border: 1px solid #FFFFFF;
|
|
|
+ }
|
|
|
+
|
|
|
+ .head-box[data-badge-number]::after {
|
|
|
+ content: attr(data-badge-number);
|
|
|
+ color: #fff;
|
|
|
+ font-size: 11px;
|
|
|
+ line-height: 15px;
|
|
|
+ top: -4px;
|
|
|
+ right: -3px;
|
|
|
+ width: auto;
|
|
|
+ height: auto;
|
|
|
+ min-height: 15px;
|
|
|
+ min-width: 15px;
|
|
|
+ padding: 0 4px;
|
|
|
+ border-radius: 20px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .head-box img {
|
|
|
+ width: 44px;
|
|
|
+ height: 44px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .top-info-box p {
|
|
|
+ font-size: 16px;
|
|
|
+ line-height: 24px;
|
|
|
+ color: #171826;
|
|
|
+ }
|
|
|
+
|
|
|
+ .top-info-box span {
|
|
|
+ flex-shrink: 0;
|
|
|
+ font-size: 12px;
|
|
|
+ line-height: 18px;
|
|
|
+ text-align: right;
|
|
|
+ color: #9B9CA3;
|
|
|
+ margin-left: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .info-content-box > p {
|
|
|
+ margin-top: 4px;
|
|
|
+ font-size: 13px;
|
|
|
+ line-height: 20px;
|
|
|
+ color: #5F5E64;
|
|
|
+ }
|
|
|
+
|
|
|
+ .noticeMain {
|
|
|
+ margin-top: 14px;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ #templateLi {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ #dataList {
|
|
|
+ padding-left: 16px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .app-layout-content-b.no-message .noticeMain {
|
|
|
+ margin-top: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .app-layout-content-b.no-message .msg-box {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .app-layout-content-b.no-message {
|
|
|
+ padding-top: 0;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
</head>
|
|
|
<body>
|
|
|
<!--头部start-->
|
|
|
<div class="app-layout-header jy-app-header">
|
|
|
- <span class="app-back jyapp-icon jyapp-icon-zuojiantou"></span>
|
|
|
- 通知
|
|
|
- <span></span></div>
|
|
|
+ <span class="app-back jyapp-icon jyapp-icon-zuojiantou"></span>
|
|
|
+ 通知
|
|
|
+ <span></span></div>
|
|
|
<div class="app-layout-content-b no-message">
|
|
|
- <!--头部end-->
|
|
|
- <!--S-固定客服-->
|
|
|
- <div class="fixed-box msg-box">
|
|
|
- <div id="open-customer" class="msg-box-card">
|
|
|
- <div class="head-box" id="msg-count">
|
|
|
- <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/me/images/logo_work.png?v={{Msg "seo" "version"}}'/>
|
|
|
- </div>
|
|
|
- <div class="info-content-box">
|
|
|
- <div class="top-info-box">
|
|
|
- <p class="ellipsis">人工客服</p>
|
|
|
- <span></span>
|
|
|
- </div>
|
|
|
- <p class="ellipsis">剑鱼标讯人工客服,很高兴为您服务。</p>
|
|
|
- </div>
|
|
|
+ <!--头部end-->
|
|
|
+ <!--S-固定客服-->
|
|
|
+ <div class="fixed-box msg-box">
|
|
|
+ <div id="open-customer" class="msg-box-card">
|
|
|
+ <div class="head-box" id="msg-count">
|
|
|
+ <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/me/images/logo_work.png?v={{Msg "seo" "version"}}'/>
|
|
|
+ </div>
|
|
|
+ <div class="info-content-box">
|
|
|
+ <div class="top-info-box">
|
|
|
+ <p class="ellipsis">人工客服</p>
|
|
|
+ <span></span>
|
|
|
</div>
|
|
|
+ <p class="ellipsis">剑鱼标讯人工客服,很高兴为您服务。</p>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <!--E-固定客服-->
|
|
|
- <div class="noticeMain">
|
|
|
- <!--信息空start-->
|
|
|
- <div class="empty">
|
|
|
- <img src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/me/images/kong.png?v={{Msg "seo" "version"}}"/>
|
|
|
- <p>暂未收到任何消息</p>
|
|
|
- </div>
|
|
|
- <!--信息空end-->
|
|
|
+ </div>
|
|
|
+ <!--E-固定客服-->
|
|
|
+ <div class="noticeMain">
|
|
|
+ <!--信息空start-->
|
|
|
+ <div class="empty">
|
|
|
+ <img src="{{Cdns .Host " seo" "cdn"|SafeUrl}}/jyapp/me/images/kong.png?v={{Msg "seo" "version"}}"/>
|
|
|
+ <p>暂未收到任何消息</p>
|
|
|
+ </div>
|
|
|
+ <!--信息空end-->
|
|
|
|
|
|
- <div class="noticeListBox">
|
|
|
- <div class="minirefresh-wrap" id="minirefresh">
|
|
|
- <div class="minirefresh-scroll">
|
|
|
- <ul class="data-list" id="dataList"></ul>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <li class="msg-box-card" id="templateLi">
|
|
|
- <div class="head-box" data-badge-number-zero>
|
|
|
- <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/me/images/logo_round.png?v={{Msg "seo" "version"}}'/>
|
|
|
- </div>
|
|
|
- <div class="info-content-box">
|
|
|
- <div class="top-info-box">
|
|
|
- <p class="ellipsis">内容最多显示2行内容最多显最多内容最多多显多显显</p>
|
|
|
- <span>1天前</span>
|
|
|
- </div>
|
|
|
- <p class="ellipsis-2">内容最多显示2行,不需要可以删除这行。内容最多显示2行,不需要可以删除这行。内容最多显示2行,不需要可以删除这行。内容最多显示2行内容最多显最多内容最多多显多显显...</p>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
+ <div class="noticeListBox">
|
|
|
+ <div class="minirefresh-wrap" id="minirefresh">
|
|
|
+ <div class="minirefresh-scroll">
|
|
|
+ <ul class="data-list" id="dataList"></ul>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
+ <li class="msg-box-card" id="templateLi">
|
|
|
+ <div class="head-box" data-badge-number-zero>
|
|
|
+ <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/me/images/logo_round.png?v={{Msg "seo" "version"}}'/>
|
|
|
+ </div>
|
|
|
+ <div class="info-content-box">
|
|
|
+ <div class="top-info-box">
|
|
|
+ <p class="ellipsis">内容最多显示2行内容最多显最多内容最多多显多显显</p>
|
|
|
+ <span>1天前</span>
|
|
|
+ </div>
|
|
|
+ <p class="ellipsis-2">内容最多显示2行,不需要可以删除这行。内容最多显示2行,不需要可以删除这行。内容最多显示2行,不需要可以删除这行。内容最多显示2行内容最多显最多内容最多多显多显显...</p>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
- if ('addEventListener' in document) {
|
|
|
- document.addEventListener('DOMContentLoaded', function () {
|
|
|
- FastClick.attach(document.body);
|
|
|
- }, false);
|
|
|
- }
|
|
|
+ if ('addEventListener' in document) {
|
|
|
+ document.addEventListener('DOMContentLoaded', function () {
|
|
|
+ FastClick.attach(document.body);
|
|
|
+ }, false);
|
|
|
+ }
|
|
|
</script>
|
|
|
<script type="text/javascript">
|
|
|
- localStorage.removeItem("redSpotLastAjaxTime");
|
|
|
+ localStorage.removeItem("redSpotLastAjaxTime");
|
|
|
|
|
|
- var userId = {{session "userId"}};
|
|
|
+ var userId = {
|
|
|
+ {
|
|
|
+ session
|
|
|
+ "userId"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ;
|
|
|
+
|
|
|
+ $(function () {
|
|
|
+ var page = 0;
|
|
|
+ var doAjaxStatus = false
|
|
|
+ // 刷新
|
|
|
+ var miniRefresh = new MiniRefresh({
|
|
|
+ container: '#minirefresh',
|
|
|
+ down: {
|
|
|
+ callback: function () {
|
|
|
+ console.log('down');
|
|
|
+ doAjax('down')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ up: {
|
|
|
+ isAuto: false,
|
|
|
+ callback: function () {
|
|
|
+ console.log('up');
|
|
|
+ doAjax('up')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ var tempLi = $("#templateLi")
|
|
|
+ window.doA = doAjax
|
|
|
+ doAjax('down')
|
|
|
|
|
|
- $(function () {
|
|
|
- var page = 0;
|
|
|
- var doAjaxStatus = false
|
|
|
- // 刷新
|
|
|
- var miniRefresh = new MiniRefresh({
|
|
|
- container: '#minirefresh',
|
|
|
- down: {
|
|
|
- callback: function () {
|
|
|
- console.log('down');
|
|
|
- doAjax('down')
|
|
|
- }
|
|
|
- },
|
|
|
- up: {
|
|
|
- isAuto: false,
|
|
|
- callback: function () {
|
|
|
- console.log('up');
|
|
|
- doAjax('up')
|
|
|
- }
|
|
|
+ function doAjax(type) {
|
|
|
+ if (doAjaxStatus) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ doAjaxStatus = true
|
|
|
+ var canDown = type === 'down'
|
|
|
+ if (canDown) {
|
|
|
+ page = 0;
|
|
|
+ } else {
|
|
|
+ page++
|
|
|
+ }
|
|
|
+ $.post("/jyapp/free/notice/list?t=" + new Date().getTime(), {pageNum: page}).done(function (r) {
|
|
|
+ if (r.list && r.list.length > 0) {
|
|
|
+ $(".empty").show()
|
|
|
+ $(".noticeListBox").show()
|
|
|
+ if (canDown) {
|
|
|
+ $('#dataList').html('')
|
|
|
+ }
|
|
|
+ // 处理数据
|
|
|
+ var computeArr = r.list.map(function (v) {
|
|
|
+ var link = v["s_url"]
|
|
|
+ if (link.indexOf("jianyu360") > -1) {
|
|
|
+ window.location.protocol + "//" + window.location.host + v["s_url"].replace(/^(http|https):\/\/[^==/]+/, "")
|
|
|
}
|
|
|
- });
|
|
|
- var tempLi = $("#templateLi")
|
|
|
- window.doA = doAjax
|
|
|
- doAjax('down')
|
|
|
- function doAjax (type) {
|
|
|
- if (doAjaxStatus) {
|
|
|
- return
|
|
|
+ var newData = {
|
|
|
+ link: link,
|
|
|
+ comeintime: v['l_comeintime'],
|
|
|
+ title: v['s_title'],
|
|
|
+ descript: (v['s_descript'] || '').replace(/\n/g, "<br/>"),
|
|
|
+ content: v['s_content'] || '',
|
|
|
+ userid: v['s_userid'] || '',
|
|
|
+ category: v['s_type'],
|
|
|
+ id: v['_id'],
|
|
|
+ unread: v['i_unread'],
|
|
|
+ descript1: v['s_descript1'] || '',
|
|
|
+ isPartner: !v['isExhibition'],
|
|
|
+ time: timeDiff(new Date(Number(v['l_comeintime'] + "000"))),
|
|
|
}
|
|
|
- doAjaxStatus = true
|
|
|
- var canDown = type === 'down'
|
|
|
- if (canDown) {
|
|
|
- page = 0;
|
|
|
- } else {
|
|
|
- page ++
|
|
|
+ // 剑鱼伙伴独有连接
|
|
|
+ if (newData.category.indexOf('profit') !== -1) {
|
|
|
+ newData.link = newData.isPartner ? '/page_partner/home' : '/page_partner/partner/partner.html'
|
|
|
}
|
|
|
- $.post("/jyapp/free/notice/list?t=" + new Date().getTime(), { pageNum: page }).done(function (r) {
|
|
|
- if (r.list && r.list.length > 0) {
|
|
|
- $(".empty").show()
|
|
|
- $(".noticeListBox").show()
|
|
|
- if (canDown) {
|
|
|
- $('#dataList').html('')
|
|
|
- }
|
|
|
- // 处理数据
|
|
|
- var computeArr = r.list.map(function (v) {
|
|
|
- var link =v["s_url"]
|
|
|
- if (link.indexOf("jianyu360")>-1){
|
|
|
- window.location.protocol + "//" + window.location.host + v["s_url"].replace(/^(http|https):\/\/[^==/]+/, "")
|
|
|
- }
|
|
|
- var newData = {
|
|
|
- link: link,
|
|
|
- comeintime: v['l_comeintime'],
|
|
|
- title: v['s_title'],
|
|
|
- descript: (v['s_descript'] || '').replace(/\n/g, "<br/>"),
|
|
|
- content: v['s_content'] || '',
|
|
|
- userid: v['s_userid'] || '',
|
|
|
- category: v['s_type'],
|
|
|
- id: v['_id'],
|
|
|
- unread: v['i_unread'],
|
|
|
- descript1: v['s_descript1'] || '',
|
|
|
- isPartner: !v['isExhibition'],
|
|
|
- time: timeDiff(new Date(Number(v['l_comeintime'] + "000"))),
|
|
|
- }
|
|
|
- // 剑鱼伙伴独有连接
|
|
|
- if (newData.category.indexOf('profit') !== -1) {
|
|
|
- newData.link = newData.isPartner ? '/page_partner/home' : '/page_partner/partner/partner.html'
|
|
|
- }
|
|
|
- // 插入节点
|
|
|
- addNewMsg({
|
|
|
- time: newData.time,
|
|
|
- title: newData.title,
|
|
|
- content: newData.descript,
|
|
|
- badge: newData.unread == '1',
|
|
|
- propDatas: {
|
|
|
- userid: newData.userid,
|
|
|
- unread: newData.unread,
|
|
|
- category: newData.category,
|
|
|
- id: newData.id,
|
|
|
- link: newData.link
|
|
|
- }
|
|
|
- })
|
|
|
- return newData
|
|
|
- })
|
|
|
- // 处理下拉上拉加载
|
|
|
- if (canDown) {
|
|
|
- miniRefresh.endDownLoading(true)
|
|
|
- } else {
|
|
|
- miniRefresh.endUpLoading(r.list.length !== 100);
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (page === 0) {
|
|
|
- $(".empty").show()
|
|
|
- $(".noticeListBox").hide()
|
|
|
- }
|
|
|
- if (canDown) {
|
|
|
- $('#dataList').html('');
|
|
|
- miniRefresh.endDownLoading(true);
|
|
|
- } else {
|
|
|
- miniRefresh.endUpLoading(true);
|
|
|
- }
|
|
|
- }
|
|
|
- doAjaxStatus = false
|
|
|
- }).fail(function (e) {
|
|
|
- if (page === 0) {
|
|
|
- $(".empty").show()
|
|
|
- $(".noticeListBox").hide()
|
|
|
- }
|
|
|
- if (canDown) {
|
|
|
- $('#dataList').html('')
|
|
|
- miniRefresh.endDownLoading(true)
|
|
|
- } else {
|
|
|
- miniRefresh.endUpLoading(true)
|
|
|
- }
|
|
|
- doAjaxStatus = false
|
|
|
+ // 插入节点
|
|
|
+ addNewMsg({
|
|
|
+ time: newData.time,
|
|
|
+ title: newData.title,
|
|
|
+ content: newData.descript,
|
|
|
+ badge: newData.unread == '1',
|
|
|
+ propDatas: {
|
|
|
+ userid: newData.userid,
|
|
|
+ unread: newData.unread,
|
|
|
+ category: newData.category,
|
|
|
+ id: newData.id,
|
|
|
+ link: newData.link
|
|
|
+ }
|
|
|
})
|
|
|
-
|
|
|
+ return newData
|
|
|
+ })
|
|
|
+ // 处理下拉上拉加载
|
|
|
+ if (canDown) {
|
|
|
+ miniRefresh.endDownLoading(true)
|
|
|
+ } else {
|
|
|
+ miniRefresh.endUpLoading(r.list.length !== 100);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (page === 0) {
|
|
|
+ $(".empty").show()
|
|
|
+ $(".noticeListBox").hide()
|
|
|
+ }
|
|
|
+ if (canDown) {
|
|
|
+ $('#dataList').html('');
|
|
|
+ miniRefresh.endDownLoading(true);
|
|
|
+ } else {
|
|
|
+ miniRefresh.endUpLoading(true);
|
|
|
+ }
|
|
|
}
|
|
|
- function addNewMsg (msgItem) {
|
|
|
- var tempLi = window.tempLi || $("#templateLi")
|
|
|
- var cloneDom = tempLi.clone()
|
|
|
- cloneDom.removeAttr('id')
|
|
|
- cloneDom.find('span').text(msgItem.time || '')
|
|
|
- cloneDom.find('p.ellipsis').text(msgItem.title || '')
|
|
|
- cloneDom.find('p.ellipsis-2').text(msgItem.content || '')
|
|
|
- if (msgItem.badge) {
|
|
|
- cloneDom.find('.head-box').attr('data-badge-number-zero')
|
|
|
- } else {
|
|
|
- cloneDom.find('.head-box').removeAttr('data-badge-number-zero')
|
|
|
- }
|
|
|
- var attributeData = Object.keys(msgItem.propDatas)
|
|
|
- attributeData.map(function (v) {
|
|
|
- cloneDom.attr('data-' + v, msgItem.propDatas[v])
|
|
|
- })
|
|
|
- $("#dataList").append(cloneDom)
|
|
|
+ doAjaxStatus = false
|
|
|
+ }).fail(function (e) {
|
|
|
+ if (page === 0) {
|
|
|
+ $(".empty").show()
|
|
|
+ $(".noticeListBox").hide()
|
|
|
}
|
|
|
- $("#open-customer").on('click',function () {
|
|
|
- $(this).find('.head-box').removeAttr('data-badge-number')
|
|
|
- location.href = '/jyapp/free/customer'
|
|
|
- })
|
|
|
- $(".noticeListBox").on('click','li',function (e) {
|
|
|
- var link = $(this).attr("data-link");
|
|
|
- if (link == "") {
|
|
|
- return
|
|
|
- }
|
|
|
- $(this).find('.head-box').removeAttr('data-badge-number-zero')
|
|
|
- var type = $(this).attr("data-category")
|
|
|
- if (type.indexOf("message") > -1 || type.indexOf("Message") > -1) {
|
|
|
- //修改此消息为已读 catagory->message==>message_r
|
|
|
- var unread = $(this).attr("data-unread")
|
|
|
- var redirectBool = true;
|
|
|
- if (unread == "1") {
|
|
|
- //调用接口修改打开数
|
|
|
- //JyObj.openActivityPage(link, "C", $(this).attr("data-userid"))
|
|
|
- $.ajax({
|
|
|
- type: 'post',
|
|
|
- url: '/jyapp/free/message/receive?t=' + new Date().getTime(),
|
|
|
- data: {"rectype": "C", "url": link},
|
|
|
- async: false,
|
|
|
- dataType: 'json',
|
|
|
- success: function (r) {
|
|
|
- if (!r.flag) {
|
|
|
- redirectBool = false;
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ if (canDown) {
|
|
|
+ $('#dataList').html('')
|
|
|
+ miniRefresh.endDownLoading(true)
|
|
|
+ } else {
|
|
|
+ miniRefresh.endUpLoading(true)
|
|
|
+ }
|
|
|
+ doAjaxStatus = false
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function addNewMsg(msgItem) {
|
|
|
+ var tempLi = window.tempLi || $("#templateLi")
|
|
|
+ var cloneDom = tempLi.clone()
|
|
|
+ cloneDom.removeAttr('id')
|
|
|
+ cloneDom.find('span').text(msgItem.time || '')
|
|
|
+ cloneDom.find('p.ellipsis').text(msgItem.title || '')
|
|
|
+ cloneDom.find('p.ellipsis-2').text(msgItem.content || '')
|
|
|
+ if (msgItem.badge) {
|
|
|
+ cloneDom.find('.head-box').attr('data-badge-number-zero')
|
|
|
+ } else {
|
|
|
+ cloneDom.find('.head-box').removeAttr('data-badge-number-zero')
|
|
|
+ }
|
|
|
+ var attributeData = Object.keys(msgItem.propDatas)
|
|
|
+ attributeData.map(function (v) {
|
|
|
+ cloneDom.attr('data-' + v, msgItem.propDatas[v])
|
|
|
+ })
|
|
|
+ $("#dataList").append(cloneDom)
|
|
|
+ }
|
|
|
+
|
|
|
+ $("#open-customer").on('click', function () {
|
|
|
+ $(this).find('.head-box').removeAttr('data-badge-number')
|
|
|
+ location.href = '/jyapp/free/customer'
|
|
|
+ })
|
|
|
+ $(".noticeListBox").on('click', 'li', function (e) {
|
|
|
+ var link = $(this).attr("data-link");
|
|
|
+ if (link == "") {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ $(this).find('.head-box').removeAttr('data-badge-number-zero')
|
|
|
+ var type = $(this).attr("data-category")
|
|
|
+ if (type.indexOf("message") > -1 || type.indexOf("Message") > -1) {
|
|
|
+ //修改此消息为已读 catagory->message==>message_r
|
|
|
+ var unread = $(this).attr("data-unread")
|
|
|
+ var redirectBool = true;
|
|
|
+ if (unread == "1") {
|
|
|
+ //调用接口修改打开数
|
|
|
+ //JyObj.openActivityPage(link, "C", $(this).attr("data-userid"))
|
|
|
+ $.ajax({
|
|
|
+ type: 'post',
|
|
|
+ url: '/jyapp/free/message/receive?t=' + new Date().getTime(),
|
|
|
+ data: {"rectype": "C", "url": link},
|
|
|
+ async: false,
|
|
|
+ dataType: 'json',
|
|
|
+ success: function (r) {
|
|
|
+ if (!r.flag) {
|
|
|
+ redirectBool = false;
|
|
|
}
|
|
|
- if (redirectBool){
|
|
|
- link = link.split('==')[0];
|
|
|
- //内部链接直接打开
|
|
|
- if (link.indexOf("/jyapp/free/message") > -1) {
|
|
|
- window.location.href = link;
|
|
|
- } else {
|
|
|
- //外部链接调用客户端方法打开
|
|
|
- var title = "消息通知"
|
|
|
- if (type == "titleMessage" || type == "titleMessage_r") {
|
|
|
- var MsgTitle = $(this).find(".noticeListRight>div>div").html();
|
|
|
- if (MsgTitle) {
|
|
|
- title = MsgTitle
|
|
|
- }
|
|
|
- }
|
|
|
- JyObj.openExternalLink(link, title);
|
|
|
- }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (redirectBool) {
|
|
|
+ link = link.split('==')[0];
|
|
|
+ //内部链接直接打开
|
|
|
+ if (link.indexOf("/jyapp/free/message") > -1) {
|
|
|
+ window.location.href = link;
|
|
|
+ } else {
|
|
|
+ //外部链接调用客户端方法打开
|
|
|
+ var title = "消息通知"
|
|
|
+ if (type == "titleMessage" || type == "titleMessage_r") {
|
|
|
+ var MsgTitle = $(this).find(".noticeListRight>div>div").html();
|
|
|
+ if (MsgTitle) {
|
|
|
+ title = MsgTitle
|
|
|
}
|
|
|
- } else {
|
|
|
- window.location.href = link;
|
|
|
}
|
|
|
- });
|
|
|
- })
|
|
|
+ if (utils.$envs.inApp) {
|
|
|
+ JyObj.openExternalLink(link, title);
|
|
|
+ }else{
|
|
|
+ window.location.href = link;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ window.location.href = link;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
</script>
|
|
|
<!--百度统计end-->
|
|
|
{{include "/common/baiducc.html"}}
|