Pārlūkot izejas kodu

重庆部门新媒体

ljh 2 gadi atpakaļ
vecāks
revīzija
27e3ac4eae

+ 89 - 1
nngkxxdp/src/main/resources/static/mxt/js/index.js

@@ -216,6 +216,89 @@ function openUrl(url) {
     window.open(url);
 }
 
+function departments() {
+    // 渲染BoxNav
+    renderBoxNav();
+    // 获取今天数据
+    getNAFBData(new Date().format("yyyy-MM-dd"), 'init');
+    $.ajax({
+        type: 'GET',
+        url: '/article/getRegionAllOfficialAccount',
+        dataType: 'json',
+        data: {
+            'type': 2,
+            'official': regionModule[0]
+        },
+        success: function (json) {
+            if (json.data) {
+                var data = json.data;
+                ofaData = data.ofa;
+                departmentLoad(ofaData)
+            }
+        },
+        error: function (e) {
+        }
+    });
+}
+
+function departmentLoad(data) {
+    $('#department').empty();
+    var html = '';
+    var topHtml = '';
+    for (var i = 0; i < data.length; i++) {
+        if (data[i].wType != '微信公众号') {
+            continue;
+        }
+        if (data[i].wName == regionModule[0]) {
+            topHtml = '<div class="gzh-item" onclick="departmentClick(this)">'
+                + '		<div class="gzh gzh-active">'
+                + '			<div class="gzhtitie">'
+                + '				<img src="' + data[i].wxHead + '" alt="' + data[i].wName + '图片">'
+                + data[i].wName
+                + '			</div>'
+                + '			<div>' + data[i].updateTime + '</div>'
+                + '		</div>'
+                + '		<div class="smgz-contanier smgz-active">'
+                + '			<div class="smgz">'
+                + '				<div class="ewm">'
+                + '					<img src="' + data[i].wxQrCode + '" alt="' + data[i].wName + '二维码">'
+                + '				</div>'
+                + '				扫码关注'
+                + '			</div>'
+                + '		</div>'
+                + '	</div>';
+            continue;
+        }
+        html += '<div class="gzh-item" onclick="regionClick(this)">'
+            + '		<div class="gzh">'
+            + '			<div class="gzhtitie">'
+            + '				<img src="' + data[i].wxHead + '" alt="' + data[i].wName + '图片">'
+            + data[i].wName
+            + '			</div>'
+            + '			<div>' + data[i].updateTime + '</div>'
+            + '		</div>'
+            + '		<div class="smgz-contanier">'
+            + '			<div class="smgz">'
+            + '				<div class="ewm">'
+            + '					<img src="' + data[i].wxQrCode + '" alt="' + data[i].wName + '二维码">'
+            + '				</div>'
+            + '				扫码关注'
+            + '			</div>'
+            + '		</div>'
+            + '	</div>';
+    }
+    $('#department').append(topHtml + html);
+    regionWeChartListByRight(regionModule[0]);
+}
+function departmentClick(){
+    page = 1;
+    regionWeChartListByRight($(that).find(".gzhtitie").text().trim())
+    $(that).find(".gzh").addClass("gzh-active");
+    $(that).find('.smgz-contanier').addClass('smgz-active');
+    $(that).siblings('div').find(".gzh").removeClass("gzh-active");
+    $(that).siblings('div').find(".smgz-contanier").removeClass("smgz-active");
+}
+
 function regionPage() {
     // 渲染BoxNav
     renderBoxNav();
@@ -240,6 +323,9 @@ function regionPage() {
         }
     });
 }
+
+
+
 function regionCenterByLeft(data) {
     $('#regionchartList').empty();
     var html = '';
@@ -305,7 +391,7 @@ function regionJrttList(data) {
 }
 function regionClick(that) {
     page = 1;
-    regionWeChartListByRight($(that).find(".gzhtitie").text().trim())
+    // regionWeChartListByRight($(that).find(".gzhtitie").text().trim())
     $(that).find(".gzh").addClass("gzh-active");
     $(that).find('.smgz-contanier').addClass('smgz-active');
     $(that).siblings('div').find(".gzh").removeClass("gzh-active");
@@ -411,6 +497,8 @@ $(".content_gzh .layui-tab-title li").click(function(){
         initPage();
     }else if(tabText=="重庆区县新媒体矩阵"){
         regionPage();
+    }else if(tabText=="重庆部门新媒体矩阵"){
+        departments();
     }
 })
 

+ 9 - 0
nngkxxdp/src/main/resources/static/mxt/mxt.html

@@ -171,6 +171,7 @@
 			<div class="layui-tab layui-tab-brief content_gzh" lay-filter="docDemoTabBrief">
 				<ul class="layui-tab-title" style="border: none">
 					<li>重庆区县新媒体矩阵</li>
+					<li>重庆部门新媒体矩阵</li>
 					<li class="layui-this">南岸区新媒体矩阵</li>
 				</ul>
 				<div class="layui-tab-content">
@@ -182,6 +183,14 @@
 							</div>
 						</div>
 					</div>
+					<div class="layui-tab-item">
+						<div class="gzh-contanier">
+							<div class="left" id="department">
+							</div>
+							<div class="right" id="department">
+							</div>
+						</div>
+					</div>
 					<div class="layui-tab-item layui-show">
 						<div class="gzh-contanier">
 							<div class="left" id="wechartList">