|
@@ -4,6 +4,7 @@ layui.use('laydate', function () {
|
|
|
|
|
|
// var topModule = ["重庆市南岸区人民政府", "南岸健康卫士", "南岸人力社保", "南岸公安", "南岸智慧城管", "遇见南坪"];
|
|
|
var topModule = ['重庆市南岸区人民政府', '广阳湾智创生态城', '南岸文旅', '南岸健康卫士', '南岸公安', '重庆南岸消防'];
|
|
|
+var regionModule = ['重庆市政府网', '合川区人民政府', '黔江区人民政府', '大足区政府网', '重庆市北碚区人民政府', '重庆市江北区人民政府', '渝北政府网','巴南区政府网','重庆忠县政府网','渝中政府','巫山政务'];
|
|
|
var page = 1, limit = 12;
|
|
|
var topData = [];
|
|
|
var ofaData = [];
|
|
@@ -49,7 +50,6 @@ function initPage() {
|
|
|
ofaData = data.ofa;
|
|
|
// initTop(data.array);
|
|
|
// $('.box-contanier').empty().append(topLeftComponent(topData[topModule[0]], topModule[0]) + topRightComponent(topData[topModule[1]], topModule[1]));
|
|
|
- $('.box-contanier').empty().append(topComponent(topData, topModule[0]));
|
|
|
initCenterByLeft(data.ofa);
|
|
|
initJrttList(data.jrtt);
|
|
|
}
|
|
@@ -60,7 +60,6 @@ function initPage() {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
// function initTop(data) {
|
|
|
// $('.box-contanier').empty();
|
|
|
// var html = '';
|
|
@@ -99,7 +98,6 @@ function initPage() {
|
|
|
// }
|
|
|
// $('.box-contanier').append(html);
|
|
|
// }
|
|
|
-
|
|
|
function initCenterByLeft(data) {
|
|
|
$('#wechartList').empty();
|
|
|
var html = '';
|
|
@@ -150,7 +148,6 @@ function initCenterByLeft(data) {
|
|
|
$('#wechartList').append(topHtml + html);
|
|
|
initWeChartListByRight(topModule[0]);
|
|
|
}
|
|
|
-
|
|
|
function initJrttList(data) {
|
|
|
$('#jrttList').empty();
|
|
|
var html = '';
|
|
@@ -165,7 +162,6 @@ function initJrttList(data) {
|
|
|
$('#jrttList').append(html)
|
|
|
jrttClick();
|
|
|
}
|
|
|
-
|
|
|
function wechartClick(that) {
|
|
|
page = 1;
|
|
|
initWeChartListByRight($(that).find(".gzhtitie").text().trim())
|
|
@@ -174,7 +170,6 @@ function wechartClick(that) {
|
|
|
$(that).siblings('div').find(".gzh").removeClass("gzh-active");
|
|
|
$(that).siblings('div').find(".smgz-contanier").removeClass("smgz-active");
|
|
|
}
|
|
|
-
|
|
|
function initWeChartListByRight(name) {
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
@@ -211,14 +206,153 @@ function initWeChartListByRight(name) {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+function moreClick(that, name) {
|
|
|
+ $(that).remove();
|
|
|
+ initWeChartListByRight(name)
|
|
|
+}
|
|
|
|
|
|
function openUrl(url) {
|
|
|
window.open(url);
|
|
|
}
|
|
|
|
|
|
-function moreClick(that, name) {
|
|
|
+function regionPage() {
|
|
|
+ var loading = layer.load(2, {
|
|
|
+ shade: [0.3, '#393D49'],
|
|
|
+ });
|
|
|
+ // 渲染BoxNav
|
|
|
+ renderBoxNav();
|
|
|
+ // 获取今天数据
|
|
|
+ getNAFBData(new Date().format("yyyy-MM-dd"), 'init');
|
|
|
+ $.ajax({
|
|
|
+ type: 'GET',
|
|
|
+ url: '/article/getRegionAllOfficialAccount',
|
|
|
+ dataType: 'json',
|
|
|
+ data: {
|
|
|
+ 'official': regionModule[0]
|
|
|
+ },
|
|
|
+ success: function (json) {
|
|
|
+ if (json.data) {
|
|
|
+ var data = json.data;
|
|
|
+ ofaData = data.ofa;
|
|
|
+ regionCenterByLeft(data.ofa);
|
|
|
+ }
|
|
|
+ layer.close(loading);
|
|
|
+ },
|
|
|
+ error: function (e) {
|
|
|
+ layer.close(loading);
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+function regionCenterByLeft(data) {
|
|
|
+ $('#regionchartList').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="regionClick(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>';
|
|
|
+ }
|
|
|
+ $('#regionchartList').append(topHtml + html);
|
|
|
+ regionWeChartListByRight(regionModule[0]);
|
|
|
+}
|
|
|
+function regionJrttList(data) {
|
|
|
+ $('#jrttList').empty();
|
|
|
+ var html = '';
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ // html += '<div class="news-item" onclick="openUrl(\''+ data[i].url +'\')">'
|
|
|
+ html += '<div class="news-item" data-url="' + data[i].url + '">'
|
|
|
+ + ' <div class="jigou"><span>' + data[i].officialAccount + '</span></div>'
|
|
|
+ + ' <p>' + data[i].title + '</p>'
|
|
|
+ + ' <span class="time">' + data[i].createTime + '</span>'
|
|
|
+ + ' </div>';
|
|
|
+ }
|
|
|
+ $('#jrttList').append(html)
|
|
|
+ jrttClick();
|
|
|
+}
|
|
|
+function regionClick(that) {
|
|
|
+ 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 regionWeChartListByRight(name) {
|
|
|
+ $.ajax({
|
|
|
+ type: 'GET',
|
|
|
+ url: '/article/getRegionOfficialAccountByPaging',
|
|
|
+ dataType: 'json',
|
|
|
+ data: {
|
|
|
+ 'page': page,
|
|
|
+ 'limit': limit,
|
|
|
+ 'name': name
|
|
|
+ },
|
|
|
+ success: function (json) {
|
|
|
+ var more = '';
|
|
|
+ if (page == 1) {
|
|
|
+ $('#regionRightList').empty();
|
|
|
+ }
|
|
|
+ if (json.data) {
|
|
|
+ var data = json.data;
|
|
|
+ if ((page * limit) < json.count) {
|
|
|
+ more = '<div class="wz-more" onclick="regionMoreClick(this,\'' + name + '\')">查看更多</div>';
|
|
|
+ page++;
|
|
|
+ }
|
|
|
+ var html = '';
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ html += '<div class="wz-item" onclick="openUrl(\'' + data[i].url + '\')">'
|
|
|
+ + '<h4>· ' + data[i].title + '</h4>'
|
|
|
+ + '<span>' + data[i].nowTime + '</span>'
|
|
|
+ + '</div>';
|
|
|
+ }
|
|
|
+ $('#regionRightList').append(html + more);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function (e) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+function regionMoreClick(that, name) {
|
|
|
$(that).remove();
|
|
|
- initWeChartListByRight(name)
|
|
|
+ regionWeChartListByRight(name)
|
|
|
}
|
|
|
|
|
|
Date.prototype.format = function (fmt) {
|
|
@@ -272,6 +406,16 @@ $(".box-nav").on('click', 'li', function () {
|
|
|
// }
|
|
|
})
|
|
|
|
|
|
+// 南岸区公众号矩阵的tab进行切换
|
|
|
+$(".content_gzh .layui-tab-title li").click(function(){
|
|
|
+ var tabText=$(this).text();
|
|
|
+ if (tabText=="重庆南岸区新媒体矩阵"){
|
|
|
+ initPage();
|
|
|
+ }else{
|
|
|
+ regionPage();
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
function getNAFBData(value, tag) {
|
|
|
$.ajax({
|
|
|
type: 'GET',
|