瀏覽代碼

修改 消息提醒

fanlongfei 6 年之前
父節點
當前提交
7864e8d131
共有 2 個文件被更改,包括 33 次插入15 次删除
  1. 0 1
      CallCenterWeb.UI/index.html
  2. 33 14
      CallCenterWeb.UI/js/index.js

+ 0 - 1
CallCenterWeb.UI/index.html

@@ -172,7 +172,6 @@
172 172
 				margin-right: 0;
173 173
 			}
174 174
 			.top_notices_lists{
175
-				display: none;
176 175
 				position: absolute;
177 176
 				top: 24px;
178 177
 				background-color: #ecfeff;

+ 33 - 14
CallCenterWeb.UI/js/index.js

@@ -720,7 +720,7 @@ function getTopMsgs() {
720 720
 				for (var i = 0; i < result.length; i++) {
721 721
 					str += '<li class="top_notices_item">' +
722 722
 						'<span class="top_notices_con">'+ result[i].Detail +'</span>' +
723
-						'<button type="button" class="btn btn-primary btn-sm" onclick="signRead('+ result[i].ID +')">已读</button>' +
723
+						'<button type="button" class="btn btn-primary btn-sm" onclick="signRead('+ result[i].ID +', event)">未读</button>' +
724 724
 						'</li>' +
725 725
 						'<li class="divider"></li>';
726 726
 				}
@@ -737,17 +737,36 @@ function getTopMsgs() {
737 737
 }
738 738
 
739 739
 // 标记消息状态
740
-function signRead(signid) {
741
-	$.post(huayi.config.callcenter_url + 'Msg/UpdateState', {
742
-		ids: signid,
743
-		state: 1, //状态,0未读 1已读
744
-		token: $.cookie("token")
745
-	}, function(result) {
746
-		result = $.parseJSON(result);
747
-		if (result.state.toLowerCase() === "success") {
748
-			// 更新顶部消息内容和数量
749
-			getTopMsgs();
750
-			$('#top_notices_lists').hide();
751
-		}
752
-	})
740
+function signRead(signid, e) {
741
+	e.stopPropagation();
742
+	layer.confirm('确认已读后该条消息将不再提示,请慎重', {
743
+		icon: 7,
744
+		btn: ['确认', '取消'] //按钮
745
+	}, function(index) {
746
+		$.ajax({
747
+			type: "get",
748
+			url: huayi.config.callcenter_url + "Msg/UpdateState",
749
+			dataType: 'json',
750
+			async: true,
751
+			data: {
752
+				ids: signid,
753
+				state: 1, //状态,0未读 1已读
754
+				token: $.cookie("token")
755
+			},
756
+			success: function(data) {
757
+				if (data.state.toLowerCase() === "success") {
758
+					// 更新顶部消息内容和数量
759
+					getTopMsgs();
760
+					$('#top_notices_lists').hide();
761
+					layer.close(index);
762
+				}
763
+			}
764
+		});
765
+	});
753 766
 }
767
+
768
+$(document).click(function(e) {
769
+	if($(e.target).is($('.top_notices_lists')) || $(e.target).is($('.top_notices_item')) || $(e.target).is($('.top_notices_con')) || $(e.target).is($('.divider'))) {
770
+		$('#top_notices_lists').show();
771
+	}
772
+})