|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- /**
- * Created by Administrator on 2021/4/5.
- */
- define(['jquery', "template", "Tools"], function ($, template, Tools) {
- //数据存储
- var module = {
- data: {
- //服务器地址
- serverApi:'',
- //焦点图数据
- focusList: [],
- communicateList: [],
- },
- };
- var tools = new Tools();
-
- module.init = function (page) {
- //新闻详情
- tools.doGet(siyigongkaiDetail, {id:getQueryVariable('id')}, module.newsDetail , true);
- //新闻列表
- tools.doGet(listSiyigongkai, {pageNum:1,pageSize:8}, module.newsList , true);
- tools.doGet(webList, {}, module.webList , true);
- };
-
- //获取地址栏参数
- function getQueryVariable(variable){
- var query = window.location.search.substring(1);
- var vars = query.split("&");
- for (var i=0;i<vars.length;i++) {
- var pair = vars[i].split("=");
- if(pair[0] == variable){return pair[1];}
- }
- return(false);
- }
-
- module.webList = function (data) {
- if (data.code == 200) {
- var content = data.data;
- module.data.webList = content;
- var webData = template('webData', module.data);
- $("#webContent").html(webData);
- var titData = template('titData', module.data);
- $("#titContent").html(titData);
- $('#ewm').attr('src', 'static/images/'+content.top.bz);
- }
- }
-
- module.newsDetail = function (data) {
- if (data.code == 200) {
- var content = data.data;
- $('#name')[0].innerHTML = content.openName;
- $('#jueyiAt')[0].innerHTML = '決议公开日期:'+content.jueyiAt;
-
- $('#jueyiPic')[0].innerHTML = '決议公开图片:<br/>';
- if (content.jueyiPic){
- let arr = content.jueyiPic.split(',');
- for (let i = 0;i < arr.length; i++){
- $('#jueyiPic')[0].innerHTML += '<img onclick="openDialog(\'/api'+arr[i]+'\')" src="/api'+arr[i]+'" style="width: 200px;height: 150px;margin-right: 10px;">';
- }
- }
-
- $('#shishiPic')[0].innerHTML = '实施公开图片:<br/>';
- if (content.shishiPic){
- let arr2 = content.jueyiPic.split(',');
- for (let i = 0;i < arr2.length; i++){
- $('#shishiPic')[0].innerHTML += '<img onclick="openDialog(\'/api'+arr2[i]+'\')" src="/api'+arr2[i]+'" style="width: 200px;height: 150px;margin-right: 10px;">';
- }
- }
-
- $('#shishiAt')[0].innerHTML = '实施公开日期:'+content.shishiAt;
-
- $('#remark')[0].innerHTML = '备注:'+content.remark;
-
- }
- }
- openDialog = function (src){
- $("#dialogOp").css('display','block');
- $('#dialogImg').attr('src', src);
- }
-
- closeDia = function (){
- $("#dialogOp").css('display','none');
- $('#dialogImg').attr('src', '');
- }
-
-
-
- module.newsList = function (data) {
- if (data.code == 200) {
- var content = data.rows;
- module.data.newList = content;
- var newListData = template('newListData', module.data);
- $("#newListContent").html(newListData);
- }
- }
-
- return module;
- });
|